[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <807f553e-517e-dd3c-8c11-a07739367b0f@intel.com>
Date: Wed, 15 Jul 2020 07:28:06 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Tony Luck <tony.luck@...el.com>,
"Gomez Iglesias, Antonio" <antonio.gomez.iglesias@...el.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Fenghua Yu <fenghua.yu@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Anthony Steinhauser <asteinhauser@...gle.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Mark Gross <mgross@...ux.intel.com>,
Waiman Long <longman@...hat.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Jonathan Corbet <corbet@....net>
Subject: Re: [PATCH] x86/bugs/multihit: Fix mitigation reporting when KVM is
not in use
On 7/14/20 5:51 PM, Sean Christopherson wrote:
> To do the above table, KVM will also need to update itlb_multihit_kvm_mitigation
> when it is unloaded, which seems rather silly. That's partly why I suggested
> keying off CR4.VMXE as it doesn't require poking directly into KVM. E.g. the
> entire fix becomes:
Failing to update itlb_multihit_kvm_mitigation leaves us with something
that's asymmetric. A system with a never-loaded kvm module will say
something different than one that was loaded and then unloaded.
That's funky, but not the end of the world I guess.
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index ed54b3b21c39..4452df7f332d 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -1447,7 +1447,12 @@ static ssize_t l1tf_show_state(char *buf)
>
> static ssize_t itlb_multihit_show_state(char *buf)
> {
> - if (itlb_multihit_kvm_mitigation)
> + if (!boot_cpu_has(X86_FEATURE_MSR_IA32_FEAT_CTL) ||
> + !boot_cpu_has(X86_FEATURE_VMX))
> + return sprintf(buf, "KVM: Mitigation: VMX unsupported\n");
> + else if (!(cr4_read_shadow() & X86_CR4_VMXE))
> + return sprintf(buf, "KVM: Mitigation: VMX disabled\n");
> + else if (itlb_multihit_kvm_mitigation)
> return sprintf(buf, "KVM: Mitigation: Split huge pages\n");
> else
> return sprintf(buf, "KVM: Vulnerable\n");
That's at least short and sweet. I wouldn't object to that at all.
Powered by blists - more mailing lists