xen: build adjustments for __read_mostly/__ro_after_init
cover xen: build adjustments for __read_mostly/__ro_after_init
In aid of getting the RISC-V build working without introducing more technical debt. It's done by making PPC shed it's copy of said technical debt.
Build tested quite thoroughly, including in Gitlab.
Andrew Cooper (3):
xen/riscv: Drop legacy __ro_after_init definition xen/ppc: Adjust ppc64_defconfig
xen/ppc: Avoid using the legacy __read_mostly/__ro_after_init
definitions
xen/arch/ppc/configs/ppc64_defconfig | 6 ------ xen/arch/ppc/include/asm/cache.h | 3 --- xen/arch/ppc/mm-radix.c | 1 + xen/arch/ppc/stubs.c | 7 +++++++ xen/arch/riscv/mm.c | 2 +- xen/common/argo.c | 1 + xen/common/cpu.c | 1 + xen/common/debugtrace.c | 1 + xen/common/domain.c | 1 + xen/common/event_channel.c | 2 ++ xen/common/keyhandler.c | 1 + xen/common/memory.c | 1 + xen/common/page_alloc.c | 1 + xen/common/pdx.c | 1 + xen/common/radix-tree.c | 1 + xen/common/random.c | 2 +- xen/common/rcupdate.c | 1 + xen/common/sched/core.c | 1 + xen/common/sched/cpupool.c | 1 + xen/common/sched/credit.c | 1 + xen/common/sched/credit2.c | 1 + xen/common/shutdown.c | 1 + xen/common/spinlock.c | 1 + xen/common/timer.c | 1 + xen/common/version.c | 3 +-- xen/common/virtual_region.c | 1 + xen/common/vmap.c | 2 +- xen/drivers/char/console.c | 1 + xen/drivers/char/ns16550.c | 1 + xen/drivers/char/serial.c | 2 +- xen/include/xen/cache.h | 2 ++ xen/include/xen/hypfs.h | 1 + 32 files changed, 38 insertions(+), 15 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/3 xen/riscv: Drop legacy __ro_after_init definition
Hide the legacy __ro_after_init definition in xen/cache.h for RISC-V, to avoid its use creeping in. Only mm.c needs adjusting as a consequence
No functional change.
---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342686294
--- xen/arch/riscv/mm.c | 2 +- xen/include/xen/cache.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
xen/arch/riscv/mm.c +1 -1
@@ -1,11 +1,11 @@/* SPDX-License-Identifier: GPL-2.0-only */ -#include <xen/cache.h> #include <xen/compiler.h> #include <xen/init.h> #include <xen/kernel.h> #include <xen/macros.h> #include <xen/pfn.h> +#include <xen/sections.h> #include <asm/early_printk.h> #include <asm/csr.h>
xen/include/xen/cache.h +2 -0
@@ -15,7 +15,9 @@#define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))#endif +#if defined(CONFIG_ARM ) || defined(CONFIG_X86 ) || defined(CONFIG_PPC64 )/* 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 1/3] xen/riscv: Drop legacy __ro_after_init definition
Quoted 46 lines · Andrew Cooper
Hide the legacy
__ro_after_initdefinition inxen/cache.hfor RISC-V, to avoid
its use creeping in. Onlymm.cneeds adjusting as a consequenceNo functional change.
Signed-off-by Andrew Cooper <[email protected]>---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342686294
---
xen/arch/riscv/mm.c | 2 +-
xen/include/xen/cache.h | 2 ++2 files changed, 3 insertions(+), 1 deletion(-)xen/arch/riscv/mm.c +0
-0@@ -1,11 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/cache.h>
#include <xen/compiler.h>
#include <xen/init.h>
#include <xen/kernel.h>
#include <xen/macros.h>
#include <xen/pfn.h>
+#include <xen/sections.h>
#include <asm/early_printk.h>
#include <asm/csr.h>xen/include/xen/cache.h +0
-0@@ -15,7 +15,9 @@ #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) #endif
Quoted 6 lines
+#ifdefined(CONFIG_ARM)||defined(CONFIG_X86)||defined(CONFIG_PPC64)
/* TODO: Phase out the use of this viacache.h*/ #define__ro_after_init__section(".data.ro_after_init")+#endif
Why "defined(CONFIG_RISCV_64)" is missed?
~ Oleksii
Quoted 2 lines
#endif /*__LINUX_CACHE_H*/
Re: [PATCH 1/3] xen/riscv: Drop legacy __ro_after_init definition
Quoted 46 lines · Oleksii
Quoted 45 lines · Andrew Cooper
Hide the legacy
__ro_after_initdefinition inxen/cache.hfor RISC-V, to avoid
its use creeping in. Onlymm.cneeds adjusting as a consequenceNo functional change.
Signed-off-by Andrew Cooper <[email protected]>---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342686294
---
xen/arch/riscv/mm.c | 2 +-
xen/include/xen/cache.h | 2 ++2 files changed, 3 insertions(+), 1 deletion(-)xen/arch/riscv/mm.c +0
-0@@ -1,11 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/cache.h>
#include <xen/compiler.h>
#include <xen/init.h>
#include <xen/kernel.h>
#include <xen/macros.h>
#include <xen/pfn.h>
+#include <xen/sections.h>
#include <asm/early_printk.h>
#include <asm/csr.h>xen/include/xen/cache.h +0
-0@@ -15,7 +15,9 @@ #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
Quoted 8 lines
Quoted 7 lines
xen/include/xen/cache.h +0
-0#endif
+#ifdefined(CONFIG_ARM)||defined(CONFIG_X86)||defined(CONFIG_PPC64)
/* TODO: Phase out the use of this viacache.h*/ #define__ro_after_init__section(".data.ro_after_init")+#endifWhy "
defined(CONFIG_RISCV_64)" is missed?
The TODO is being addressed by this patch for RISC-V. See how a subsequent patch also drops CONFIG_PPC64.
Jan
Re: [PATCH 1/3] xen/riscv: Drop legacy __ro_after_init definition
Quoted 57 lines · Jan Beulich
Quoted 47 lines · Oleksii
Quoted 46 lines · Andrew Cooper
Hide the legacy
__ro_after_initdefinition inxen/cache.hfor RISC-V,
to avoid
its use creeping in. Onlymm.cneeds adjusting as a consequenceNo functional change.
Signed-off-by Andrew Cooper <[email protected]>---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342686294
---
xen/arch/riscv/mm.c | 2 +-
xen/include/xen/cache.h | 2 ++2 files changed, 3 insertions(+), 1 deletion(-)xen/arch/riscv/mm.c +0
-0@@ -1,11 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/cache.h>
#include <xen/compiler.h>
#include <xen/init.h>
#include <xen/kernel.h>
#include <xen/macros.h>
#include <xen/pfn.h>
+#include <xen/sections.h>
#include <asm/early_printk.h>
#include <asm/csr.h>xen/include/xen/cache.h +0
-0@@ -15,7 +15,9 @@ #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))Quoted 8 lines
Quoted 7 lines
xen/include/xen/cache.h +0
-0#endif
+#ifdefined(CONFIG_ARM)||defined(CONFIG_X86)||defined(CONFIG_PPC64)
/* TODO: Phase out the use of this viacache.h*/ #define__ro_after_init__section(".data.ro_after_init")+#endifWhy "
defined(CONFIG_RISCV_64)" is missed?
Quoted 3 lines
The TODO is being addressed by this patch for RISC-V. See how a subsequent
patch also dropsCONFIG_PPC64.
Thanks for the explanation. Now it makes sense to me.
~ Oleksii
Re: [PATCH 1/3] xen/riscv: Drop legacy __ro_after_init definition
In reply to Andrew CooperQuoted 7 lines · Andrew Cooper
Hide the legacy
__ro_after_initdefinition inxen/cache.hfor RISC-V, to avoid
its use creeping in. Onlymm.cneeds adjusting as a consequenceNo functional change.
Signed-off-by Andrew Cooper <[email protected]>
~ Oleksii
Quoted 47 lines
---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342686294
---
xen/arch/riscv/mm.c | 2 +-
xen/include/xen/cache.h | 2 ++2 files changed, 3 insertions(+), 1 deletion(-)xen/arch/riscv/mm.c +0
-0@@ -1,11 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/cache.h>
#include <xen/compiler.h>
#include <xen/init.h>
#include <xen/kernel.h>
#include <xen/macros.h>
#include <xen/pfn.h>
+#include <xen/sections.h>
#include <asm/early_printk.h>
#include <asm/csr.h>xen/include/xen/cache.h +0
-0@@ -15,7 +15,9 @@ #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) #endif
+#ifdefined(CONFIG_ARM)||defined(CONFIG_X86)||defined(CONFIG_PPC64)
/* TODO: Phase out the use of this viacache.h*/ #define__ro_after_init__section(".data.ro_after_init")+#endif
#endif /*__LINUX_CACHE_H*/
PATCH 2/3 xen/ppc: Adjust ppc64_defconfig
In reply to Andrew CooperAll of CONFIG_SCHED_*, and CONFIG_HYPFS build fine.
Add a stub for share_xen_page_with_guest(), which is all that is necessary to make CONFIG_TRACEBUFFER build.
No functional change.
---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342672505
This is in aid of getting wider compiler coverage with the subseqeuent patch
--- xen/arch/ppc/configs/ppc64_defconfig | 6 ------ xen/arch/ppc/stubs.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-)
xen/arch/ppc/configs/ppc64_defconfig +0 -6
@@ -1,9 +1,3 @@ -# CONFIG_SCHED_CREDIT is not set -# CONFIG_SCHED_RTDS is not set -# CONFIG_SCHED_NULL is not set -# CONFIG_SCHED_ARINC653 is not set -# CONFIG_TRACEBUFFER is not set -# CONFIG_HYPFS is not set # CONFIG_GRANT_TABLE is not set # CONFIG_SPECULATIVE_HARDEN_ARRAY is not set # CONFIG_MEM_ACCESS is not set
xen/arch/ppc/stubs.c +6 -0
@@ -333,3 +333,9 @@ void udelay(unsigned long usecs) {BUG_ON ("unimplemented" ); } + +void share_xen_page_with_guest (struct page_info *page,struct domain *d, +enum XENSHARE_flags flags) +{ +BUG_ON ("unimplemented" ); +}
Signature · 1 line
2.39.2
[ping] Re: [PATCH 2/3] xen/ppc: Adjust ppc64_defconfig
Quoted 52 lines · Andrew Cooper
All of CONFIG_SCHED_*, and
CONFIG_HYPFSbuild fine.Add a stub for
share_xen_page_with_guest(), which is all that is necessary to makeCONFIG_TRACEBUFFERbuild.No functional change.
Signed-off-by Andrew Cooper <[email protected]>---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342672505
This is in aid of getting wider compiler coverage with the subseqeuent patch
--- xen/arch/ppc/configs/ppc64_defconfig | 6 ------ xen/arch/ppc/stubs.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-)xen/arch/ppc/configs/ppc64_defconfig +0
-6@@ -1,9 +1,3 @@ -# CONFIG_SCHED_CREDIT is not set -# CONFIG_SCHED_RTDS is not set -# CONFIG_SCHED_NULL is not set -# CONFIG_SCHED_ARINC653 is not set -# CONFIG_TRACEBUFFER is not set -# CONFIG_HYPFS is not set # CONFIG_GRANT_TABLE is not set # CONFIG_SPECULATIVE_HARDEN_ARRAY is not set # CONFIG_MEM_ACCESS is not setxen/arch/ppc/stubs.c +6
-0@@ -333,3 +333,9 @@ void udelay(unsigned long usecs) {BUG_ON ("unimplemented" ); } + +void share_xen_page_with_guest (struct page_info *page,struct domain *d, +enum XENSHARE_flags flags) +{ +BUG_ON ("unimplemented" ); +}
Jan Beulich
Acked-byRe: [ping] Re: [PATCH 2/3] xen/ppc: Adjust ppc64_defconfig
Quoted 9 lines · Andrew Cooper
Quoted 8 lines · Andrew Cooper
All of CONFIG_SCHED_*, and
CONFIG_HYPFSbuild fine.Add a stub for
share_xen_page_with_guest(), which is all that is necessary to makeCONFIG_TRACEBUFFERbuild.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
PATCH 3/3 xen/ppc: Avoid using the legacy __read_mostly/__ro_after_init definitions
In reply to Andrew CooperRISC-V wants to introduce a full build of Xen without using the legacy definitions. PPC64 has the most minimal full build of Xen right now, so make it compile without the legacy definitions.
Mostly this is just including xen/sections.h in a variety of common files. In a couple of cases, we can drop an inclusion of {xen,asm}/cache.h, but almost all files get the definitions transitively.
No functional change.
---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342714126
--- xen/arch/ppc/include/asm/cache.h | 3 --- xen/arch/ppc/mm-radix.c | 1 + xen/arch/ppc/stubs.c | 1 + xen/common/argo.c | 1 + xen/common/cpu.c | 1 + xen/common/debugtrace.c | 1 + xen/common/domain.c | 1 + xen/common/event_channel.c | 2 ++ xen/common/keyhandler.c | 1 + xen/common/memory.c | 1 + xen/common/page_alloc.c | 1 + xen/common/pdx.c | 1 + xen/common/radix-tree.c | 1 + xen/common/random.c | 2 +- xen/common/rcupdate.c | 1 + xen/common/sched/core.c | 1 + xen/common/sched/cpupool.c | 1 + xen/common/sched/credit.c | 1 + xen/common/sched/credit2.c | 1 + xen/common/shutdown.c | 1 + xen/common/spinlock.c | 1 + xen/common/timer.c | 1 + xen/common/version.c | 3 +-- xen/common/virtual_region.c | 1 + xen/common/vmap.c | 2 +- xen/drivers/char/console.c | 1 + xen/drivers/char/ns16550.c | 1 + xen/drivers/char/serial.c | 2 +- xen/include/xen/cache.h | 2 +- xen/include/xen/hypfs.h | 1 + 30 files changed, 30 insertions(+), 9 deletions(-)
xen/arch/ppc/include/asm/cache.h +0 -3
@@ -3,7 +3,4 @@#ifndef _ASM_PPC_CACHE_H#define _ASM_PPC_CACHE_H -/* TODO: Phase out the use of this via cache.h */ -#define __read_mostly __section(".data.read_mostly") -#endif /* _ASM_PPC_CACHE_H */
xen/arch/ppc/mm-radix.c +1 -0
@@ -2,6 +2,7 @@#include <xen/init.h> #include <xen/kernel.h> #include <xen/mm.h> +#include <xen/sections.h> #include <xen/types.h> #include <xen/lib.h>
xen/arch/ppc/stubs.c +1 -0
@@ -3,6 +3,7 @@#include <xen/domain.h> #include <xen/irq.h> #include <xen/nodemask.h> +#include <xen/sections.h> #include <xen/time.h> #include <public/domctl.h> #include <public/vm_event.h>
xen/common/argo.c +1 -0
@@ -25,6 +25,7 @@#include <xen/nospec.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/time.h> #include <xsm/xsm.h>
xen/common/cpu.c +1 -0
@@ -3,6 +3,7 @@#include <xen/event.h> #include <xen/init.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/stop_machine.h> #include <xen/rcupdate.h>
xen/common/debugtrace.c +1 -0
@@ -13,6 +13,7 @@#include <xen/mm.h> #include <xen/param.h> #include <xen/percpu.h> +#include <xen/sections.h> #include <xen/serial.h> #include <xen/smp.h> #include <xen/spinlock.h>
xen/common/domain.c +1 -0
@@ -11,6 +11,7 @@#include <xen/err.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/mm.h> #include <xen/event.h>
xen/common/event_channel.c +2 -0
@@ -26,6 +26,8 @@#include <xen/guest_access.h> #include <xen/hypercall.h> #include <xen/keyhandler.h> +#include <xen/sections.h> +#include <asm/current.h> #include <public/xen.h>
xen/common/keyhandler.c +1 -0
@@ -6,6 +6,7 @@#include <xen/delay.h> #include <xen/keyhandler.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/shutdown.h> #include <xen/event.h> #include <xen/console.h>
xen/common/memory.c +1 -0
@@ -23,6 +23,7 @@#include <xen/param.h> #include <xen/perfc.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/trace.h> #include <xen/types.h> #include <asm/current.h>
xen/common/page_alloc.c +1 -0
@@ -134,6 +134,7 @@#include <xen/pfn.h> #include <xen/types.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/softirq.h> #include <xen/spinlock.h>
xen/common/pdx.c +1 -0
@@ -19,6 +19,7 @@#include <xen/mm.h> #include <xen/bitops.h> #include <xen/nospec.h> +#include <xen/sections.h> /** * Maximum (non-inclusive) usable pdx. Must be
xen/common/radix-tree.c +1 -0
@@ -21,6 +21,7 @@#include <xen/init.h> #include <xen/radix-tree.h> #include <xen/errno.h> +#include <xen/sections.h> struct radix_tree_path {struct radix_tree_node *node;
xen/common/random.c +1 -1
@@ -1,6 +1,6 @@ -#include <xen/cache.h> #include <xen/init.h> #include <xen/percpu.h> +#include <xen/sections.h> #include <xen/random.h> #include <xen/time.h> #include <asm/random.h>
xen/common/rcupdate.c +1 -0
@@ -35,6 +35,7 @@#include <xen/kernel.h> #include <xen/init.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/spinlock.h> #include <xen/smp.h> #include <xen/rcupdate.h>
xen/common/sched/core.c +1 -0
@@ -18,6 +18,7 @@#include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/event.h>
xen/common/sched/cpupool.c +1 -0
@@ -22,6 +22,7 @@#include <xen/param.h> #include <xen/percpu.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/warning.h> #include "private.h"
xen/common/sched/credit.c +1 -0
@@ -12,6 +12,7 @@#include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/event.h>
xen/common/sched/credit2.c +1 -0
@@ -14,6 +14,7 @@#include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/event.h>
xen/common/shutdown.c +1 -0
@@ -2,6 +2,7 @@#include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/watchdog.h>
xen/common/spinlock.c +1 -0
@@ -5,6 +5,7 @@#include <xen/param.h> #include <xen/smp.h> #include <xen/time.h> +#include <xen/sections.h> #include <xen/spinlock.h> #include <xen/guest_access.h> #include <xen/preempt.h>
xen/common/timer.c +1 -0
@@ -11,6 +11,7 @@#include <xen/sched.h> #include <xen/lib.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/smp.h> #include <xen/perfc.h> #include <xen/time.h>
xen/common/version.c +1 -2
@@ -3,14 +3,13 @@#include <xen/init.h> #include <xen/errno.h> #include <xen/lib.h> +#include <xen/sections.h> #include <xen/string.h> #include <xen/types.h> #include <xen/efi.h> #include <xen/elf.h> #include <xen/version.h> -#include <asm/cache.h> -const char *xen_compile_date (void ) {return XEN_COMPILE_DATE ;
xen/common/virtual_region.c +1 -0
@@ -6,6 +6,7 @@#include <xen/kernel.h> #include <xen/mm.h> #include <xen/rcupdate.h> +#include <xen/sections.h> #include <xen/spinlock.h> #include <xen/virtual_region.h>
xen/common/vmap.c +1 -1
@@ -1,6 +1,6 @@#ifdef VMAP_VIRT_START #include <xen/bitmap.h> -#include <xen/cache.h> +#include <xen/sections.h> #include <xen/init.h> #include <xen/mm.h> #include <xen/pfn.h>
xen/drivers/char/console.c +1 -0
@@ -32,6 +32,7 @@#include <xen/warning.h> #include <xen/pv_console.h> #include <asm/setup.h> +#include <xen/sections.h> #ifdef CONFIG_X86 #include <xen/consoled.h>
xen/drivers/char/ns16550.c +1 -0
@@ -22,6 +22,7 @@#include <xen/irq.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/timer.h> #include <xen/serial.h> #include <xen/iocap.h>
xen/drivers/char/serial.c +1 -1
@@ -10,8 +10,8 @@#include <xen/init.h> #include <xen/mm.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/serial.h> -#include <xen/cache.h> #include <asm/processor.h>
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 ) || defined(CONFIG_PPC64 ) +#if defined(CONFIG_ARM ) || defined(CONFIG_X86 )/* TODO: Phase out the use of this via cache.h */ #define __ro_after_init __section(".data.ro_after_init")#endif
xen/include/xen/hypfs.h +1 -0
@@ -4,6 +4,7 @@#ifdef CONFIG_HYPFS #include <xen/lib.h> #include <xen/list.h> +#include <xen/sections.h> #include <xen/string.h> #include <public/hypfs.h>
Signature · 1 line
2.39.2
Re: [PATCH 3/3] xen/ppc: Avoid using the legacy __read_mostly/__ro_after_init definitions
Quoted 11 lines · Andrew Cooper
RISC-V wants to introduce a full build of Xen without using the legacy definitions. PPC64 has the most minimal full build of Xen right now, so make it compile without the legacy definitions.
Mostly this is just including
xen/sections.hin a variety of common files. In a couple of cases, we can drop an inclusion of {xen,asm}/cache.h, but almost all files get the definitions transitively.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
Re: [PATCH 3/3] xen/ppc: Avoid using the legacy __read_mostly/__ro_after_init definitions
In reply to Andrew CooperQuoted 12 lines · Andrew Cooper
RISC-V wants to introduce a full build of Xen without using the legacy
definitions. PPC64 has the most minimal full build of Xen right now, so make
it compile without the legacy definitions.Mostly this is just including
xen/sections.hin a variety of common files. In
a couple of cases, we can drop an inclusion of {xen,asm}/cache.h, but almost
all files get the definitions transitively.
Quoted 3 lines
No functional change.
Signed-off-by Andrew Cooper <[email protected]>
~ Oleskii
Quoted 418 lines
---
CC: Shawn Anastasio <[email protected]>
CC: Oleksii Kurochko <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1342714126
---
xen/arch/ppc/include/asm/cache.h | 3 ---
xen/arch/ppc/mm-radix.c | 1 +
xen/arch/ppc/stubs.c | 1 +
xen/common/argo.c | 1 +
xen/common/cpu.c | 1 +
xen/common/debugtrace.c | 1 +
xen/common/domain.c | 1 +
xen/common/event_channel.c | 2 ++
xen/common/keyhandler.c | 1 +
xen/common/memory.c | 1 +
xen/common/page_alloc.c | 1 +
xen/common/pdx.c | 1 +
xen/common/radix-tree.c | 1 +
xen/common/random.c | 2 +-
xen/common/rcupdate.c | 1 +
xen/common/sched/core.c | 1 +
xen/common/sched/cpupool.c | 1 +
xen/common/sched/credit.c | 1 +
xen/common/sched/credit2.c | 1 +
xen/common/shutdown.c | 1 +
xen/common/spinlock.c | 1 +
xen/common/timer.c | 1 +
xen/common/version.c | 3 +--
xen/common/virtual_region.c | 1 +
xen/common/vmap.c | 2 +-
xen/drivers/char/console.c | 1 +
xen/drivers/char/ns16550.c | 1 +
xen/drivers/char/serial.c | 2 +-
xen/include/xen/cache.h | 2 +-
xen/include/xen/hypfs.h | 1 +30 files changed, 30 insertions(+), 9 deletions(-)xen/arch/ppc/include/asm/cache.h +0
-0@@ -3,7 +3,4 @@ #ifndef _ASM_PPC_CACHE_H #define _ASM_PPC_CACHE_Hxen/arch/ppc/include/asm/cache.h +0
-3-/* TODO: Phase out the use of this via cache.h */ -#define __read_mostly __section(".data.read_mostly") -#endif /*
_ASM_PPC_CACHE_H*/xen/arch/ppc/mm-radix.c +1
-0@@ -2,6 +2,7 @@ #include <xen/init.h> #include <xen/kernel.h> #include <xen/mm.h> +#include <xen/sections.h> #include <xen/types.h> #include <xen/lib.h>xen/arch/ppc/stubs.c +1
-0@@ -3,6 +3,7 @@ #include <xen/domain.h> #include <xen/irq.h> #include <xen/nodemask.h> +#include <xen/sections.h> #include <xen/time.h> #include <public/domctl.h> #include <public/vm_event.h>xen/common/argo.c +1
-0@@ -25,6 +25,7 @@ #include <xen/nospec.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/time.h>
#include <xsm/xsm.h>xen/common/cpu.c +1
-0@@ -3,6 +3,7 @@ #include <xen/event.h> #include <xen/init.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/stop_machine.h> #include <xen/rcupdate.h>xen/common/debugtrace.c +1
-0@@ -13,6 +13,7 @@ #include <xen/mm.h> #include <xen/param.h> #include <xen/percpu.h> +#include <xen/sections.h> #include <xen/serial.h> #include <xen/smp.h> #include <xen/spinlock.h>xen/common/domain.c +1
-0@@ -11,6 +11,7 @@ #include <xen/err.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/mm.h> #include <xen/event.h>xen/common/event_channel.c +2
-0@@ -26,6 +26,8 @@ #include <xen/guest_access.h> #include <xen/hypercall.h> #include <xen/keyhandler.h> +#include <xen/sections.h> + #include <asm/current.h>
#include <public/xen.h>xen/common/keyhandler.c +1
-0@@ -6,6 +6,7 @@ #include <xen/delay.h> #include <xen/keyhandler.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/shutdown.h> #include <xen/event.h> #include <xen/console.h>xen/common/memory.c +1
-0@@ -23,6 +23,7 @@ #include <xen/param.h> #include <xen/perfc.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/trace.h> #include <xen/types.h> #include <asm/current.h>xen/common/page_alloc.c +1
-0@@ -134,6 +134,7 @@ #include <xen/pfn.h> #include <xen/types.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/softirq.h> #include <xen/spinlock.h>xen/common/pdx.c +1
-0@@ -19,6 +19,7 @@ #include <xen/mm.h> #include <xen/bitops.h> #include <xen/nospec.h> +#include <xen/sections.h>
/**
* Maximum (non-inclusive) usable pdx. Must bexen/common/radix-tree.c +1
-0@@ -21,6 +21,7 @@ #include <xen/init.h> #include <xen/radix-tree.h> #include <xen/errno.h> +#include <xen/sections.h>
structradix_tree_path{
structradix_tree_node*node;xen/common/random.c +1
-1@@ -1,6 +1,6 @@ -#include <xen/cache.h> #include <xen/init.h> #include <xen/percpu.h> +#include <xen/sections.h> #include <xen/random.h> #include <xen/time.h> #include <asm/random.h>xen/common/rcupdate.c +1
-0@@ -35,6 +35,7 @@ #include <xen/kernel.h> #include <xen/init.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/spinlock.h> #include <xen/smp.h> #include <xen/rcupdate.h>xen/common/sched/core.c +1
-0@@ -18,6 +18,7 @@ #include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/event.h>xen/common/sched/cpupool.c +1
-0@@ -22,6 +22,7 @@ #include <xen/param.h> #include <xen/percpu.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/warning.h>
#include "private.h"xen/common/sched/credit.c +1
-0@@ -12,6 +12,7 @@ #include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/event.h>xen/common/sched/credit2.c +1
-0@@ -14,6 +14,7 @@ #include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/event.h>xen/common/shutdown.c +1
-0@@ -2,6 +2,7 @@ #include <xen/lib.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/domain.h> #include <xen/delay.h> #include <xen/watchdog.h>xen/common/spinlock.c +1
-0@@ -5,6 +5,7 @@ #include <xen/param.h> #include <xen/smp.h> #include <xen/time.h> +#include <xen/sections.h> #include <xen/spinlock.h> #include <xen/guest_access.h> #include <xen/preempt.h>xen/common/timer.c +1
-0@@ -11,6 +11,7 @@ #include <xen/sched.h> #include <xen/lib.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/smp.h> #include <xen/perfc.h> #include <xen/time.h>xen/common/version.c +1
-0@@ -3,14 +3,13 @@ #include <xen/init.h> #include <xen/errno.h> #include <xen/lib.h> +#include <xen/sections.h> #include <xen/string.h> #include <xen/types.h> #include <xen/efi.h> #include <xen/elf.h> #include <xen/version.h>xen/common/version.c +0
-2-#include <asm/cache.h> -const char
*xen_compile_date(void)
{
returnXEN_COMPILE_DATE;xen/common/virtual_region.c +1
-0@@ -6,6 +6,7 @@ #include <xen/kernel.h> #include <xen/mm.h> #include <xen/rcupdate.h> +#include <xen/sections.h> #include <xen/spinlock.h> #include <xen/virtual_region.h>xen/common/vmap.c +1
-1@@ -1,6 +1,6 @@ #ifdef VMAP_VIRT_START #include <xen/bitmap.h> -#include <xen/cache.h> +#include <xen/sections.h> #include <xen/init.h> #include <xen/mm.h> #include <xen/pfn.h>xen/drivers/char/console.c +1
-0@@ -32,6 +32,7 @@ #include <xen/warning.h> #include <xen/pv_console.h> #include <asm/setup.h> +#include <xen/sections.h>
#ifdefCONFIG_X86
#include <xen/consoled.h>xen/drivers/char/ns16550.c +1
-0@@ -22,6 +22,7 @@ #include <xen/irq.h> #include <xen/param.h> #include <xen/sched.h> +#include <xen/sections.h> #include <xen/timer.h> #include <xen/serial.h> #include <xen/iocap.h>xen/drivers/char/serial.c +1
-1@@ -10,8 +10,8 @@ #include <xen/init.h> #include <xen/mm.h> #include <xen/param.h> +#include <xen/sections.h> #include <xen/serial.h> -#include <xen/cache.h>
#include <asm/processor.h>xen/include/xen/cache.h +0
-0@@ -15,7 +15,7 @@ #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) #endif
-#ifdefined(CONFIG_ARM)||defined(CONFIG_X86)||defined(CONFIG_PPC64)
+#ifdefined(CONFIG_ARM)||defined(CONFIG_X86)/* TODO: Phase out the use of this viacache.h*/ #define__ro_after_init__section(".data.ro_after_init")#endifxen/include/xen/hypfs.h +1
-0@@ -4,6 +4,7 @@ #ifdef CONFIG_HYPFS #include <xen/lib.h> #include <xen/list.h> +#include <xen/sections.h> #include <xen/string.h> #include <public/hypfs.h>
Quoted 5 lines · Andrew Cooper
In aid of getting the RISC-V build working without introducing more technical
debt. It's done by making PPC shed it's copy of said technical debt.Build tested quite thoroughly, including in Gitlab.
~ Oleksii
Quoted 41 lines
Andrew Cooper (3):
xen/riscv: Drop legacy__ro_after_initdefinition xen/ppc: Adjustppc64_defconfig
xen/ppc: Avoid using the legacy __read_mostly/__ro_after_init definitionsxen/arch/ppc/configs/ppc64_defconfig | 6 ------
xen/arch/ppc/include/asm/cache.h | 3 ---
xen/arch/ppc/mm-radix.c | 1 +
xen/arch/ppc/stubs.c | 7 +++++++
xen/arch/riscv/mm.c | 2 +-
xen/common/argo.c | 1 +
xen/common/cpu.c | 1 +
xen/common/debugtrace.c | 1 +
xen/common/domain.c | 1 +
xen/common/event_channel.c | 2 ++
xen/common/keyhandler.c | 1 +
xen/common/memory.c | 1 +
xen/common/page_alloc.c | 1 +
xen/common/pdx.c | 1 +
xen/common/radix-tree.c | 1 +
xen/common/random.c | 2 +-
xen/common/rcupdate.c | 1 +
xen/common/sched/core.c | 1 +
xen/common/sched/cpupool.c | 1 +
xen/common/sched/credit.c | 1 +
xen/common/sched/credit2.c | 1 +
xen/common/shutdown.c | 1 +
xen/common/spinlock.c | 1 +
xen/common/timer.c | 1 +
xen/common/version.c | 3 +--
xen/common/virtual_region.c | 1 +
xen/common/vmap.c | 2 +-
xen/drivers/char/console.c | 1 +
xen/drivers/char/ns16550.c | 1 +
xen/drivers/char/serial.c | 2 +-
xen/include/xen/cache.h | 2 ++
xen/include/xen/hypfs.h | 1 +32 files changed, 38 insertions(+), 15 deletions(-)