x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()

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é <roger@xenproject.org>
Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Jiaqing Zhao authored and Jan Beulich committed 2026-08-26 14:14:20 +02:00
1 parent 829d67e244
commit bf8a74a3e1
1 file changed
+1 -1
+1 -1
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.