diff mbox series

[v1,2/8] xen/riscv: add .sbss section to .bss

Message ID 6a0f3171323f0092b8374f2244182c7e7ca850c0.1686080337.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series xen/riscv: introduce identity mapping | expand

Commit Message

Oleksii June 6, 2023, 7:55 p.m. UTC
Sometimes variables are located in .sbss section but it won't
be mapped after MMU will be enabled.
To avoid MMU failures .sbss should be mapped

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/xen.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alistair Francis June 12, 2023, 5:09 a.m. UTC | #1
On Wed, Jun 7, 2023 at 5:55 AM Oleksii Kurochko
<oleksii.kurochko@gmail.com> wrote:
>
> Sometimes variables are located in .sbss section but it won't
> be mapped after MMU will be enabled.
> To avoid MMU failures .sbss should be mapped
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  xen/arch/riscv/xen.lds.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
> index 74afbaab9b..9a2799bab5 100644
> --- a/xen/arch/riscv/xen.lds.S
> +++ b/xen/arch/riscv/xen.lds.S
> @@ -151,7 +151,7 @@ SECTIONS
>          *(.bss.percpu.read_mostly)
>          . = ALIGN(SMP_CACHE_BYTES);
>          __per_cpu_data_end = .;
> -        *(.bss .bss.*)
> +        *(.bss .bss.* .sbss)
>          . = ALIGN(POINTER_ALIGN);
>          __bss_end = .;
>      } :text
> --
> 2.40.1
>
>
Jan Beulich June 12, 2023, 7:04 a.m. UTC | #2
On 06.06.2023 21:55, Oleksii Kurochko wrote:
> Sometimes variables are located in .sbss section but it won't
> be mapped after MMU will be enabled.
> To avoid MMU failures .sbss should be mapped
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  xen/arch/riscv/xen.lds.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
> index 74afbaab9b..9a2799bab5 100644
> --- a/xen/arch/riscv/xen.lds.S
> +++ b/xen/arch/riscv/xen.lds.S
> @@ -151,7 +151,7 @@ SECTIONS
>          *(.bss.percpu.read_mostly)
>          . = ALIGN(SMP_CACHE_BYTES);
>          __per_cpu_data_end = .;
> -        *(.bss .bss.*)
> +        *(.bss .bss.* .sbss)
>          . = ALIGN(POINTER_ALIGN);
>          __bss_end = .;
>      } :text

Two remarks, despite Alistair's ack: Wouldn't it be better to add .sbss.*
right away as well? And strictly speaking wouldn't it be more logical to
have .sbss ahead of .bss?

Jan
Oleksii June 13, 2023, 5:41 p.m. UTC | #3
On Mon, 2023-06-12 at 09:04 +0200, Jan Beulich wrote:
> On 06.06.2023 21:55, Oleksii Kurochko wrote:
> > Sometimes variables are located in .sbss section but it won't
> > be mapped after MMU will be enabled.
> > To avoid MMU failures .sbss should be mapped
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> >  xen/arch/riscv/xen.lds.S | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
> > index 74afbaab9b..9a2799bab5 100644
> > --- a/xen/arch/riscv/xen.lds.S
> > +++ b/xen/arch/riscv/xen.lds.S
> > @@ -151,7 +151,7 @@ SECTIONS
> >          *(.bss.percpu.read_mostly)
> >          . = ALIGN(SMP_CACHE_BYTES);
> >          __per_cpu_data_end = .;
> > -        *(.bss .bss.*)
> > +        *(.bss .bss.* .sbss)
> >          . = ALIGN(POINTER_ALIGN);
> >          __bss_end = .;
> >      } :text
> 
> Two remarks, despite Alistair's ack: Wouldn't it be better to add
> .sbss.*
> right away as well? And strictly speaking wouldn't it be more logical
> to
> have .sbss ahead of .bss?
It makes sense. I'll take it into account in the following patch
series.
Thanks.
> 
> Jan
diff mbox series

Patch

diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 74afbaab9b..9a2799bab5 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -151,7 +151,7 @@  SECTIONS
         *(.bss.percpu.read_mostly)
         . = ALIGN(SMP_CACHE_BYTES);
         __per_cpu_data_end = .;
-        *(.bss .bss.*)
+        *(.bss .bss.* .sbss)
         . = ALIGN(POINTER_ALIGN);
         __bss_end = .;
     } :text