On 2025-11-19 14:30, Grygorii Strashko wrote:
From: Grygorii Strashko <[email protected]>
Factor out COMPAT HVM code under ifdefs in preparation for making HVM
COMPAT code optional.
- hypercall-defs.c updated to always provide compat declaration for:
physdev_op, grant_table_op, grant_table_op. This reduces number of COMPAT
ifdefs in HVM code and lets compiler DCE do the job.
- Only 64-bit shinfo is supported with COMPAT=n, so struct
arch_domain->has_32bit_shinfo field is moved under COMPAT ifdef and
has_32bit_shinfo() is updated to account for COMPAT=n.
Signed-off-by: Grygorii Strashko <[email protected]>
diff --git a/xen/arch/x86/include/asm/domain.h
b/xen/arch/x86/include/asm/domain.h
index 5df8c7825333..0005f4450931 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -12,8 +12,11 @@
#include <public/vcpu.h>
#include <public/hvm/hvm_info_table.h>
-#define has_32bit_shinfo(d) ((d)->arch.has_32bit_shinfo)
-
+#ifdef CONFIG_COMPAT
+#define has_32bit_shinfo(d) ((d)->arch.has_32bit_shinfo)
+#else
+#define has_32bit_shinfo(d) ((void)(d), false)
(void)(d) is to avoid an any potential unreferenced 'd' messages?
Just using false builds for me, but your way is a little more robust.
+#endif
/*
* Set to true if either the global vector-type callback or per-vCPU
* LAPIC vectors are used. Assume all vCPUs will use
Reviewed-by: Jason Andryuk <[email protected]>
Regards,
Jason