HV: remove vm_config pointer in acrn_vm struct

For each vm_array[] item, its config is located in corresponding
index of vm_configs[], so vm_config pointer is not needed any more.

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:
Victor Sun
2019-01-21 02:18:05 +08:00
committed by Eddie Dong
parent 7bf9b1be2c
commit 253b25937b
7 changed files with 17 additions and 14 deletions

View File

@@ -2087,7 +2087,9 @@ static int32_t vlapic_x2apic_access(struct acrn_vcpu *vcpu, uint32_t msr, bool w
vlapic = vcpu_vlapic(vcpu);
if (is_x2apic_enabled(vlapic)) {
#ifdef CONFIG_PARTITION_MODE
if (vcpu->vm->vm_config->lapic_pt) {
struct acrn_vm_config *vm_config = get_vm_config(vcpu->vm->vm_id);
if (vm_config->lapic_pt) {
if (msr == MSR_IA32_EXT_APIC_ICR) {
error = vlapic_x2apic_pt_icr_access(vcpu->vm, *val);
}

View File

@@ -124,10 +124,6 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
vm = &vm_array[vm_id];
(void)memset((void *)vm, 0U, sizeof(struct acrn_vm));
vm->vm_id = vm_id;
#ifdef CONFIG_PARTITION_MODE
/* Map Virtual Machine to its VM Description */
vm->vm_config = vm_config;
#endif
vm->hw.created_vcpus = 0U;
vm->emul_mmio_regions = 0U;
vm->snoopy_mem = true;

View File

@@ -574,7 +574,9 @@ void switch_apicv_mode_x2apic(struct acrn_vcpu *vcpu)
void switch_apicv_mode_x2apic(struct acrn_vcpu *vcpu)
{
uint32_t value32;
if(vcpu->vm->vm_config->lapic_pt) {
struct acrn_vm_config *vm_config = get_vm_config(vcpu->vm->vm_id);
if(vm_config->lapic_pt) {
/*
* Disable external interrupt exiting and irq ack
* Disable posted interrupt processing