Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Shivansh Dhiman <shivansh.dhiman@amd.com>
Cc: pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com,
	 kvm@vger.kernel.org, x86@kernel.org, yosry@kernel.org,
	jmattson@google.com,  thomas.lendacky@amd.com,
	nikunj.dadhania@amd.com, ravi.bangoria@amd.com,
	 santosh.shukla@amd.com
Subject: Re: [PATCH v4 0/5] KVM: SVM: Add Bus Lock Detect support and refactor LBRV
Date: Fri, 25 Sep 2026 16:01:52 -0700	[thread overview]
Message-ID: <arb9YBIW8C5KXuXK@google.com> (raw)
In-Reply-To: <arazNV7Y93gnflU2@google.com>

On Fri, Sep 25, 2026, Sean Christopherson wrote:
> On Tue, Jul 21, 2026, Shivansh Dhiman wrote:
> > Shivansh Dhiman (5):
> >   KVM: SVM: Refactor svm_update_lbrv()
> >   KVM: nSVM: Disable LBRV in nested control cache when unsupported
> >   KVM: nSVM: Sanitize nested DR6 using kvm_dr6_fixed()
> >   KVM: SVM: Turn DEBUGCTL_RESERVED_BITS into a helper
> >   KVM: SVM: Add Bus Lock Detect support
> 
> I'll send a v5 as I have variety of changes (I already responded to each patch),
> and I'm not in the mood to deal with another version as I'm quite grumpy that no
> one bothered to follow up on Sashiko's bug report, or to write tests.
> 
> I'll also post a KUT testcase, which I created to verify the bug Sashiko pointed
> out as well as the fix. 

You know what I *love* doing on a Friday afternoon?  Debugging ucode bugs because
apparently hardware engineers are also allergic to testing.  Or maybe the APM just
sucks more than usual.   But the behavior fundamentally breaks virtualization, so
IMO it's a hardware/ucode bug.

On Turin (the only AMD hardware with Bus Lock Detect I've tested), hardware/ucode
forces DR6.BLD=1 if DEBUGCTL.BLCKDB=0, even on software writes and even on loads
of DR6 via VMRUN (this last bit is what really throws a wrench in virtualization).

Software can still read DR6.BLD=0 if DEBUGCTL.BLCKDB=0, but if anything touches
DR6, DR6.BLD gets clobbered back to '1'.  E.g. if the guest gets into a state
where DR6.BLD=0 and DEBUGCTL.BLCKDB=0, then AFAICT *any* #VMEXIT will end up
setting guest.DR6.BLD=1 on the subsequent VMRUN, which is just a wee bit problematic
because it means asynchronous #VMEXITs, e.g. for host IRQs, clobber guest state.

I'm still going to post v5 because I'm fairly confident the KVM implementation
is correct, and the bug is easy enough to workaround in the testcases, but needless
to say, I'm not happy at the moment.

  reply	other threads:[~2026-09-25 23:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  5:05 [PATCH v4 0/5] KVM: SVM: Add Bus Lock Detect support and refactor LBRV Shivansh Dhiman
2026-07-21  5:05 ` [PATCH v4 1/5] KVM: SVM: Refactor svm_update_lbrv() Shivansh Dhiman
2026-07-21  6:40   ` Nikunj A. Dadhania
2026-07-21  9:16     ` Shivansh Dhiman
2026-09-25 17:31   ` Sean Christopherson
2026-09-30 22:16     ` Shivansh Dhiman
2026-07-21  5:05 ` [PATCH v4 2/5] KVM: nSVM: Disable LBRV in nested control cache when unsupported Shivansh Dhiman
2026-07-21  5:05 ` [PATCH v4 3/5] KVM: nSVM: Sanitize nested DR6 using kvm_dr6_fixed() Shivansh Dhiman
2026-07-21  5:21   ` sashiko-bot
2026-09-25 17:26     ` Sean Christopherson
2026-09-25 17:39   ` Sean Christopherson
2026-09-30 22:16     ` Shivansh Dhiman
2026-07-21  5:05 ` [PATCH v4 4/5] KVM: SVM: Turn DEBUGCTL_RESERVED_BITS into a helper Shivansh Dhiman
2026-09-25 17:43   ` Sean Christopherson
2026-09-30 22:29     ` Shivansh Dhiman
2026-07-21  5:06 ` [PATCH v4 5/5] KVM: SVM: Add Bus Lock Detect support Shivansh Dhiman
2026-09-25 17:45 ` [PATCH v4 0/5] KVM: SVM: Add Bus Lock Detect support and refactor LBRV Sean Christopherson
2026-09-25 23:01   ` Sean Christopherson [this message]
2026-09-28 18:38     ` Shivansh Dhiman
2026-10-01 20:18     ` Shivansh Dhiman
2026-10-01 23:11       ` Sean Christopherson
2026-09-30 23:05   ` Shivansh Dhiman

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=arb9YBIW8C5KXuXK@google.com \
    --to=seanjc@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nikunj.dadhania@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=ravi.bangoria@amd.com \
    --cc=santosh.shukla@amd.com \
    --cc=shivansh.dhiman@amd.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    --cc=yosry@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