From: Sean Christopherson <seanjc@google.com>
To: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, pbonzini@redhat.com,
thomas.lendacky@amd.com, jmattson@google.com, hpa@zytor.com,
rmk+kernel@armlinux.org.uk, peterz@infradead.org,
james.morse@arm.com, lukas.bulwahn@gmail.com,
arjan@linux.intel.com, j.granados@samsung.com,
sibs@chinatelecom.cn, nik.borisov@suse.com,
michael.roth@amd.com, nikunj.dadhania@amd.com,
babu.moger@amd.com, x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, santosh.shukla@amd.com,
ananth.narayan@amd.com, sandipan.das@amd.com,
manali.shukla@amd.com
Subject: Re: [PATCH v4 4/4] KVM: SVM: Add Bus Lock Detect support
Date: Mon, 26 Aug 2024 11:31:36 -0700 [thread overview]
Message-ID: <ZszKCCXE7yT4zCEd@google.com> (raw)
In-Reply-To: <5fe11dfb-2a33-4b52-8181-c82bc326b968@amd.com>
On Wed, Aug 21, 2024, Ravi Bangoria wrote:
> On 21-Aug-24 11:06 AM, Ravi Bangoria wrote:
> >>> @@ -3158,6 +3159,10 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
> >>> if (data & DEBUGCTL_RESERVED_BITS)
> >>
> >> Not your code, but why does DEBUGCTL_RESERVED_BITS = ~0x3f!?!? That means the
> >> introduction of the below check, which is architecturally correct, has the
> >> potential to break guests. *sigh*
> >>
> >> I doubt it will cause a problem, but it's something to look out for.
> > This dates back to 2008: https://git.kernel.org/torvalds/c/24e09cbf480a7
> >
> > The legacy definition[1] of DEBUGCTL MSR is:
> >
> > 5:2 PB: performance monitor pin control. Read-write. Reset: 0h.
> > This field does not control any hardware.
Uh, what? So the CPU provided 4 bits of scratch space? Or is that saying that
5:2 controlled some perfmon stuff on older CPUs, but that Zen deprecated those
bits?
> > 1 BTF. Read-write. Reset: 0. 1=Enable branch single step.
> > 0 LBR. Read-write. Reset: 0. 1=Enable last branch record.
> >
> > [1]: https://bugzilla.kernel.org/attachment.cgi?id=287389
>
> How about adding cpu_feature_enabled() check:
That doesn't fix anything, KVM will still break, just on a smaller set of CPUs.
The only way to avoid breaking guests is to ignore bits 5:2, though we could
quirk that so that userspace can effectively enable what is now the architectural
behavior.
Though I'm very tempted to just add a prep patch to disallow setting bits 5:2 and
see if anyone complains. If they do, then we can add a quirk. And if no one
complains, yay.
next prev parent reply other threads:[~2024-08-26 18:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 6:29 [PATCH v4 0/4] x86/cpu: Add Bus Lock Detect support for AMD Ravi Bangoria
2024-08-08 6:29 ` [PATCH v4 1/4] x86/split_lock: Move Split and Bus lock code to a dedicated file Ravi Bangoria
2024-08-08 6:29 ` [PATCH v4 2/4] x86/bus_lock: Add support for AMD Ravi Bangoria
2024-08-08 6:29 ` [PATCH v4 3/4] KVM: SVM: Don't advertise Bus Lock Detect to guest if SVM support is missing Ravi Bangoria
2024-08-08 6:29 ` [PATCH v4 4/4] KVM: SVM: Add Bus Lock Detect support Ravi Bangoria
2024-08-17 0:13 ` Sean Christopherson
2024-08-20 16:38 ` Ravi Bangoria
2024-09-05 11:40 ` Ravi Bangoria
2024-08-21 5:36 ` Ravi Bangoria
2024-08-21 10:40 ` Ravi Bangoria
2024-08-26 18:31 ` Sean Christopherson [this message]
2025-11-11 10:03 ` Shivansh Dhiman
2025-11-11 15:15 ` Sean Christopherson
2025-11-14 8:50 ` Shivansh Dhiman
2024-08-23 23:47 ` [PATCH v4 0/4] x86/cpu: Add Bus Lock Detect support for AMD 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=ZszKCCXE7yT4zCEd@google.com \
--to=seanjc@google.com \
--cc=ananth.narayan@amd.com \
--cc=arjan@linux.intel.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=j.granados@samsung.com \
--cc=james.morse@arm.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=manali.shukla@amd.com \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=nik.borisov@suse.com \
--cc=nikunj.dadhania@amd.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=sandipan.das@amd.com \
--cc=santosh.shukla@amd.com \
--cc=sibs@chinatelecom.cn \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.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).