[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85fc729e-6ff6-3a13-481c-2e0e11407225@linux.intel.com>
Date: Fri, 26 Jan 2018 13:36:05 -0800
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: David Woodhouse <dwmw@...zon.co.uk>, arjan@...ux.intel.com,
tglx@...utronix.de, karahmed@...zon.de, x86@...nel.org,
linux-kernel@...r.kernel.org, bp@...en8.de, peterz@...radead.org,
pbonzini@...hat.com, ak@...ux.intel.com,
torvalds@...ux-foundation.org, gregkh@...ux-foundation.org,
dave.hansen@...el.com, gnomes@...rguk.ukuu.org.uk,
ashok.raj@...el.com, mingo@...nel.org
Subject: Re: [PATCH v5 7/7] x86/speculation: Add basic IBPB (Indirect Branch
Prediction Barrier) support
On 01/25/2018 08:14 AM, David Woodhouse wrote:
>
> diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
> index 4ad4108..34e384c 100644
> --- a/arch/x86/include/asm/nospec-branch.h
> +++ b/arch/x86/include/asm/nospec-branch.h
> @@ -218,5 +218,18 @@ static inline void vmexit_fill_RSB(void)
> #endif
> }
>
> +static inline void indirect_branch_prediction_barrier(void)
> +{
> + asm volatile(ALTERNATIVE("",
> + "movl %[msr], %%ecx\n\t"
> + "movl %[val], %%eax\n\t"
> + "movl $0, %%edx\n\t"
> + "wrmsr",
> + X86_FEATURE_IBPB)
> + : : [msr] "i" (MSR_IA32_PRED_CMD),
> + [val] "i" (PRED_CMD_IBPB)
> + : "eax", "ecx", "edx", "memory");
With Peter's fixing of paravirt's indirect call for wrmsr,
(https://patchwork.kernel.org/patch/10173547/)
we don't have to worry about indirect call in wrmsr anymore.
Can we use regular wrmsr here?
It will make IBPB tracing straightforward using the
MSR tracepoints.
Tim
Powered by blists - more mailing lists