Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761946AbYBTJqJ (ORCPT ); Wed, 20 Feb 2008 04:46:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755393AbYBTJp4 (ORCPT ); Wed, 20 Feb 2008 04:45:56 -0500 Received: from mtagate5.de.ibm.com ([195.212.29.154]:62441 "EHLO mtagate5.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755279AbYBTJpy (ORCPT ); Wed, 20 Feb 2008 04:45:54 -0500 Date: Wed, 20 Feb 2008 10:45:52 +0100 From: Heiko Carstens To: Segher Boessenkool Cc: Bastian Blank , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Martin Schwidefsky Subject: Re: [patch 07/13] Initialize per cpu lowcores on cpu hotplug. Message-ID: <20080220094552.GA12635@osiris.boeblingen.de.ibm.com> References: <20080219144047.587547541@de.ibm.com> <20080219144504.392301782@de.ibm.com> <20080219151355.GA24547@wavehammer.waldi.eu.org> <20080219153855.GA11599@osiris.boeblingen.de.ibm.com> <20080219154149.GB11599@osiris.boeblingen.de.ibm.com> <0d276daad249ac20ae922f4aa9a6e88b@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0d276daad249ac20ae922f4aa9a6e88b@kernel.crashing.org> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2317 Lines: 60 >>>> Boah, workaround alert. Why do you not fix the compiler? >>> >>> We need to copy from address 0 (that's where the lowcore resides). But >>> gcc >>> insists to complain if memcpy is used with src == NULL.. Now what? >> >> Erm sorry, misread your question. Usually it's a bug to use memcpy with >> src == NULL. In this case it's ok. So I think it's perfectly ok if gcc >> emits a warning. >> If you know of a better way to get around this please let me know. > > -ffreestanding or -Wno-nonnull? 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/