ACRN: hv: Unify terminology for user vm

Rename gpa_uos to gpa_user_vm
rename base_gpa_in_uos to base_gpa_in_user_vm
rename UOS_VIRT_PCI_MMCFG_BASE to USER_VM_VIRT_PCI_MMCFG_BASE
rename UOS_VIRT_PCI_MMCFG_START_BUS to USER_VM_VIRT_PCI_MMCFG_START_BUS
rename UOS_VIRT_PCI_MMCFG_END_BUS to USER_VM_VIRT_PCI_MMCFG_END_BUS
rename UOS_VIRT_PCI_MEMBASE32 to USER_VM_VIRT_PCI_MEMBASE32
rename UOS_VIRT_PCI_MEMLIMIT32 to USER_VM_VIRT_PCI_MEMLIMIT32
rename UOS_VIRT_PCI_MEMBASE64 to USER_VM_VIRT_PCI_MEMBASE64
rename UOS_VIRT_PCI_MEMLIMIT64 to USER_VM_VIRT_PCI_MEMLIMIT64
rename UOS in comments message to User VM.

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
Liu Long 2021-10-29 14:48:19 +08:00 committed by wenlingz
parent 92b7d6a9a3
commit e9c4ced460
9 changed files with 32 additions and 31 deletions

View File

@ -698,7 +698,7 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_gsi, enum intx_ct
* while phys pin is always means for physical IOAPIC.
*
* Device Model should pre-hold the mapping entries by calling
* ptirq_add_intx_remapping for UOS.
* ptirq_add_intx_remapping for User VM.
*
* For Service VM, it adds the mapping entries at runtime, if the
* entry already be held by others, return error.

View File

@ -70,8 +70,8 @@ static void create_secure_world_ept(struct acrn_vm *vm, uint64_t gpa_orig,
/* Map [gpa_rebased, gpa_rebased + size) to secure ept mapping */
ept_add_mr(vm, (uint64_t *)vm->arch_vm.sworld_eptp, hpa, gpa_rebased, size, EPT_RWX | EPT_WB);
/* Backup secure world info, will be used when destroy secure world and suspend UOS */
vm->sworld_control.sworld_memory.base_gpa_in_uos = gpa_orig;
/* Backup secure world info, will be used when destroy secure world and suspend User VM */
vm->sworld_control.sworld_memory.base_gpa_in_user_vm = gpa_orig;
vm->sworld_control.sworld_memory.base_hpa = hpa;
vm->sworld_control.sworld_memory.length = size;
}
@ -79,7 +79,7 @@ static void create_secure_world_ept(struct acrn_vm *vm, uint64_t gpa_orig,
void destroy_secure_world(struct acrn_vm *vm, bool need_clr_mem)
{
uint64_t hpa = vm->sworld_control.sworld_memory.base_hpa;
uint64_t gpa_uos = vm->sworld_control.sworld_memory.base_gpa_in_uos;
uint64_t gpa_user_vm = vm->sworld_control.sworld_memory.base_gpa_in_user_vm;
uint64_t size = vm->sworld_control.sworld_memory.length;
if (vm->arch_vm.sworld_eptp != NULL) {
@ -90,11 +90,11 @@ void destroy_secure_world(struct acrn_vm *vm, bool need_clr_mem)
clac();
}
ept_del_mr(vm, vm->arch_vm.sworld_eptp, gpa_uos, size);
ept_del_mr(vm, vm->arch_vm.sworld_eptp, gpa_user_vm, size);
vm->arch_vm.sworld_eptp = NULL;
/* Restore memory to guest normal world */
ept_add_mr(vm, vm->arch_vm.nworld_eptp, hpa, gpa_uos, size, EPT_RWX | EPT_WB);
ept_add_mr(vm, vm->arch_vm.nworld_eptp, hpa, gpa_user_vm, size, EPT_RWX | EPT_WB);
} else {
pr_err("sworld eptp is NULL, it's not created");
}
@ -309,7 +309,7 @@ static bool setup_trusty_info(struct acrn_vcpu *vcpu, uint32_t mem_size, uint64_
return success;
}
/* Secure World will reuse environment of UOS_Loder since they are
/* Secure World will reuse environment of User VM Loder since they are
* both booting from and running in 64bit mode, except GP registers.
* RIP, RSP and RDI are specified below, other GP registers are leaved
* as 0.
@ -409,7 +409,7 @@ void restore_sworld_context(struct acrn_vcpu *vcpu)
&vcpu->vm->sworld_control;
create_secure_world_ept(vcpu->vm,
sworld_ctl->sworld_memory.base_gpa_in_uos,
sworld_ctl->sworld_memory.base_gpa_in_user_vm,
sworld_ctl->sworld_memory.length,
TRUSTY_EPT_REBASE_GPA);

View File

@ -41,7 +41,7 @@ int32_t hcall_world_switch(struct acrn_vcpu *vcpu, __unused struct acrn_vm *targ
/**
* @brief Initialize environment for Trusty-OS on a vCPU.
*
* * It is used by the User OS bootloader (``UOS_Loader``) to request ACRN
* * It is used by the User VM OS bootloader (``User VM OS Loader``) to request ACRN
* to initialize Trusty
* * The Trusty memory region range, entry point must be specified
* * The hypervisor needs to save current vCPU contexts (Normal World)

View File

@ -114,9 +114,9 @@ static void init_vhostbridge(struct pci_vdev *vdev)
if (is_prelaunched_vm(container_of(vdev->vpci, struct acrn_vm, vpci))) {
/* For pre-launched VMs, we only need to write an GPA that's reserved in guest ve820,
* and UOS_VIRT_PCI_MMCFG_BASE(0xE0000000) is fine. The trailing 1 is a ECAM enable-bit
* and USER_VM_VIRT_PCI_MMCFG_BASE(0xE0000000) is fine. The trailing 1 is a ECAM enable-bit
*/
pciexbar_low = UOS_VIRT_PCI_MMCFG_BASE | 0x1U;
pciexbar_low = USER_VM_VIRT_PCI_MMCFG_BASE | 0x1U;
} else {
/*Inject physical ECAM value to Service VM vhostbridge since Service VM may check PCIe-MMIO Base Address with it */
phys_did = pci_pdev_read_cfg(hostbridge_bdf, PCIR_DEVICE, 2);

View File

@ -233,13 +233,13 @@ int32_t init_vpci(struct acrn_vm *vm)
vm->vpci.res64.start = MMIO64_START;
vm->vpci.res64.end = MMIO64_END;
} else {
vm->vpci.pci_mmcfg.address = UOS_VIRT_PCI_MMCFG_BASE;
vm->vpci.pci_mmcfg.start_bus = UOS_VIRT_PCI_MMCFG_START_BUS;
vm->vpci.pci_mmcfg.end_bus = UOS_VIRT_PCI_MMCFG_END_BUS;
vm->vpci.res32.start = UOS_VIRT_PCI_MEMBASE32;
vm->vpci.res32.end = UOS_VIRT_PCI_MEMLIMIT32;
vm->vpci.res64.start = UOS_VIRT_PCI_MEMBASE64;
vm->vpci.res64.end = UOS_VIRT_PCI_MEMLIMIT64;
vm->vpci.pci_mmcfg.address = USER_VM_VIRT_PCI_MMCFG_BASE;
vm->vpci.pci_mmcfg.start_bus = USER_VM_VIRT_PCI_MMCFG_START_BUS;
vm->vpci.pci_mmcfg.end_bus = USER_VM_VIRT_PCI_MMCFG_END_BUS;
vm->vpci.res32.start = USER_VM_VIRT_PCI_MEMBASE32;
vm->vpci.res32.end = USER_VM_VIRT_PCI_MEMLIMIT32;
vm->vpci.res64.start = USER_VM_VIRT_PCI_MEMBASE64;
vm->vpci.res64.end = USER_VM_VIRT_PCI_MEMLIMIT64;
}
/* Build up vdev list for vm */
@ -358,7 +358,7 @@ static struct pci_vdev *find_available_vdev(struct acrn_vpci *vpci, union pci_bd
if ((vdev != NULL) && (vdev->user != vdev)) {
if (vdev->user != NULL) {
/* the Service VM is able to access, if and only if the Service VM has higher severity than the UOS. */
/* the Service VM is able to access, if and only if the Service VM has higher severity than the User VM. */
if (get_vm_severity(vpci2vm(vpci)->vm_id) <
get_vm_severity(vpci2vm(vdev->user->vpci)->vm_id)) {
vdev = NULL;
@ -734,7 +734,7 @@ int32_t vpci_assign_pcidev(struct acrn_vm *tgt_vm, struct acrn_pcidev *pcidev)
pci_vdev_write_vcfg(vdev, PCIR_INTERRUPT_LINE, 1U, pcidev->intr_line);
pci_vdev_write_vcfg(vdev, PCIR_INTERRUPT_PIN, 1U, pcidev->intr_pin);
for (idx = 0U; idx < vdev->nr_bars; idx++) {
/* VF is assigned to a UOS */
/* VF is assigned to a User VM */
if (vdev->phyfun != NULL) {
vdev->vbars[idx] = vdev_in_service_vm->vbars[idx];
if (has_msix_cap(vdev) && (idx == vdev->msix.table_bar)) {

View File

@ -90,7 +90,7 @@ struct trusty_key_info {
struct secure_world_memory {
/* The original secure world base address allocated by bootloader */
uint64_t base_gpa_in_uos;
uint64_t base_gpa_in_user_vm;
/* The secure world base address of HPA */
uint64_t base_hpa;
/* Secure world runtime memory size */

View File

@ -449,7 +449,7 @@ int32_t hcall_world_switch(struct acrn_vcpu *vcpu, struct acrn_vm *target_vm, ui
/**
* @brief Initialize environment for Trusty-OS on a vCPU.
*
* * It is used by the User OS bootloader (``UOS_Loader``) to request ACRN
* * It is used by the User VM OS bootloader (``User VM OS Loader``) to request ACRN
* to initialize Trusty
* * The Trusty memory region range, entry point must be specified
* * The hypervisor needs to save current vCPU contexts (Normal World)

View File

@ -23,13 +23,13 @@
#define VIRT_XSDT_ADDR 0x7fe00080UL
/* virtual PCI MMCFG address base for pre/post-launched VM. */
#define UOS_VIRT_PCI_MMCFG_BASE 0xE0000000UL
#define UOS_VIRT_PCI_MMCFG_START_BUS 0x0U
#define UOS_VIRT_PCI_MMCFG_END_BUS 0xFFU
#define UOS_VIRT_PCI_MEMBASE32 0x80000000UL /* 2GB */
#define UOS_VIRT_PCI_MEMLIMIT32 0xE0000000UL /* 3.5GB */
#define UOS_VIRT_PCI_MEMBASE64 0x4000000000UL /* 256GB */
#define UOS_VIRT_PCI_MEMLIMIT64 0x8000000000UL /* 512GB */
#define USER_VM_VIRT_PCI_MMCFG_BASE 0xE0000000UL
#define USER_VM_VIRT_PCI_MMCFG_START_BUS 0x0U
#define USER_VM_VIRT_PCI_MMCFG_END_BUS 0xFFU
#define USER_VM_VIRT_PCI_MEMBASE32 0x80000000UL /* 2GB */
#define USER_VM_VIRT_PCI_MEMLIMIT32 0xE0000000UL /* 3.5GB */
#define USER_VM_VIRT_PCI_MEMBASE64 0x4000000000UL /* 256GB */
#define USER_VM_VIRT_PCI_MEMLIMIT64 0x8000000000UL /* 512GB */
void build_vrsdp(struct acrn_vm *vm);

View File

@ -211,7 +211,8 @@ struct acrn_pci_request {
* | | | |
* | | | - Fill in type, |
* | | | addr, etc. |
* | | | - Pause UOS vCPU y |
* | | | - Pause User VM |
* | | | vCPU y |
* | | | - Set state to |
* | | | PENDING (a) |
* | | | - Fire upcall to |
@ -240,7 +241,7 @@ struct acrn_pci_request {
* +-----------------------+-------------------------+----------------------+
* | | Hypervisor: | |
* | | | |
* | | - resume UOS vCPU y | |
* | | - resume User VM vCPU y | |
* | | (e) | |
* | | | |
* +-----------------------+-------------------------+----------------------+