mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kaplan, David" <David.Kaplan@amd.com>
To: Jim Mattson <jmattson@google.com>,
	Sean Christopherson <seanjc@google.com>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"ctpence@google.com" <ctpence@google.com>
Subject: RE: [PATCH v3 3/4] KVM: x86: Virtualize AMD CPUID faulting
Date: Thu, 14 May 2026 18:17:25 +0000	[thread overview]
Message-ID: <DS7PR12MB82016B1B310BD994C83B35D294072@DS7PR12MB8201.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CALMp9eQqbHrcV1_WM+5xUR16OpGk+unxoZGi+=t55cqVhFgAfQ@mail.gmail.com>

AMD General

> -----Original Message-----
> From: Jim Mattson <jmattson@google.com>
> Sent: Thursday, May 14, 2026 1:02 PM
> To: Sean Christopherson <seanjc@google.com>; Kaplan, David
> <David.Kaplan@amd.com>
> Cc: pbonzini@redhat.com; tglx@kernel.org; mingo@redhat.com;
> bp@alien8.de; dave.hansen@linux.intel.com; x86@kernel.org;
> hpa@zytor.com; shuah@kernel.org; kvm@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-kselftest@vger.kernel.org; ctpence@google.com
> Subject: Re: [PATCH v3 3/4] KVM: x86: Virtualize AMD CPUID faulting
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Thu, May 14, 2026 at 9:35 AM Sean Christopherson
> <seanjc@google.com> wrote:
> >
> > On Thu, May 14, 2026, Jim Mattson wrote:
> > > On Thu, May 14, 2026 at 9:20 AM Sean Christopherson
> <seanjc@google.com> wrote:
> > > > Oooh, this is based on the generic CPL rules.  I didn't think about it from
> that
> > > > perspective.  So yeah, addressing that does make sense.  What a pain.
> > >
> > > When I fix this in version 4, what's the correct footer for Sashiko
> attribution:
> > >
> > > Assisted-by: Sashiko:gemini/gemini-3.1-pro-preview
> > >
> > > or
> > >
> > > Reported-by: Sashiko:gemini/gemini-3.1-pro-preview
> >
> > This, or even just:
> >
> >   Reported-by: Sashiko
> >
> > is good enough for me.  I don't expect random developers to know or care
> what
> > model was used, at least not when it comes to reporting bugs.  If you use AI
> to
> > help write the code, then maybe I'd care?
>
> I had Jetski write an empirical test to see how the hardware behaves.
> On the first userspace CPUID VM-exit, temporarily set #GP on userspace
> CPUID per the appropriate vendor's mechanism, make sure that we
> intercept #GP, and re-enter the guest without advancing RIP. Then, see
> what the next VM-exit is.
>
> Surprise!
>
> kvm_intel: KVM: EMPIRICAL TEST RESULT: #GP took precedence over CPUID
> VM-exit
> kvm_amd: KVM: EMPIRICAL TEST RESULT (SVM): CPUID VM-exit took
> precedence over #GP!
>
> LOL!
>
> David: Is this intentional or a bug?

This appears to be a bug, as most other instructions (e.g. INVPCID) that have CPL checks do the CPL checks before the VMEXIT checks.  I'm following up on this internally...

Thanks for bringing this to our attention
--David Kaplan

  reply	other threads:[~2026-05-14 18:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 22:46 [PATCH v3 0/4] KVM: x86: Virtualize AMD's "disable CPUID in usermode" Jim Mattson
2026-05-13 22:46 ` [PATCH v3 1/4] KVM: x86: Consolidate CPUID fault handling for emulator and interception logic Jim Mattson
2026-05-14  8:41   ` Binbin Wu
2026-05-13 22:46 ` [PATCH v3 2/4] KVM: x86: Remove supports_cpuid_fault() helper Jim Mattson
2026-05-14  8:51   ` Binbin Wu
2026-05-13 22:46 ` [PATCH v3 3/4] KVM: x86: Virtualize AMD CPUID faulting Jim Mattson
2026-05-14 13:19   ` Jim Mattson
2026-05-14 14:28     ` Sean Christopherson
2026-05-14 14:45       ` Jim Mattson
2026-05-14 16:20         ` Sean Christopherson
2026-05-14 16:22           ` Jim Mattson
2026-05-14 16:35             ` Sean Christopherson
2026-05-14 18:01               ` Jim Mattson
2026-05-14 18:17                 ` Kaplan, David [this message]
2026-05-26 18:38                   ` Jim Mattson
2026-05-26 21:30                     ` Kaplan, David
2026-05-27 13:25                       ` Jim Mattson
2026-05-13 22:46 ` [PATCH v3 4/4] KVM: selftests: Update hwcr_msr_test for CPUID faulting bit Jim Mattson
2026-05-28 22:01 [PATCH v3 3/4] KVM: x86: Virtualize AMD CPUID faulting Christian Ludloff
2026-05-29  0:00 ` 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=DS7PR12MB82016B1B310BD994C83B35D294072@DS7PR12MB8201.namprd12.prod.outlook.com \
    --to=david.kaplan@amd.com \
    --cc=bp@alien8.de \
    --cc=ctpence@google.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=tglx@kernel.org \
    --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

all inboxes | Powered by JetHome®