mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 04:02:05 +00:00
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>
This commit is contained in:
parent
55e5ed2e1a
commit
49e6deaf26
@ -123,7 +123,7 @@
|
||||
struct vm_memmap {
|
||||
/** memory mapping type */
|
||||
uint32_t type;
|
||||
/** using vma_base to get vm0_gpa,
|
||||
/** using vma_base to get sos_vm_gpa,
|
||||
* only for type == VM_MEMMAP_SYSMEM
|
||||
*/
|
||||
uint32_t using_vma;
|
||||
|
@ -439,7 +439,7 @@ Address Space Translation
|
||||
.. doxygenfunction:: gpa2hpa
|
||||
:project: Project ACRN
|
||||
|
||||
.. doxygenfunction:: vm0_hpa2gpa
|
||||
.. doxygenfunction:: sos_vm_hpa2gpa
|
||||
:project: Project ACRN
|
||||
|
||||
EPT
|
||||
|
@ -306,7 +306,7 @@ deinitialization:
|
||||
.. doxygenfunction:: init_iommu
|
||||
:project: Project ACRN
|
||||
|
||||
.. doxygenfunction:: init_iommu_vm0_domain
|
||||
.. doxygenfunction:: init_iommu_sos_vm_domain
|
||||
:project: Project ACRN
|
||||
|
||||
runtime
|
||||
|
@ -279,11 +279,11 @@ config PLATFORM_RAM_SIZE
|
||||
(MMIO not included).
|
||||
|
||||
config SOS_RAM_SIZE
|
||||
hex "Size of the vm0 (SOS) RAM"
|
||||
hex "Size of the Service OS (SOS) RAM"
|
||||
default 0x200000000 if PLATFORM_SBL
|
||||
default 0x400000000 if PLATFORM_UEFI
|
||||
help
|
||||
A 64-bit integer indicating the size of the vm0 (SOS) RAM (MMIO not
|
||||
A 64-bit integer indicating the size of the Service OS RAM (MMIO not
|
||||
included).
|
||||
|
||||
config UOS_RAM_SIZE
|
||||
|
@ -182,7 +182,7 @@ ptirq_build_physical_rte(struct acrn_vm *vm, struct ptirq_remapping_info *entry)
|
||||
|
||||
/* add msix entry for a vm, based on msi id (phys_bdf+msix_index)
|
||||
* - if the entry not be added by any vm, allocate it
|
||||
* - if the entry already be added by vm0, then change the owner to current vm
|
||||
* - if the entry already be added by sos_vm, then change the owner to current vm
|
||||
* - if the entry already be added by other vm, return NULL
|
||||
*/
|
||||
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,
|
||||
}
|
||||
}
|
||||
} else if (entry->vm != vm) {
|
||||
if (is_vm0(entry->vm)) {
|
||||
if (is_sos_vm(entry->vm)) {
|
||||
entry->vm = vm;
|
||||
entry->virt_sid.msi_id.bdf = virt_bdf;
|
||||
} else {
|
||||
@ -257,7 +257,7 @@ remove_msix_remapping(const struct acrn_vm *vm, uint16_t virt_bdf, uint32_t entr
|
||||
|
||||
/* add intx entry for a vm, based on intx id (phys_pin)
|
||||
* - if the entry not be added by any vm, allocate it
|
||||
* - if the entry already be added by vm0, then change the owner to current vm
|
||||
* - if the entry already be added by sos_vm, then change the owner to current vm
|
||||
* - if the entry already be added by other vm, return NULL
|
||||
*/
|
||||
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
|
||||
pr_err("INTX re-add vpin %d", virt_pin);
|
||||
}
|
||||
} else if (entry->vm != vm) {
|
||||
if (is_vm0(entry->vm)) {
|
||||
if (is_sos_vm(entry->vm)) {
|
||||
entry->vm = vm;
|
||||
entry->virt_sid.value = virt_sid.value;
|
||||
} else {
|
||||
@ -511,14 +511,14 @@ int32_t ptirq_msix_remap(struct acrn_vm *vm, uint16_t virt_bdf,
|
||||
* Device Model should pre-hold the mapping entries by calling
|
||||
* ptirq_add_msix_remapping for UOS.
|
||||
*
|
||||
* For SOS(vm0), it adds the mapping entries at runtime, if the
|
||||
* For SOS(sos_vm), it adds the mapping entries at runtime, if the
|
||||
* entry already be held by others, return error.
|
||||
*/
|
||||
spinlock_obtain(&ptdev_lock);
|
||||
entry = ptirq_lookup_entry_by_sid(PTDEV_INTR_MSI, &virt_sid, vm);
|
||||
if (entry == NULL) {
|
||||
/* VM0 we add mapping dynamically */
|
||||
if (is_vm0(vm)) {
|
||||
/* SOS_VM we add mapping dynamically */
|
||||
if (is_sos_vm(vm)) {
|
||||
entry = add_msix_remapping(vm, virt_bdf, virt_bdf, entry_nr);
|
||||
if (entry == NULL) {
|
||||
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
|
||||
* Device Model should pre-hold the mapping entries by calling
|
||||
* ptirq_add_intx_remapping for UOS.
|
||||
*
|
||||
* For SOS(vm0), it adds the mapping entries at runtime, if the
|
||||
* For SOS(sos_vm), it adds the mapping entries at runtime, if the
|
||||
* entry already be held by others, return error.
|
||||
*/
|
||||
|
||||
/* no remap for hypervisor owned intx */
|
||||
if (is_vm0(vm) && hv_used_dbg_intx(virt_sid.intx_id.pin)) {
|
||||
if (is_sos_vm(vm) && hv_used_dbg_intx(virt_sid.intx_id.pin)) {
|
||||
status = -ENODEV;
|
||||
}
|
||||
|
||||
@ -615,9 +615,9 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_pin, uint32_t vpi
|
||||
spinlock_obtain(&ptdev_lock);
|
||||
entry = ptirq_lookup_entry_by_vpin(vm, virt_pin, pic_pin);
|
||||
if (entry == NULL) {
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
|
||||
/* for vm0, there is chance of vpin source switch
|
||||
/* for sos_vm, there is chance of vpin source switch
|
||||
* between vPIC & vIOAPIC for one legacy phys_pin.
|
||||
*
|
||||
* 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
|
||||
}
|
||||
|
||||
/* @pre vm != NULL
|
||||
* except vm0, Device Model should call this function to pre-hold ptdev intx
|
||||
* except sos_vm, Device Model should call this function to pre-hold ptdev intx
|
||||
* entries:
|
||||
* - the entry is identified by phys_pin:
|
||||
* 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
|
||||
spinlock_release(&ptdev_lock);
|
||||
}
|
||||
|
||||
/* except vm0, Device Model should call this function to pre-hold ptdev msi
|
||||
/* except sos_vm, Device Model should call this function to pre-hold ptdev msi
|
||||
* entries:
|
||||
* - the entry is identified by phys_bdf:msi_idx:
|
||||
* one entry vs. one phys_bdf:msi_idx
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
/*
|
||||
* e820.c contains the related e820 operations; like HV to get memory info for its MMU setup;
|
||||
* and hide HV memory from VM0...
|
||||
* and hide HV memory from SOS_VM...
|
||||
*/
|
||||
|
||||
static uint32_t e820_entries_count;
|
||||
@ -51,8 +51,8 @@ static void obtain_e820_mem_info(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* before boot vm0(service OS), call it to hide the HV RAM entry in e820 table from vm0 */
|
||||
void rebuild_vm0_e820(void)
|
||||
/* before boot sos_vm(service OS), call it to hide the HV RAM entry in e820 table from sos_vm */
|
||||
void rebuild_sos_vm_e820(void)
|
||||
{
|
||||
uint32_t i;
|
||||
uint64_t entry_start;
|
||||
@ -116,7 +116,7 @@ void rebuild_vm0_e820(void)
|
||||
e820_mem.total_mem_size -= CONFIG_HV_RAM_SIZE;
|
||||
}
|
||||
|
||||
/* get some RAM below 1MB in e820 entries, hide it from vm0, return its start address */
|
||||
/* get some RAM below 1MB in e820 entries, hide it from sos_vm, return its start address */
|
||||
uint64_t e820_alloc_low_memory(uint32_t size_arg)
|
||||
{
|
||||
uint32_t i;
|
||||
|
@ -67,7 +67,7 @@ uint64_t gpa2hpa(struct acrn_vm *vm, uint64_t gpa)
|
||||
/**
|
||||
* @pre: the gpa and hpa are identical mapping in SOS.
|
||||
*/
|
||||
uint64_t vm0_hpa2gpa(uint64_t hpa)
|
||||
uint64_t sos_vm_hpa2gpa(uint64_t hpa)
|
||||
{
|
||||
return hpa;
|
||||
}
|
||||
|
@ -448,9 +448,9 @@ int32_t copy_to_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
* @retval 0 on success
|
||||
*
|
||||
* @pre vm != NULL
|
||||
* @pre is_vm0(vm) == true
|
||||
* @pre is_sos_vm(vm) == true
|
||||
*/
|
||||
void prepare_vm0_memmap(struct acrn_vm *vm)
|
||||
void prepare_sos_vm_memmap(struct acrn_vm *vm)
|
||||
{
|
||||
uint32_t i;
|
||||
uint64_t attr_uc = (EPT_RWX | EPT_UNCACHED);
|
||||
@ -462,11 +462,11 @@ void prepare_vm0_memmap(struct acrn_vm *vm)
|
||||
const struct e820_entry *p_e820 = get_e820_entry();
|
||||
const struct e820_mem_params *p_e820_mem_info = get_e820_mem_info();
|
||||
|
||||
dev_dbg(ACRN_DBG_GUEST, "vm0: bottom memory - 0x%llx, top memory - 0x%llx\n",
|
||||
dev_dbg(ACRN_DBG_GUEST, "sos_vm: bottom memory - 0x%llx, top memory - 0x%llx\n",
|
||||
p_e820_mem_info->mem_bottom, p_e820_mem_info->mem_top);
|
||||
|
||||
if (p_e820_mem_info->mem_top > EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE)) {
|
||||
panic("Please configure VM0_ADDRESS_SPACE correctly!\n");
|
||||
panic("Please configure SOS_VM_ADDRESS_SPACE correctly!\n");
|
||||
}
|
||||
|
||||
/* create real ept map for all ranges with UC */
|
||||
@ -481,7 +481,7 @@ void prepare_vm0_memmap(struct acrn_vm *vm)
|
||||
}
|
||||
}
|
||||
|
||||
dev_dbg(ACRN_DBG_GUEST, "VM0 e820 layout:\n");
|
||||
dev_dbg(ACRN_DBG_GUEST, "SOS_VM e820 layout:\n");
|
||||
for (i = 0U; i < entries_count; i++) {
|
||||
entry = p_e820 + i;
|
||||
dev_dbg(ACRN_DBG_GUEST, "e820 table: %d type: 0x%x", i, entry->type);
|
||||
|
@ -10,7 +10,7 @@ int32_t validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl)
|
||||
{
|
||||
int32_t ret = -1;
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
ret = 0;
|
||||
} else {
|
||||
uint8_t i;
|
||||
@ -132,7 +132,7 @@ static inline void enter_s3(struct acrn_vm *vm, uint32_t pm1a_cnt_val, uint32_t
|
||||
guest_wakeup_vec32 = *(vm->pm.sx_state_data->wake_vector_32);
|
||||
clac();
|
||||
|
||||
pause_vm(vm); /* pause vm0 before suspend system */
|
||||
pause_vm(vm); /* pause sos_vm before suspend system */
|
||||
host_enter_s3(vm->pm.sx_state_data, pm1a_cnt_val, pm1b_cnt_val);
|
||||
resume_vm_from_s3(vm, guest_wakeup_vec32); /* jump back to vm */
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ void set_ap_entry(struct acrn_vcpu *vcpu, uint64_t entry)
|
||||
* vcpu_id/pcpu_id mapping table:
|
||||
*
|
||||
* if
|
||||
* VM0_CPUS[2] = {0, 2} , VM1_CPUS[2] = {3, 1};
|
||||
* SOS_VM_CPUS[2] = {0, 2} , VM1_CPUS[2] = {3, 1};
|
||||
* then
|
||||
* for physical CPU 0 : vcpu->pcpu_id = 0, vcpu->vcpu_id = 0, vmid = 0;
|
||||
* for physical CPU 2 : vcpu->pcpu_id = 2, vcpu->vcpu_id = 1, vmid = 0;
|
||||
|
@ -365,7 +365,7 @@ void guest_cpuid(struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx, uint32_t
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
cpuid_subleaf(leaf, subleaf, eax, ebx, ecx, edx);
|
||||
#else
|
||||
if (is_vm0(vcpu->vm)) {
|
||||
if (is_sos_vm(vcpu->vm)) {
|
||||
cpuid_subleaf(leaf, subleaf, eax, ebx, ecx, edx);
|
||||
} else {
|
||||
*ecx = subleaf & 0xFFU;
|
||||
|
@ -174,7 +174,7 @@ vlapic_build_id(const struct acrn_vlapic *vlapic)
|
||||
*/
|
||||
vlapic_id = per_cpu(lapic_id, vcpu->pcpu_id);
|
||||
#else
|
||||
if (is_vm0(vcpu->vm)) {
|
||||
if (is_sos_vm(vcpu->vm)) {
|
||||
/* Get APIC ID sequence format from cpu_storage */
|
||||
vlapic_id = per_cpu(lapic_id, vcpu->vcpu_id);
|
||||
} else {
|
||||
@ -2183,7 +2183,7 @@ int32_t vlapic_create(struct acrn_vcpu *vcpu)
|
||||
uint64_t *pml4_page =
|
||||
(uint64_t *)vcpu->vm->arch_vm.nworld_eptp;
|
||||
/* only need unmap it from SOS as UOS never mapped it */
|
||||
if (is_vm0(vcpu->vm)) {
|
||||
if (is_sos_vm(vcpu->vm)) {
|
||||
ept_mr_del(vcpu->vm, pml4_page,
|
||||
DEFAULT_APIC_BASE, PAGE_SIZE);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ static inline bool is_vm_valid(uint16_t vm_id)
|
||||
*/
|
||||
static void setup_io_bitmap(struct acrn_vm *vm)
|
||||
{
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
(void)memset(vm->arch_vm.io_bitmap, 0x00U, PAGE_SIZE * 2U);
|
||||
} else {
|
||||
/* block all IO port access from Guest */
|
||||
@ -112,10 +112,10 @@ int32_t create_vm(struct acrn_vm_config *vm_config, struct acrn_vm **rtn_vm)
|
||||
|
||||
/* Only for SOS: Configure VM software information */
|
||||
/* For UOS: This VM software information is configure in DM */
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
vm->snoopy_mem = false;
|
||||
rebuild_vm0_e820();
|
||||
prepare_vm0_memmap(vm);
|
||||
rebuild_sos_vm_e820();
|
||||
prepare_sos_vm_memmap(vm);
|
||||
|
||||
#ifndef CONFIG_EFI_STUB
|
||||
status = init_vm_boot_info(vm);
|
||||
@ -123,7 +123,7 @@ int32_t create_vm(struct acrn_vm_config *vm_config, struct acrn_vm **rtn_vm)
|
||||
status = efi_boot_init();
|
||||
#endif
|
||||
if (status == 0) {
|
||||
init_iommu_vm0_domain(vm);
|
||||
init_iommu_sos_vm_domain(vm);
|
||||
} else {
|
||||
need_cleanup = true;
|
||||
}
|
||||
@ -163,7 +163,7 @@ int32_t create_vm(struct acrn_vm_config *vm_config, struct acrn_vm **rtn_vm)
|
||||
|
||||
vm_setup_cpu_state(vm);
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
/* Load pm S state data */
|
||||
if (vm_load_pm_s_state(vm) == 0) {
|
||||
register_pm1ab_handler(vm);
|
||||
@ -290,7 +290,7 @@ int32_t reset_vm(struct acrn_vm *vm)
|
||||
reset_vcpu(vcpu);
|
||||
}
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
(void )vm_sw_loader(vm);
|
||||
}
|
||||
|
||||
@ -411,22 +411,22 @@ int32_t prepare_vm(uint16_t pcpu_id)
|
||||
|
||||
#else
|
||||
|
||||
/* Create vm/vcpu for vm0 */
|
||||
static int32_t prepare_vm0(void)
|
||||
/* Create vm/vcpu for sos_vm */
|
||||
static int32_t prepare_sos_vm(void)
|
||||
{
|
||||
int32_t err;
|
||||
uint16_t i;
|
||||
struct acrn_vm *vm = NULL;
|
||||
struct acrn_vm_config vm0_config;
|
||||
struct acrn_vm_config sos_vm_config;
|
||||
|
||||
(void)memset((void *)&vm0_config, 0U, sizeof(vm0_config));
|
||||
vm0_config.vm_hw_num_cores = get_pcpu_nums();
|
||||
(void)memset((void *)&sos_vm_config, 0U, sizeof(sos_vm_config));
|
||||
sos_vm_config.vm_hw_num_cores = get_pcpu_nums();
|
||||
|
||||
err = create_vm(&vm0_config, &vm);
|
||||
err = create_vm(&sos_vm_config, &vm);
|
||||
|
||||
if (err == 0) {
|
||||
/* Allocate all cpus to vm0 at the beginning */
|
||||
for (i = 0U; i < vm0_config.vm_hw_num_cores; i++) {
|
||||
/* Allocate all cpus to sos_vm at the beginning */
|
||||
for (i = 0U; i < sos_vm_config.vm_hw_num_cores; i++) {
|
||||
err = prepare_vcpu(vm, i);
|
||||
if (err != 0) {
|
||||
break;
|
||||
@ -439,14 +439,14 @@ static int32_t prepare_vm0(void)
|
||||
vm_sw_loader = general_sw_loader;
|
||||
}
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
(void)vm_sw_loader(vm);
|
||||
}
|
||||
|
||||
/* start vm0 BSP automatically */
|
||||
/* start sos_vm BSP automatically */
|
||||
start_vm(vm);
|
||||
|
||||
pr_acrnlog("Start VM0");
|
||||
pr_acrnlog("Start SOS_VM");
|
||||
}
|
||||
}
|
||||
|
||||
@ -457,9 +457,9 @@ int32_t prepare_vm(uint16_t pcpu_id)
|
||||
{
|
||||
int32_t err = 0;
|
||||
|
||||
/* prepare vm0 if pcpu_id is BOOT_CPU_ID */
|
||||
/* prepare sos_vm if pcpu_id is BOOT_CPU_ID */
|
||||
if (pcpu_id == BOOT_CPU_ID) {
|
||||
err = prepare_vm0();
|
||||
err = prepare_sos_vm();
|
||||
}
|
||||
|
||||
return err;
|
||||
|
@ -195,10 +195,10 @@ int32_t vmcall_vmexit_handler(struct acrn_vcpu *vcpu)
|
||||
if (!is_hypercall_from_ring0()) {
|
||||
pr_err("hypercall is only allowed from RING-0!\n");
|
||||
ret = -EACCES;
|
||||
} else if (!is_vm0(vm) && (hypcall_id != HC_WORLD_SWITCH) &&
|
||||
} else if (!is_sos_vm(vm) && (hypcall_id != HC_WORLD_SWITCH) &&
|
||||
(hypcall_id != HC_INITIALIZE_TRUSTY) &&
|
||||
(hypcall_id != HC_SAVE_RESTORE_SWORLD_CTX)) {
|
||||
pr_err("hypercall %d is only allowed from VM0!\n", hypcall_id);
|
||||
pr_err("hypercall %d is only allowed from SOS_VM!\n", hypcall_id);
|
||||
ret = -EACCES;
|
||||
} else {
|
||||
/* Dispatch the hypercall handler */
|
||||
|
@ -553,7 +553,7 @@ int32_t wrmsr_vmexit_handler(struct acrn_vcpu *vcpu)
|
||||
case MSR_IA32_BIOS_UPDT_TRIG:
|
||||
{
|
||||
/* We only allow SOS to do uCode update */
|
||||
if (is_vm0(vcpu->vm)) {
|
||||
if (is_sos_vm(vcpu->vm)) {
|
||||
acrn_update_ucode(vcpu, v);
|
||||
}
|
||||
break;
|
||||
|
@ -100,14 +100,14 @@ void init_vmtrr(struct acrn_vcpu *vcpu)
|
||||
vmtrr->def_type.bits.fixed_enable = 1U;
|
||||
vmtrr->def_type.bits.type = MTRR_MEM_TYPE_UC;
|
||||
|
||||
if (is_vm0(vcpu->vm)) {
|
||||
if (is_sos_vm(vcpu->vm)) {
|
||||
cap.value = msr_read(MSR_IA32_MTRR_CAP);
|
||||
}
|
||||
|
||||
for (i = 0U; i < FIXED_RANGE_MTRR_NUM; i++) {
|
||||
if (cap.bits.fix != 0U) {
|
||||
/*
|
||||
* The system firmware runs in VMX non-root mode on VM0.
|
||||
* The system firmware runs in VMX non-root mode on SOS_VM.
|
||||
* In some cases, the firmware needs particular mem type
|
||||
* at certain mmeory locations (e.g. UC for some
|
||||
* hardware registers), so we need to configure EPT
|
||||
@ -116,7 +116,7 @@ void init_vmtrr(struct acrn_vcpu *vcpu)
|
||||
vmtrr->fixed_range[i].value = msr_read(fixed_mtrr_map[i].msr);
|
||||
} else {
|
||||
/*
|
||||
* For non-vm0 EPT, all memory is setup with WB type in
|
||||
* For non-sos_vm EPT, all memory is setup with WB type in
|
||||
* EPT, so we setup fixed range MTRRs accordingly.
|
||||
*/
|
||||
vmtrr->fixed_range[i].value = MTRR_FIXED_RANGE_ALL_WB;
|
||||
|
@ -536,7 +536,7 @@ static void deny_guest_pio_access(struct acrn_vm *vm, uint16_t port_address,
|
||||
void register_pio_emulation_handler(struct acrn_vm *vm, uint32_t pio_idx,
|
||||
const struct vm_io_range *range, io_read_fn_t io_read_fn_ptr, io_write_fn_t io_write_fn_ptr)
|
||||
{
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
deny_guest_pio_access(vm, range->base, range->len);
|
||||
}
|
||||
vm->arch_vm.emul_pio[pio_idx].port_start = range->base;
|
||||
@ -588,7 +588,7 @@ int32_t register_mmio_emulation_handler(struct acrn_vm *vm,
|
||||
* should unmap it. But UOS will not, so we shouldn't
|
||||
* need to unmap it.
|
||||
*/
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
ept_mr_del(vm, (uint64_t *)vm->arch_vm.nworld_eptp, start, end - start);
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ static int32_t request_notification_irq(irq_action_t func, void *data)
|
||||
*/
|
||||
void setup_notification(void)
|
||||
{
|
||||
/* support IPI notification, VM0 will register all CPU */
|
||||
/* support IPI notification, SOS_VM will register all CPU */
|
||||
if (request_notification_irq(kick_notification, NULL) < 0) {
|
||||
pr_err("Failed to setup notification");
|
||||
}
|
||||
|
@ -58,10 +58,10 @@ const struct memory_ops ppt_mem_ops = {
|
||||
.get_pd_page = ppt_get_pd_page,
|
||||
};
|
||||
|
||||
static struct page vm0_pml4_pages[PML4_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
static struct page vm0_pdpt_pages[PDPT_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
static struct page vm0_pd_pages[PD_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
static struct page vm0_pt_pages[PT_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
static struct page sos_vm_pml4_pages[PML4_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
static struct page sos_vm_pdpt_pages[PDPT_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
static struct page sos_vm_pd_pages[PD_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
static struct page sos_vm_pt_pages[PT_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE))];
|
||||
|
||||
/* uos_nworld_pml4_pages[i] is ...... of UOS i (whose vm_id = i +1) */
|
||||
static struct page uos_nworld_pml4_pages[CONFIG_MAX_VM_NUM - 1U][PML4_PAGE_NUM(EPT_ADDRESS_SPACE(CONFIG_UOS_RAM_SIZE))];
|
||||
@ -78,10 +78,10 @@ static union pgtable_pages_info ept_pages_info[CONFIG_MAX_VM_NUM] = {
|
||||
{
|
||||
.ept = {
|
||||
.top_address_space = EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE),
|
||||
.nworld_pml4_base = vm0_pml4_pages,
|
||||
.nworld_pdpt_base = vm0_pdpt_pages,
|
||||
.nworld_pd_base = vm0_pd_pages,
|
||||
.nworld_pt_base = vm0_pt_pages,
|
||||
.nworld_pml4_base = sos_vm_pml4_pages,
|
||||
.nworld_pdpt_base = sos_vm_pdpt_pages,
|
||||
.nworld_pd_base = sos_vm_pd_pages,
|
||||
.nworld_pt_base = sos_vm_pt_pages,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -156,7 +156,7 @@ bool iommu_snoop_supported(const struct acrn_vm *vm)
|
||||
|
||||
static struct dmar_drhd_rt dmar_drhd_units[CONFIG_MAX_IOMMU_NUM];
|
||||
static bool iommu_page_walk_coherent = true;
|
||||
static struct iommu_domain *vm0_domain;
|
||||
static struct iommu_domain *sos_vm_domain;
|
||||
|
||||
/* Domain id 0 is reserved in some cases per VT-d */
|
||||
#define MAX_DOMAIN_NUM (CONFIG_MAX_VM_NUM + 1)
|
||||
@ -1061,8 +1061,8 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de
|
||||
|
||||
/* TODO: check if the device assigned */
|
||||
|
||||
if (vm0_domain != NULL) {
|
||||
status = remove_iommu_device(vm0_domain, 0U, bus, devfun);
|
||||
if (sos_vm_domain != NULL) {
|
||||
status = remove_iommu_device(sos_vm_domain, 0U, bus, devfun);
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
@ -1079,8 +1079,8 @@ int32_t unassign_iommu_device(const struct iommu_domain *domain, uint8_t bus, ui
|
||||
/* TODO: check if the device assigned */
|
||||
status = remove_iommu_device(domain, 0U, bus, devfun);
|
||||
|
||||
if ((status == 0) && (vm0_domain != NULL)) {
|
||||
status = add_iommu_device(vm0_domain, 0U, bus, devfun);
|
||||
if ((status == 0) && (sos_vm_domain != NULL)) {
|
||||
status = add_iommu_device(sos_vm_domain, 0U, bus, devfun);
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -1121,22 +1121,22 @@ int32_t init_iommu(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void init_iommu_vm0_domain(struct acrn_vm *vm0)
|
||||
void init_iommu_sos_vm_domain(struct acrn_vm *sos_vm)
|
||||
{
|
||||
uint16_t bus;
|
||||
uint16_t devfun;
|
||||
|
||||
vm0->iommu = create_iommu_domain(vm0->vm_id, hva2hpa(vm0->arch_vm.nworld_eptp), 48U);
|
||||
sos_vm->iommu = create_iommu_domain(sos_vm->vm_id, hva2hpa(sos_vm->arch_vm.nworld_eptp), 48U);
|
||||
|
||||
vm0_domain = (struct iommu_domain *) vm0->iommu;
|
||||
if (vm0_domain == NULL) {
|
||||
pr_err("vm0 domain is NULL\n");
|
||||
sos_vm_domain = (struct iommu_domain *) sos_vm->iommu;
|
||||
if (sos_vm_domain == NULL) {
|
||||
pr_err("sos_vm domain is NULL\n");
|
||||
} else {
|
||||
for (bus = 0U; bus < CONFIG_IOMMU_BUS_NUM; bus++) {
|
||||
for (devfun = 0U; devfun <= 255U; devfun++) {
|
||||
if (add_iommu_device(vm0_domain, 0U, (uint8_t)bus, (uint8_t)devfun) != 0) {
|
||||
/* the panic only occurs before VM0 starts running in sharing mode */
|
||||
panic("Failed to add %x:%x.%x to VM0 domain", bus, pci_slot(devfun), pci_func(devfun));
|
||||
if (add_iommu_device(sos_vm_domain, 0U, (uint8_t)bus, (uint8_t)devfun) != 0) {
|
||||
/* the panic only occurs before SOS_VM starts running in sharing mode */
|
||||
panic("Failed to add %x:%x.%x to SOS_VM domain", bus, pci_slot(devfun), pci_func(devfun));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ int32_t init_vm_boot_info(struct acrn_vm *vm)
|
||||
}
|
||||
|
||||
#else
|
||||
/* There are two sources for vm0 kernel cmdline:
|
||||
/* There are two sources for sos_vm kernel cmdline:
|
||||
* - cmdline from sbl. mbi->cmdline
|
||||
* - cmdline from acrn stitching tool. mod[0].mm_string
|
||||
* We need to merge them together
|
||||
@ -152,7 +152,7 @@ static void *get_kernel_load_addr(void *kernel_src_addr)
|
||||
* @retval -EINVAL on invalid parameters
|
||||
*
|
||||
* @pre vm != NULL
|
||||
* @pre is_vm0(vm) == true
|
||||
* @pre is_sos_vm(vm) == true
|
||||
*/
|
||||
int32_t init_vm_boot_info(struct acrn_vm *vm)
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ bool sbl_seed_parse(struct acrn_vm *vm, char *cmdline, char *out_arg, uint32_t o
|
||||
uint32_t len;
|
||||
bool parse_success = false;
|
||||
|
||||
if (is_vm0(vm) && (cmdline != NULL)) {
|
||||
if (is_sos_vm(vm) && (cmdline != NULL)) {
|
||||
len = strnlen_s(boot_params_arg, MEM_1K);
|
||||
arg = strstr_s((const char *)cmdline, MEM_2K, boot_params_arg, len);
|
||||
|
||||
@ -153,8 +153,8 @@ bool sbl_seed_parse(struct acrn_vm *vm, char *cmdline, char *out_arg, uint32_t o
|
||||
* Convert the addresses to SOS GPA since this structure will
|
||||
* be used in SOS.
|
||||
*/
|
||||
boot_params->p_seed_list = vm0_hpa2gpa(boot_params->p_seed_list);
|
||||
boot_params->p_platform_info = vm0_hpa2gpa(boot_params->p_platform_info);
|
||||
boot_params->p_seed_list = sos_vm_hpa2gpa(boot_params->p_seed_list);
|
||||
boot_params->p_platform_info = sos_vm_hpa2gpa(boot_params->p_platform_info);
|
||||
|
||||
/*
|
||||
* Replace original arguments with spaces since SOS's GPA is not
|
||||
|
@ -36,7 +36,7 @@ bool is_hypercall_from_ring0(void)
|
||||
* @param vm Pointer to VM data structure
|
||||
* @param lapicid lapic id of the vcpu which wants to offline
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_sos_offline_cpu(struct acrn_vm *vm, uint64_t lapicid)
|
||||
@ -66,13 +66,13 @@ int32_t hcall_sos_offline_cpu(struct acrn_vm *vm, uint64_t lapicid)
|
||||
/**
|
||||
* @brief Get hypervisor api version
|
||||
*
|
||||
* The function only return api version information when VM is VM0.
|
||||
* The function only return api version information when VM is SOS_VM.
|
||||
*
|
||||
* @param vm Pointer to VM data structure
|
||||
* @param param guest physical memory address. The api version returned
|
||||
* will be copied to this gpa
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_get_api_version(struct acrn_vm *vm, uint64_t param)
|
||||
@ -104,7 +104,7 @@ int32_t hcall_get_api_version(struct acrn_vm *vm, uint64_t param)
|
||||
* @param param guest physical memory address. This gpa points to
|
||||
* struct acrn_create_vm
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_create_vm(struct acrn_vm *vm, uint64_t param)
|
||||
@ -231,7 +231,7 @@ int32_t hcall_pause_vm(uint16_t vmid)
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct acrn_create_vcpu
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_create_vcpu(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -276,7 +276,7 @@ int32_t hcall_reset_vm(uint16_t vmid)
|
||||
struct acrn_vm *target_vm = get_vm_from_vmid(vmid);
|
||||
int32_t ret;
|
||||
|
||||
if ((target_vm == NULL) || is_vm0(target_vm)) {
|
||||
if ((target_vm == NULL) || is_sos_vm(target_vm)) {
|
||||
ret = -1;
|
||||
} else {
|
||||
ret = reset_vm(target_vm);
|
||||
@ -305,7 +305,7 @@ int32_t hcall_set_vcpu_regs(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
struct acrn_vcpu *vcpu;
|
||||
int32_t ret;
|
||||
|
||||
if ((target_vm == NULL) || (param == 0U) || is_vm0(target_vm) || (target_vm->state == VM_STARTED)) {
|
||||
if ((target_vm == NULL) || (param == 0U) || is_sos_vm(target_vm) || (target_vm->state == VM_STARTED)) {
|
||||
/* Only allow setup init ctx while target_vm is inactive */
|
||||
ret = -1;
|
||||
} else if (copy_from_gpa(vm, &vcpu_regs, param, sizeof(vcpu_regs)) != 0) {
|
||||
@ -334,7 +334,7 @@ int32_t hcall_set_vcpu_regs(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
* @param vmid ID of the VM
|
||||
* @param ops request command for IRQ set or clear
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_irqline(const struct acrn_vm *vm, uint16_t vmid,
|
||||
@ -377,7 +377,7 @@ int32_t hcall_set_irqline(const struct acrn_vm *vm, uint16_t vmid,
|
||||
* @param vmid ID of the VM
|
||||
* @param param guest physical address. This gpa points to struct acrn_msi_entry
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_inject_msi(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -412,7 +412,7 @@ int32_t hcall_inject_msi(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct acrn_set_ioreq_buffer
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_ioreq_buffer(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -497,10 +497,10 @@ static int32_t add_vm_memory_region(struct acrn_vm *vm, struct acrn_vm *target_v
|
||||
uint64_t prot;
|
||||
uint64_t hpa, base_paddr;
|
||||
|
||||
hpa = gpa2hpa(vm, region->vm0_gpa);
|
||||
hpa = gpa2hpa(vm, region->sos_vm_gpa);
|
||||
if (hpa == INVALID_HPA) {
|
||||
pr_err("%s,vm[%hu] gpa 0x%llx,GPA is unmapping.",
|
||||
__func__, vm->vm_id, region->vm0_gpa);
|
||||
__func__, vm->vm_id, region->sos_vm_gpa);
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
base_paddr = get_hv_image_base();
|
||||
@ -543,7 +543,7 @@ static int32_t add_vm_memory_region(struct acrn_vm *vm, struct acrn_vm *target_v
|
||||
}
|
||||
|
||||
/**
|
||||
*@pre Pointer vm shall point to VM0
|
||||
*@pre Pointer vm shall point to SOS_VM
|
||||
*/
|
||||
static int32_t set_vm_memory_region(struct acrn_vm *vm,
|
||||
struct acrn_vm *target_vm, const struct vm_memory_region *region)
|
||||
@ -564,9 +564,9 @@ static int32_t set_vm_memory_region(struct acrn_vm *vm,
|
||||
ret = 0;
|
||||
} else {
|
||||
dev_dbg(ACRN_DBG_HYCALL,
|
||||
"[vm%d] type=%d gpa=0x%x vm0_gpa=0x%x size=0x%x",
|
||||
"[vm%d] type=%d gpa=0x%x sos_vm_gpa=0x%x size=0x%x",
|
||||
target_vm->vm_id, region->type, region->gpa,
|
||||
region->vm0_gpa, region->size);
|
||||
region->sos_vm_gpa, region->size);
|
||||
|
||||
pml4_page = (uint64_t *)target_vm->arch_vm.nworld_eptp;
|
||||
if (region->type != MR_DEL) {
|
||||
@ -589,7 +589,7 @@ static int32_t set_vm_memory_region(struct acrn_vm *vm,
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct set_memmaps
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_vm_memory_regions(struct acrn_vm *vm, uint64_t param)
|
||||
@ -608,7 +608,7 @@ int32_t hcall_set_vm_memory_regions(struct acrn_vm *vm, uint64_t param)
|
||||
ret = -EFAULT;
|
||||
} else {
|
||||
target_vm = get_vm_from_vmid(regions.vmid);
|
||||
if ((target_vm == NULL) || is_vm0(target_vm)) {
|
||||
if ((target_vm == NULL) || is_sos_vm(target_vm)) {
|
||||
pr_err("%p %s:target_vm is invalid or Targeting to service vm", target_vm, __func__);
|
||||
ret = -EFAULT;
|
||||
} else {
|
||||
@ -633,7 +633,7 @@ int32_t hcall_set_vm_memory_regions(struct acrn_vm *vm, uint64_t param)
|
||||
}
|
||||
|
||||
/**
|
||||
*@pre Pointer vm shall point to VM0
|
||||
*@pre Pointer vm shall point to SOS_VM
|
||||
*/
|
||||
static int32_t write_protect_page(struct acrn_vm *vm,const struct wp_data *wp)
|
||||
{
|
||||
@ -678,7 +678,7 @@ static int32_t write_protect_page(struct acrn_vm *vm,const struct wp_data *wp)
|
||||
* @param wp_gpa guest physical address. This gpa points to
|
||||
* struct wp_data
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_write_protect_page(struct acrn_vm *vm, uint16_t vmid, uint64_t wp_gpa)
|
||||
@ -687,7 +687,7 @@ int32_t hcall_write_protect_page(struct acrn_vm *vm, uint16_t vmid, uint64_t wp_
|
||||
struct acrn_vm *target_vm = get_vm_from_vmid(vmid);
|
||||
int32_t ret;
|
||||
|
||||
if ((target_vm == NULL) || is_vm0(target_vm)) {
|
||||
if ((target_vm == NULL) || is_sos_vm(target_vm)) {
|
||||
pr_err("%p %s: target_vm is invalid or Targeting to service vm", target_vm, __func__);
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
@ -714,7 +714,7 @@ int32_t hcall_write_protect_page(struct acrn_vm *vm, uint16_t vmid, uint64_t wp_
|
||||
* @param vmid ID of the VM
|
||||
* @param param guest physical address. This gpa points to struct vm_gpa2hpa
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_gpa_to_hpa(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -753,7 +753,7 @@ int32_t hcall_gpa_to_hpa(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
* For the compatibility it still can be the guest physical address that
|
||||
* points to the physical BDF of the assigning ptdev.(Depreciated)
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_assign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -814,7 +814,7 @@ int32_t hcall_assign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
* To keep the compatibility it still can be the guest physical address that
|
||||
* points to the physical BDF of the deassigning ptdev.(Depreciated)
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_deassign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -854,7 +854,7 @@ int32_t hcall_deassign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
* @param param guest physical address. This gpa points to data structure of
|
||||
* hc_ptdev_irq including intr remapping info
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_ptdev_intr_info(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -899,7 +899,7 @@ int32_t hcall_set_ptdev_intr_info(struct acrn_vm *vm, uint16_t vmid, uint64_t pa
|
||||
* @param param guest physical address. This gpa points to data structure of
|
||||
* hc_ptdev_irq including intr remapping info
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t
|
||||
@ -950,7 +950,7 @@ hcall_reset_ptdev_intr_info(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
* @param cmd cmd to show get which VCPU power state data
|
||||
* @param param VCPU power state data
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_get_cpu_pm_state(struct acrn_vm *vm, uint64_t cmd, uint64_t param)
|
||||
@ -1069,7 +1069,7 @@ int32_t hcall_get_cpu_pm_state(struct acrn_vm *vm, uint64_t cmd, uint64_t param)
|
||||
* @param param guest physical address. This gpa points to data structure of
|
||||
* acrn_intr_monitor
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_vm_intr_monitor(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
@ -1124,14 +1124,14 @@ int32_t hcall_vm_intr_monitor(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
||||
* @param vm Pointer to VM data structure
|
||||
* @param param the expected notifier vector from guest
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_callback_vector(const struct acrn_vm *vm, uint64_t param)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (!is_vm0(vm)) {
|
||||
if (!is_sos_vm(vm)) {
|
||||
pr_err("%s: Targeting to service vm", __func__);
|
||||
ret = -EPERM;
|
||||
} else if ((param > NR_MAX_VECTOR) || (param < VECTOR_DYNAMIC_START)) {
|
||||
|
@ -66,8 +66,8 @@ struct ptirq_remapping_info *ptirq_dequeue_softirq(struct acrn_vm *vm)
|
||||
|
||||
list_del_init(&entry->softirq_node);
|
||||
|
||||
/* if vm0, just dequeue, if uos, check delay timer */
|
||||
if (is_vm0(entry->vm) || timer_expired(&entry->intr_delay_timer)) {
|
||||
/* if sos vm, just dequeue, if uos, check delay timer */
|
||||
if (is_sos_vm(entry->vm) || timer_expired(&entry->intr_delay_timer)) {
|
||||
break;
|
||||
} else {
|
||||
/* add it into timer list; dequeue next one */
|
||||
@ -131,7 +131,7 @@ static void ptirq_interrupt_handler(__unused uint32_t irq, void *data)
|
||||
* "interrupt storm" detection & delay intr injection just for UOS
|
||||
* pass-thru devices, collect its data and delay injection if needed
|
||||
*/
|
||||
if (!is_vm0(entry->vm)) {
|
||||
if (!is_sos_vm(entry->vm)) {
|
||||
entry->intr_count++;
|
||||
|
||||
/* if delta > 0, set the delay TSC, dequeue to handle */
|
||||
|
@ -128,7 +128,7 @@ int32_t general_sw_loader(struct acrn_vm *vm)
|
||||
* reserving. Current strategy is "total_mem_size in Giga -
|
||||
* remained 1G pages" for reserving.
|
||||
*/
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
int32_t reserving_1g_pages;
|
||||
|
||||
#ifdef CONFIG_REMAIN_1G_PAGES
|
||||
|
@ -20,7 +20,7 @@
|
||||
* @param param guest physical address. This gpa points to
|
||||
* data structure required by each command
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
static int32_t hcall_profiling_ops(struct acrn_vm *vm, uint64_t cmd, uint64_t param)
|
||||
@ -67,7 +67,7 @@ static int32_t hcall_profiling_ops(struct acrn_vm *vm, uint64_t cmd, uint64_t pa
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct sbuf_setup_param
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
static int32_t hcall_setup_sbuf(struct acrn_vm *vm, uint64_t param)
|
||||
@ -98,7 +98,7 @@ static int32_t hcall_setup_sbuf(struct acrn_vm *vm, uint64_t param)
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct hv_npk_log_param
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
static int32_t hcall_setup_hv_npk_log(struct acrn_vm *vm, uint64_t param)
|
||||
@ -128,7 +128,7 @@ static int32_t hcall_setup_hv_npk_log(struct acrn_vm *vm, uint64_t param)
|
||||
* @param vm Pointer to vm data structure
|
||||
* @param param Guest physical address pointing to struct acrn_hw_info
|
||||
*
|
||||
* @pre vm shall point to VM0
|
||||
* @pre vm shall point to SOS_VM
|
||||
* @pre param shall be a valid physical address
|
||||
*
|
||||
* @retval 0 on success
|
||||
@ -158,7 +158,7 @@ static int32_t hcall_get_hw_info(struct acrn_vm *vm, uint64_t param)
|
||||
* @param param2 hypercall param2 from guest
|
||||
* @param hypcall_id hypercall ID from guest
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_debug(struct acrn_vm *vm, uint64_t param1, uint64_t param2, uint64_t hypcall_id)
|
||||
|
@ -1394,7 +1394,7 @@ void profiling_setup(void)
|
||||
int32_t retval;
|
||||
dev_dbg(ACRN_DBG_PROFILING, "%s: entering", __func__);
|
||||
cpu = get_cpu_id();
|
||||
/* support PMI notification, VM0 will register all CPU */
|
||||
/* support PMI notification, SOS_VM will register all CPU */
|
||||
if ((cpu == BOOT_CPU_ID) && (profiling_pmi_irq == IRQ_INVALID)) {
|
||||
pr_info("%s: calling request_irq", __func__);
|
||||
retval = request_irq(PMI_IRQ,
|
||||
|
@ -529,7 +529,7 @@ vioapic_pincount(const struct acrn_vm *vm)
|
||||
{
|
||||
uint32_t ret;
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
ret = REDIR_ENTRIES_HW;
|
||||
} else {
|
||||
ret = VIOAPIC_RTE_NUM;
|
||||
|
@ -328,7 +328,7 @@ static void decode_msix_table_bar(struct pci_vdev *vdev)
|
||||
}
|
||||
|
||||
vdev->msix.mmio_hva = (uint64_t)hpa2hva(base);
|
||||
vdev->msix.mmio_gpa = vm0_hpa2gpa(base);
|
||||
vdev->msix.mmio_gpa = sos_vm_hpa2gpa(base);
|
||||
|
||||
/* Sizing the BAR */
|
||||
size = 0U;
|
||||
|
@ -38,7 +38,7 @@ struct pci_vdev *sharing_mode_find_vdev(union pci_bdf pbdf)
|
||||
struct pci_vdev *vdev = NULL;
|
||||
uint32_t i;
|
||||
|
||||
/* in VM0, it uses phys BDF */
|
||||
/* in SOS_VM, it uses phys BDF */
|
||||
for (i = 0U; i < num_pci_vdev; i++) {
|
||||
if (sharing_mode_vdev_array[i].pdev.bdf.value == pbdf.value) {
|
||||
vdev = &sharing_mode_vdev_array[i];
|
||||
@ -140,16 +140,16 @@ static int32_t sharing_mode_vpci_init(const struct acrn_vm *vm)
|
||||
|
||||
/*
|
||||
* Only setup IO bitmap for SOS.
|
||||
* IO/MMIO requests from non-vm0 guests will be injected to device model.
|
||||
* IO/MMIO requests from non-sos_vm guests will be injected to device model.
|
||||
*/
|
||||
if (!is_vm0(vm)) {
|
||||
if (!is_sos_vm(vm)) {
|
||||
ret = -ENODEV;
|
||||
} else {
|
||||
/* Initialize PCI vdev array */
|
||||
num_pci_vdev = 0U;
|
||||
(void)memset((void *)sharing_mode_vdev_array, 0U, sizeof(sharing_mode_vdev_array));
|
||||
|
||||
/* build up vdev array for vm0 */
|
||||
/* build up vdev array for sos_vm */
|
||||
pci_scan_bus(enumerate_pci_dev, vm);
|
||||
|
||||
for (i = 0U; i < num_pci_vdev; i++) {
|
||||
@ -171,7 +171,7 @@ static void sharing_mode_vpci_deinit(__unused const struct acrn_vm *vm)
|
||||
struct pci_vdev *vdev;
|
||||
uint32_t i, j;
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
if (is_sos_vm(vm)) {
|
||||
for (i = 0U; i < num_pci_vdev; i++) {
|
||||
vdev = &sharing_mode_vdev_array[i];
|
||||
for (j = 0U; j < vdev->nr_ops; j++) {
|
||||
|
@ -86,7 +86,7 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_pin, uint32_t vpi
|
||||
/**
|
||||
* @brief Add an interrupt remapping entry for INTx as pre-hold mapping.
|
||||
*
|
||||
* Except vm0, Device Model should call this function to pre-hold ptdev intx
|
||||
* Except sos_vm, Device Model should call this function to pre-hold ptdev intx
|
||||
* The entry is identified by phys_pin, one entry vs. one phys_pin.
|
||||
* Currently, one phys_pin can only be held by one pin source (vPIC or vIOAPIC).
|
||||
*
|
||||
@ -125,7 +125,7 @@ void ptirq_remove_intx_remapping(struct acrn_vm *vm, uint32_t virt_pin, bool pic
|
||||
* @brief Add interrupt remapping entry/entries for MSI/MSI-x as pre-hold mapping.
|
||||
*
|
||||
* Add pre-hold mapping of the given number of vectors between the given physical and virtual BDF for the given vm.
|
||||
* Except vm0, Device Model should call this function to pre-hold ptdev MSI/MSI-x.
|
||||
* Except sos_vm, Device Model should call this function to pre-hold ptdev MSI/MSI-x.
|
||||
* The entry is identified by phys_bdf:msi_idx, one entry vs. one phys_bdf:msi_idx.
|
||||
*
|
||||
* @param[in] vm pointer to acrn_vm
|
||||
|
@ -18,10 +18,10 @@ struct e820_mem_params {
|
||||
/* HV read multiboot header to get e820 entries info and calc total RAM info */
|
||||
void init_e820(void);
|
||||
|
||||
/* before boot vm0(service OS), call it to hide the HV RAM entry in e820 table from vm0 */
|
||||
void rebuild_vm0_e820(void);
|
||||
/* before boot sos_vm(service OS), call it to hide the HV RAM entry in e820 table from sos_vm */
|
||||
void rebuild_sos_vm_e820(void);
|
||||
|
||||
/* get some RAM below 1MB in e820 entries, hide it from vm0, return its start address */
|
||||
/* get some RAM below 1MB in e820 entries, hide it from sos_vm, return its start address */
|
||||
uint64_t e820_alloc_low_memory(uint32_t size_arg);
|
||||
|
||||
/* copy the original e820 entries info to param_e820 */
|
||||
|
@ -70,7 +70,7 @@
|
||||
#define LDTR_AR (0x0082U) /* LDT, type must be 2, refer to SDM Vol3 26.3.1.2 */
|
||||
#define TR_AR (0x008bU) /* TSS (busy), refer to SDM Vol3 26.3.1.2 */
|
||||
|
||||
void prepare_vm0_memmap(struct acrn_vm *vm);
|
||||
void prepare_sos_vm_memmap(struct acrn_vm *vm);
|
||||
|
||||
/* Use # of paging level to identify paging mode */
|
||||
enum vm_paging_mode {
|
||||
|
@ -235,7 +235,7 @@ struct acrn_vm_config {
|
||||
|
||||
} __aligned(8);
|
||||
|
||||
static inline bool is_vm0(const struct acrn_vm *vm)
|
||||
static inline bool is_sos_vm(const struct acrn_vm *vm)
|
||||
{
|
||||
return (vm->vm_id) == 0U;
|
||||
}
|
||||
|
@ -238,13 +238,13 @@ uint64_t gpa2hpa(struct acrn_vm *vm, uint64_t gpa);
|
||||
*/
|
||||
uint64_t local_gpa2hpa(struct acrn_vm *vm, uint64_t gpa, uint32_t *size);
|
||||
/**
|
||||
* @brief Translating from host-physical address to guest-physical address for VM0
|
||||
* @brief Translating from host-physical address to guest-physical address for SOS_VM
|
||||
*
|
||||
* @param[in] hpa the specified host-physical address
|
||||
*
|
||||
* @pre: the gpa and hpa are identical mapping in SOS.
|
||||
*/
|
||||
uint64_t vm0_hpa2gpa(uint64_t hpa);
|
||||
uint64_t sos_vm_hpa2gpa(uint64_t hpa);
|
||||
/**
|
||||
* @brief Guest-physical memory region mapping
|
||||
*
|
||||
|
@ -485,7 +485,7 @@ struct iommu_domain;
|
||||
/**
|
||||
* @brief Assign a device specified by bus & devfun to a iommu domain.
|
||||
*
|
||||
* Remove the device from the VM0 domain (if present), and add it to the specific domain.
|
||||
* Remove the device from the SOS_VM domain (if present), and add it to the specific domain.
|
||||
*
|
||||
* @param[in] domain iommu domain the device is assigned to
|
||||
* @param[in] bus the 8-bit bus number of the device
|
||||
@ -502,7 +502,7 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de
|
||||
/**
|
||||
* @brief Unassign a device specified by bus & devfun from a iommu domain .
|
||||
*
|
||||
* Remove the device from the specific domain, and then add it to the VM0 domain (if present).
|
||||
* Remove the device from the specific domain, and then add it to the SOS_VM domain (if present).
|
||||
*
|
||||
* @param[in] domain iommu domain the device is assigned to
|
||||
* @param[in] bus the 8-bit bus number of the device
|
||||
@ -594,19 +594,19 @@ void resume_iommu(void);
|
||||
int32_t init_iommu(void);
|
||||
|
||||
/**
|
||||
* @brief Init VM0 domain of iommu.
|
||||
* @brief Init SOS_VM domain of iommu.
|
||||
*
|
||||
* Create VM0 domain using the Normal World's EPT table of VM0 as address translation table.
|
||||
* All PCI devices are added to the VM0 domain when creating it.
|
||||
* Create SOS_VM domain using the Normal World's EPT table of SOS_VM as address translation table.
|
||||
* All PCI devices are added to the SOS_VM domain when creating it.
|
||||
*
|
||||
* @param[in] vm0 pointer to VM0
|
||||
* @param[in] sos_vm pointer to SOS_VM
|
||||
*
|
||||
* @pre vm0 shall point to VM0
|
||||
* @pre sos_vm shall point to SOS_VM
|
||||
*
|
||||
* @remark to reduce boot time & memory cost, a config IOMMU_INIT_BUS_LIMIT, which limit the bus number.
|
||||
*
|
||||
*/
|
||||
void init_iommu_vm0_domain(struct acrn_vm *vm0);
|
||||
void init_iommu_sos_vm_domain(struct acrn_vm *sos_vm);
|
||||
|
||||
/**
|
||||
* @brief check the iommu if support cache snoop.
|
||||
|
@ -32,7 +32,7 @@ bool is_hypercall_from_ring0(void);
|
||||
* @param vm Pointer to VM data structure
|
||||
* @param lapicid lapic id of the vcpu which wants to offline
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_sos_offline_cpu(struct acrn_vm *vm, uint64_t lapicid);
|
||||
@ -40,13 +40,13 @@ int32_t hcall_sos_offline_cpu(struct acrn_vm *vm, uint64_t lapicid);
|
||||
/**
|
||||
* @brief Get hypervisor api version
|
||||
*
|
||||
* The function only return api version information when VM is VM0.
|
||||
* The function only return api version information when VM is SOS_VM.
|
||||
*
|
||||
* @param vm Pointer to VM data structure
|
||||
* @param param guest physical memory address. The api version returned
|
||||
* will be copied to this gpa
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_get_api_version(struct acrn_vm *vm, uint64_t param);
|
||||
@ -62,7 +62,7 @@ int32_t hcall_get_api_version(struct acrn_vm *vm, uint64_t param);
|
||||
* @param param guest physical memory address. This gpa points to
|
||||
* struct acrn_create_vm
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_create_vm(struct acrn_vm *vm, uint64_t param);
|
||||
@ -131,7 +131,7 @@ int32_t hcall_pause_vm(uint16_t vmid);
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct acrn_create_vcpu
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_create_vcpu(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -163,7 +163,7 @@ int32_t hcall_set_vcpu_regs(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
* @param vmid ID of the VM
|
||||
* @param ops request command for IRQ set or clear
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_irqline(const struct acrn_vm *vm, uint16_t vmid,
|
||||
@ -178,7 +178,7 @@ int32_t hcall_set_irqline(const struct acrn_vm *vm, uint16_t vmid,
|
||||
* @param vmid ID of the VM
|
||||
* @param param guest physical address. This gpa points to struct acrn_msi_entry
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_inject_msi(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -194,7 +194,7 @@ int32_t hcall_inject_msi(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct acrn_set_ioreq_buffer
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_ioreq_buffer(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -219,7 +219,7 @@ int32_t hcall_notify_ioreq_finish(uint16_t vmid, uint16_t vcpu_id);
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct set_memmaps
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_vm_memory_regions(struct acrn_vm *vm, uint64_t param);
|
||||
@ -232,7 +232,7 @@ int32_t hcall_set_vm_memory_regions(struct acrn_vm *vm, uint64_t param);
|
||||
* @param wp_gpa guest physical address. This gpa points to
|
||||
* struct wp_data
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_write_protect_page(struct acrn_vm *vm, uint16_t vmid, uint64_t wp_gpa);
|
||||
@ -247,7 +247,7 @@ int32_t hcall_write_protect_page(struct acrn_vm *vm, uint16_t vmid, uint64_t wp_
|
||||
* @param vmid ID of the VM
|
||||
* @param param guest physical address. This gpa points to struct vm_gpa2hpa
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_gpa_to_hpa(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -261,7 +261,7 @@ int32_t hcall_gpa_to_hpa(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
* To keep the compatibility it still can be the guest physical address that
|
||||
* points to the physical BDF of the assigning ptdev.(Depreciated)
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_assign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -275,7 +275,7 @@ int32_t hcall_assign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
* To keep the compatibility it still can be the guest physical address that
|
||||
* points to the physical BDF of the deassigning ptdev.(Depreciated)
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_deassign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -288,7 +288,7 @@ int32_t hcall_deassign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
* @param param guest physical address. This gpa points to data structure of
|
||||
* hc_ptdev_irq including intr remapping info
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_ptdev_intr_info(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -301,7 +301,7 @@ int32_t hcall_set_ptdev_intr_info(struct acrn_vm *vm, uint16_t vmid, uint64_t pa
|
||||
* @param param guest physical address. This gpa points to data structure of
|
||||
* hc_ptdev_irq including intr remapping info
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_reset_ptdev_intr_info(struct acrn_vm *vm, uint16_t vmid,
|
||||
@ -315,7 +315,7 @@ int32_t hcall_reset_ptdev_intr_info(struct acrn_vm *vm, uint16_t vmid,
|
||||
* @param param2 hypercall param2 from guest
|
||||
* @param hypcall_id hypercall ID from guest
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_debug(struct acrn_vm *vm, uint64_t param1, uint64_t param2, uint64_t hypcall_id);
|
||||
@ -327,7 +327,7 @@ int32_t hcall_debug(struct acrn_vm *vm, uint64_t param1, uint64_t param2, uint64
|
||||
* @param cmd cmd to show get which VCPU power state data
|
||||
* @param param VCPU power state data
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
|
||||
@ -341,7 +341,7 @@ int32_t hcall_get_cpu_pm_state(struct acrn_vm *vm, uint64_t cmd, uint64_t param)
|
||||
* @param param guest physical address. This gpa points to data structure of
|
||||
* acrn_intr_monitor
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_vm_intr_monitor(struct acrn_vm *vm, uint16_t vmid, uint64_t param);
|
||||
@ -412,7 +412,7 @@ int32_t hcall_save_restore_sworld_ctx(struct acrn_vcpu *vcpu);
|
||||
* @param vm Pointer to VM data structure
|
||||
* @param param the expected notifier vector from guest
|
||||
*
|
||||
* @pre Pointer vm shall point to VM0
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_set_callback_vector(const struct acrn_vm *vm, uint64_t param);
|
||||
|
@ -45,7 +45,7 @@ static inline void *gpa2hva(struct acrn_vm *vm, uint64_t x)
|
||||
|
||||
static inline uint64_t hva2gpa(struct acrn_vm *vm, void *x)
|
||||
{
|
||||
return (is_vm0(vm)) ? vm0_hpa2gpa(hva2hpa(x)) : INVALID_GPA;
|
||||
return (is_sos_vm(vm)) ? sos_vm_hpa2gpa(hva2hpa(x)) : INVALID_GPA;
|
||||
}
|
||||
|
||||
#endif /* !ASSEMBLER */
|
||||
|
@ -123,8 +123,8 @@ struct vm_memory_region {
|
||||
/** the beginning guest physical address of the memory reion*/
|
||||
uint64_t gpa;
|
||||
|
||||
/** VM0's guest physcial address which gpa will be mapped to */
|
||||
uint64_t vm0_gpa;
|
||||
/** SOS_VM's guest physcial address which gpa will be mapped to */
|
||||
uint64_t sos_vm_gpa;
|
||||
|
||||
/** size of the memory region */
|
||||
uint64_t size;
|
||||
|
Loading…
Reference in New Issue
Block a user