[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aed43a6a-aca9-4c81-af1a-775f5858ebe3@zytor.com>
Date: Wed, 9 Apr 2025 14:55:54 -0700
From: Xin Li <xin@...or.com>
To: Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org
Cc: Juergen Gross <jgross@...e.com>, "H . Peter Anvin" <hpa@...or.com>,
Dave Hansen <dave.hansen@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>, Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in
<asm/msr.h>
On 4/9/2025 1:28 PM, Ingo Molnar wrote:
> @@ -79,7 +79,7 @@ static inline void do_trace_rdpmc(u32 msr, u64 val, int failed) {}
> * think of extending them - you will be slapped with a stinking trout or a frozen
> * shark will reach you, wherever you are! You've been warned.
> */
> -static __always_inline u64 __rdmsr(unsigned int msr)
> +static __always_inline u64 __rdmsr(u32 msr)
> {
> DECLARE_ARGS(val, low, high);
>
> @@ -91,7 +91,7 @@ static __always_inline u64 __rdmsr(unsigned int msr)
> return EAX_EDX_VAL(val, low, high);
> }
>
> -static __always_inline void __wrmsr(unsigned int msr, u32 low, u32 high)
> +static __always_inline void __wrmsr(u32 msr, u32 low, u32 high)
> {
> asm volatile("1: wrmsr\n"
> "2:\n"
It looks to me that we don't use the "const" qualifier in the code a
lot. However since the MSR index is usually not expected to change
inside the MSR API implementations, would it be nicer to add the "const"
qualifier?
The same to the MSR value of MSR write APIs.
Thanks!
Xin
Powered by blists - more mailing lists