x86/mm: don't reference hvm_funcs directly
authorWei Liu <wei.liu2@citrix.com>
Fri, 17 Aug 2018 15:12:22 +0000 (16:12 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 21 Aug 2018 13:57:31 +0000 (14:57 +0100)
It is generally not a good idea to reference the internal data
structure of the another subsystem directly. Introduce a wrapper
function for the invlpg hook.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c
xen/include/asm-x86/hvm/hvm.h

index 85ccf488f5aae2539b6e5e954ad7890dc93a6045..8ac441255497ce76564ccc68c79b52306f2fb459 100644 (file)
@@ -5800,7 +5800,7 @@ void paging_invlpg(struct vcpu *v, unsigned long va)
     if ( is_pv_vcpu(v) )
         flush_tlb_one_local(va);
     else
-        hvm_funcs.invlpg(v, va);
+        hvm_invlpg(v, va);
 }
 
 /* Build a 32bit PSE page table using 4MB pages. */
index 4f720ade4b889a07c04bd29a334673ebaecd1062..146720c3566ef9c76030d58e5fbde5d1ab7c510b 100644 (file)
@@ -454,6 +454,11 @@ static inline int hvm_event_pending(struct vcpu *v)
     return hvm_funcs.event_pending(v);
 }
 
+static inline void hvm_invlpg(struct vcpu *v, unsigned long va)
+{
+    hvm_funcs.invlpg(v, va);
+}
+
 /* These bits in CR4 are owned by the host. */
 #define HVM_CR4_HOST_MASK (mmu_cr4_features & \
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))