From bf8a74a3e107044eafd7174cf21286cda8f45c66 Mon Sep 17 00:00:00 2001 From: Jiaqing Zhao Date: Wed, 26 Aug 2026 14:14:20 +0200 Subject: [PATCH] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hypervisor leaf 5 is PV-specific, but is gated with !is_hvm_domain(), which stays a runtime test in a build without PV support. Test for a PV domain directly so the compiler can discard the leaf when CONFIG_PV is disabled. Suggested-by: Roger Pau Monné Signed-off-by: Jiaqing Zhao Reviewed-by: Jan Beulich --- xen/arch/x86/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c index 6e9b15c9c3..a9aeb2d268 100644 --- a/xen/arch/x86/cpuid.c +++ b/xen/arch/x86/cpuid.c @@ -157,7 +157,7 @@ static void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf, break; case 5: /* PV-specific parameters */ - if ( is_hvm_domain(d) || subleaf != 0 ) + if ( !is_pv_domain(d) || subleaf != 0 ) break; res->b = flsl(get_upper_mfn_bound()) + PAGE_SHIFT;