[PATCH v1 1/3] xen/ppc: add section for device information in linker script

Oleksii Kurochko posted 3 patches 1 year, 1 month ago
There is a newer version of this series
[PATCH v1 1/3] xen/ppc: add section for device information in linker script
Posted by Oleksii Kurochko 1 year, 1 month ago
Introduce a new `.dev.info` section in the PPC linker script to
handle device-specific information.
This section is aligned to `POINTER_ALIGN`, with `_sdevice` and `_edevice`
marking the start and end of the section, respectively.

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

diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
index 38cd857187..c087827d28 100644
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -161,6 +161,13 @@ SECTIONS
         __bss_end = .;
     } :text
 
+    . = ALIGN(POINTER_ALIGN);
+    .dev.info : {
+      _sdevice = .;
+      *(.dev.info)
+      _edevice = .;
+    } :text
+
     _end = . ;
 
     /* Section for the device tree blob (if any). */
-- 
2.46.0
Re: [PATCH v1 1/3] xen/ppc: add section for device information in linker script
Posted by Shawn Anastasio 1 year, 1 month ago
Hi Oleksii,

On 9/11/24 5:04 AM, Oleksii Kurochko wrote:
> Introduce a new `.dev.info` section in the PPC linker script to
> handle device-specific information.
> This section is aligned to `POINTER_ALIGN`, with `_sdevice` and `_edevice`
> marking the start and end of the section, respectively.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  xen/arch/ppc/xen.lds.S | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
> index 38cd857187..c087827d28 100644
> --- a/xen/arch/ppc/xen.lds.S
> +++ b/xen/arch/ppc/xen.lds.S
> @@ -161,6 +161,13 @@ SECTIONS
>          __bss_end = .;
>      } :text
>  
> +    . = ALIGN(POINTER_ALIGN);
> +    .dev.info : {

Sections in the PPC linker script must be declared with the DECL_SECTION
macro to ensure that they are placed at the correct physical and virtual
address (see all other sections in the file).

Additionally, like Jan mentioned, placing the section section before
.bss would probably be preferable. Right before .init.text would
probably be a reasonable place to put it, like ARM's linker script does.

Thanks,
Shawn
Re: [PATCH v1 1/3] xen/ppc: add section for device information in linker script
Posted by oleksii.kurochko@gmail.com 1 year, 1 month ago
On Fri, 2024-09-13 at 09:35 -0500, Shawn Anastasio wrote:
> Hi Oleksii,
> 
> On 9/11/24 5:04 AM, Oleksii Kurochko wrote:
> > Introduce a new `.dev.info` section in the PPC linker script to
> > handle device-specific information.
> > This section is aligned to `POINTER_ALIGN`, with `_sdevice` and
> > `_edevice`
> > marking the start and end of the section, respectively.
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> >  xen/arch/ppc/xen.lds.S | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
> > index 38cd857187..c087827d28 100644
> > --- a/xen/arch/ppc/xen.lds.S
> > +++ b/xen/arch/ppc/xen.lds.S
> > @@ -161,6 +161,13 @@ SECTIONS
> >          __bss_end = .;
> >      } :text
> >  
> > +    . = ALIGN(POINTER_ALIGN);
> > +    .dev.info : {
> 
> Sections in the PPC linker script must be declared with the
> DECL_SECTION
> macro to ensure that they are placed at the correct physical and
> virtual
> address (see all other sections in the file).
> 
> Additionally, like Jan mentioned, placing the section section before
> .bss would probably be preferable. Right before .init.text would
> probably be a reasonable place to put it, like ARM's linker script
> does.
Thanks. I will apply your comments.

~ Oleksii