Re: [patch 07/13] Initialize per cpu lowcores on cpu hotplug.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Heiko Carstens
Date: Wednesday, February 20, 2008 - 2:45 am

>>>> Boah, workaround alert. Why do you not fix the compiler?

Ok, how about the patch below? Everybody happy with it?

---
 arch/s390/kernel/Makefile |    5 +++++
 arch/s390/kernel/smp.c    |    8 +-------
 2 files changed, 6 insertions(+), 7 deletions(-)

Index: linux-2.5/arch/s390/kernel/Makefile
===================================================================
--- linux-2.5.orig/arch/s390/kernel/Makefile
+++ linux-2.5/arch/s390/kernel/Makefile
@@ -4,6 +4,11 @@
 
 EXTRA_AFLAGS	:= -traditional
 
+#
+# Passing null pointers is ok for smp code, since we access the lowcore here.
+#
+CFLAGS_smp.o	:= -Wno-nonnull
+
 obj-y	:=  bitmap.o traps.o time.o process.o base.o early.o \
             setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
 	    semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o diag.o
Index: linux-2.5/arch/s390/kernel/smp.c
===================================================================
--- linux-2.5.orig/arch/s390/kernel/smp.c
+++ linux-2.5/arch/s390/kernel/smp.c
@@ -631,13 +631,7 @@ static int __cpuinit smp_alloc_lowcore(i
 	panic_stack = __get_free_page(GFP_KERNEL);
 	if (!panic_stack || !async_stack)
 		goto out;
-	/*
-	 * Only need to copy the first 512 bytes from address 0. But since
-	 * the compiler emits a warning if src == NULL for memcpy use copy_page
-	 * instead. Copies more than needed but this code is not performance
-	 * critical.
-	 */
-	copy_page(lowcore, &S390_lowcore);
+	memcpy(lowcore, &S390_lowcore, 512);
 	memset((void *)lowcore + 512, 0, sizeof(*lowcore) - 512);
 	lowcore->async_stack = async_stack + ASYNC_SIZE;
 	lowcore->panic_stack = panic_stack + PAGE_SIZE;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 07/13] Initialize per cpu lowcores on cpu hotplug., Martin Schwidefsky, (Tue Feb 19, 7:40 am)
Re: [patch 07/13] Initialize per cpu lowcores on cpu hotplug., Segher Boessenkool, (Tue Feb 19, 11:44 am)
Re: [patch 07/13] Initialize per cpu lowcores on cpu hotplug., Heiko Carstens, (Wed Feb 20, 2:45 am)