[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN][PATCH v2 3/4] x86: hvm: factor out COMPAT code under ifdefs
- To: Grygorii Strashko <grygorii_strashko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Tue, 2 Dec 2025 14:26:23 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1D1uoybhF9d7OkIjgFCgPM+f3eVGpi7FVEjaq/W9ISY=; b=eaI43s2YrkOIyBK0nAULZq0ubOSHz+u800cFUk92XFf/RRxE8racXLAgLYN0I4q0OsB88ygXbWx7CANfG4XeY0+BxLRDOWWv+L1qozdVK7D6r8apf5RSpZfwsF/yQTM5HW6Luf+wRDJH2pdoDC49zWrpZlyQco4WI1D3BAt6dl7UPM/Z5MxjvL9xYQtphfjBbKeKn7iHdrq0elstq69qINRGvo2YNXFeLYtGly3SLGvyOZKtfAvCLrXx92FftEvZbSeeqQ+BIklUmLWrPMcTpgn49w1wL92m8DtJcjWdTUBXN7sPbbqHS+01yaWbK0wLVNk2PywbqmKnXWXY2RnBbQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WV2N2grsz8pt37pBITipn92C8I9w4HjuCP53xbDastfDmpHaWecdiKGXKJRLhcOrpBT88x17hDTLQ3BCWWaBsqB+8PPu4cwKkxKauff/MNMOxg3wzi36o/XLKJjoDVZZpSdvOAKhUML88FryJCD/UBCBIIoqk6wckm/60X0SKsMhA6GPcgJ/ASXahbb8ugIvvITuFCYtdvyXV2ud2v7Fgw3bh13tnNdboNYbxAIf7sKi+2JgEPLqZpTMMg2o6gqZoXxub9XDiM/MX/aupFsATpPD6NqOXPgbAulI6uA4ZB0KIPAEZkcAh1PSkudxgkgq9Y0w7pdOrfO4wZhg94IXOQ==
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Michal Orzel" <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Jürgen Groß <jgross@xxxxxxxx>
- Delivery-date: Tue, 02 Dec 2025 19:26:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2025-11-19 14:30, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
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 <grygorii_strashko@xxxxxxxx>
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 <jason.andryuk@xxxxxxx>
Regards,
Jason
|