All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Alejandro Vallejo <alejandro.garciavallejo@amd.com>,
	xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH 1/2] x86: Make hvm_enabled a constant unless both PV and HVM are both compiled
Date: Fri, 13 Feb 2026 17:33:27 +0100	[thread overview]
Message-ID: <aY9SV1PeqNqiPWlx@Mac.lan> (raw)
In-Reply-To: <1e4e20cb-71fd-4ed3-888b-7ca8b17175a5@citrix.com>

On Fri, Feb 13, 2026 at 04:01:25PM +0000, Andrew Cooper wrote:
> On 13/02/2026 2:26 pm, Roger Pau Monné wrote:
> > On Fri, Feb 13, 2026 at 02:37:29PM +0100, Alejandro Vallejo wrote:
> >> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> >> index 4d37a93c57..da56944e74 100644
> >> --- a/xen/arch/x86/hvm/hvm.c
> >> +++ b/xen/arch/x86/hvm/hvm.c
> >> @@ -173,9 +175,16 @@ static int __init cf_check hvm_enable(void)
> >>          svm_fill_funcs();
> >>  
> >>      if ( fns == NULL )
> >> +    {
> >> +        if ( !IS_ENABLED(CONFIG_PV) )
> >> +            panic("HVM support not detected and PV compiled-out\n");
> 
> As with Rogers feedback on the next patch, this wording isn't ideal. 
> How about:
> 
> "HVM support required but not available\n".
> 
> This is reachable for people who use cpuid=no-vmx,no-svm but they get to
> keep all the pieces and the documentation already has a general warning
> about this kind of stuff.

Hm, yes, I forgot to comment on this one.

> 
> >> +
> >>          return 0;
> >> +    }
> >>  
> >> +#ifdef CONFIG_PV
> > CONFIG_HVM I think?
> 
> No - CONFIG_PV is correct here, because we're inside an HVM-only file. 
> It's the only case where this variable exists for real.

Oh, I see.  Yes, those are the right guards, otherwise the variable is
hardcoded to IS_ENABLED(CONFIG_HVM).  Sorry, my bad.  It's a bit ugly
to have to do it with such ifdefs, but right now I don't see a better
way.

Thanks, Roger.


  reply	other threads:[~2026-02-13 16:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13 13:37 [PATCH 0/2] x86: Const-ify hvm_enabled and hap_enabled() when possible Alejandro Vallejo
2026-02-13 13:37 ` [PATCH 1/2] x86: Make hvm_enabled a constant unless both PV and HVM are both compiled Alejandro Vallejo
2026-02-13 14:26   ` Roger Pau Monné
2026-02-13 16:01     ` Andrew Cooper
2026-02-13 16:33       ` Roger Pau Monné [this message]
2026-02-13 17:04     ` Alejandro Vallejo
2026-02-13 18:30       ` Roger Pau Monné
2026-02-13 13:37 ` [PATCH 2/2] x86: Force HAP to be enabled when PV and shadow paging are compiled out Alejandro Vallejo
2026-02-13 15:09   ` Roger Pau Monné
2026-02-13 17:30     ` Alejandro Vallejo
2026-02-13 18:42       ` Roger Pau Monné
2026-02-13 19:13         ` Alejandro Vallejo
2026-02-13 19:54           ` Roger Pau Monné

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=aY9SV1PeqNqiPWlx@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=alejandro.garciavallejo@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --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.