[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] x86: Conditionalise PV-only fallback branches on CONFIG_PV


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Wed, 12 Nov 2025 16:22:30 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=sSNMRiJhvIm2jM238s1+EHLPCDbys9wV9XE8+uZm1rI=; b=fhFHt6aw3qNwA22Vxyi1V5cic5mqRFdRfALJLnQJVEsKyo5HBhf6dT2MF1tv5q/IRQqHJYYq5vIDKyCdswqFaYj7Jxb1GM0vJz0NV4og8rFtZJaEWyQbo9oKhU8JvNJCJ8zcqyIdCJ177Sok7tsGU1bLzoLjTIVk7y7NZqr+uuDHlsYWH1/XlJSQV75hopT+yse+/QyaTLsxGBNxmieX9U8HOZ3bzfamXG6/LaL44w97EESN0On/BKACzCtElhAcXxjtSXwLYaDcOdmE7QZpyLrF0aHMmD4V39oS6XUSbcND5VnUw11xzYZ6A48F71UzBz+TilAlPturEYX/Lk/8yA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oa/E9qQfQoNy8YhQAB/KcB0AwKXiUwRXUlW7K36bFU09TUyX10udihHwFNeBNkXYw7Rk5OZYCHlgtDoVsFJBBKK9CdW3EPvAJQciP+oswuBd9Y7E5tXsB5V28keO4M7eu6+5EASB0+TfSHymAXVwijuXLN8P4umaQcs14Lh9GEf7vSx4ihWIyGJvWsVf2+2776Cp8acA0efh4jUL4lWgNxXnKGDG25p/nDrqTBu/nP53UfFNChLw05gvTgJ3SHhGfdd3F0/8Q0FOTrduFv9coZx5Y/RRAdNLmBVcEebHyJVK7IsD4mX/LOtJ5pJcCCB+TvN8uugs990OsDGTIiSIsw==
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 12 Nov 2025 15:23:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

A couple of branches rely on PV being the "else" branch, making it
be compiled even when PV support is not itself compiled-in.

Add a explicit conditional on CONFIG_PV in those cases to remove the
code in !CONFIG_PV builds.

Not a functional change.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
---
 xen/arch/x86/cpuid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index b63a82dd38..2e24c84708 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -297,7 +297,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
             if ( v->arch.hvm.guest_cr[4] & X86_CR4_OSXSAVE )
                 res->c |= cpufeat_mask(X86_FEATURE_OSXSAVE);
         }
-        else /* PV domain */
+        else if ( IS_ENABLED(CONFIG_PV) )
         {
             regs = guest_cpu_user_regs();
 
@@ -509,7 +509,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
             if ( !hap_enabled(d) && !hvm_pae_enabled(v) )
                 res->d &= ~cpufeat_mask(X86_FEATURE_PSE36);
         }
-        else /* PV domain */
+        else if ( IS_ENABLED(CONFIG_PV) )
         {
             /*
              * MTRR used to unconditionally leak into PV guests.  They cannot
-- 
2.43.0




 


Rackspace

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