Skip to content

Commit 49e6dea

Browse files
jsun26intelEddie Dong
authored andcommitted
HV: rename the term of vm0 to sos vm
Under sharing mode, VM0 is identical with SOS VM. But the coupling of SOS VM and VM 0 is not friendly for partition mode. This patch is a pure term change of vm0 to sos VM, it does not change any code logic or senmantic. Tracked-On: #2291 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 55e5ed2 commit 49e6dea

File tree

39 files changed

+174
-174
lines changed

39 files changed

+174
-174
lines changed

devicemodel/include/public/vhm_ioctl_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
struct vm_memmap {
124124
/** memory mapping type */
125125
uint32_t type;
126-
/** using vma_base to get vm0_gpa,
126+
/** using vma_base to get sos_vm_gpa,
127127
* only for type == VM_MEMMAP_SYSMEM
128128
*/
129129
uint32_t using_vma;

doc/developer-guides/hld/hv-memmgt.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ Address Space Translation
439439
.. doxygenfunction:: gpa2hpa
440440
:project: Project ACRN
441441

442-
.. doxygenfunction:: vm0_hpa2gpa
442+
.. doxygenfunction:: sos_vm_hpa2gpa
443443
:project: Project ACRN
444444

445445
EPT

doc/developer-guides/hld/hv-vt-d.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ deinitialization:
306306
.. doxygenfunction:: init_iommu
307307
:project: Project ACRN
308308

309-
.. doxygenfunction:: init_iommu_vm0_domain
309+
.. doxygenfunction:: init_iommu_sos_vm_domain
310310
:project: Project ACRN
311311

312312
runtime

hypervisor/arch/x86/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ config PLATFORM_RAM_SIZE
279279
(MMIO not included).
280280

281281
config SOS_RAM_SIZE
282-
hex "Size of the vm0 (SOS) RAM"
282+
hex "Size of the Service OS (SOS) RAM"
283283
default 0x200000000 if PLATFORM_SBL
284284
default 0x400000000 if PLATFORM_UEFI
285285
help
286-
A 64-bit integer indicating the size of the vm0 (SOS) RAM (MMIO not
286+
A 64-bit integer indicating the size of the Service OS RAM (MMIO not
287287
included).
288288

289289
config UOS_RAM_SIZE

hypervisor/arch/x86/assign.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ ptirq_build_physical_rte(struct acrn_vm *vm, struct ptirq_remapping_info *entry)
182182

183183
/* add msix entry for a vm, based on msi id (phys_bdf+msix_index)
184184
* - if the entry not be added by any vm, allocate it
185-
* - if the entry already be added by vm0, then change the owner to current vm
185+
* - if the entry already be added by sos_vm, then change the owner to current vm
186186
* - if the entry already be added by other vm, return NULL
187187
*/
188188
static struct ptirq_remapping_info *add_msix_remapping(struct acrn_vm *vm,
@@ -209,7 +209,7 @@ static struct ptirq_remapping_info *add_msix_remapping(struct acrn_vm *vm,
209209
}
210210
}
211211
} else if (entry->vm != vm) {
212-
if (is_vm0(entry->vm)) {
212+
if (is_sos_vm(entry->vm)) {
213213
entry->vm = vm;
214214
entry->virt_sid.msi_id.bdf = virt_bdf;
215215
} else {
@@ -257,7 +257,7 @@ remove_msix_remapping(const struct acrn_vm *vm, uint16_t virt_bdf, uint32_t entr
257257

258258
/* add intx entry for a vm, based on intx id (phys_pin)
259259
* - if the entry not be added by any vm, allocate it
260-
* - if the entry already be added by vm0, then change the owner to current vm
260+
* - if the entry already be added by sos_vm, then change the owner to current vm
261261
* - if the entry already be added by other vm, return NULL
262262
*/
263263
static struct ptirq_remapping_info *add_intx_remapping(struct acrn_vm *vm, uint32_t virt_pin,
@@ -292,7 +292,7 @@ static struct ptirq_remapping_info *add_intx_remapping(struct acrn_vm *vm, uint3
292292
pr_err("INTX re-add vpin %d", virt_pin);
293293
}
294294
} else if (entry->vm != vm) {
295-
if (is_vm0(entry->vm)) {
295+
if (is_sos_vm(entry->vm)) {
296296
entry->vm = vm;
297297
entry->virt_sid.value = virt_sid.value;
298298
} else {
@@ -511,14 +511,14 @@ int32_t ptirq_msix_remap(struct acrn_vm *vm, uint16_t virt_bdf,
511511
* Device Model should pre-hold the mapping entries by calling
512512
* ptirq_add_msix_remapping for UOS.
513513
*
514-
* For SOS(vm0), it adds the mapping entries at runtime, if the
514+
* For SOS(sos_vm), it adds the mapping entries at runtime, if the
515515
* entry already be held by others, return error.
516516
*/
517517
spinlock_obtain(&ptdev_lock);
518518
entry = ptirq_lookup_entry_by_sid(PTDEV_INTR_MSI, &virt_sid, vm);
519519
if (entry == NULL) {
520-
/* VM0 we add mapping dynamically */
521-
if (is_vm0(vm)) {
520+
/* SOS_VM we add mapping dynamically */
521+
if (is_sos_vm(vm)) {
522522
entry = add_msix_remapping(vm, virt_bdf, virt_bdf, entry_nr);
523523
if (entry == NULL) {
524524
pr_err("dev-assign: msi entry exist in others");
@@ -599,12 +599,12 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_pin, uint32_t vpi
599599
* Device Model should pre-hold the mapping entries by calling
600600
* ptirq_add_intx_remapping for UOS.
601601
*
602-
* For SOS(vm0), it adds the mapping entries at runtime, if the
602+
* For SOS(sos_vm), it adds the mapping entries at runtime, if the
603603
* entry already be held by others, return error.
604604
*/
605605

606606
/* no remap for hypervisor owned intx */
607-
if (is_vm0(vm) && hv_used_dbg_intx(virt_sid.intx_id.pin)) {
607+
if (is_sos_vm(vm) && hv_used_dbg_intx(virt_sid.intx_id.pin)) {
608608
status = -ENODEV;
609609
}
610610

@@ -615,9 +615,9 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_pin, uint32_t vpi
615615
spinlock_obtain(&ptdev_lock);
616616
entry = ptirq_lookup_entry_by_vpin(vm, virt_pin, pic_pin);
617617
if (entry == NULL) {
618-
if (is_vm0(vm)) {
618+
if (is_sos_vm(vm)) {
619619

620-
/* for vm0, there is chance of vpin source switch
620+
/* for sos_vm, there is chance of vpin source switch
621621
* between vPIC & vIOAPIC for one legacy phys_pin.
622622
*
623623
* here checks if there is already mapping entry from
@@ -680,7 +680,7 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_pin, uint32_t vpi
680680
}
681681

682682
/* @pre vm != NULL
683-
* except vm0, Device Model should call this function to pre-hold ptdev intx
683+
* except sos_vm, Device Model should call this function to pre-hold ptdev intx
684684
* entries:
685685
* - the entry is identified by phys_pin:
686686
* one entry vs. one phys_pin
@@ -708,7 +708,7 @@ void ptirq_remove_intx_remapping(struct acrn_vm *vm, uint32_t virt_pin, bool pic
708708
spinlock_release(&ptdev_lock);
709709
}
710710

711-
/* except vm0, Device Model should call this function to pre-hold ptdev msi
711+
/* except sos_vm, Device Model should call this function to pre-hold ptdev msi
712712
* entries:
713713
* - the entry is identified by phys_bdf:msi_idx:
714714
* one entry vs. one phys_bdf:msi_idx

hypervisor/arch/x86/e820.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/*
1313
* e820.c contains the related e820 operations; like HV to get memory info for its MMU setup;
14-
* and hide HV memory from VM0...
14+
* and hide HV memory from SOS_VM...
1515
*/
1616

1717
static uint32_t e820_entries_count;
@@ -51,8 +51,8 @@ static void obtain_e820_mem_info(void)
5151
}
5252
}
5353

54-
/* before boot vm0(service OS), call it to hide the HV RAM entry in e820 table from vm0 */
55-
void rebuild_vm0_e820(void)
54+
/* before boot sos_vm(service OS), call it to hide the HV RAM entry in e820 table from sos_vm */
55+
void rebuild_sos_vm_e820(void)
5656
{
5757
uint32_t i;
5858
uint64_t entry_start;
@@ -116,7 +116,7 @@ void rebuild_vm0_e820(void)
116116
e820_mem.total_mem_size -= CONFIG_HV_RAM_SIZE;
117117
}
118118

119-
/* get some RAM below 1MB in e820 entries, hide it from vm0, return its start address */
119+
/* get some RAM below 1MB in e820 entries, hide it from sos_vm, return its start address */
120120
uint64_t e820_alloc_low_memory(uint32_t size_arg)
121121
{
122122
uint32_t i;

hypervisor/arch/x86/ept.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ uint64_t gpa2hpa(struct acrn_vm *vm, uint64_t gpa)
6767
/**
6868
* @pre: the gpa and hpa are identical mapping in SOS.
6969
*/
70-
uint64_t vm0_hpa2gpa(uint64_t hpa)
70+
uint64_t sos_vm_hpa2gpa(uint64_t hpa)
7171
{
7272
return hpa;
7373
}

hypervisor/arch/x86/guest/guest.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,9 @@ int32_t copy_to_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
448448
* @retval 0 on success
449449
*
450450
* @pre vm != NULL
451-
* @pre is_vm0(vm) == true
451+
* @pre is_sos_vm(vm) == true
452452
*/
453-
void prepare_vm0_memmap(struct acrn_vm *vm)
453+
void prepare_sos_vm_memmap(struct acrn_vm *vm)
454454
{
455455
uint32_t i;
456456
uint64_t attr_uc = (EPT_RWX | EPT_UNCACHED);
@@ -462,11 +462,11 @@ void prepare_vm0_memmap(struct acrn_vm *vm)
462462
const struct e820_entry *p_e820 = get_e820_entry();
463463
const struct e820_mem_params *p_e820_mem_info = get_e820_mem_info();
464464

465-
dev_dbg(ACRN_DBG_GUEST, "vm0: bottom memory - 0x%llx, top memory - 0x%llx\n",
465+
dev_dbg(ACRN_DBG_GUEST, "sos_vm: bottom memory - 0x%llx, top memory - 0x%llx\n",
466466
p_e820_mem_info->mem_bottom, p_e820_mem_info->mem_top);
467467

468468
if (p_e820_mem_info->mem_top > EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE)) {
469-
panic("Please configure VM0_ADDRESS_SPACE correctly!\n");
469+
panic("Please configure SOS_VM_ADDRESS_SPACE correctly!\n");
470470
}
471471

472472
/* create real ept map for all ranges with UC */
@@ -481,7 +481,7 @@ void prepare_vm0_memmap(struct acrn_vm *vm)
481481
}
482482
}
483483

484-
dev_dbg(ACRN_DBG_GUEST, "VM0 e820 layout:\n");
484+
dev_dbg(ACRN_DBG_GUEST, "SOS_VM e820 layout:\n");
485485
for (i = 0U; i < entries_count; i++) {
486486
entry = p_e820 + i;
487487
dev_dbg(ACRN_DBG_GUEST, "e820 table: %d type: 0x%x", i, entry->type);

hypervisor/arch/x86/guest/pm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int32_t validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl)
1010
{
1111
int32_t ret = -1;
1212

13-
if (is_vm0(vm)) {
13+
if (is_sos_vm(vm)) {
1414
ret = 0;
1515
} else {
1616
uint8_t i;
@@ -132,7 +132,7 @@ static inline void enter_s3(struct acrn_vm *vm, uint32_t pm1a_cnt_val, uint32_t
132132
guest_wakeup_vec32 = *(vm->pm.sx_state_data->wake_vector_32);
133133
clac();
134134

135-
pause_vm(vm); /* pause vm0 before suspend system */
135+
pause_vm(vm); /* pause sos_vm before suspend system */
136136
host_enter_s3(vm->pm.sx_state_data, pm1a_cnt_val, pm1b_cnt_val);
137137
resume_vm_from_s3(vm, guest_wakeup_vec32); /* jump back to vm */
138138
}

hypervisor/arch/x86/guest/vcpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void set_ap_entry(struct acrn_vcpu *vcpu, uint64_t entry)
308308
* vcpu_id/pcpu_id mapping table:
309309
*
310310
* if
311-
* VM0_CPUS[2] = {0, 2} , VM1_CPUS[2] = {3, 1};
311+
* SOS_VM_CPUS[2] = {0, 2} , VM1_CPUS[2] = {3, 1};
312312
* then
313313
* for physical CPU 0 : vcpu->pcpu_id = 0, vcpu->vcpu_id = 0, vmid = 0;
314314
* for physical CPU 2 : vcpu->pcpu_id = 2, vcpu->vcpu_id = 1, vmid = 0;

0 commit comments

Comments
 (0)