From: Sean Christopherson <seanjc@google.com>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, Maxim Levitsky <mlevitsk@redhat.com>
Subject: Re: [PATCH 6.1.y 3/4] KVM: nVMX: Check vmcs12->guest_ia32_debugctl on nested VM-Enter
Date: Thu, 14 Aug 2025 13:31:34 -0700 [thread overview]
Message-ID: <aJ5HppgpdlrLHTYV@google.com> (raw)
In-Reply-To: <20250814132434.2096873-3-sashal@kernel.org>
On Thu, Aug 14, 2025, Sasha Levin wrote:
> From: Maxim Levitsky <mlevitsk@redhat.com>
>
> [ Upstream commit 095686e6fcb4150f0a55b1a25987fad3d8af58d6 ]
>
> Add a consistency check for L2's guest_ia32_debugctl, as KVM only supports
> a subset of hardware functionality, i.e. KVM can't rely on hardware to
> detect illegal/unsupported values. Failure to check the vmcs12 value
> would allow the guest to load any harware-supported value while running L2.
>
> Take care to exempt BTF and LBR from the validity check in order to match
> KVM's behavior for writes via WRMSR, but without clobbering vmcs12. Even
> if VM_EXIT_SAVE_DEBUG_CONTROLS is set in vmcs12, L1 can reasonably expect
> that vmcs12->guest_ia32_debugctl will not be modified if writes to the MSR
> are being intercepted.
>
> Arguably, KVM _should_ update vmcs12 if VM_EXIT_SAVE_DEBUG_CONTROLS is set
> *and* writes to MSR_IA32_DEBUGCTLMSR are not being intercepted by L1, but
> that would incur non-trivial complexity and wouldn't change the fact that
> KVM's handling of DEBUGCTL is blatantly broken. I.e. the extra complexity
> is not worth carrying.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> Co-developed-by: Sean Christopherson <seanjc@google.com>
> Link: https://lore.kernel.org/r/20250610232010.162191-7-seanjc@google.com
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> Stable-dep-of: 7d0cce6cbe71 ("KVM: VMX: Wrap all accesses to IA32_DEBUGCTL with getter/setter APIs")
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
Acked-by: Sean Christopherson <seanjc@google.com>
Just in case you read this before my other N emails that say the exact same thing...
Needs to land after the RTM_DEBUG patch:
https://lore.kernel.org/all/20250813184918.2071296-1-sashal@kernel.org
next prev parent reply other threads:[~2025-08-14 20:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 16:15 FAILED: patch "[PATCH] KVM: VMX: Wrap all accesses to IA32_DEBUGCTL with" failed to apply to 6.1-stable tree gregkh
2025-08-14 13:24 ` [PATCH 6.1.y 1/4] KVM: x86/pmu: Gate all "unimplemented MSR" prints on report_ignored_msrs Sasha Levin
2025-08-14 13:24 ` [PATCH 6.1.y 2/4] KVM: VMX: Extract checking of guest's DEBUGCTL into helper Sasha Levin
2025-08-14 20:29 ` Sean Christopherson
2025-08-14 20:31 ` Sean Christopherson
2025-08-14 13:24 ` [PATCH 6.1.y 3/4] KVM: nVMX: Check vmcs12->guest_ia32_debugctl on nested VM-Enter Sasha Levin
2025-08-14 20:31 ` Sean Christopherson [this message]
2025-08-14 13:24 ` [PATCH 6.1.y 4/4] KVM: VMX: Wrap all accesses to IA32_DEBUGCTL with getter/setter APIs Sasha Levin
2025-08-14 20:31 ` Sean Christopherson
2025-08-14 20:29 ` [PATCH 6.1.y 1/4] KVM: x86/pmu: Gate all "unimplemented MSR" prints on report_ignored_msrs 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=aJ5HppgpdlrLHTYV@google.com \
--to=seanjc@google.com \
--cc=mlevitsk@redhat.com \
--cc=sashal@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).