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

[PATCH] move __read_mostly to xen/cache.h


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 8 Aug 2023 11:46:23 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=SVrFtQxpqHFMm4qDt7dXEN4BfK0cHrftLblwpSh5cH0=; b=TXhsNkxj0pcrYayCxGnboHo0BOIAsIvvY3yKTqP7r0PhFrkawwCPsSfRjfAU1kElAu8oN8Ww/5Ke39+IBZUFhn6lKyhZH5Z2pH6PEgHJgN9xkbmufoUUQxLOO6/iNv2ql1MKANK6vurGLRkFj0DFQHJldBb3y8djQR+uwWRZS5a5708jo/neEV8Uq/IrBM5uUJSociq7SSTvChne4CWr+D3ZFu6wJt7LOr6KUbIfJvSxBGzDVDYpnbin0zQKLMM1t+kzveeiXUnl75YOMcP/gHftHuJbEa70KBdow8HO9ZYBn+eDRgxi1cJ1KqxIfyPlGAImbRiHIesvQpolp3pH8g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TsQbHyK8371hUpUCjQ2h6kvc8HkwF3y7Z9LtBlQWjIa1MaZJULl6ReeSxv4LWLAxb/MY/cCBpFxAZ6wnvVl6hxh6y9oakyCAL3wPzWxsqlJwq/DnvnEm8/Ri9Tsd0GMTNq9GUx1oWHwLnWzt6KcUCXLstX7rlG5M29ekNO6Lng0TmWHLPcx1RRcFnGm+SbJENil5LHk/S+YvKXqhUvayu/6bBtv0X4s9awc8l+7a62WSpXjXH3gkXyo9FaoDz8PLxbr9sfXh0fPXhPB8WBAnfsL4O/O55NUDgT5zuaaCJ2ncAT0S3Tgy9noyFVIoFCduiJQdNKpXH1z4E2DfKZVXUA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 08 Aug 2023 09:46:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

There's no need for every arch to define its own identical copy. If down
the road an arch needs to customize it, we can add #ifndef around the
common #define.

To be on the safe side build-breakage-wise, change a couple of #include
<asm/cache.h> to the xen/ equivalent.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/arm/include/asm/cache.h
+++ b/xen/arch/arm/include/asm/cache.h
@@ -6,8 +6,6 @@
 #define L1_CACHE_SHIFT  (CONFIG_ARM_L1_CACHE_SHIFT)
 #define L1_CACHE_BYTES  (1 << L1_CACHE_SHIFT)
 
-#define __read_mostly __section(".data.read_mostly")
-
 #endif
 /*
  * Local variables:
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -34,13 +34,13 @@
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/acpi.h>
+#include <xen/cache.h>
 #include <xen/smp.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
 #include <xen/param.h>
 #include <xen/trace.h>
 #include <xen/irq.h>
-#include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/iocap.h>
 #include <asm/hpet.h>
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -7,11 +7,11 @@
  * Copyright (c) 2003-2006, K A Fraser
  */
 
+#include <xen/cache.h>
 #include <xen/paging.h>
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
-#include <asm/cache.h>
 #include <asm/flushtlb.h>
 #include <asm/invpcid.h>
 #include <asm/nops.h>
--- a/xen/arch/x86/genapic/probe.c
+++ b/xen/arch/x86/genapic/probe.c
@@ -6,10 +6,10 @@
 #include <xen/cpumask.h>
 #include <xen/string.h>
 #include <xen/kernel.h>
+#include <xen/cache.h>
 #include <xen/ctype.h>
 #include <xen/init.h>
 #include <xen/param.h>
-#include <asm/cache.h>
 #include <asm/fixmap.h>
 #include <asm/mpspec.h>
 #include <asm/apicdef.h>
--- a/xen/arch/x86/guest/hypervisor.c
+++ b/xen/arch/x86/guest/hypervisor.c
@@ -6,11 +6,11 @@
  *
  * Copyright (c) 2019 Microsoft.
  */
+#include <xen/cache.h>
 #include <xen/cpumask.h>
 #include <xen/init.h>
 #include <xen/types.h>
 
-#include <asm/cache.h>
 #include <asm/guest.h>
 
 static struct hypervisor_ops __read_mostly ops;
--- a/xen/arch/x86/include/asm/cache.h
+++ b/xen/arch/x86/include/asm/cache.h
@@ -9,8 +9,6 @@
 #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
 
-#define __read_mostly __section(".data.read_mostly")
-
 #ifndef __ASSEMBLY__
 
 void cache_flush(const void *addr, unsigned int size);
--- a/xen/common/version.c
+++ b/xen/common/version.c
@@ -1,3 +1,4 @@
+#include <xen/cache.h>
 #include <xen/compile.h>
 #include <xen/init.h>
 #include <xen/errno.h>
@@ -8,8 +9,6 @@
 #include <xen/elf.h>
 #include <xen/version.h>
 
-#include <asm/cache.h>
-
 const char *xen_compile_date(void)
 {
     return XEN_COMPILE_DATE;
--- a/xen/include/xen/cache.h
+++ b/xen/include/xen/cache.h
@@ -15,6 +15,7 @@
 #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
 #endif
 
+#define __read_mostly   __section(".data.read_mostly")
 #define __ro_after_init __section(".data.ro_after_init")
 
 #endif /* __LINUX_CACHE_H */



 


Rackspace

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