[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2EEA5074-7A1A-4C12-9FC4-36FB5110FF93@zytor.com>
Date: Fri, 05 Jul 2024 04:33:53 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Peter Zijlstra <peterz@...radead.org>,
Andrew Cooper <andrew.cooper3@...rix.com>
CC: Borislav Petkov <bp@...en8.de>, dave.hansen@...el.com, xin@...or.com,
linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
dave.hansen@...ux.intel.com, x86@...nel.org, nik.borisov@...e.com,
houwenlong.hwl@...group.com
Subject: Re: [PATCH v1 2/4] x86/fred: Write to FRED MSRs with wrmsrns()
On July 5, 2024 2:28:05 AM PDT, Peter Zijlstra <peterz@...radead.org> wrote:
>On Wed, Jul 03, 2024 at 05:00:53PM +0100, Andrew Cooper wrote:
>
>> /* Non-serialising WRMSR, when available. Falls back to a serialising WRMSR. */
>> static inline void wrmsrns(uint32_t msr, uint32_t lo, uint32_t hi)
>> {
>> /*
>> * WRMSR is 2 bytes. WRMSRNS is 3 bytes. Pad WRMSR with a redundant CS
>> * prefix to avoid a trailing NOP.
>> */
>> alternative_input(".byte 0x2e; wrmsr",
>> ".byte 0x0f,0x01,0xc6", X86_FEATURE_WRMSRNS,
>> "c" (msr), "a" (lo), "d" (hi));
>> }
>
>FWIW, I favour this variant.
We normally use DS as the padding prefix.
Powered by blists - more mailing lists