diff mbox series

[4/5] x86/cache: Drop legacy __read_mostly/__ro_after_init definitions

Message ID 20240905220806.141300-5-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series xen: Remove legacy __read_mostly/__ro_after_init definitions | expand

Commit Message

Andrew Cooper Sept. 5, 2024, 10:08 p.m. UTC
Lots of files were picking these up transitively, including lib.h

However, lib.h needs __read_mostly for printk_once() and this has the side
effect of kicking the transitive can down the road.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/x86/include/asm/cache.h | 3 ---
 xen/include/xen/cache.h          | 2 +-
 xen/include/xen/lib.h            | 1 +
 3 files changed, 2 insertions(+), 4 deletions(-)

Comments

Jan Beulich Sept. 9, 2024, 11:59 a.m. UTC | #1
On 06.09.2024 00:08, Andrew Cooper wrote:
> Lots of files were picking these up transitively, including lib.h
> 
> However, lib.h needs __read_mostly for printk_once() and this has the side
> effect of kicking the transitive can down the road.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/include/asm/cache.h b/xen/arch/x86/include/asm/cache.h
index 956c05493e23..f15d10dc7f2d 100644
--- a/xen/arch/x86/include/asm/cache.h
+++ b/xen/arch/x86/include/asm/cache.h
@@ -9,9 +9,6 @@ 
 #define L1_CACHE_SHIFT	(CONFIG_X86_L1_CACHE_SHIFT)
 #define L1_CACHE_BYTES	(1 << L1_CACHE_SHIFT)
 
-/* TODO: Phase out the use of this via cache.h */
-#define __read_mostly __section(".data.read_mostly")
-
 #ifndef __ASSEMBLY__
 
 void cache_flush(const void *addr, unsigned int size);
diff --git a/xen/include/xen/cache.h b/xen/include/xen/cache.h
index a19942fd63ef..90816ba05b1a 100644
--- a/xen/include/xen/cache.h
+++ b/xen/include/xen/cache.h
@@ -15,7 +15,7 @@ 
 #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
 #endif
 
-#if defined(CONFIG_ARM) || defined(CONFIG_X86)
+#if defined(CONFIG_ARM)
 /* TODO: Phase out the use of this via cache.h */
 #define __ro_after_init __section(".data.ro_after_init")
 #endif
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index e884a02ee8ce..81b722ea3e80 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -10,6 +10,7 @@ 
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/string.h>
+#include <xen/sections.h>
 
 #define __ACCESS_ONCE(x) ({                             \
             (void)(typeof(x))0; /* Scalar typecheck. */ \