hv:Replace vpic pointer with instance in structure vm

-- update 'vpic' field in 'struct vm' from pointer
  to instance, and move it from 'struct vm' to 'struct arch_vm'
-- replace MACRO with inline function for vm_pic, and move it
   to vm.h
-- changed vpic_init to void type
-- removed vpic_cleanup
-- move struct acrn_vpic/i8259_reg_state from vpic.c to vpic.h

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-08-22 14:41:39 +08:00
committed by lijinxia
parent de53964c05
commit 0b54946bac
7 changed files with 48 additions and 69 deletions

View File

@@ -201,7 +201,7 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
/* Create virtual uart */
vm->vuart = vuart_init(vm);
}
vm->vpic = vpic_init(vm);
vpic_init(vm);
#ifdef CONFIG_PARTITION_MODE
/* Create virtual uart */
@@ -240,10 +240,6 @@ err:
vioapic_cleanup(vm->arch_vm.virt_ioapic);
}
if (vm->vpic != NULL) {
vpic_cleanup(vm);
}
if (vm->arch_vm.m2p != NULL) {
free(vm->arch_vm.m2p);
}
@@ -314,9 +310,6 @@ int shutdown_vm(struct vm *vm)
free_vm_id(vm);
#endif
if (vm->vpic != NULL) {
vpic_cleanup(vm);
}
#ifdef CONFIG_PARTITION_MODE
vpci_cleanup(vm);

View File

@@ -156,7 +156,7 @@ static int vcpu_do_pending_extint(struct vcpu *vcpu)
/* check if there is valid interrupt from vPIC, if yes just inject it */
/* PIC only connect with primary CPU */
primary = get_primary_vcpu(vm);
if ((vm->vpic != NULL) && vcpu == primary) {
if (vcpu == primary) {
vpic_pending_intr(vcpu->vm, &vector);
if (vector <= NR_MAX_VECTOR) {