From: Dave Hansen <dave.hansen@intel.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Tony Luck <tony.luck@intel.com>,
"Gomez Iglesias, Antonio" <antonio.gomez.iglesias@intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Fenghua Yu <fenghua.yu@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Anthony Steinhauser <asteinhauser@google.com>,
Mike Rapoport <rppt@linux.ibm.com>,
Mark Gross <mgross@linux.intel.com>,
Waiman Long <longman@redhat.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH] x86/bugs/multihit: Fix mitigation reporting when KVM is not in use
Date: Wed, 15 Jul 2020 07:28:06 -0700 [thread overview]
Message-ID: <807f553e-517e-dd3c-8c11-a07739367b0f@intel.com> (raw)
In-Reply-To: <20200715005130.GE14404@linux.intel.com>
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.
next prev parent reply other threads:[~2020-07-15 14:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-14 1:18 [PATCH] x86/bugs/multihit: Fix mitigation reporting when KVM is not in use Pawan Gupta
2020-07-14 1:45 ` Sean Christopherson
2020-07-14 14:57 ` Dave Hansen
2020-07-14 19:17 ` Pawan Gupta
2020-07-14 19:54 ` Dave Hansen
2020-07-14 21:04 ` Pawan Gupta
2020-07-14 21:20 ` Dave Hansen
2020-07-15 0:51 ` Sean Christopherson
2020-07-15 14:28 ` Dave Hansen [this message]
2020-07-15 17:18 ` Pawan Gupta
2020-07-15 18:04 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=807f553e-517e-dd3c-8c11-a07739367b0f@intel.com \
--to=dave.hansen@intel.com \
--cc=antonio.gomez.iglesias@intel.com \
--cc=asteinhauser@google.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=jpoimboe@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=luto@kernel.org \
--cc=mgross@linux.intel.com \
--cc=mingo@redhat.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rppt@linux.ibm.com \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=vincenzo.frascino@arm.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).