mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
HV:Modularize vpic code to remove usage of acrn_vm
V1:Initial Patch Modularize vpic. The current patch reduces the usage of acrn_vm inside the vpic.c file. Due to the global natire of register_pio_handler, where acrn_vm is being passed, some usage remains. These needs to be a separate "interface" file. That will come in smaller newer patch provided this patch is accepted. V2: Incorporated comments from Jason. V3: Fixed some MISRA-C Violations. Tracked-On: #1842 Signed-off-by: Arindam Roy <arindam.roy@intel.com> Reviewed-by: Xu, Anthony <anthony.xu@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
@@ -253,7 +253,7 @@ ptirq_build_physical_rte(struct acrn_vm *vm, struct ptirq_remapping_info *entry)
|
||||
ioapic_get_rte(phys_irq, &phys_rte);
|
||||
rte = phys_rte;
|
||||
rte.bits.trigger_mode = IOAPIC_RTE_TRGRMODE_EDGE;
|
||||
vpic_get_irqline_trigger_mode(vm, (uint32_t)virt_sid->intx_id.pin, &trigger);
|
||||
vpic_get_irqline_trigger_mode(vm_pic(vm), (uint32_t)virt_sid->intx_id.pin, &trigger);
|
||||
if (trigger == LEVEL_TRIGGER) {
|
||||
rte.bits.trigger_mode = IOAPIC_RTE_TRGRMODE_LEVEL;
|
||||
}
|
||||
@@ -499,11 +499,11 @@ static void ptirq_handle_intx(struct acrn_vm *vm,
|
||||
enum vpic_trigger trigger;
|
||||
|
||||
/* VPIN_PIC src means we have vpic enabled */
|
||||
vpic_get_irqline_trigger_mode(vm, virt_sid->intx_id.pin, &trigger);
|
||||
vpic_get_irqline_trigger_mode(vm_pic(vm), virt_sid->intx_id.pin, &trigger);
|
||||
if (trigger == LEVEL_TRIGGER) {
|
||||
vpic_set_irqline(vm, virt_sid->intx_id.pin, GSI_SET_HIGH);
|
||||
vpic_set_irqline(vm_pic(vm), virt_sid->intx_id.pin, GSI_SET_HIGH);
|
||||
} else {
|
||||
vpic_set_irqline(vm, virt_sid->intx_id.pin, GSI_RAISING_PULSE);
|
||||
vpic_set_irqline(vm_pic(vm), virt_sid->intx_id.pin, GSI_RAISING_PULSE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -579,7 +579,7 @@ void ptirq_intx_ack(struct acrn_vm *vm, uint32_t virt_pin, uint32_t vpin_src)
|
||||
}
|
||||
break;
|
||||
case PTDEV_VPIN_PIC:
|
||||
vpic_set_irqline(vm, virt_pin, GSI_SET_LOW);
|
||||
vpic_set_irqline(vm_pic(vm), virt_pin, GSI_SET_LOW);
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
|
@@ -139,14 +139,14 @@ static bool vcpu_do_pending_extint(const struct acrn_vcpu *vcpu)
|
||||
primary = vcpu_from_vid(vm, BOOT_CPU_ID);
|
||||
if (vcpu == primary) {
|
||||
|
||||
vpic_pending_intr(vcpu->vm, &vector);
|
||||
vpic_pending_intr(vm_pic(vcpu->vm), &vector);
|
||||
if (vector <= NR_MAX_VECTOR) {
|
||||
dev_dbg(ACRN_DBG_INTR, "VPIC: to inject PIC vector %d\n",
|
||||
vector & 0xFFU);
|
||||
exec_vmwrite32(VMX_ENTRY_INT_INFO_FIELD,
|
||||
VMX_INT_INFO_VALID |
|
||||
(vector & 0xFFU));
|
||||
vpic_intr_accepted(vcpu->vm, vector);
|
||||
vpic_intr_accepted(vm_pic(vcpu->vm), vector);
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user