diff mbox series

[1/3] xen/riscv: Drop legacy __ro_after_init definition

Message ID 20240621201928.319293-2-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen: build adjustments for __read_mostly/__ro_after_init | expand

Commit Message

Andrew Cooper June 21, 2024, 8:19 p.m. UTC
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.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: George Dunlap <George.Dunlap@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>

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(-)

Comments

Oleksii Kurochko June 24, 2024, 8:02 a.m. UTC | #1
On Fri, 2024-06-21 at 21:19 +0100, Andrew Cooper wrote:
> 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.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Shawn Anastasio <sanastasio@raptorengineering.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> CC: George Dunlap <George.Dunlap@citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> 
> 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(-)
> 
> diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> index 053f043a3d2a..3ebaf6da01cc 100644
> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -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>
> diff --git a/xen/include/xen/cache.h b/xen/include/xen/cache.h
> index 55456823c543..82a3ba38e3e7 100644
> --- a/xen/include/xen/cache.h
> +++ b/xen/include/xen/cache.h
> @@ -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
Why "defined(CONFIG_RISCV_64)" is missed?

~ Oleksii

>  
>  #endif /* __LINUX_CACHE_H */
Jan Beulich June 24, 2024, 8:04 a.m. UTC | #2
On 24.06.2024 10:02, Oleksii wrote:
> On Fri, 2024-06-21 at 21:19 +0100, Andrew Cooper wrote:
>> 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.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Shawn Anastasio <sanastasio@raptorengineering.com>
>> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> CC: George Dunlap <George.Dunlap@citrix.com>
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Julien Grall <julien@xen.org>
>>
>> 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(-)
>>
>> diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
>> index 053f043a3d2a..3ebaf6da01cc 100644
>> --- a/xen/arch/riscv/mm.c
>> +++ b/xen/arch/riscv/mm.c
>> @@ -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>
>> diff --git a/xen/include/xen/cache.h b/xen/include/xen/cache.h
>> index 55456823c543..82a3ba38e3e7 100644
>> --- a/xen/include/xen/cache.h
>> +++ b/xen/include/xen/cache.h
>> @@ -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
> Why "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
Oleksii Kurochko June 24, 2024, 12:50 p.m. UTC | #3
On Fri, 2024-06-21 at 21:19 +0100, Andrew Cooper wrote:
> 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.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii

> ---
> CC: Shawn Anastasio <sanastasio@raptorengineering.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> CC: George Dunlap <George.Dunlap@citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> 
> 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(-)
> 
> diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> index 053f043a3d2a..3ebaf6da01cc 100644
> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -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>
> diff --git a/xen/include/xen/cache.h b/xen/include/xen/cache.h
> index 55456823c543..82a3ba38e3e7 100644
> --- a/xen/include/xen/cache.h
> +++ b/xen/include/xen/cache.h
> @@ -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 */
Oleksii Kurochko June 24, 2024, 12:51 p.m. UTC | #4
On Mon, 2024-06-24 at 10:04 +0200, Jan Beulich wrote:
> On 24.06.2024 10:02, Oleksii wrote:
> > On Fri, 2024-06-21 at 21:19 +0100, Andrew Cooper wrote:
> > > 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.
> > > 
> > > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > > ---
> > > CC: Shawn Anastasio <sanastasio@raptorengineering.com>
> > > CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > > CC: George Dunlap <George.Dunlap@citrix.com>
> > > CC: Jan Beulich <JBeulich@suse.com>
> > > CC: Stefano Stabellini <sstabellini@kernel.org>
> > > CC: Julien Grall <julien@xen.org>
> > > 
> > > 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(-)
> > > 
> > > diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> > > index 053f043a3d2a..3ebaf6da01cc 100644
> > > --- a/xen/arch/riscv/mm.c
> > > +++ b/xen/arch/riscv/mm.c
> > > @@ -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>
> > > diff --git a/xen/include/xen/cache.h b/xen/include/xen/cache.h
> > > index 55456823c543..82a3ba38e3e7 100644
> > > --- a/xen/include/xen/cache.h
> > > +++ b/xen/include/xen/cache.h
> > > @@ -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
> > Why "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.
Thanks for the explanation. Now it makes sense to me.

~ Oleksii
diff mbox series

Patch

diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index 053f043a3d2a..3ebaf6da01cc 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -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>
diff --git a/xen/include/xen/cache.h b/xen/include/xen/cache.h
index 55456823c543..82a3ba38e3e7 100644
--- a/xen/include/xen/cache.h
+++ b/xen/include/xen/cache.h
@@ -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 */