linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] um: Avoid circular dependency on asm-offsets in pgtable.h
@ 2025-10-28  9:02 Thomas Weißschuh
  2025-10-28 10:17 ` Tiwei Bie
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2025-10-28  9:02 UTC (permalink / raw)
  To: Richard Weinberger, Anton Ivanov, Johannes Berg, Tiwei Bie
  Cc: Johannes Berg, linux-um, linux-kernel, Thomas Weißschuh

Recent changes have added an include of as-layout.h to pgtable.h.
However this introduces a circular dependency during asm-offsets
generation as as-layout.h depends on asm-offsets and pgtable.h is an
input for asm-offsets.

Building from a clean state results in the following error:

  CC      arch/um/kernel/asm-offsets.s
In file included from arch/um/include/asm/pgtable.h:48,
                 from include/linux/pgtable.h:6,
                 from include/linux/mm.h:31,
                 from include/linux/pid_namespace.h:7,
                 from include/linux/ptrace.h:10,
                 from include/linux/audit.h:13,
                 from arch/um/kernel/asm-offsets.c:8:
arch/um/include/shared/as-layout.h:9:10: fatal error: generated/asm-offsets.h: No such file or directory
    9 | #include <generated/asm-offsets.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [scripts/Makefile.build:182: arch/um/kernel/asm-offsets.s] Error 1

As the inclusion of as-layout.h in pgtable.h is not yet needed while
asm-offsets are generated, break the dependency here.

Fixes: a7f7dbae94a5 ("um: Remove file-based iomem emulation support")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 arch/um/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
index 1a0d7405e97c..3b42b0f45bf6 100644
--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -45,7 +45,9 @@ extern unsigned long *empty_zero_page;
  * area for the same reason. ;)
  */
 
+#ifndef COMPILE_OFFSETS
 #include <as-layout.h> /* for high_physmem */
+#endif
 
 #define VMALLOC_OFFSET	(__va_space)
 #define VMALLOC_START	((high_physmem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))

---
base-commit: aa3e6faf620b1091ae85b07c0106918d48fcce05
change-id: 20251028-uml-offsets-circular-64bd45b0e172

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] um: Avoid circular dependency on asm-offsets in pgtable.h
  2025-10-28  9:02 [PATCH] um: Avoid circular dependency on asm-offsets in pgtable.h Thomas Weißschuh
@ 2025-10-28 10:17 ` Tiwei Bie
  0 siblings, 0 replies; 2+ messages in thread
From: Tiwei Bie @ 2025-10-28 10:17 UTC (permalink / raw)
  To: linux
  Cc: richard, anton.ivanov, johannes, johannes.berg, linux-um,
	linux-kernel, tiwei.btw, tiwei.bie

On Tue, 28 Oct 2025 10:02:55 +0100, Thomas Weißschuh wrote:
> Recent changes have added an include of as-layout.h to pgtable.h.
> However this introduces a circular dependency during asm-offsets
> generation as as-layout.h depends on asm-offsets and pgtable.h is an
> input for asm-offsets.
> 
> Building from a clean state results in the following error:
> 
>   CC      arch/um/kernel/asm-offsets.s
> In file included from arch/um/include/asm/pgtable.h:48,
>                  from include/linux/pgtable.h:6,
>                  from include/linux/mm.h:31,
>                  from include/linux/pid_namespace.h:7,
>                  from include/linux/ptrace.h:10,
>                  from include/linux/audit.h:13,
>                  from arch/um/kernel/asm-offsets.c:8:
> arch/um/include/shared/as-layout.h:9:10: fatal error: generated/asm-offsets.h: No such file or directory
>     9 | #include <generated/asm-offsets.h>
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[4]: *** [scripts/Makefile.build:182: arch/um/kernel/asm-offsets.s] Error 1
> 
> As the inclusion of as-layout.h in pgtable.h is not yet needed while
> asm-offsets are generated, break the dependency here.
> 
> Fixes: a7f7dbae94a5 ("um: Remove file-based iomem emulation support")
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  arch/um/include/asm/pgtable.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
> index 1a0d7405e97c..3b42b0f45bf6 100644
> --- a/arch/um/include/asm/pgtable.h
> +++ b/arch/um/include/asm/pgtable.h
> @@ -45,7 +45,9 @@ extern unsigned long *empty_zero_page;
>   * area for the same reason. ;)
>   */
>  
> +#ifndef COMPILE_OFFSETS
>  #include <as-layout.h> /* for high_physmem */
> +#endif

Oops, my bad. Thanks for the fix!

Reviewed-by: Tiwei Bie <tiwei.btw@antgroup.com>

Regards,
Tiwei


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-28 10:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28  9:02 [PATCH] um: Avoid circular dependency on asm-offsets in pgtable.h Thomas Weißschuh
2025-10-28 10:17 ` Tiwei Bie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).