X86_NUMAQ build fix
PATCH 1/1 X86_NUMAQ build fix
Hi,
This patch fixes the build breakage of X86_NUMAQ. And this declares xquad_portio on only X86_NUMAQ.
Please apply.
Signature · 55 lines
OGAWA Hirofumi <[email protected]> Signed-off-by: OGAWA Hirofumi <[email protected]> --- arch/i386/boot/compressed/misc.c | 4 +++- arch/i386/kernel/smpboot.c | 2 +- arch/i386/pci/Makefile | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff -puN arch/i386/pci/Makefile~numaq-build-fix arch/i386/pci/Makefile --- linux-2.6/arch/i386/pci/Makefile~numaq-build-fix 2006-04-22 00:54:29.000000000 +0900 +++ linux-2.6-hirofumi/arch/i386/pci/Makefile 2006-04-22 00:55:27.000000000 +0900 @@ -5,10 +5,11 @@ obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o obj-$(CONFIG_PCI_DIRECT) += direct.o pci-y := fixup.o -pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o pci-$(CONFIG_X86_VISWS) := visws.o fixup.o pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o +pci-$(CONFIG_ACPI) += acpi.o + obj-y += $(pci-y) common.o diff -puN arch/i386/boot/compressed/misc.c~numaq-build-fix arch/i386/boot/compressed/misc.c --- linux-2.6/arch/i386/boot/compressed/misc.c~numaq-build-fix 2006-04-22 00:54:29.000000000 +0900 +++ linux-2.6-hirofumi/arch/i386/boot/compressed/misc.c 2006-04-22 00:54:29.000000000 +0900 @@ -122,7 +122,9 @@ static int vidport; static int lines, cols; #ifdef CONFIG_X86_NUMAQ -static void * xquad_portio = NULL; +/* hack to avoid using xquad_portio=NULL */ +#undef outb_p +#define outb_p outb_local_p #endif #include "../../../../lib/inflate.c" diff -puN arch/i386/kernel/smpboot.c~numaq-build-fix arch/i386/kernel/smpboot.c --- linux-2.6/arch/i386/kernel/smpboot.c~numaq-build-fix 2006-04-22 00:54:29.000000000 +0900 +++ linux-2.6-hirofumi/arch/i386/kernel/smpboot.c 2006-04-22 00:54:29.000000000 +0900 @@ -1116,9 +1116,9 @@ static void smp_tune_scheduling (void) */ static int boot_cpu_logical_apicid; +#ifdef CONFIG_X86_NUMAQ /* Where the IO area was mapped on multiquad, always 0 otherwise */ void *xquad_portio; -#ifdef CONFIG_X86_NUMAQ EXPORT_SYMBOL(xquad_portio); #endif _
Quoted 2 lines · OGAWA Hirofumi
This patch fixes the build breakage of
X86_NUMAQ. And this declaresxquad_portioon onlyX86_NUMAQ.
What bug does this patch fix? What is your .config? I'm not having any compile problems on my NUMAQ lately.
Review
Quoted 10 lines
obj-$(CONFIG_PCI_DIRECT) += direct.o
pci-y := fixup.o
(quoted diff) +1
-1-pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o pci-$(CONFIG_X86_VISWS) := visws.o fixup.o pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o +pci-$(CONFIG_ACPI) += acpi.o
Am I reading this wrong, or does this just move the option down a bit? Did you need to change the link order? Why?
Review static int vidport; · line 128
Quoted 10 lines
+++
linux-2.6-hirofumi/arch/i386/boot/compressed/misc.c2006-04-22 00:54:29.000000000 +0900(quoted diff) +3
-1@@ -122,7 +122,9 @@ static int vidport; static int lines, cols; #ifdef CONFIG_X86_NUMAQ -static void * xquad_portio = NULL; +/* hack to avoid using xquad_portio=NULL */ +#undef outb_p +#define outb_p outb_local_p #endif
It's really weird, but I'd hope that there was a reason for having two xquad_portio. Are you sure that this has no other consequences?
That said, it does boot on my 16-way NUMAQ, but I still have no real idea what problem this is solving or what it is actually doing ;)
-- Dave
Quoted 6 lines · Dave Hansen
Quoted 2 lines · OGAWA Hirofumi
This patch fixes the build breakage of
X86_NUMAQ. And this declaresxquad_portioon onlyX86_NUMAQ.What bug does this patch fix? What is your .config? I'm not having any compile problems on my NUMAQ lately.
Ah, sorry for stuipd description...
Quoted 6 lines
Quoted 6 lines
obj-$(CONFIG_PCI_DIRECT) += direct.o
pci-y := fixup.o -pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o
Quoted 7 lines
Quoted 4 lines
pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o+pci-$(CONFIG_ACPI) += acpi.o
Am I reading this wrong, or does this just move the option down a bit? Did you need to change the link order? Why?
No, this is not link order. Note that CONFIG_X86_VISWS/CONFIG_X86_NUMAQ uses ":=", not "+=". In case of ACPI=y", it breaks build.
Maybe NUMAQ shouldn't allow ACPI=y in Kconfig (very old Makefile doesn't allow to build acpi.o), but I think Makefile is ok with this, and it also fixes CONFIG_X86_VISWS case (very old Makefile also allow to build acpi.o).
Quoted 4 lines
Quoted 4 lines
+++
linux-2.6-hirofumi/arch/i386/boot/compressed/misc.c2006-04-22 00:54:29.000000000 +0900(quoted diff) +0
-0@@ -122,7 +122,9 @@ static int vidport; static int lines, cols;
Quoted 9 lines
Review static int vidport; · line 128
Quoted 6 lines
(quoted diff) +3
-1#ifdef CONFIG_X86_NUMAQ -static void * xquad_portio = NULL; +/* hack to avoid using xquad_portio=NULL */ +#undef outb_p +#define outb_p outb_local_p #endifIt's really weird, but I'd hope that there was a reason for having two
xquad_portio. Are you sure that this has no other consequences?
Note that this is boot/compressed/misc.c. We can't share vmlinux's data in here. However we can share macros, so probably, it's using "static void * xquad_portio = NULL" hack.
But, in include/asm-i386/io.h, it is declared as "extern". At least, gcc-4.0 doesn't allow "static" and "extern" mismatch.
Quoted 2 lines
That said, it does boot on my 16-way NUMAQ, but I still have no real idea what problem this is solving or what it is actually doing ;)
Oh, good. Thanks.
Signature · 1 line
OGAWA Hirofumi <[email protected]>
Quoted 8 lines · OGAWA Hirofumi
Quoted 7 lines · Dave Hansen
Quoted 7 lines
pci-y := fixup.o -pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.opci-$(CONFIG_X86_VISWS) := visws.o fixup.o
pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
+pci-$(CONFIG_ACPI) += acpi.o
Am I reading this wrong, or does this just move the option down a bit? Did you need to change the link order? Why?
No, this is not link order. Note that CONFIG_X86_VISWS/CONFIG_X86_NUMAQ uses ":=", not "+=". In case of ACPI=y", it breaks build.
Ahh, so NUMAQ and VISWS don't seem to allow or want ACPI code. Especially for the NUMAQ, I don't think we should even mess with this too much. Just fix it in the build system and directly disallow NUMAQ && ACPI.
We already have this:
menu "ACPI (Advanced Configuration and Power Interface) Support"
depends on !X86_VISWS
Just add the NUMAQ in there, too.
-- Dave
Quoted 8 lines · Dave Hansen
Quoted 1 line · OGAWA Hirofumi
Dave Hansen <[email protected]> writes:
Ahh, so NUMAQ and VISWS don't seem to allow or want ACPI code. Especially for the NUMAQ, I don't think we should even mess with this too much. Just fix it in the build system and directly disallow NUMAQ && ACPI.
Quoted 6 lines
We already have this:
menu "ACPI (Advanced Configuration and Power Interface) Support"
depends on !X86_VISWSJust add the NUMAQ in there, too.
Oh, thanks a lot for noticeing this. Fixed patch is here.
[compile test only. I don't have NUMAQ, and I just wanted to see "objdump -S" of NUMA's code.]
Signature · 53 lines
OGAWA Hirofumi <[email protected]> Signed-off-by: OGAWA Hirofumi <[email protected]> --- arch/i386/boot/compressed/misc.c | 4 +++- arch/i386/kernel/smpboot.c | 2 +- drivers/acpi/Kconfig | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff -puN arch/i386/pci/Makefile~numaq-build-fix arch/i386/pci/Makefile diff -puN arch/i386/boot/compressed/misc.c~numaq-build-fix arch/i386/boot/compressed/misc.c --- linux-2.6/arch/i386/boot/compressed/misc.c~numaq-build-fix 2006-04-22 04:15:04.000000000 +0900 +++ linux-2.6-hirofumi/arch/i386/boot/compressed/misc.c 2006-04-22 04:15:04.000000000 +0900 @@ -122,7 +122,9 @@ static int vidport; static int lines, cols; #ifdef CONFIG_X86_NUMAQ -static void * xquad_portio = NULL; +/* hack to avoid using xquad_portio=NULL */ +#undef outb_p +#define outb_p outb_local_p #endif #include "../../../../lib/inflate.c" diff -puN arch/i386/kernel/smpboot.c~numaq-build-fix arch/i386/kernel/smpboot.c --- linux-2.6/arch/i386/kernel/smpboot.c~numaq-build-fix 2006-04-22 04:15:04.000000000 +0900 +++ linux-2.6-hirofumi/arch/i386/kernel/smpboot.c 2006-04-22 04:15:04.000000000 +0900 @@ -1116,9 +1116,9 @@ static void smp_tune_scheduling (void) */ static int boot_cpu_logical_apicid; +#ifdef CONFIG_X86_NUMAQ /* Where the IO area was mapped on multiquad, always 0 otherwise */ void *xquad_portio; -#ifdef CONFIG_X86_NUMAQ EXPORT_SYMBOL(xquad_portio); #endif diff -puN drivers/acpi/Kconfig~numaq-build-fix drivers/acpi/Kconfig --- linux-2.6/drivers/acpi/Kconfig~numaq-build-fix 2006-04-22 04:16:35.000000000 +0900 +++ linux-2.6-hirofumi/drivers/acpi/Kconfig 2006-04-22 04:16:41.000000000 +0900 @@ -4,6 +4,7 @@ menu "ACPI (Advanced Configuration and Power Interface) Support" depends on !X86_VISWS + depends on !X86_NUMAQ depends on !IA64_HP_SIM depends on IA64 || X86 _
Do you really need anything other than the Kconfig fix? I thought that it alone would be a complete fix.
-- Dave
Quoted 2 lines · Dave Hansen
Do you really need anything other than the
Kconfigfix? I thought that it alone would be a complete fix.
Yes. I thought I explained those...
Review
Quoted 6 lines
#ifdef
CONFIG_X86_NUMAQ(quoted diff) +3
-1-static void * xquad_portio = NULL; +/* hack to avoid using xquad_portio=NULL */ +#undef outb_p +#define outb_p outb_local_p #endif
This fixes the following error.
make -C /devel/linux/works/linux-2.6 O=/devel/linux/works/linux-2.6-devron
GEN /devel/linux/works/linux-2.6-devron/Makefile
CHK include/linux/version.h
Using /devel/linux/works/linux-2.6 as source for kernel
CHK include/linux/compile.h LD vmlinux SYSMAP System.map SYSMAP .tmp_System.map
Building modules, stage 2.
LD arch/i386/boot/setup
CC arch/i386/boot/compressed/misc.o
OBJCOPY arch/i386/boot/compressed/vmlinux.bin
GZIP arch/i386/boot/compressed/vmlinux.bin.gz
/devel/linux/works/linux-2.6/arch/i386/boot/compressed/misc.c:125: error: static declaration of 'xquad_portio' follows non-static declaration include2/asm/io.h:303: error: previous declaration of 'xquad_portio' was here
make[4]: *** [arch/i386/boot/compressed/misc.o] Error 1
make[4]: *** Waiting for unfinished jobs....
MODPOST
make[3]: *** [arch/i386/boot/compressed/vmlinux] Error 2
make[2]: *** [bzImage] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_all] Error 2
make: *** [all] Error 2
Review
Quoted 7 lines
static int
boot_cpu_logical_apicid;(quoted diff) +1
-1+#ifdef CONFIG_X86_NUMAQ /* Where the IO area was mapped on multiquad, always 0 otherwise */ void *xquad_portio; -#ifdef CONFIG_X86_NUMAQ EXPORT_SYMBOL(xquad_portio); #endif
xquad_portio is needed to only X86_NUMAQ.
Signature · 1 line
OGAWA Hirofumi <[email protected]>