The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Aidan Khoury <aidan@aktech.ai>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	 Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,  Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,  "H. Peter Anvin" <hpa@zytor.com>,
	Aidan Khoury <aidan@revers.engineering>,
	 Nick Peterson <everdox@gmail.com>
Subject: Re: [PATCH v1 1/1] KVM: x86: Merge pending debug causes when vectoring #DB
Date: Fri, 15 May 2026 07:20:22 -0700	[thread overview]
Message-ID: <agcrpj6rKoxoedtE@google.com> (raw)
In-Reply-To: <agZwE6kX_94AjCQ-@google.com>

On Thu, May 14, 2026, Sean Christopherson wrote:
> On Thu, May 14, 2026, Sean Christopherson wrote:
> > On Wed, May 13, 2026, Sean Christopherson wrote:
> > > On Wed, Jan 07, 2026, Aidan Khoury wrote:
> > > So while I don't exactly love the idea, I think this?  Compile tested only at
> > > this point, I'll try to properly test it tomorrow.
> > 
> > Confirmed the below works, once I remembered how to configure debug breakpoints.
> > I'll plan on sending a v2 on your behalf, along with a KVM-Unit-Test testcase.
> 
> Ugh, and of course the test fails on AMD.  I'll still send the KVM patch, but
> I'll hold off on the KUT mini-series until I've done at least a little digging
> through the APM (I'm not exactly brimming with confidence that SVM can handle
> this correctly).

Ok, I'm not crazy, AMD SVM simply doesn't support this.  E.g. from an old paper
on making a VMM/hypervisor truly transparent:

  Similarly, native x86 CPUs hold off debug exceptions for a one-instruction
  window following MOV %SS instructions. AMD's SVM provides no information
  about pending debug exceptions if an exit occurs in such a window [2]. We
  constructed a simple SVM detector based on this discrepancy in less than
  100 lines of C and assembly.

The easy solution for the test is to skip it on AMD, but before we do any of this,
why do you care?  I.e. what prompted this patch?  If this is purely an academic
exercise, then no small part of me thinks it might be better for KVM to take an
erratum.  I.e. consistency might be better in this case, maybe?

[*] https://www.usenix.org/legacy/event/hotos07/tech/full_papers/garfinkel/garfinkel_html/paper.html#tex2html2

      reply	other threads:[~2026-05-15 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260107235724.28101-1-aidan@aktech.ai>
     [not found] ` <20260107235724.28101-2-aidan@aktech.ai>
2026-05-14  1:08   ` [PATCH v1 1/1] KVM: x86: Merge pending debug causes when vectoring #DB Sean Christopherson
2026-05-15  0:50     ` Sean Christopherson
2026-05-15  1:00       ` Sean Christopherson
2026-05-15 14:20         ` Sean Christopherson [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=agcrpj6rKoxoedtE@google.com \
    --to=seanjc@google.com \
    --cc=aidan@aktech.ai \
    --cc=aidan@revers.engineering \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=everdox@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --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