All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: chunjie.zhu@citrix.com, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	jbeulich@suse.com, roger@xenproject.org, teddy.astie@vates.tech
Subject: Re: [PATCH v1 0/2] x86/cpuid: Hide XSAVES/RDRAND/RDSEED from nested VMX guests
Date: Tue, 1 Dec 2026 11:09:27 +0000	[thread overview]
Message-ID: <ab2cefa7-3a6d-4b69-bf7c-e38ef4c15693@citrix.com> (raw)
In-Reply-To: <20261130073850.22478-1-chunjie.zhu@citrix.com>

On 30/11/2026 7:38 am, chunjie.zhu@citrix.com wrote:
> From: Chunjie Zhu <chunjie.zhu@citrix.com>
>
> Hyper-V (hvix64) as an L1 guest on Xen checks that every feature CPUID
> reports has the matching secondary VM-execution control available in
> IA32_VMX_PROCBASED_CTLS2, and fails early during boot otherwise.  Xen's
> nested VMX does not offer the XSAVES, RDRAND-exiting or RDSEED-exiting
> controls, so hide the features from L1 instead.
>
> This is a pragmatic workaround rather than a complete answer.  Ideally the
> CPUID policy would be derived from what nested VMX can actually offer, at
> the toolstack level, and I'd welcome guidance on whether that is the
> preferred direction before this goes any further.
>
> Tested with a Hyper-V L1 guest, which gets past the VMX capability checks
> with these applied.  Applies on top of current master.

It is HyperV's choice to demand those features.  It is arguably a bug
that Xen doesn't expose the exiting controls, but nested virt had been
abandoned for so long that it's not surprising that these weren't
implemented.

However, you can't simply hide the features like this.  If nothing else,
it's playing behind the back of a toolstack which thinks the VM can see
the features.


For RDRAND and RDSEED, it's probably easier to add support for exiting
than to play with CPUID.  It's just two extra intercept checks.

XSAVES is harder.  We probably should hide XSAVES generally; we do not
support any supervisor states, and there's a long list of things needing
doing before we can expose any.  Only then will we be able to reason
about what's required to make it work under nested virt.

~Andrew


      parent reply	other threads:[~2026-12-01 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  7:38 [PATCH v1 0/2] x86/cpuid: Hide XSAVES/RDRAND/RDSEED from nested VMX guests chunjie.zhu
2026-11-30  7:38 ` [PATCH v1 1/2] x86/cpuid: Hide XSAVES " chunjie.zhu
2026-11-30  7:38 ` [PATCH v1 2/2] x86/cpuid: Hide RDRAND and RDSEED " chunjie.zhu
2026-11-30 22:15   ` Teddy Astie
2026-12-01 11:09 ` Andrew Cooper [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=ab2cefa7-3a6d-4b69-bf7c-e38ef4c15693@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=chunjie.zhu@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger@xenproject.org \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.