public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: John Allen <john.allen@amd.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, seanjc@google.com, pbonzini@redhat.com,
	rick.p.edgecombe@intel.com, mlevitsk@redhat.com,
	weijiang.yang@intel.com, chao.gao@intel.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com,
	tglx@linutronix.de, thomas.lendacky@amd.com
Subject: Re: [PATCH v3 2/2] x86/sev-es: Include XSS value in GHCB CPUID request
Date: Fri, 26 Sep 2025 14:22:59 -0500	[thread overview]
Message-ID: <aNboE3FqdjgqlEuy@AUSJOHALLEN.amd.com> (raw)
In-Reply-To: <e0b0180f-17aa-444a-8ede-39709501e82b@intel.com>

On Wed, Sep 24, 2025 at 04:02:11PM -0700, Dave Hansen wrote:
> On 9/24/25 13:08, John Allen wrote:
> > +	if (has_cpuflag(X86_FEATURE_SHSTK) && regs->ax == 0xd && regs->cx == 1) {
> > +		struct msr m;
> > +
> > +		raw_rdmsr(MSR_IA32_XSS, &m);
> > +		ghcb_set_xss(ghcb, m.q);
> > +	}
> 
> Is there a reason this is open-coding CPUID_LEAF_XSTATE?

That's a good question. This patch was adapted from an old SNP patch
from years ago so if I had to guess, maybe there was some issue bringing
in the old pre-split cpuid header into the early boot/shared
environment. It looks like including asm/cpuid/types.h and using
CPUID_LEAF_XSTATE works here and now so I'll include it in the next
version.

Thanks,
John

  reply	other threads:[~2025-09-26 19:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 20:08 [PATCH v3 0/2] Support for SEV-ES guest shadow stack John Allen
2025-09-24 20:08 ` [PATCH v3 1/2] x86/boot: Move boot_*msr helpers to asm/shared/msr.h John Allen
2025-09-24 20:08 ` [PATCH v3 2/2] x86/sev-es: Include XSS value in GHCB CPUID request John Allen
2025-09-24 23:02   ` Dave Hansen
2025-09-26 19:22     ` John Allen [this message]
2025-10-31 12:21 ` [PATCH] x86/coco/sev: Convert has_cpuflag() to use cpu_feature_enabled() Borislav Petkov

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=aNboE3FqdjgqlEuy@AUSJOHALLEN.amd.com \
    --to=john.allen@amd.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=weijiang.yang@intel.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