diff mbox series

[v4,3/6] xen/arm: use {DT,ACPI}_DEV_INFO for device info sections

Message ID fc4243be6e43224f27311d96512dc0f465c73a38.1727365854.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series Move {acpi_}device_init() and device_get_class() to common code | expand

Commit Message

Oleksii Kurochko Sept. 26, 2024, 4:54 p.m. UTC
Refactor arm/xen.lds.S by replacing the inline definitions for
device info sections with the newly introduced {DT,ACPI}_DEV_INFO
macros from xen/xen.lds.h.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - use newly refactored ACPI_DEV_INFO and DT_DEV_INFO
---
Changes in V3:
 - use refactored ADEV_INFO and DT_DEV_INFO macros.
---
 xen/arch/arm/xen.lds.S | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

Comments

Michal Orzel Sept. 27, 2024, 7:16 a.m. UTC | #1
Hi Oleksii,

On 26/09/2024 18:54, Oleksii Kurochko wrote:
> 
> 
> Refactor arm/xen.lds.S by replacing the inline definitions for
> device info sections with the newly introduced {DT,ACPI}_DEV_INFO
> macros from xen/xen.lds.h.

I would expect so see a note about s/8/POINTER_ALIGN/ that it's safe to do that.

> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in V4:
>  - use newly refactored ACPI_DEV_INFO and DT_DEV_INFO
> ---
> Changes in V3:
>  - use refactored ADEV_INFO and DT_DEV_INFO macros.
> ---
>  xen/arch/arm/xen.lds.S | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
> index 0987052f1a..3b7b677197 100644
> --- a/xen/arch/arm/xen.lds.S
> +++ b/xen/arch/arm/xen.lds.S
> @@ -4,6 +4,8 @@
> 
>  #include <xen/cache.h>
>  #include <xen/lib.h>
> +
> +#define SIMPLE_DECL_SECTION
>  #include <xen/xen.lds.h>
>  #include <asm/page.h>
>  #undef ENTRY
> @@ -124,20 +126,10 @@ SECTIONS
>        _eplatform = .;
>    } :text
> 
> -  . = ALIGN(8);
> -  .dev.info : {
> -      _sdevice = .;
> -      *(.dev.info)
> -      _edevice = .;
> -  } :text
> +  DT_DEV_INFO(.dev.info)
> 
>  #ifdef CONFIG_ACPI
> -  . = ALIGN(8);
> -  .adev.info : {
The name of the section is ".adev.info", but ...
> -      _asdevice = .;
> -      *(.adev.info)
> -      _aedevice = .;
> -  } :text
> +  ACPI_DEV_INFO(adev.info)
here you're missing the leading dot which will cause the probe to fail.

Apart from that:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal
Oleksii Kurochko Sept. 27, 2024, 9:17 a.m. UTC | #2
Hi Michal,

On Fri, 2024-09-27 at 09:16 +0200, Michal Orzel wrote:
> Hi Oleksii,
> 
> On 26/09/2024 18:54, Oleksii Kurochko wrote:
> > 
> > 
> > Refactor arm/xen.lds.S by replacing the inline definitions for
> > device info sections with the newly introduced {DT,ACPI}_DEV_INFO
> > macros from xen/xen.lds.h.
> 
> I would expect so see a note about s/8/POINTER_ALIGN/ that it's safe
> to do that.
Agree, it would be good to mention, so I will update the commit message
in the next patch version.

> 
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> > Changes in V4:
> >  - use newly refactored ACPI_DEV_INFO and DT_DEV_INFO
> > ---
> > Changes in V3:
> >  - use refactored ADEV_INFO and DT_DEV_INFO macros.
> > ---
> >  xen/arch/arm/xen.lds.S | 16 ++++------------
> >  1 file changed, 4 insertions(+), 12 deletions(-)
> > 
> > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
> > index 0987052f1a..3b7b677197 100644
> > --- a/xen/arch/arm/xen.lds.S
> > +++ b/xen/arch/arm/xen.lds.S
> > @@ -4,6 +4,8 @@
> > 
> >  #include <xen/cache.h>
> >  #include <xen/lib.h>
> > +
> > +#define SIMPLE_DECL_SECTION
> >  #include <xen/xen.lds.h>
> >  #include <asm/page.h>
> >  #undef ENTRY
> > @@ -124,20 +126,10 @@ SECTIONS
> >        _eplatform = .;
> >    } :text
> > 
> > -  . = ALIGN(8);
> > -  .dev.info : {
> > -      _sdevice = .;
> > -      *(.dev.info)
> > -      _edevice = .;
> > -  } :text
> > +  DT_DEV_INFO(.dev.info)
> > 
> >  #ifdef CONFIG_ACPI
> > -  . = ALIGN(8);
> > -  .adev.info : {
> The name of the section is ".adev.info", but ...
> > -      _asdevice = .;
> > -      *(.adev.info)
> > -      _aedevice = .;
> > -  } :text
> > +  ACPI_DEV_INFO(adev.info)
> here you're missing the leading dot which will cause the probe to
> fail.
Overlooked that, interesting then out CI&CD doesn't check CONFIG_ACPI
for ARM enough... Anyway, I will update that in the next patch version.

> 
> Apart from that:
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Thanks.

~ Oleksii
diff mbox series

Patch

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 0987052f1a..3b7b677197 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -4,6 +4,8 @@ 
 
 #include <xen/cache.h>
 #include <xen/lib.h>
+
+#define SIMPLE_DECL_SECTION
 #include <xen/xen.lds.h>
 #include <asm/page.h>
 #undef ENTRY
@@ -124,20 +126,10 @@  SECTIONS
       _eplatform = .;
   } :text
 
-  . = ALIGN(8);
-  .dev.info : {
-      _sdevice = .;
-      *(.dev.info)
-      _edevice = .;
-  } :text
+  DT_DEV_INFO(.dev.info)
 
 #ifdef CONFIG_ACPI
-  . = ALIGN(8);
-  .adev.info : {
-      _asdevice = .;
-      *(.adev.info)
-      _aedevice = .;
-  } :text
+  ACPI_DEV_INFO(adev.info)
 #endif
 
   . = ALIGN(8);