[PATCH v2] ACPI, x86/boot: Remove {set|get}_root_pointer() ACPI callbacks

Hou Wenlong posted 1 patch 1 month ago
arch/x86/include/asm/acpi.h     | 17 +++++------------
arch/x86/include/asm/x86_init.h |  4 ----
arch/x86/kernel/x86_init.c      |  2 --
3 files changed, 5 insertions(+), 18 deletions(-)
[PATCH v2] ACPI, x86/boot: Remove {set|get}_root_pointer() ACPI callbacks
Posted by Hou Wenlong 1 month ago
After removing pvh_get_root_pointer(), the only get_root_pointer() ACPI
callback is x86_default_get_root_pointer(). So call it directly in
acpi_arch_get_root_pointer() and remove the get_root_pointer() ACPI
callback. Since the set_root_pointer() ACPI callback is also only
x86_default_set_root_pointer(), remove it as well.

Note that x86_default_get_root_pointer() cannot be directly folded into
acpi_arch_get_root_pointer() for now, as it references 'boot_params',
which requires including asm/bootparams.h. This header file, in turn,
includes linux/screen_info.h, which declares pixel_format as a struct,
while amdgpu defines it as an enum, leading to namespace clashes.

Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
---
 arch/x86/include/asm/acpi.h     | 17 +++++------------
 arch/x86/include/asm/x86_init.h |  4 ----
 arch/x86/kernel/x86_init.c      |  2 --
 3 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index a03aa6f999d1..66ca6badb3e5 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -157,23 +157,23 @@ static inline bool acpi_has_cpu_in_madt(void)
 	return !!acpi_lapic;
 }
 
+void x86_default_set_root_pointer(u64 addr);
+u64 x86_default_get_root_pointer(void);
+
 #define ACPI_HAVE_ARCH_SET_ROOT_POINTER
 static __always_inline void acpi_arch_set_root_pointer(u64 addr)
 {
-	x86_init.acpi.set_root_pointer(addr);
+	x86_default_set_root_pointer(addr);
 }
 
 #define ACPI_HAVE_ARCH_GET_ROOT_POINTER
 static __always_inline u64 acpi_arch_get_root_pointer(void)
 {
-	return x86_init.acpi.get_root_pointer();
+	return x86_default_get_root_pointer();
 }
 
 void acpi_generic_reduced_hw_init(void);
 
-void x86_default_set_root_pointer(u64 addr);
-u64 x86_default_get_root_pointer(void);
-
 #ifdef CONFIG_XEN_PV
 /* A Xen PV domain needs a special acpi_os_ioremap() handling. */
 extern void __iomem * (*acpi_os_ioremap)(acpi_physical_address phys,
@@ -193,13 +193,6 @@ static inline void disable_acpi(void) { }
 
 static inline void acpi_generic_reduced_hw_init(void) { }
 
-static inline void x86_default_set_root_pointer(u64 addr) { }
-
-static inline u64 x86_default_get_root_pointer(void)
-{
-	return 0;
-}
-
 #endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT	1
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 6c8a6ead84f6..254221eec395 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -132,13 +132,9 @@ struct x86_hyper_init {
 
 /**
  * struct x86_init_acpi - x86 ACPI init functions
- * @set_root_pointer:		set RSDP address
- * @get_root_pointer:		get RSDP address
  * @reduced_hw_early_init:	hardware reduced platform early init
  */
 struct x86_init_acpi {
-	void (*set_root_pointer)(u64 addr);
-	u64 (*get_root_pointer)(void);
 	void (*reduced_hw_early_init)(void);
 };
 
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index ebefb77c37bb..4a1a70366b71 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -121,8 +121,6 @@ struct x86_init_ops x86_init __initdata = {
 	},
 
 	.acpi = {
-		.set_root_pointer	= x86_default_set_root_pointer,
-		.get_root_pointer	= x86_default_get_root_pointer,
 		.reduced_hw_early_init	= acpi_generic_reduced_hw_init,
 	},
 };

base-commit: 01420de66faaa5b9b031d9fa2c58ab4cae8f35bc
prerequisite-patch-id: 5490aaedd3761b7a9ddc57b4990384f0b144d665
-- 
2.31.1
Re: [PATCH v2] ACPI, x86/boot: Remove {set|get}_root_pointer() ACPI callbacks
Posted by Borislav Petkov 3 weeks, 6 days ago
On Fri, Mar 06, 2026 at 11:25:30AM +0800, Hou Wenlong wrote:
> After removing pvh_get_root_pointer(), the only get_root_pointer() ACPI
> callback is x86_default_get_root_pointer(). So call it directly in
> acpi_arch_get_root_pointer() and remove the get_root_pointer() ACPI
> callback. Since the set_root_pointer() ACPI callback is also only
> x86_default_set_root_pointer(), remove it as well.
> 
> Note that x86_default_get_root_pointer() cannot be directly folded into
> acpi_arch_get_root_pointer() for now, as it references 'boot_params',
> which requires including asm/bootparams.h. This header file, in turn,
> includes linux/screen_info.h, which declares pixel_format as a struct,
> while amdgpu defines it as an enum, leading to namespace clashes.

How about disambiguating them and fixing this properly?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
Re: [PATCH v2] ACPI, x86/boot: Remove {set|get}_root_pointer() ACPI callbacks
Posted by Hou Wenlong 3 weeks, 6 days ago
On Fri, Mar 13, 2026 at 01:28:08PM +0100, Borislav Petkov wrote:
> On Fri, Mar 06, 2026 at 11:25:30AM +0800, Hou Wenlong wrote:
> > After removing pvh_get_root_pointer(), the only get_root_pointer() ACPI
> > callback is x86_default_get_root_pointer(). So call it directly in
> > acpi_arch_get_root_pointer() and remove the get_root_pointer() ACPI
> > callback. Since the set_root_pointer() ACPI callback is also only
> > x86_default_set_root_pointer(), remove it as well.
> > 
> > Note that x86_default_get_root_pointer() cannot be directly folded into
> > acpi_arch_get_root_pointer() for now, as it references 'boot_params',
> > which requires including asm/bootparams.h. This header file, in turn,
> > includes linux/screen_info.h, which declares pixel_format as a struct,
> > while amdgpu defines it as an enum, leading to namespace clashes.
> 
> How about disambiguating them and fixing this properly?
>

Okay, I’ll give it a try. 

Based on my grep search, I found three definitions of 'pixel_format' in the
entire codebase:
- include/video/pixel_format.h
- drivers/gpu/drm/i915/gvt/fb_decoder.c
- drivers/gpu/drm/amd/display/dc/dc_hw_types.h

My understanding is that the 'include' directory has higher priority
than drivers directory, so the first one should be kept. I would need to
modify the other two definitions by adding module-specific prefixes to
them?

Thanks!

>     Boris.
> 
> https://people.kernel.org/tglx/notes-about-netiquette
Re: [PATCH v2] ACPI, x86/boot: Remove {set|get}_root_pointer() ACPI callbacks
Posted by Borislav Petkov 3 weeks, 6 days ago
On Fri, Mar 13, 2026 at 09:21:45PM +0800, Hou Wenlong wrote:
> Based on my grep search, I found three definitions of 'pixel_format' in the
> entire codebase:
> - include/video/pixel_format.h
> - drivers/gpu/drm/i915/gvt/fb_decoder.c
> - drivers/gpu/drm/amd/display/dc/dc_hw_types.h
> 
> My understanding is that the 'include' directory has higher priority
> than drivers directory, so the first one should be kept. I would need to
> modify the other two definitions by adding module-specific prefixes to
> them?

Sounds about right.

Just CC everyone on your change who get_maintainers.pl suggests and we'll hash
out the details.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette