diff options
author | Borislav Petkov <bp@suse.de> | 2018-03-01 16:13:36 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-03-08 10:22:57 +0100 |
commit | c996f3802006a585a6c3f8eaa73e375330efc0e7 (patch) | |
tree | 8c82d8ef9d64dac49974251e45b32276176eaf7d /arch/x86/include/asm/msr.h | |
parent | 1b88accf6a659c46d5c8e68912896f112bf882bb (diff) | |
download | linux-stable-c996f3802006a585a6c3f8eaa73e375330efc0e7.tar.gz linux-stable-c996f3802006a585a6c3f8eaa73e375330efc0e7.tar.bz2 linux-stable-c996f3802006a585a6c3f8eaa73e375330efc0e7.zip |
x86/MSR: Move native_* variants to msr.h
... where they belong.
No functional change.
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Cc: kvm@vger.kernel.org
Link: https://lkml.kernel.org/r/20180301151336.12948-1-bp@alien8.de
Diffstat (limited to 'arch/x86/include/asm/msr.h')
-rw-r--r-- | arch/x86/include/asm/msr.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 30df295f6d94..77254c9c8f61 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h @@ -108,6 +108,20 @@ static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high) : : "c" (msr), "a"(low), "d" (high) : "memory"); } +#define native_rdmsr(msr, val1, val2) \ +do { \ + u64 __val = __rdmsr((msr)); \ + (void)((val1) = (u32)__val); \ + (void)((val2) = (u32)(__val >> 32)); \ +} while (0) + +#define native_wrmsr(msr, low, high) \ + __wrmsr(msr, low, high) + +#define native_wrmsrl(msr, val) \ + __wrmsr((msr), (u32)((u64)(val)), \ + (u32)((u64)(val) >> 32)) + static inline unsigned long long native_read_msr(unsigned int msr) { unsigned long long val; |