[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231024103601.GH31411@noisy.programming.kicks-ass.net>
Date: Tue, 24 Oct 2023 12:36:01 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: 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>,
Josh Poimboeuf <jpoimboe@...nel.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,
Alyssa Milburn <alyssa.milburn@...el.com>
Subject: Re: [PATCH v2 1/6] x86/bugs: Add asm helpers for executing VERW
On Tue, Oct 24, 2023 at 01:08:21AM -0700, Pawan Gupta wrote:
> +.macro CLEAR_CPU_BUFFERS
> + ALTERNATIVE "jmp .Lskip_verw_\@;", "jmp .Ldo_verw_\@", X86_FEATURE_CLEAR_CPU_BUF
> + /* nopl __KERNEL_DS(%rax) */
> + .byte 0x0f, 0x1f, 0x80, 0x00, 0x00;
> +.Lverw_arg_\@: .word __KERNEL_DS;
> +.Ldo_verw_\@: verw _ASM_RIP(.Lverw_arg_\@);
> +.Lskip_verw_\@:
> +.endm
Why can't this be:
ALTERNATIVE "". "verw _ASM_RIP(mds_verw_sel)", X86_FEATURE_CLEAR_CPU_BUF
And have that mds_verw_sel thing be out-of-line ? That gives much better
code for the case where we don't need this.
Powered by blists - more mailing lists