From patchwork Tue Oct 16 17:09:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 1601961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 98F2340ABA for ; Tue, 16 Oct 2012 17:11:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TOAdq-0001Mb-DG; Tue, 16 Oct 2012 17:09:18 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TOAdm-0001Lt-RL for linux-arm-kernel@merlin.infradead.org; Tue, 16 Oct 2012 17:09:15 +0000 Received: from filtteri6.pp.htv.fi ([213.243.153.189]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TOAdj-0007AH-0k for linux-arm-kernel@lists.infradead.org; Tue, 16 Oct 2012 17:09:13 +0000 Received: from localhost (localhost [127.0.0.1]) by filtteri6.pp.htv.fi (Postfix) with ESMTP id 50ADA56E78A; Tue, 16 Oct 2012 20:09:02 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp4.welho.com ([213.243.153.38]) by localhost (filtteri6.pp.htv.fi [213.243.153.189]) (amavisd-new, port 10024) with ESMTP id pD3hkjq8j2hE; Tue, 16 Oct 2012 20:09:01 +0300 (EEST) Received: from musicnaut.iki.fi (cs181064211.pp.htv.fi [82.181.64.211]) by smtp4.welho.com (Postfix) with SMTP id AE8095BC010; Tue, 16 Oct 2012 20:09:00 +0300 (EEST) Received: by musicnaut.iki.fi (sSMTP sendmail emulation); Tue, 16 Oct 2012 20:09:00 +0300 Date: Tue, 16 Oct 2012 20:09:00 +0300 From: Aaro Koskinen To: Will Deacon Subject: Re: [RESEND PATCH 2/2] ARM: kexec: Check segment memory addresses Message-ID: <20121016170900.GB1613@blackmetal.musicnaut.iki.fi> References: <1348157018-31059-1-git-send-email-will.deacon@arm.com> <1348157018-31059-2-git-send-email-will.deacon@arm.com> <20121016161020.GA1613@blackmetal.musicnaut.iki.fi> <20121016163226.GG23979@mudshark.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121016163226.GG23979@mudshark.cambridge.arm.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121016_180911_394980_CB8A8F5B X-CRM114-Status: GOOD ( 20.39 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Tue, Oct 16, 2012 at 05:32:26PM +0100, Will Deacon wrote: > On Tue, Oct 16, 2012 at 05:10:21PM +0100, Aaro Koskinen wrote: > > On Thu, Sep 20, 2012 at 05:03:38PM +0100, Will Deacon wrote: > > > From: Matthew Leach > > > > > > Ensure that the memory regions that are set within the segments > > > correspond to physical contiguous memory regions. > > > > This patch seems to break kexec for me in 3.7-rc1 (commit > > c564df4db85aac8d1d65a56176a0a25f46138064, bisected). > > > > kexec -l fails with the following output: > > > > kexec_load failed: Invalid argument > > entry = 0x80008000 flags = 280000 > > nr_segments = 2 > > segment[0].buf = 0xc48008 > > segment[0].bufsz = 230 > > segment[0].mem = 0x80001000 > > segment[0].memsz = 1000 > > segment[1].buf = 0xb6a9b008 > > segment[1].bufsz = 3a4668 > > segment[1].mem = 0x80008000 > > segment[1].memsz = 3a5000 > > Could not load the kexec kernel: n800-zImage > > > > The board is OMAP2420 / Nokia N800. > > Interesting, it sounds like kexec thinks that you don't have contiguous > memory from 0x80008000 to 0x803ad000. Can you provide some more information > about your physical memory map please? Well, I think it's because the patch is wrong. Shouldn't it be: A. diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index e29c333..a80192e 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c @@ -47,7 +47,7 @@ int machine_kexec_prepare(struct kimage *image) err = memblock_is_region_memory(current_segment->mem, current_segment->memsz); - if (err) + if (!err) return - EINVAL; err = get_user(header, (__be32*)current_segment->buf);