]> xenbits.xensource.com Git - xen.git/commitdiff
xen/x86: Simplify header dependencies in x86/hvm
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Thu, 23 May 2024 08:07:31 +0000 (10:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 May 2024 08:07:31 +0000 (10:07 +0200)
Otherwise it's not possible to call functions described in hvm/vlapic.h from the
inline functions of hvm/hvm.h.

This is because a static inline in vlapic.h depends on hvm.h, and pulls it
transitively through vpt.h. The ultimate cause is having hvm.h included in any
of the "v*.h" headers, so break the cycle moving the guilty inline into hvm.h.

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/irq.c
xen/arch/x86/hvm/vlapic.c
xen/arch/x86/include/asm/hvm/hvm.h
xen/arch/x86/include/asm/hvm/vlapic.h
xen/arch/x86/include/asm/hvm/vpt.h

index 4a9fe82cbd8d12025514a5fa962a8adeadffe94c..210cebb0e69af13f9b2353f4445a89a7b0ef58a7 100644 (file)
@@ -512,13 +512,13 @@ struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v)
     int vector;
 
     /*
-     * Always call vlapic_sync_pir_to_irr so that PIR is synced into IRR when
-     * using posted interrupts. Note this is also done by
+     * Always call hvm_sync_pir_to_irr() so that PIR is synced into IRR
+     * when using posted interrupts. Note this is also done by
      * vlapic_has_pending_irq but depending on which interrupts are pending
      * hvm_vcpu_has_pending_irq will return early without calling
      * vlapic_has_pending_irq.
      */
-    vlapic_sync_pir_to_irr(v);
+    hvm_sync_pir_to_irr(v);
 
     if ( unlikely(v->arch.nmi_pending) )
         return hvm_intack_nmi;
index 6a11f4d94dd1e6a1a9bfef656e3acf8542b7eed2..9cfc82666ae5aef69f0d7966360f4e5f4899c89e 100644 (file)
@@ -97,7 +97,7 @@ static void vlapic_clear_irr(int vector, struct vlapic *vlapic)
 
 static int vlapic_find_highest_irr(struct vlapic *vlapic)
 {
-    vlapic_sync_pir_to_irr(vlapic_vcpu(vlapic));
+    hvm_sync_pir_to_irr(vlapic_vcpu(vlapic));
 
     return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
@@ -1506,7 +1506,7 @@ static int cf_check lapic_save_regs(struct vcpu *v, hvm_domain_context_t *h)
     if ( !has_vlapic(v->domain) )
         return 0;
 
-    vlapic_sync_pir_to_irr(v);
+    hvm_sync_pir_to_irr(v);
 
     return hvm_save_entry(LAPIC_REGS, v->vcpu_id, h, vcpu_vlapic(v)->regs);
 }
index 0c9e6f15645d5cd22176559f2286567446950a31..1c01e22c8e62f17d8441cefbfd4d00ab1c75623e 100644 (file)
@@ -797,6 +797,12 @@ static inline void hvm_update_vlapic_mode(struct vcpu *v)
         alternative_vcall(hvm_funcs.update_vlapic_mode, v);
 }
 
+static inline void hvm_sync_pir_to_irr(struct vcpu *v)
+{
+    if ( hvm_funcs.sync_pir_to_irr )
+        alternative_vcall(hvm_funcs.sync_pir_to_irr, v);
+}
+
 #else  /* CONFIG_HVM */
 
 #define hvm_enabled false
index 88ef94524339e2f48ab7a0f0e8d4e418c72819e4..2c4ff94ae7a86d92ee44a399fcd91054f3a0bed7 100644 (file)
@@ -137,10 +137,4 @@ bool vlapic_match_dest(
     const struct vlapic *target, const struct vlapic *source,
     int short_hand, uint32_t dest, bool dest_mode);
 
-static inline void vlapic_sync_pir_to_irr(struct vcpu *v)
-{
-    if ( hvm_funcs.sync_pir_to_irr )
-        alternative_vcall(hvm_funcs.sync_pir_to_irr, v);
-}
-
 #endif /* __ASM_X86_HVM_VLAPIC_H__ */
index feb0bf43f14ba12e26d66384c6497a5cd4e3ce34..0b92b286252dc9613afbb323e1256a9be400da57 100644 (file)
@@ -11,7 +11,6 @@
 #include <xen/timer.h>
 #include <xen/list.h>
 #include <xen/rwlock.h>
-#include <asm/hvm/hvm.h>
 
 /*
  * Abstract layer of periodic time, one short time.