[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: Jason Andryuk <jason.andryuk@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Thu, 4 Dec 2025 20:39:48 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • 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=RDMfcvz8fLnte1WsCYChgp9m2SH7DImUd7y12a5Nx1I=; b=q4LCGCUirxEY6HOc+2umSk6560WC0FkdwoxFltmpaoibEsKrIrX9PvvgyAgG1zr2EXQXl6C7DdA6QYmawPIhWwAU9/CHwH4XiUSodGZeVkmow4oZwSsjZolEUNhtIkOASi1ZAuTlu5497/x+kTUP/khTV+Qo54wVOd1iscbmOfUrOTC3191pG4tCsD06w1xusdyv40vtrEnwxMYAYNw8hmkFNOtKyfhnzcy0gDio5BX9t4L6sHT6XiRvKSDMRnH4xNTOhRDBfLCXcmNHCveLKzvWgb0lqM6jnbo7Bu3mHZBWOGGJYRHRgmyb3eIiGY+j6XFjEEh6WS93vQ5GlJPSIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AGSauk4CSgRHgzlo7LaFt/QfIGPRohQ5e3seguG/ACfTQjoLfiEEXxldQKliiqQB/MmyTmB0aMIaGHWCTE9hfqkIgNz8SJz82kamGgZ7WYKgHEum1Mnjwk0SllHUQ5qYEmGIOsW24SqAbMg9KTdKf4KyNxMsQbHDQXVyHZFlNvxydBjYexGJivl0HOYEGAOg92EBGNAvZcRpfIIlIq5PX0sLJR/cbQurW0c3iTt/U0WGifs9AXfRysazd1gZnPOO4tmfr08YZFunssbHXE2bAaXTPjzSbnornyPXkXM5v6ePT4NmU2eCpckiEu5Wv94I8JOCAZwiFwZusOICQ12fkA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • 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: Thu, 04 Dec 2025 18:40:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 02.12.25 21:26, Jason Andryuk wrote:
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?

It's a generic request to have macro arguments evaluated consistently.


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

--
Best regards,
-grygorii




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.