[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b4cae913-282a-4772-a2b0-d2638adfe486@intel.com>
Date: Wed, 9 Oct 2024 08:00:56 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Borislav Petkov <bp@...en8.de>, linux-kernel@...r.kernel.org
Cc: linux-tip-commits@...r.kernel.org, Robert Gill <rtgill82@...il.com>,
Andrew Cooper <andrew.cooper3@...rix.com>, stable@...r.kernel.org,
#@...-bot2.tec.linutronix.de, 5.10+@...-bot2.tec.linutronix.de,
Dave Hansen <dave.hansen@...ux.intel.com>, Brian Gerst <brgerst@...il.com>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>, x86@...nel.org
Subject: Re: [tip: x86/urgent] x86/bugs: Use code segment selector for VERW
operand
On 10/8/24 23:11, Borislav Petkov wrote:
>> .macro CLEAR_CPU_BUFFERS
>> - ALTERNATIVE "", __stringify(verw _ASM_RIP(mds_verw_sel)), X86_FEATURE_CLEAR_CPU_BUF
>> +#ifdef CONFIG_X86_64
>> + ALTERNATIVE "", "verw mds_verw_sel(%rip)", X86_FEATURE_CLEAR_CPU_BUF
>> +#else
>> + /*
>> + * In 32bit mode, the memory operand must be a %cs reference. The data
>> + * segments may not be usable (vm86 mode), and the stack segment may not
>> + * be flat (ESPFIX32).
>> + */
>> + ALTERNATIVE "", "verw %cs:mds_verw_sel", X86_FEATURE_CLEAR_CPU_BUF
>> +#endif
> So why didn't we ifdef the "verw mds_verw_sel(%rip)" and "verw
> %cs:mds_verw_sel" macro argument instead of adding more bigger ugly ifdeffery?
I'm not jumping for joy about how it looks, but I applied it because
it's good enough and the regression was about to get its driver's
license. ;)
I did spend some time noodling to come up with _some_ common 32/64-bit
implementation, but 32-bit is just too special of a snowflake.
Powered by blists - more mailing lists