|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] x86/msr: Rename wrmsr_ns() to wrmsrns(), and take 64bit value
commit 64d6d5cbf9484ff214bf9598ab885906211778c8
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Aug 7 13:36:24 2025 +0100
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Aug 13 13:13:08 2025 +0100
x86/msr: Rename wrmsr_ns() to wrmsrns(), and take 64bit value
In hindsight, having the wrapper name not be the instruction mnemonic was a
poor choice. Also, PKRS turns out to be quite rare in wanting a split
value.
Switch to using a single 64bit value ahead of introducing new users.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/arch/x86/include/asm/msr.h | 4 +++-
xen/arch/x86/include/asm/prot-key.h | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/include/asm/msr.h b/xen/arch/x86/include/asm/msr.h
index 4c4f18b3a5..e185db0967 100644
--- a/xen/arch/x86/include/asm/msr.h
+++ b/xen/arch/x86/include/asm/msr.h
@@ -39,8 +39,10 @@ static inline void wrmsrl(unsigned int msr, uint64_t val)
}
/* Non-serialising WRMSR, when available. Falls back to a serialising WRMSR.
*/
-static inline void wrmsr_ns(uint32_t msr, uint32_t lo, uint32_t hi)
+static inline void wrmsrns(uint32_t msr, uint64_t val)
{
+ uint32_t lo = val, hi = val >> 32;
+
/*
* WRMSR is 2 bytes. WRMSRNS is 3 bytes. Pad WRMSR with a redundant CS
* prefix to avoid a trailing NOP.
diff --git a/xen/arch/x86/include/asm/prot-key.h
b/xen/arch/x86/include/asm/prot-key.h
index 0cbecc2df4..3e9c2eaef4 100644
--- a/xen/arch/x86/include/asm/prot-key.h
+++ b/xen/arch/x86/include/asm/prot-key.h
@@ -72,14 +72,14 @@ static inline void wrpkrs(uint32_t pkrs)
{
*this_pkrs = pkrs;
- wrmsr_ns(MSR_PKRS, pkrs, 0);
+ wrmsrns(MSR_PKRS, pkrs);
}
}
static inline void wrpkrs_and_cache(uint32_t pkrs)
{
this_cpu(pkrs) = pkrs;
- wrmsr_ns(MSR_PKRS, pkrs, 0);
+ wrmsrns(MSR_PKRS, pkrs);
}
#endif /* ASM_PROT_KEY_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |