[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: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 13 Feb 2026 16:01:25 +0000
  • 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=fLOphD0jur9UOiAHjMvOhmytlNXwdiOi5GDPDxuG8nA=; b=IFf0VG2ivLunTfeXlbT4bOAySame4tnfRJZjA/nIoGAlUBXrLxs+cXVjhffP47CEWH1ucqHjIe3efoI3K3fWZ2p9g0XICL0GrkublETWCVQNQwy1F6V2UuuMw30fIrfa+KKr15MF5hFp7sKLYAW8AyrlmKKsSWr5p1FxXgNGqHR4uvOKw/GSBNCvuJgUM5aMMDDbxev7ELhAuFq01SAGwzqLRpiwwiksBJ1BU3DaArLZqi0UYzHPWE+ZBOY0y8y6drdFehe0M0tfmE8wDfu27+K3J+i+IEK9USEghPuQk5J+7e7RZMT9vC7MRH4vzGbaa2BZT8pHov84sf43Dp2yEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L4/f02YHtgSGKHn2D/U3wjv6hc0FZOOIau7NRhqk36Sbj3DCUjnu/+C0oYrwFpwSFDlgzXFITo+Sj7l/DQLdTpSxl2ePjWWMKxFLSPbMJbntG0QPDye23NKZQ1iZ2/rfGee5S09fDeFFEjZ+m10HR3WbpWsSpUcRNi1fYXi+YLuWMpYRsYj4RqODn0Im85iURdnjNAxqYnG32HJ63vR+su8KmmixAy4ujNjsl6v4exhp0F8Ji634SAAfJ5c6Nz6DCQgf6DMZMXquzNOl3v4TI2pFZFkOil3d/nw/w5FcXbBIgMTguBssSRujGLR2xtxVnMbBh5mMhd4/eTKiB0Qd6g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Fri, 13 Feb 2026 16:01:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

>> +
>>          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.

~Andrew



 


Rackspace

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