2006-11-24 17:58:34

by Andy Whitcroft

[permalink] [raw]
Subject: [PATCH] x86_64 vsyscall fails to compile when CONFIG_HOTPLUG_CPU is disabled

x86_64 vsyscall fails to compile when CONFIG_HOTPLUG_CPU is disabled

The following change attempted to fix up the notifier structure
when CONFIG_HOTPLUG_CPU is disabled:

[PATCH] x86-64: Fix vgetcpu when CONFIG_HOTPLUG_CPU is disabled

It seems to leave a reference to the cpu_vsyscall_notifier which is
not declared unles CONFIG_HOTPLUG_CPU is defined, leading to the following
compile time error:

arch/x86_64/kernel/vsyscall.c:310: error: `cpu_vsyscall_notifier'
undeclared (first use in this function)

Make the hotcpu_notifier dependant on CONFIG_HOTPLUG_CPU.

Signed-off-by: Andy Whitcroft <[email protected]>
---
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index 3416462..e93ffcf 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -307,7 +307,9 @@ static int __init vsyscall_init(void)
register_sysctl_table(kernel_root_table2, 0);
#endif
on_each_cpu(cpu_vsyscall_init, NULL, 0, 1);
+#ifdef CONFIG_HOTPLUG_CPU
hotcpu_notifier(cpu_vsyscall_notifier, 0);
+#endif
return 0;
}


2006-11-24 18:04:17

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] x86_64 vsyscall fails to compile when CONFIG_HOTPLUG_CPU is disabled

On Fri, 24 Nov 2006, Andy Whitcroft wrote:

> The following change attempted to fix up the notifier structure
> when CONFIG_HOTPLUG_CPU is disabled:
> It seems to leave a reference to the cpu_vsyscall_notifier which is
> not declared unles CONFIG_HOTPLUG_CPU is defined, leading to the following
> compile time error:
> arch/x86_64/kernel/vsyscall.c:310: error: `cpu_vsyscall_notifier'
> undeclared (first use in this function)
> Make the hotcpu_notifier dependant on CONFIG_HOTPLUG_CPU.

Another fix is appropriate for -mm, please see this thread:
http://lkml.org/lkml/2006/11/23/121

--
Jiri Kosina

2006-11-24 19:11:35

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] x86_64 vsyscall fails to compile when CONFIG_HOTPLUG_CPU is disabled

On Friday 24 November 2006 18:58, Andy Whitcroft wrote:
> x86_64 vsyscall fails to compile when CONFIG_HOTPLUG_CPU is disabled
>
> The following change attempted to fix up the notifier structure
> when CONFIG_HOTPLUG_CPU is disabled:
>
> [PATCH] x86-64: Fix vgetcpu when CONFIG_HOTPLUG_CPU is disabled
>
> It seems to leave a reference to the cpu_vsyscall_notifier which is
> not declared unles CONFIG_HOTPLUG_CPU is defined, leading to the following
> compile time error:

It's ok in mainline, unfortunately mm has another independent patch that
broke it again.

-Andi