From: Dave Hansen <dave.hansen@intel.com>
To: Borislav Petkov <bp@alien8.de>, linux-kernel@vger.kernel.org
Cc: linux-tip-commits@vger.kernel.org,
Robert Gill <rtgill82@gmail.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
stable@vger.kernel.org, #@tip-bot2.tec.linutronix.de,
5.10+@tip-bot2.tec.linutronix.de,
Dave Hansen <dave.hansen@linux.intel.com>,
Brian Gerst <brgerst@gmail.com>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
x86@kernel.org
Subject: Re: [tip: x86/urgent] x86/bugs: Use code segment selector for VERW operand
Date: Wed, 9 Oct 2024 08:00:56 -0700 [thread overview]
Message-ID: <b4cae913-282a-4772-a2b0-d2638adfe486@intel.com> (raw)
In-Reply-To: <20241009061102.GBZwYediMceBEfSEFo@fat_crate.local>
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.
next prev parent reply other threads:[~2024-10-09 15:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 22:45 [tip: x86/urgent] x86/bugs: Use code segment selector for VERW operand tip-bot2 for Pawan Gupta
2024-10-09 6:11 ` Borislav Petkov
2024-10-09 7:34 ` Peter Zijlstra
2024-10-09 9:32 ` Borislav Petkov
2024-10-09 10:24 ` Andrew Cooper
2024-10-09 13:42 ` Borislav Petkov
2024-10-09 15:00 ` Dave Hansen [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-10-09 7:52 tip-bot2 for Pawan Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4cae913-282a-4772-a2b0-d2638adfe486@intel.com \
--to=dave.hansen@intel.com \
--cc=#@tip-bot2.tec.linutronix.de \
--cc=5.10+@tip-bot2.tec.linutronix.de \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=rtgill82@gmail.com \
--cc=stable@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox