[XEN][PATCH 5/5] x86: constify has_32bit_shinfo() if !CONFIG_COMPAT

Grygorii Strashko posted 5 patches 1 week ago
[XEN][PATCH 5/5] x86: constify has_32bit_shinfo() if !CONFIG_COMPAT
Posted by Grygorii Strashko 1 week ago
From: Grygorii Strashko <grygorii_strashko@epam.com>

Constify has_32bit_shinfo() if !CONFIG_COMPAT.

Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
---
 xen/arch/x86/include/asm/domain.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 5df8c7825333..6883b7226aa7 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -12,7 +12,8 @@
 #include <public/vcpu.h>
 #include <public/hvm/hvm_info_table.h>
 
-#define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
+#define has_32bit_shinfo(d)                                                    \
+        (IS_ENABLED(CONFIG_COMPAT) && (d)->arch.has_32bit_shinfo)
 
 /*
  * Set to true if either the global vector-type callback or per-vCPU
-- 
2.34.1
Re: [XEN][PATCH 5/5] x86: constify has_32bit_shinfo() if !CONFIG_COMPAT
Posted by Jan Beulich 5 days, 12 hours ago
On 11.11.2025 18:54, Grygorii Strashko wrote:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
> 
> Constify has_32bit_shinfo() if !CONFIG_COMPAT.

As already indicated in reply to another patch, drop the field altogether
when COMPAT=n, having the macro simply resolve to false in that case?

Jan