* [PATCH] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()
@ 2026-08-26 7:25 Jiaqing Zhao
2026-08-26 9:42 ` Jan Beulich
2026-08-28 9:41 ` Roger Pau Monné
0 siblings, 2 replies; 3+ messages in thread
From: Jiaqing Zhao @ 2026-08-26 7:25 UTC (permalink / raw)
To: xen-devel
Cc: Teddy Astie, Andrew Cooper, Jan Beulich, Jiaqing Zhao,
Roger Pau Monné
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>
---
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;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()
2026-08-26 7:25 [PATCH] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain() Jiaqing Zhao
@ 2026-08-26 9:42 ` Jan Beulich
2026-08-28 9:41 ` Roger Pau Monné
1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2026-08-26 9:42 UTC (permalink / raw)
To: Jiaqing Zhao; +Cc: Teddy Astie, Andrew Cooper, Roger Pau Monné, xen-devel
On 26.08.2026 09:25, Jiaqing Zhao wrote:
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()
2026-08-26 7:25 [PATCH] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain() Jiaqing Zhao
2026-08-26 9:42 ` Jan Beulich
@ 2026-08-28 9:41 ` Roger Pau Monné
1 sibling, 0 replies; 3+ messages in thread
From: Roger Pau Monné @ 2026-08-28 9:41 UTC (permalink / raw)
To: Jiaqing Zhao; +Cc: xen-devel, Teddy Astie, Andrew Cooper, Jan Beulich
On Wed, Aug 26, 2026 at 03:25:26PM +0800, Jiaqing Zhao wrote:
> Hypervisor leaf 5 is PV-specific, but is gated with !is_hvm_domain(),
I would maybe write "..., but is gated using 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>
Acked-by: Roger Pau Monné <roger@xenproject.org>
Thanks, Roger.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-28 9:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-26 7:25 [PATCH] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain() Jiaqing Zhao
2026-08-26 9:42 ` Jan Beulich
2026-08-28 9:41 ` Roger Pau Monné
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.