mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 08:50:27 +00:00
hv: vlapic: add combined constraint for APICv
Add two functions to combine constraint for APICv: is_apicv_basic_feature_supported: check the physical platform whether support "Use TPR shadow", "Virtualize APIC accesses" and "Virtualize x2APIC mode" is_apicv_advanced_feature_supported: check the physical platform whether support "APIC-register virtualization", "Virtual-interrupt delivery" and "Process posted interrupts". If the physical platform only support APICv basic feature, enable "Use TPR shadow" and "Virtualize APIC accesses" for xAPIC mode; enable "Use TPR shadow" and "Virtualize x2APIC mode" for x2APIC. Otherwise, if the physical platform support APICv advanced feature, enable APICv feature for xAPIC mode and x2APIC mode. Tracked-On: #1842 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -513,12 +513,12 @@ vlapic_accept_intr(struct acrn_vlapic *vlapic, uint32_t vector, bool level)
|
||||
if ((lapic->svr.v & APIC_SVR_ENABLE) == 0U) {
|
||||
dev_dbg(ACRN_DBG_LAPIC, "vlapic is software disabled, ignoring interrupt %u", vector);
|
||||
ret = false;
|
||||
} else if (is_apicv_intr_delivery_supported()) {
|
||||
} else if (is_apicv_advanced_feature_supported()) {
|
||||
pending_intr = apicv_set_intr_ready(vlapic, vector);
|
||||
|
||||
vlapic_set_tmr(vlapic, vector, level);
|
||||
|
||||
if ((pending_intr != 0) && (is_apicv_posted_intr_supported()) && (get_cpu_id() != vlapic->vcpu->pcpu_id)) {
|
||||
if ((pending_intr != 0) && (get_cpu_id() != vlapic->vcpu->pcpu_id)) {
|
||||
/*
|
||||
* Send interrupt to vCPU via posted interrupt way:
|
||||
* 1. If target vCPU is in non-root mode(running),
|
||||
|
Reference in New Issue
Block a user