[xen master] x86/efer: Make {read, write}_efer() into inline helpers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] x86/efer: Make {read, write}_efer() into inline helpers

patchbot
commit d630832f9f9c2ef80b04a2c7d7f08581a18df2b3
Author:     Andrew Cooper <[hidden email]>
AuthorDate: Mon Oct 23 10:49:33 2017 +0100
Commit:     Andrew Cooper <[hidden email]>
CommitDate: Thu Dec 14 18:05:45 2017 +0000

    x86/efer: Make {read,write}_efer() into inline helpers
   
    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 <[hidden email]>
    Acked-by: Jan Beulich <[hidden email]>
---
 xen/arch/x86/traps.c      | 13 +------------
 xen/include/asm-x86/msr.h | 14 +++++++++++---
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8a80cd9..db16a44 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -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;
diff --git a/xen/include/asm-x86/msr.h b/xen/include/asm-x86/msr.h
index 41732a4..2fbed02 100644
--- a/xen/include/asm-x86/msr.h
+++ b/xen/include/asm-x86/msr.h
@@ -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);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog