Re: [tip: x86/urgent] x86/bugs: Use code segment selector for VERW operand
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [tip: x86/urgent] x86/bugs: Use code segment selector for VERW operand
- From: Dave Hansen <dave.hansen@xxxxxxxxx>
- Date: Wed, 9 Oct 2024 08:00:56 -0700
- Cc: linux-tip-commits@xxxxxxxxxxxxxxx, Robert Gill <rtgill82@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, stable@xxxxxxxxxxxxxxx, #@tip-bot2.tec.linutronix.de, 5.10+@xxxxxxxxxxxxxxxxxxxxxxxxxx, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Brian Gerst <brgerst@xxxxxxxxx>, Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx
- In-reply-to: <20241009061102.GBZwYediMceBEfSEFo@fat_crate.local>
- References: <172842753652.1442.15253433006014560776.tip-bot2@tip-bot2> <20241009061102.GBZwYediMceBEfSEFo@fat_crate.local>
- User-agent: Mozilla Thunderbird
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.
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]