Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* Re: [RESEND PATCH 2/2] ARM: kexec: Check segment memory addresses
       [not found] ` <1348157018-31059-2-git-send-email-will.deacon@arm.com>
@ 2012-10-16 16:10   ` Aaro Koskinen
  2012-10-16 16:32     ` Will Deacon
  0 siblings, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2012-10-16 16:10 UTC (permalink / raw)
  To: Will Deacon; +Cc: linux-arm-kernel, linux-omap

Hi,

On Thu, Sep 20, 2012 at 05:03:38PM +0100, Will Deacon wrote:
> From: Matthew Leach <matthew.leach@arm.com>
> 
> 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.

A.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH 2/2] ARM: kexec: Check segment memory addresses
  2012-10-16 16:10   ` [RESEND PATCH 2/2] ARM: kexec: Check segment memory addresses Aaro Koskinen
@ 2012-10-16 16:32     ` Will Deacon
  2012-10-16 17:09       ` Aaro Koskinen
  0 siblings, 1 reply; 4+ messages in thread
From: Will Deacon @ 2012-10-16 16:32 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org

On Tue, Oct 16, 2012 at 05:10:21PM +0100, Aaro Koskinen wrote:
> Hi,

Hi Aaro,

> On Thu, Sep 20, 2012 at 05:03:38PM +0100, Will Deacon wrote:
> > From: Matthew Leach <matthew.leach@arm.com>
> > 
> > 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?

Cheers,

Will

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH 2/2] ARM: kexec: Check segment memory addresses
  2012-10-16 16:32     ` Will Deacon
@ 2012-10-16 17:09       ` Aaro Koskinen
  2012-10-16 17:16         ` Will Deacon
  0 siblings, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2012-10-16 17:09 UTC (permalink / raw)
  To: Will Deacon
  Cc: linux-omap@vger.kernel.org, linux-arm-kernel@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 <matthew.leach@arm.com>
> > > 
> > > 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:

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);

A.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH 2/2] ARM: kexec: Check segment memory addresses
  2012-10-16 17:09       ` Aaro Koskinen
@ 2012-10-16 17:16         ` Will Deacon
  0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2012-10-16 17:16 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org

On Tue, Oct 16, 2012 at 06:09:00PM +0100, Aaro Koskinen wrote:
> On Tue, Oct 16, 2012 at 05:32:26PM +0100, Will Deacon wrote:
> > 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:
> 
> 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);

Oops, that's a howler! Thanks for spotting it. We should probably reflow the
code a bit because !err sounds like everything should be ok.

Fancy reworking the patch or do you want me to take care of this?

Cheers,

Will

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-16 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1348157018-31059-1-git-send-email-will.deacon@arm.com>
     [not found] ` <1348157018-31059-2-git-send-email-will.deacon@arm.com>
2012-10-16 16:10   ` [RESEND PATCH 2/2] ARM: kexec: Check segment memory addresses Aaro Koskinen
2012-10-16 16:32     ` Will Deacon
2012-10-16 17:09       ` Aaro Koskinen
2012-10-16 17:16         ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox