[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180125094258.GZ2228@hirez.programming.kicks-ass.net>
Date: Thu, 25 Jan 2018 10:42:58 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: David Woodhouse <dwmw@...zon.co.uk>
Cc: arjan@...ux.intel.com, tglx@...utronix.de, karahmed@...zon.de,
x86@...nel.org, linux-kernel@...r.kernel.org,
tim.c.chen@...ux.intel.com, bp@...en8.de, 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 v4 5/7] x86/pti: Do not enable PTI on processors which
are not vulnerable to Meltdown
On Thu, Jan 25, 2018 at 09:23:07AM +0000, David Woodhouse wrote:
> +static bool __init early_cpu_vulnerable_meltdown(struct cpuinfo_x86 *c)
> +{
> + u64 ia32_cap = 0;
> +
> + if (x86_match_cpu(cpu_no_meltdown))
> + return false;
> +
> + if (cpu_has(c, X86_FEATURE_ARCH_CAPABILITIES))
> + rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap);
I think it was suggested a while back to write this like:
if (cpu_has(c, X86_FEATURE_ARCH_CAPABILITIES) &&
!rdmsrl_safe(MSR_IA32_ARCH_CAPABILITIES, ia32_cap))
to deal with funny virt scenarios where they accidentally advertise the
CPUID bit but don't in fact provide the MSR.
> +
> + /* Rogue Data Cache Load? No! */
> + if (ia32_cap & ARCH_CAP_RDCL_NO)
> + return false;
> +
> + return true;
> +}
Powered by blists - more mailing lists