All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel-bounces@lists.xenproject.org>
Subject: Re: [PATCH] x86/hvm: short-circuit HVM shadow guest creation earlier
Date: Tue, 10 Feb 2026 08:54:13 +0100	[thread overview]
Message-ID: <aYrkJZZd293bhSSZ@Mac.lan> (raw)
In-Reply-To: <DGAKLSGGUD3Z.36NW0SSYZ8ZW4@amd.com>

On Mon, Feb 09, 2026 at 05:26:54PM +0100, Alejandro Vallejo wrote:
> On Mon Feb 9, 2026 at 5:11 PM CET, Roger Pau Monné wrote:
> > On Mon, Feb 09, 2026 at 05:02:26PM +0100, Alejandro Vallejo wrote:
> >> On Mon Feb 9, 2026 at 3:40 PM CET, Roger Pau Monne wrote:
> >> > If shadow paging has been compiled out short circuit the creation of HVM
> >> > guests that attempt to use shadow paging at arch_sanitise_domain_config().
> >> > There's no need to further build the domain when creation is doomed to fail
> >> > later on.
> >> >
> >> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> >> > ---
> >> >  xen/arch/x86/domain.c | 6 ++++++
> >> >  1 file changed, 6 insertions(+)
> >> >
> >> > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> >> > index 8b2f33f1a06c..8eb1509782ef 100644
> >> > --- a/xen/arch/x86/domain.c
> >> > +++ b/xen/arch/x86/domain.c
> >> > @@ -627,6 +627,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
> >> >          return -EINVAL;
> >> >      }
> >> >  
> >> > +    if ( hvm && !hap && !IS_ENABLED(CONFIG_SHADOW_PAGING) )
> >> > +    {
> >> > +        dprintk(XENLOG_INFO, "Shadow paging requested but not available\n");
> >> 
> >> nit: s/requested/required/, maybe?
> >
> > The wording matches the rest of the messages in
> > arch_sanitise_domain_config().  I'm not saying that makes it correct,
> > but if we word this differently we should also change the others
> > IMO.
> 
> My point is rather that HAP, or relaxed MSRs, or other settings are actively
> requested via createdomain flags. Shadow is instead the consequence of not
> setting HAP. You don't request shadow, you either requested something else or
> you hit the error.
> 
> It's not terrible wording, just imprecise.

Hm, I see.  I've always considered not requesting HAP equivalent to
requesting shadow.  IOW: not setting XEN_DOMCTL_CDF_hap doesn't mean
"pick any possible option" but rather it's an explicit request to use
shadow paging on HVM.

The interface would possibly be cleaner if we had both a HAP and
Shadow flags, and lack of any being selected could mean for Xen to
pick the default one.

Thanks, Roger.


      reply	other threads:[~2026-02-10  7:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09 14:40 [PATCH] x86/hvm: short-circuit HVM shadow guest creation earlier Roger Pau Monne
2026-02-09 14:56 ` Jan Beulich
2026-02-09 16:02 ` Alejandro Vallejo
2026-02-09 16:11   ` Roger Pau Monné
2026-02-09 16:24     ` Jan Beulich
2026-02-09 16:26     ` Alejandro Vallejo
2026-02-10  7:54       ` Roger Pau Monné [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=aYrkJZZd293bhSSZ@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=alejandro.garciavallejo@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel-bounces@lists.xenproject.org \
    --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.