[PATCH v6 17/17] x86/msr: Make all MSR access functions __always_inline
From: Juergen Gross
Date: Mon Nov 16 2026 - 13:40:56 EST
There are a few MSR access functions left which are not yet marked as
__always_inline. Do the conversion.
Remove a leftover comment no longer being true related to this.
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
V4:
- new patch
---
arch/x86/include/asm/msr.h | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 9cd0ff3315de..8c0f5595970b 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -269,13 +269,12 @@ static __always_inline void native_wrmsrq(u32 msr, u64 val)
__wrmsrq(msr, val);
}
-static inline int native_read_msr_safe(u32 msr, u64 *val)
+static __always_inline int native_read_msr_safe(u32 msr, u64 *val)
{
return __rdmsr(msr, val, EX_TYPE_RDMSR_SAFE) ? -EIO : 0;
}
-/* Can be uninlined because referenced by paravirt */
-static inline int notrace native_write_msr_safe(u32 msr, u64 val)
+static __always_inline int notrace native_write_msr_safe(u32 msr, u64 val)
{
int err;
@@ -301,7 +300,7 @@ static __always_inline int native_wrmsrns_safe(u32 msr, u64 val)
extern int rdmsr_safe_regs(u32 regs[8]);
extern int wrmsr_safe_regs(u32 regs[8]);
-static inline u64 native_read_pmc(int counter)
+static __always_inline u64 native_read_pmc(int counter)
{
EAX_EDX_DECLARE_ARGS(val, low, high);
@@ -362,7 +361,7 @@ static __always_inline u64 rdmsrq(u32 msr)
}
/* rdmsr with exception handling */
-static inline int rdmsrq_safe(u32 msr, u64 *p)
+static __always_inline int rdmsrq_safe(u32 msr, u64 *p)
{
int err;
@@ -374,7 +373,7 @@ static inline int rdmsrq_safe(u32 msr, u64 *p)
return err;
}
-static inline void wrmsrq(u32 msr, u64 val)
+static __always_inline void wrmsrq(u32 msr, u64 val)
{
write_msr(msr, val);
@@ -383,7 +382,7 @@ static inline void wrmsrq(u32 msr, u64 val)
}
/* wrmsr with exception handling */
-static inline int wrmsrq_safe(u32 msr, u64 val)
+static __always_inline int wrmsrq_safe(u32 msr, u64 val)
{
int err;
--
2.56.0