[PATCH] ACPI: add acpi_get_cpu_uid() stub helper

Arnd Bergmann posted 1 patch 2 months ago
include/linux/acpi.h | 6 ++++++
1 file changed, 6 insertions(+)
[PATCH] ACPI: add acpi_get_cpu_uid() stub helper
Posted by Arnd Bergmann 2 months ago
From: Arnd Bergmann <arnd@arndb.de>

When ACPI is disabled, x86 Xen support fails to build:

arch/x86/xen/enlighten_hvm.c: In function 'xen_cpu_up_prepare_hvm':
arch/x86/xen/enlighten_hvm.c:165:13: error: implicit declaration of function 'acpi_get_cpu_uid' [-Wimplicit-function-declaration]
  165 |         if (acpi_get_cpu_uid(cpu, &cpu_uid) == 0)
      |             ^~~~~~~~~~~~~~~~

Add a trivial stub that can be used in place of the real function.

Fixes: f652d0a4e13c ("ACPI: Centralize acpi_get_cpu_uid() declaration in include/linux/acpi.h")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/acpi.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 0afab1a2ad8e..4e5e0ff4c887 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -964,6 +964,12 @@ static inline int acpi_table_parse(char *id,
 	return -ENODEV;
 }
 
+static inline int acpi_get_cpu_uid(unsigned int cpu, u32 *uid)
+{
+	*uid = cpu;
+	return 0;
+}
+
 static inline int acpi_nvs_register(__u64 start, __u64 size)
 {
 	return 0;
-- 
2.39.5
Re: [PATCH] ACPI: add acpi_get_cpu_uid() stub helper
Posted by fengchengwen 2 months ago
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Thanks

On 4/13/2026 3:01 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When ACPI is disabled, x86 Xen support fails to build:
> 
> arch/x86/xen/enlighten_hvm.c: In function 'xen_cpu_up_prepare_hvm':
> arch/x86/xen/enlighten_hvm.c:165:13: error: implicit declaration of function 'acpi_get_cpu_uid' [-Wimplicit-function-declaration]
>   165 |         if (acpi_get_cpu_uid(cpu, &cpu_uid) == 0)
>       |             ^~~~~~~~~~~~~~~~
> 
> Add a trivial stub that can be used in place of the real function.
> 
> Fixes: f652d0a4e13c ("ACPI: Centralize acpi_get_cpu_uid() declaration in include/linux/acpi.h")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

...
Re: [PATCH] ACPI: add acpi_get_cpu_uid() stub helper
Posted by Rafael J. Wysocki 2 months ago
On Mon, Apr 13, 2026 at 1:42 PM fengchengwen <fengchengwen@huawei.com> wrote:
>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> Thanks
>
> On 4/13/2026 3:01 PM, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > When ACPI is disabled, x86 Xen support fails to build:
> >
> > arch/x86/xen/enlighten_hvm.c: In function 'xen_cpu_up_prepare_hvm':
> > arch/x86/xen/enlighten_hvm.c:165:13: error: implicit declaration of function 'acpi_get_cpu_uid' [-Wimplicit-function-declaration]
> >   165 |         if (acpi_get_cpu_uid(cpu, &cpu_uid) == 0)
> >       |             ^~~~~~~~~~~~~~~~
> >
> > Add a trivial stub that can be used in place of the real function.
> >
> > Fixes: f652d0a4e13c ("ACPI: Centralize acpi_get_cpu_uid() declaration in include/linux/acpi.h")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> ...

Applied as 7.1-rc material, thanks!