Re: [PATCH v1 2/3] x86/msr: Switch between WRMSRNS and WRMSR with the alternatives mechanism
From: Thomas Gleixner
Date: Wed Aug 07 2024 - 14:11:33 EST
On Tue, Aug 06 2024 at 22:47, Xin Li wrote:
>
> +/* Instruction opcode for WRMSRNS supported in binutils >= 2.40 */
> +#define WRMSRNS _ASM_BYTES(0x0f,0x01,0xc6)
> +
> +/* Non-serializing WRMSR, when available. Falls back to a serializing WRMSR. */
> static __always_inline void wrmsrns(u32 msr, u64 val)
> {
> - __wrmsrns(msr, val, val >> 32);
> + /*
> + * WRMSR is 2 bytes. WRMSRNS is 3 bytes. Pad WRMSR with a redundant
> + * DS prefix to avoid a trailing NOP.
> + */
> + asm volatile("1: "
> + ALTERNATIVE("ds wrmsr",
> + WRMSRNS, X86_FEATURE_WRMSRNS)
Please get rid of this horrible line break. You have 100 characters line width.
Thanks,
tglx