Skip to contentSkip to conversation

x86/devicetree: Fix build for amd64

PATCH Superseded Ricardo Ribalda Delgado 2 participants 3 messages Feb 2, 2015 x86

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/devicetree: Fix build for amd64

apic_force_enable is not defined for amd64.

Without this patch:

LD init/built-in.o
arch/x86/built-in.o: In function `dtb_lapic_setup':
kernel/devicetree.c:155:
undefined reference to `apic_force_enable' Makefile:923: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

---
 arch/x86/kernel/devicetree.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/devicetree.c +2 -0
index 3d35033..b5560de 100644
@@ -152,7 +152,9 @@ static void __init dtb_lapic_setup(void)
 
 	/* Did the boot loader setup the local APIC ? */
 	if (!cpu_has_apic) {
+#ifndef CONFIG_X86_64
 		if (apic_force_enable(r.start))
+#endif
 			return;
 	}
 	smp_found_config = 1;
Signature · 1 line
2.1.4
#1 lore raw

Hi Ricardo,
How about defining a version of apic_force_enable()
for X86_64 in apic.h which just return failure? Regards!
Gerry

Quoted 31 lines · Ricardo Ribalda Delgado

apic_force_enable is not defined for amd64.

Without this patch:

LD init/built-in.o
arch/x86/built-in.o: In function `dtb_lapic_setup':
kernel/devicetree.c:155:
undefined reference to `apic_force_enable' Makefile:923: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

---
 arch/x86/kernel/devicetree.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/devicetree.c +2 -0
index 3d35033..b5560de 100644
@@ -152,7 +152,9 @@ static void __init dtb_lapic_setup(void)
 
 	/* Did the boot loader setup the local APIC ? */
 	if (!cpu_has_apic) {
+#ifndef CONFIG_X86_64
 		if (apic_force_enable(r.start))
+#endif
 			return;
 	}
 	smp_found_config = 1;
#2 lore raw

Hello,

That is also an option, but I thought this was cleaner. If you prefer it that way I can prepare a patch.

Regards

Quoted 38 lines · Jiang Liu

Hi Ricardo,
How about defining a version of apic_force_enable()
for X86_64 in apic.h which just return failure? Regards!
Gerry

Quoted 31 lines · Ricardo Ribalda Delgado

apic_force_enable is not defined for amd64.

Without this patch:

LD init/built-in.o
arch/x86/built-in.o: In function `dtb_lapic_setup':
kernel/devicetree.c:155:
undefined reference to `apic_force_enable' Makefile:923: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

---
 arch/x86/kernel/devicetree.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/devicetree.c +2 -0
index 3d35033..b5560de 100644
@@ -152,7 +152,9 @@ static void __init dtb_lapic_setup(void)
 
      /* Did the boot loader setup the local APIC ? */
      if (!cpu_has_apic) {
+#ifndef CONFIG_X86_64
              if (apic_force_enable(r.start))
+#endif
                      return;
      }
      smp_found_config = 1;
Signature · 1 line
Ricardo Ribalda