x86/efer: Make {read,write}_efer() into inline helpers
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 23 Oct 2017 09:49:33 +0000 (10:49 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 14 Dec 2017 18:05:45 +0000 (18:05 +0000)
There is no need for the overhead of a call to a separate translation unit.
While moving the implementation, update them to use uint64_t over u64

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/traps.c
xen/include/asm-x86/msr.h

index 8a80cd9f4838b104a60bebff15d9e78287c3103f..db16a4441731273c7484d6397f5938e7be467202 100644 (file)
@@ -93,7 +93,7 @@ static char __read_mostly opt_nmi[10] = "fatal";
 #endif
 string_param("nmi", opt_nmi);
 
-DEFINE_PER_CPU(u64, efer);
+DEFINE_PER_CPU(uint64_t, efer);
 static DEFINE_PER_CPU(unsigned long, last_extable_addr);
 
 DEFINE_PER_CPU_READ_MOSTLY(u32, ler_msr);
@@ -1718,17 +1718,6 @@ void do_device_not_available(struct cpu_user_regs *regs)
     return;
 }
 
-u64 read_efer(void)
-{
-    return this_cpu(efer);
-}
-
-void write_efer(u64 val)
-{
-    this_cpu(efer) = val;
-    wrmsrl(MSR_EFER, val);
-}
-
 static void ler_enable(void)
 {
     u64 debugctl;
index 41732a4c93f8cc1405fe2fdb4580eab7b1543e05..2fbed0251ed94da337c2bb1db1ff3580beea979b 100644 (file)
@@ -196,9 +196,17 @@ static inline void wrgsbase(unsigned long base)
         wrmsrl(MSR_GS_BASE, base);
 }
 
-DECLARE_PER_CPU(u64, efer);
-u64 read_efer(void);
-void write_efer(u64 val);
+DECLARE_PER_CPU(uint64_t, efer);
+static inline uint64_t read_efer(void)
+{
+    return this_cpu(efer);
+}
+
+static inline void write_efer(uint64_t val)
+{
+    this_cpu(efer) = val;
+    wrmsrl(MSR_EFER, val);
+}
 
 DECLARE_PER_CPU(u32, ler_msr);