Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jack Wang <jinpu.wang@cloud.ionos.com>,
	gregkh@linuxfoundation.org, stable@vger.kernel.org,
	Maxim Levitsky <mlevitsk@redhat.com>,
	Sean Christopherson <sean.j.christopherson@intel.com>
Subject: Re: [PATCH stable-5.4] KVM: x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally
Date: Thu, 12 Nov 2020 11:15:12 -0500	[thread overview]
Message-ID: <20201112161512.GF403069@sasha-vm> (raw)
In-Reply-To: <9cdcac85-3f02-190f-cf4c-296a8eb415de@redhat.com>

On Wed, Nov 11, 2020 at 02:51:12PM +0100, Paolo Bonzini wrote:
>On 11/11/20 14:20, Jack Wang wrote:
>>From: Maxim Levitsky <mlevitsk@redhat.com>
>>
>>This msr is only available when the host supports WAITPKG feature.
>>
>>This breaks a nested guest, if the L1 hypervisor is set to ignore
>>unknown msrs, because the only other safety check that the
>>kernel does is that it attempts to read the msr and
>>rejects it if it gets an exception.
>>
>>Cc: stable@vger.kernel.org
>>Fixes: 6e3ba4abce ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL")
>>Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
>>Message-Id: <20200523161455.3940-3-mlevitsk@redhat.com>
>>Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
>>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>(cherry picked from commit f4cfcd2d5aea4e96c5d483c476f3057b6b7baf6a
>>use boot_cpu_has for checking the feature)
>>Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
>>---
>>  arch/x86/kvm/x86.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>>diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>index 708b37274cb5..4cacf4669235 100644
>>--- a/arch/x86/kvm/x86.c
>>+++ b/arch/x86/kvm/x86.c
>>@@ -5226,6 +5226,10 @@ static void kvm_init_msr_list(void)
>>  			if (!kvm_x86_ops->rdtscp_supported())
>>  				continue;
>>  			break;
>>+		case MSR_IA32_UMWAIT_CONTROL:
>>+			if (!boot_cpu_has(X86_FEATURE_WAITPKG))
>>+				continue;
>>+			break;
>>  		case MSR_IA32_RTIT_CTL:
>>  		case MSR_IA32_RTIT_STATUS:
>>  			if (!kvm_x86_ops->pt_supported())
>>
>
>Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Queued up, thanks!

-- 
Thanks,
Sasha

      reply	other threads:[~2020-11-12 16:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 13:20 [PATCH stable-5.4] KVM: x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally Jack Wang
2020-11-11 13:51 ` Paolo Bonzini
2020-11-12 16:15   ` Sasha Levin [this message]

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=20201112161512.GF403069@sasha-vm \
    --to=sashal@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=stable@vger.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