mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86/HVM: switch virtual_intr_delivery_enabled() hook to simple boolean
This patch modifies the hvm_funcs.virtual_intr_delivery_enabled() to become a bool variable as VMX does and SVM will simply return a static value. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
1 parent
2e20a71404
commit
90e6a78b7b
3 files changed
+7
-17
No files matched your search
@@ -1258,14 +1258,6 @@ void vlapic_adjust_i8259_target(struct domain *d)
|
||||
pt_adjust_global_vcpu_target(v);
|
||||
}
|
||||
|
||||
int vlapic_virtual_intr_delivery_enabled(void)
|
||||
{
|
||||
if ( hvm_funcs.virtual_intr_delivery_enabled )
|
||||
return hvm_funcs.virtual_intr_delivery_enabled();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vlapic_has_pending_irq(struct vcpu *v)
|
||||
{
|
||||
struct vlapic *vlapic = vcpu_vlapic(v);
|
||||
@@ -1278,7 +1270,7 @@ int vlapic_has_pending_irq(struct vcpu *v)
|
||||
if ( irr == -1 )
|
||||
return -1;
|
||||
|
||||
if ( vlapic_virtual_intr_delivery_enabled() &&
|
||||
if ( hvm_funcs.virtual_intr_delivery_enabled &&
|
||||
!nestedhvm_vcpu_in_guestmode(v) )
|
||||
return irr;
|
||||
|
||||
@@ -1316,7 +1308,7 @@ int vlapic_ack_pending_irq(struct vcpu *v, int vector, bool_t force_ack)
|
||||
int isr;
|
||||
|
||||
if ( !force_ack &&
|
||||
vlapic_virtual_intr_delivery_enabled() )
|
||||
hvm_funcs.virtual_intr_delivery_enabled )
|
||||
return 1;
|
||||
|
||||
/* If there's no chance of using APIC assist then bail now. */
|
||||
|
||||
@@ -1947,11 +1947,6 @@ static void vmx_update_eoi_exit_bitmap(struct vcpu *v, u8 vector, u8 trig)
|
||||
vmx_clear_eoi_exit_bitmap(v, vector);
|
||||
}
|
||||
|
||||
static int vmx_virtual_intr_delivery_enabled(void)
|
||||
{
|
||||
return cpu_has_vmx_virtual_intr_delivery;
|
||||
}
|
||||
|
||||
static void vmx_process_isr(int isr, struct vcpu *v)
|
||||
{
|
||||
unsigned long status;
|
||||
@@ -2330,7 +2325,6 @@ static struct hvm_function_table __initdata vmx_function_table = {
|
||||
.nhvm_intr_blocked = nvmx_intr_blocked,
|
||||
.nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources,
|
||||
.update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap,
|
||||
.virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled,
|
||||
.process_isr = vmx_process_isr,
|
||||
.deliver_posted_intr = vmx_deliver_posted_intr,
|
||||
.sync_pir_to_irr = vmx_sync_pir_to_irr,
|
||||
@@ -2469,6 +2463,8 @@ const struct hvm_function_table * __init start_vmx(void)
|
||||
vmx_function_table.process_isr = NULL;
|
||||
vmx_function_table.handle_eoi = NULL;
|
||||
}
|
||||
else
|
||||
vmx_function_table.virtual_intr_delivery_enabled = true;
|
||||
|
||||
if ( cpu_has_vmx_posted_intr_processing )
|
||||
{
|
||||
|
||||
@@ -97,6 +97,9 @@ struct hvm_function_table {
|
||||
/* Necessary hardware support for alternate p2m's? */
|
||||
bool altp2m_supported;
|
||||
|
||||
/* Hardware virtual interrupt delivery enable? */
|
||||
bool virtual_intr_delivery_enabled;
|
||||
|
||||
/* Indicate HAP capabilities. */
|
||||
unsigned int hap_capabilities;
|
||||
|
||||
@@ -195,7 +198,6 @@ struct hvm_function_table {
|
||||
|
||||
/* Virtual interrupt delivery */
|
||||
void (*update_eoi_exit_bitmap)(struct vcpu *v, u8 vector, u8 trig);
|
||||
int (*virtual_intr_delivery_enabled)(void);
|
||||
void (*process_isr)(int isr, struct vcpu *v);
|
||||
void (*deliver_posted_intr)(struct vcpu *v, u8 vector);
|
||||
void (*sync_pir_to_irr)(struct vcpu *v);
|
||||
|
||||