[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN][PATCH 8/8] xen/arm64: constify regs_mode_is_32bit macro for CONFIG_ARM64_AARCH32=n


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Wed, 23 Jul 2025 07:58:40 +0000
  • Accept-language: en-US
  • 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=x/xUhbOd3Hd2arTHKwJKlILV9mz0mb0pwpQ7u8kFI5Y=; b=xbPWo+/DkZfRQhfk+neA120L2M6qEK14Ui8VjVOsW4n+7x+SpKp77WnMkvtxy1lMThL4PfNY9yOF6rCGLeMuI3QE8eMWE45u4pr7KbSwvgmqru35DTBJCNWOPZSKNdnlnK5R7/tFS5fqpwYgRPqmugRnasZVOYsrId2jKC7Mf5DQKOAahbQbAfu7e+HN3/ommrMdp3T4goNrULA12xKCSEY522UllawRmF/qhnELXTfaFXkFUDWGWH7OnROiFQPMe2Bv50DNZiuqqTwZGOAa/joIadID83X45OAkm+22hvXWHn3pLqPkwXoZgExw3WFwYqGr7SUJofWLkbre/9TytQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=me+0NfpjBTB8TBpSCxfSMzQb3FQTvx6KUn3PjiN5KighV4h/xS94Zf3IRsk1nAiRoUtZqPVx2dxOHjBR5ne1baD0jul2e4nx/iLv63nnAwGK7a0qHuOVrzrQDVlr3oIVAi4ilktYrNA18KBS6gwVNs+g13zxaiSXAutsiBsJSd4qctk+cfPVpzwE3cAgYY+NTCHX57ktGcdcCP3A0dQoujWBQfRh3swUx9gzeEJmMVhQ3A2moeJZRnANAUoMm63aGlMWSt/u6jDlxM1WaNALMrAQPylGqzNNuHo7bEDc7dWyNzajZuL5mnXooHaVq2RrhQ4LYiNqxvYPZgL2R9qsnw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Wed, 23 Jul 2025 07:58:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb+6eaXQ5OjqGTX0GClPul0tEYsQ==
  • Thread-topic: [XEN][PATCH 8/8] xen/arm64: constify regs_mode_is_32bit macro for CONFIG_ARM64_AARCH32=n

From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

Constify regs_mode_is_32bit() macro for the case CONFIG_ARM64_AARCH32=n  and
so allow compiler to opt out Aarch32 specific code.

(CONFIG_ARM64_AARCH32=y)
Before:
 855232  322404  270880 1448516  161a44 xen-syms

(CONFIG_ARM64_AARCH32=n, CONFIG_EXPERT=y)
After:
 849548  322404  270880 1442832  160410 xen-syms
diff: -5684 (dec)

Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
---
 xen/arch/arm/include/asm/arm64/processor.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/include/asm/arm64/processor.h 
b/xen/arch/arm/include/asm/arm64/processor.h
index daf890708d87..a3d83869f02d 100644
--- a/xen/arch/arm/include/asm/arm64/processor.h
+++ b/xen/arch/arm/include/asm/arm64/processor.h
@@ -96,10 +96,14 @@ struct cpu_user_regs
  */
 #define regs_mode_is_user(r) (psr_mode((r)->cpsr, PSR_MODE_EL0t) || 
usr_mode(r))
 
+#if defined(CONFIG_ARM64_AARCH32)
 static inline bool regs_mode_is_32bit(const struct cpu_user_regs *regs)
 {
     return !!(regs->cpsr & PSR_MODE_BIT);
 }
+#else
+#define regs_mode_is_32bit(regs) (false)
+#endif /* CONFIG_ARM64_AARCH32 */
 
 #endif /* __ASSEMBLY__ */
 
-- 
2.34.1



 


Rackspace

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