|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 1/2] x86: Make hvm_enabled a constant unless both PV and HVM are both compiled
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.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |