[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


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 13 Feb 2026 17:33:27 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yqm1//Ni5dovdXJ2JqxsMrEse5eljym6mkA8zl2x1tU=; b=MZDXB3+Ggh+/WPPb3yFr12ZGCsQWTCPKBbNyrouuD9j0PtSR1Vy2BHCaUK0QQxHeHcEmgwjdsNwioNtPlrXJ25f3J2/MLx4ETsgLyGpHMYNe1emhCj2sCjxRARHt1K2DmMA8Mmn6JnTIAMEGjaOXD8FTF12CdcdT1D/N/oXyjf+VDfTIcQnvSguBFlL7LK5JlE8hjeObIJCHrwu94blptyUhO8NRkmCUIeeDN7dhMjq3dE8yMMXVRF4ACPUUSVZUOjLhr/M5LOCSv8Yke+HB6uBbd343U6r7347N/O8oGIoX8LZyGy3bvmSwgFKypzaze9vxV2K49pM5V3h+AZRFxQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lF3gymsVmJWTV2bbRY1xLxLksCckMSng+lKEuN7DGQZw//QKnvCLrGqJbfes9v4acyhyk7uNrkTrEWgeB8b6rww9+3UT9nGXuIwrllT8uSZEPzJHCuHK12obSB5uXTp6Vt54t4bgDchq5Yu04zlnPcqLPPL/T5lz7qUcIlU1k/3JvxUBxNV1R/5P7s5FqDwPQMryAvyrbYURTXn7KTy2PYgkY46YaVyktK3X+PZb19QCjzYwUSThX0cdEvQpHsfJjsqP2zFcl+XX+N5miDwkxt5K0X9d5iAu59belCAzkiPf+n+VqfWdQ+/xlEWE9w/QYkXmmb0t4+LZ3Lzapwoxlw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Fri, 13 Feb 2026 16:33:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.