VMX: suppress pointless indirect calls
authorJan Beulich <jbeulich@suse.com>
Wed, 17 Jul 2013 06:48:24 +0000 (08:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 17 Jul 2013 06:48:24 +0000 (08:48 +0200)
Get the other virtual interrupt delivery related actors in sync
with the newly added handle_eoi() one: Clear the respective pointers
(thus avoiding the call from generic code) when the feature is
unavailable instead of checking feature availability in the actors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
xen/arch/x86/hvm/vmx/vmx.c

index 24098e468d3710b1b1d8e1acec5bcd6af5c8d7d6..8ed70264c70cc85051d03d37fc39126f4b0150f1 100644 (file)
@@ -1414,13 +1414,10 @@ static void vmx_set_info_guest(struct vcpu *v)
 
 static void vmx_update_eoi_exit_bitmap(struct vcpu *v, u8 vector, u8 trig)
 {
-    if ( cpu_has_vmx_virtual_intr_delivery )
-    {
-        if (trig)
-            vmx_set_eoi_exit_bitmap(v, vector);
-        else
-            vmx_clear_eoi_exit_bitmap(v, vector);
-    }
+    if ( trig )
+        vmx_set_eoi_exit_bitmap(v, vector);
+    else
+        vmx_clear_eoi_exit_bitmap(v, vector);
 }
 
 static int vmx_virtual_intr_delivery_enabled(void)
@@ -1433,9 +1430,6 @@ static void vmx_process_isr(int isr, struct vcpu *v)
     unsigned long status;
     u8 old;
 
-    if ( !cpu_has_vmx_virtual_intr_delivery )
-        return;
-
     if ( isr < 0 )
         isr = 0;
 
@@ -1595,7 +1589,11 @@ const struct hvm_function_table * __init start_vmx(void)
     }
 
     if ( !cpu_has_vmx_virtual_intr_delivery )
+    {
+        vmx_function_table.update_eoi_exit_bitmap = NULL;
+        vmx_function_table.process_isr = NULL;
         vmx_function_table.handle_eoi = NULL;
+    }
 
     if ( cpu_has_vmx_posted_intr_processing )
         alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);