[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <caeebbb1-f733-4969-8eab-ce69ce35f4c4@intel.com>
Date: Mon, 23 Oct 2023 12:17:21 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Jonathan Corbet <corbet@....net>,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>, tony.luck@...el.com,
ak@...ux.intel.com, tim.c.chen@...ux.intel.com,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
kvm@...r.kernel.org,
Alyssa Milburn <alyssa.milburn@...ux.intel.com>,
Daniel Sneddon <daniel.sneddon@...ux.intel.com>,
antonio.gomez.iglesias@...ux.intel.com
Subject: Re: [PATCH 2/6] x86/entry_64: Add VERW just before userspace
transition
On 10/23/23 11:22, Josh Poimboeuf wrote:
> On Fri, Oct 20, 2023 at 01:45:03PM -0700, Pawan Gupta wrote:
>> + /* Mitigate CPU data sampling attacks .e.g. MDS */
>> + USER_CLEAR_CPU_BUFFERS
>> +
>> jmp .Lnative_iret
>>
>>
>> @@ -774,6 +780,9 @@ native_irq_return_ldt:
>> */
>> popq %rax /* Restore user RAX */
>>
>> + /* Mitigate CPU data sampling attacks .e.g. MDS */
>> + USER_CLEAR_CPU_BUFFERS
>> +
>
> I'm thinking the comments add unnecessary noise here. The macro name is
> self-documenting enough.
>
> The detail about what mitigations are being done can go above the macro
> definition itself, which the reader can refer to if they want more
> detail about what the macro is doing and why.
>
> Speaking of the macro name, I think just "CLEAR_CPU_BUFFERS" is
> sufficient. The "USER_" prefix makes it harder to read IMO.
Yes, please. The "USER_" prefix should be reserved for things that are
uniquely for the unambiguous return-to-userspace paths.
Powered by blists - more mailing lists