xen: Remove legacy __read_mostly/__ro_after_init definitions
cover xen: Remove legacy __read_mostly/__ro_after_init definitions
This continues prior work done for PPC and RISCV. Patches 1-4 are some header rearranging for x86, with the convenient side effect of letting ARM fall out in the wash in patch 5.
I've done a reasonable amount of Gitlab CI work, but I cant claim to have tried every possible combination. RANDCONFIG might find some transitive paths I haven't spotted.
Andrew Cooper (5):
x86/build: Rework includes in genapic/probe.c xen/build: Drop unused includes of xen/cache.h x86/build: Swap cache.h includes for xen/sections.h x86/cache: Drop legacy __read_mostly/__ro_after_init definitions ARM/cache: Drop legacy __read_mostly/__ro_after_init definitions
xen/arch/arm/include/asm/cache.h | 3 --- xen/arch/x86/acpi/cpu_idle.c | 3 ++- xen/arch/x86/bzimage.c | 1 - xen/arch/x86/cpu-policy.c | 2 +- xen/arch/x86/dmi_scan.c | 1 - xen/arch/x86/genapic/probe.c | 34 +++++++++++++--------------- xen/arch/x86/guest/hypervisor.c | 2 +- xen/arch/x86/include/asm/cache.h | 3 --- xen/arch/x86/include/asm/genapic.h | 2 ++ xen/arch/x86/include/asm/processor.h | 1 - xen/common/decompress.h | 1 - xen/common/efi/runtime.c | 3 ++- xen/include/acpi/platform/aclinux.h | 1 - xen/include/xen/cache.h | 5 ---- xen/include/xen/lib.h | 1 + xen/include/xen/rcupdate.h | 1 - 16 files changed, 25 insertions(+), 39 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/5 x86/build: Rework includes in genapic/probe.c
probe.c includes a large number of headers which are unused, and not from churn so far as I can see in history. Strip back to a reasonable set.
One complication is that genapic.h has to include xen/cpumask.h because there's no way to forward declare a cpumask_t.
Also strip trailing whitespace while adjusting the file.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
--- xen/arch/x86/genapic/probe.c | 34 ++++++++++++++---------------- xen/arch/x86/include/asm/genapic.h | 2 ++ 2 files changed, 18 insertions(+), 18 deletions(-)
xen/arch/x86/genapic/probe.c +16 -18
@@ -1,25 +1,23 @@ -/* Copyright 2003 Andi Kleen, SuSE Labs. -* Subject to the GNU Public License, v.2 -* +/* Copyright 2003 Andi Kleen, SuSE Labs. +* Subject to the GNU Public License, v.2 +* * Generic x86 APIC driver probe layer. -*/ -#include <xen/cpumask.h> -#include <xen/string.h> -#include <xen/kernel.h> -#include <xen/ctype.h> +*/ +#include <xen/bug.h> +#include <xen/errno.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> -#include <asm/mach-generic/mach_apic.h> -#include <asm/setup.h> +#include <xen/sections.h> +#include <xen/string.h> +#include <xen/types.h> + +#include <asm/apic.h> +#include <asm/genapic.h> struct genapic __ro_after_init genapic; static const struct genapic *const __initconstrel apic_probe[] = { - &apic_bigsmp, + &apic_bigsmp, &apic_default,/* must be last */ NULL , };
@@ -57,8 +55,8 @@ static int __init cf_check genapic_apic_force(const char *str) }custom_param ("apic" , genapic_apic_force); -void __init generic_apic_probe (void ) -{ +void __init generic_apic_probe (void ) +{int i;record_boot_APIC_mode ();
@@ -75,4 +73,4 @@ void __init generic_apic_probe(void)BUG_ON (!genapic.name);printk (KERN_INFO "Using APIC driver %s\n" , genapic.name); -} +}
xen/arch/x86/include/asm/genapic.h +2 -0
@@ -1,6 +1,8 @@#ifndef _ASM_GENAPIC_H#define _ASM_GENAPIC_H 1 +#include <xen/cpumask.h> +/* * Generic APIC driver interface. *
Signature · 1 line
2.39.2
Re: [PATCH 1/5] x86/build: Rework includes in genapic/probe.c
Quoted 9 lines · Andrew Cooper
probe.cincludes a large number of headers which are unused, and not from churn so far as I can see in history. Strip back to a reasonable set.One complication is that
genapic.hhas to includexen/cpumask.hbecause there's no way to forward declare acpumask_t.Also strip trailing whitespace while adjusting the file.
Signed-off-by Andrew Cooper <[email protected]>
PATCH 2/5 xen/build: Drop unused includes of xen/cache.h
In reply to Andrew CooperNone of these are used, not even transitively.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
--- xen/arch/x86/bzimage.c | 1 - xen/arch/x86/dmi_scan.c | 1 - xen/arch/x86/include/asm/processor.h | 1 - xen/common/decompress.h | 1 - xen/include/acpi/platform/aclinux.h | 1 - xen/include/xen/rcupdate.h | 1 - 6 files changed, 6 deletions(-)
xen/arch/x86/bzimage.c +0 -1
@@ -1,4 +1,3 @@ -#include <xen/cache.h> #include <xen/errno.h> #include <xen/lib.h> #include <xen/mm.h>
xen/arch/x86/dmi_scan.c +0 -1
@@ -3,7 +3,6 @@#include <xen/kernel.h> #include <xen/string.h> #include <xen/init.h> -#include <xen/cache.h> #include <xen/acpi.h> #include <asm/io.h> #include <asm/system.h>
xen/arch/x86/include/asm/processor.h +0 -1
@@ -5,7 +5,6 @@#define __ASM_X86_PROCESSOR_H#ifndef __ASSEMBLY__ -#include <xen/cache.h> #include <xen/types.h> #include <xen/smp.h> #include <xen/percpu.h>
xen/common/decompress.h +0 -1
@@ -1,6 +1,5 @@#ifdef __XEN__ -#include <xen/cache.h> #include <xen/decompress.h> #include <xen/init.h> #include <xen/string.h>
xen/include/acpi/platform/aclinux.h +0 -1
@@ -47,7 +47,6 @@#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 -#include <xen/cache.h> #include <xen/string.h> #include <xen/kernel.h> #include <xen/ctype.h>
xen/include/xen/rcupdate.h +0 -1
@@ -31,7 +31,6 @@#ifndef __XEN_RCUPDATE_H#define __XEN_RCUPDATE_H -#include <xen/cache.h> #include <xen/compiler.h> #include <xen/spinlock.h> #include <xen/cpumask.h>
Signature · 1 line
2.39.2
Re: [PATCH 2/5] xen/build: Drop unused includes of xen/cache.h
Quoted 3 lines · Andrew Cooper
None of these are used, not even transitively.
Signed-off-by Andrew Cooper <[email protected]>
PATCH 3/5 x86/build: Swap cache.h includes for xen/sections.h
In reply to Andrew CooperThese include {xen/asm}/cache.h but only want xen/sections.h.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
--- xen/arch/x86/acpi/cpu_idle.c | 3 ++- xen/arch/x86/cpu-policy.c | 2 +- xen/arch/x86/guest/hypervisor.c | 2 +- xen/common/efi/runtime.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-)
xen/arch/x86/acpi/cpu_idle.c +2 -1
@@ -40,7 +40,8 @@#include <xen/param.h> #include <xen/trace.h> #include <xen/irq.h> -#include <asm/cache.h> +#include <xen/sections.h> +#include <asm/io.h> #include <asm/iocap.h> #include <asm/hpet.h>
xen/arch/x86/cpu-policy.c +1 -1
@@ -1,8 +1,8 @@/* SPDX-License-Identifier: GPL-2.0-or-later */ -#include <xen/cache.h> #include <xen/kernel.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/lib/x86/cpu-policy.h>
xen/arch/x86/guest/hypervisor.c +1 -1
@@ -8,9 +8,9 @@*/ #include <xen/cpumask.h> #include <xen/init.h> +#include <xen/sections.h> #include <xen/types.h> -#include <asm/cache.h> #include <asm/guest.h> static struct hypervisor_ops __ro_after_init ops;
xen/common/efi/runtime.c +2 -1
@@ -1,9 +1,10 @@#include "efi.h" #include "runtime.h" -#include <xen/cache.h> +#include <xen/errno.h> #include <xen/guest_access.h> #include <xen/irq.h> +#include <xen/sections.h> #include <xen/time.h> DEFINE_XEN_GUEST_HANDLE (CHAR16 );
Signature · 1 line
2.39.2
Re: [PATCH 3/5] x86/build: Swap cache.h includes for xen/sections.h
Quoted 3 lines · Andrew Cooper
These include {
xen/asm}/cache.hbut only wantxen/sections.h.Signed-off-by Andrew Cooper <[email protected]>
PATCH 4/5 x86/cache: Drop legacy __read_mostly/__ro_after_init definitions
In reply to Andrew CooperLots 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.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
--- 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(-)
xen/arch/x86/include/asm/cache.h +0 -3
@@ -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);
xen/include/xen/cache.h +1 -1
@@ -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
xen/include/xen/lib.h +1 -0
@@ -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. */ \
Signature · 1 line
2.39.2
Re: [PATCH 4/5] x86/cache: Drop legacy __read_mostly/__ro_after_init definitions
Quoted 6 lines · Andrew Cooper
Lots of files were picking these up transitively, including
lib.hHowever,
lib.hneeds__read_mostlyforprintk_once()and this has the side effect of kicking the transitive can down the road.Signed-off-by Andrew Cooper <[email protected]>
PATCH 5/5 ARM/cache: Drop legacy __read_mostly/__ro_after_init definitions
In reply to Andrew CooperThese are no longer needed.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
--- xen/arch/arm/include/asm/cache.h | 3 --- xen/include/xen/cache.h | 5 ----- 2 files changed, 8 deletions(-)
xen/arch/arm/include/asm/cache.h +0 -3
@@ -6,9 +6,6 @@#define L1_CACHE_SHIFT (CONFIG_ARM_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") -#endif /* * Local variables:
xen/include/xen/cache.h +0 -5
@@ -15,9 +15,4 @@#define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))#endif -#if defined(CONFIG_ARM ) -/* TODO: Phase out the use of this via cache.h */ -#define __ro_after_init __section(".data.ro_after_init") -#endif -#endif /* __LINUX_CACHE_H */
Signature · 1 line
2.39.2
Re: [PATCH 5/5] ARM/cache: Drop legacy __read_mostly/__ro_after_init definitions
Hi Andrew,
Quoted 3 lines · Andrew Cooper
These are no longer needed.
Signed-off-by Andrew Cooper <[email protected]>
Cheers,
Quoted 41 lines
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>--- xen/arch/arm/include/asm/cache.h | 3 --- xen/include/xen/cache.h | 5 ----- 2 files changed, 8 deletions(-)xen/arch/arm/include/asm/cache.h +0
-3@@ -6,9 +6,6 @@#define L1_CACHE_SHIFT (CONFIG_ARM_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") -#endif /* * Local variables: xen/include/xen/cache.h +0
-5@@ -15,9 +15,4 @@#define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))#endif -#if defined(CONFIG_ARM ) -/* TODO: Phase out the use of this via cache.h */ -#define __ro_after_init __section(".data.ro_after_init") -#endif -#endif /* __LINUX_CACHE_H */
Signature · 1 line
Julien Grall