From: "H. Peter Anvin" <hpa@zytor.com>
To: Xin Li <xin@zytor.com>, Nikolay Borisov <nik.borisov@suse.com>,
linux-kernel@vger.kernel.org
Cc: luto@kernel.org, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org
Subject: Re: [PATCH v3 1/1] x86/fred: Fix INT80 emulation for FRED
Date: Wed, 17 Apr 2024 09:39:13 -0700 [thread overview]
Message-ID: <908d65db-6926-449e-8aca-5f9968f7fcd6@zytor.com> (raw)
In-Reply-To: <58272a50-fa74-4ae8-8ce2-aeb92a0f6ece@zytor.com>
On 4/17/24 08:55, Xin Li wrote:
> On 4/17/2024 8:07 AM, H. Peter Anvin wrote:
>> On 4/17/24 04:02, Nikolay Borisov wrote:
>>>
>>> On 17.04.24 г. 9:30 ч., Xin Li (Intel) wrote:
>>>> 4) int80_emulation() does a CLEAR_BRANCH_HISTORY, which is likely
>>>> > overkill for new x86 CPU implementations that support FRED.
>>>
>>> Well, that's a bit of an overstatement/speculation, because
>>> clear_branch_history will only be effective if the machine is
>>> susceptible to the given bug and there isn't a better options (i.e
>>> using a hardware bit controlling the respective aspect of the CPU).
>>>>
>>
>> It would seem like a huge stretch to expect that a FRED-capable CPU
>> would not have such a facility. This is a matter of establishing a
>> baseline for FRED-capable hardware.
>>
>> It would make more sense to me to add it if we turn out to need it;
>> note that FRED code is currently only enabled on demand, in order to
>> defend against bit rot until we have physical hardware.
>>
>> Now, if this is still desired, it *probably* belongs better in either
>> fred_intx()/fred_other() or asm_fred_entrypoint_user, depending on if
>> this ought to be done for all entries from userspace or only system
>> calls.
>
> My bad that I didn't make this a good comment, even neglected that
> clear_branch_history is just a nop on machines w/o such security issues.
>
>
> So how about?
>
> int80_emulation() does a CLEAR_BRANCH_HISTORY, which is IDT-specific.
> While FRED will likely take a different approach when it is needed:
s/when/if it is ever needed/
> it *probably* belongs in either fred_intx()/fred_other() or
> asm_fred_entrypoint_user(), depending on if this ought to be done for
> all entries from userspace or only system calls.
prev parent reply other threads:[~2024-04-17 16:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 6:30 Xin Li (Intel)
2024-04-17 9:38 ` Borislav Petkov
2024-04-17 14:59 ` H. Peter Anvin
2024-04-17 15:34 ` Xin Li
2024-04-17 20:28 ` Borislav Petkov
2024-04-17 15:06 ` Xin Li
2024-04-17 15:09 ` H. Peter Anvin
2024-04-17 11:02 ` Nikolay Borisov
2024-04-17 15:07 ` H. Peter Anvin
2024-04-17 15:55 ` Xin Li
2024-04-17 16:39 ` H. Peter Anvin [this message]
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=908d65db-6926-449e-8aca-5f9968f7fcd6@zytor.com \
--to=hpa@zytor.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=nik.borisov@suse.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xin@zytor.com \
/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
all inboxes | Powered by JetHome®