Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Sachin Kamat
On 29 January 2014 03:34, Yinghai Lu  wrote:
> In original bootmem wrapper for memblock, we have limit checking.
>
> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
>
> Signed-off-by: Yinghai Lu 
>
> ---

Confirmed that this patch fixes the boot crash issue on Exynos (ARM
based) boards.

Tested-by: Sachin Kamat 

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Tony Luck
On Wed, Jan 29, 2014 at 4:34 PM, Andrew Morton
 wrote:
> It applies for me.  MIME getting you down?

Perhaps - Gmail's web client showed me a downward pointing arrow when I
moused over the attachment icon in Yinghai's e-mail. So I clicked it ... and
it looked like it downloaded a patch-like looking file. So I ran
"patch -p1 < file"
and whoops - that wasn't so great after all :-(

Your plain text e-mail version applied just fine.

GUI: 0 CLI: 1

Patch works - my ia64 boots again.  Thanks.

Tested-by: Tony Luck 

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Andrew Morton
On Wed, 29 Jan 2014 16:12:13 -0800 Tony Luck  wrote:

> Applying on top of Linus' tree (commit =
> dda68a8c1707b4011dc3c656fa1b2c6de6f7f304) I just get:
> 
> patching file include/linux/bootmem.h
> Hunk #1 FAILED at 264.
> Hunk #2 FAILED at 272.
> 2 out of 2 hunks FAILED -- saving rejects to file include/linux/bootmem.h.rej
> 
> - not a promising start :-(
> 

It applies for me.  MIME getting you down?


From: Yinghai Lu 
Subject: memblock, bootmem: restore goal for alloc_low

Now we have memblock_virt_alloc_low to replace original bootmem api
in swiotlb.

But we should not use BOOTMEM_LOW_LIMIT for arch that does not support
CONFIG_NOBOOTMEM, as old api take 0.

| #define alloc_bootmem_low(x) \
|__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
|#define alloc_bootmem_low_pages_nopanic(x) \
|__alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0)

and we have
 #define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS)
for CONFIG_NOBOOTMEM.

Restore goal to 0 to fix ia64 crash, that Tony found.

Signed-off-by: Yinghai Lu 
Reported-by: Tony Luck 
Signed-off-by: Andrew Morton 
---

 include/linux/bootmem.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN include/linux/bootmem.h~memblock-bootmem-restore-goal-for-alloc_low 
include/linux/bootmem.h
--- a/include/linux/bootmem.h~memblock-bootmem-restore-goal-for-alloc_low
+++ a/include/linux/bootmem.h
@@ -264,7 +264,7 @@ static inline void * __init memblock_vir
 {
if (!align)
align = SMP_CACHE_BYTES;
-   return __alloc_bootmem_low(size, align, BOOTMEM_LOW_LIMIT);
+   return __alloc_bootmem_low(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_low_nopanic(
@@ -272,7 +272,7 @@ static inline void * __init memblock_vir
 {
if (!align)
align = SMP_CACHE_BYTES;
-   return __alloc_bootmem_low_nopanic(size, align, BOOTMEM_LOW_LIMIT);
+   return __alloc_bootmem_low_nopanic(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_from_nopanic(
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Tony Luck
Applying on top of Linus' tree (commit =
dda68a8c1707b4011dc3c656fa1b2c6de6f7f304) I just get:

patching file include/linux/bootmem.h
Hunk #1 FAILED at 264.
Hunk #2 FAILED at 272.
2 out of 2 hunks FAILED -- saving rejects to file include/linux/bootmem.h.rej

- not a promising start :-(

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Yinghai Lu
On Wed, Jan 29, 2014 at 3:39 PM, Yinghai Lu  wrote:
> On Wed, Jan 29, 2014 at 3:07 PM, Tony Luck  wrote:
>> Hmmph.  ia64 is broken too.  git bisect says:
>>
>> commit ad6492b80f60a2139fa9bf8fd79b182fe5e3647c
>> Author: Yinghai Lu 
>> Date:   Mon Jan 27 17:06:49 2014 -0800
>>
>> memblock, nobootmem: add memblock_virt_alloc_low()
>>
>> is to blame.  But this patch doesn't fix it.  Still dies with:
>>
>> PID hash table entries: 4096 (order: -1, 32768 bytes)
>> Sorting __ex_table...
>> kernel BUG at mm/bootmem.c:504!
>
> that's another path with memblock_virt wrapper for bootmem.

Please check attached patch.

Thanks

Yinghai
Subject: [PATCH] memblock, bootmem: Restore goal for alloc_low

Now we have memblock_virt_alloc_low to replace original bootmem api
in swiotlb.

But we should not use BOOTMEM_LOW_LIMIT for arch that does not support
CONFIG_NOBOOTMEM, as old api take 0.

| #define alloc_bootmem_low(x) \
|__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
|#define alloc_bootmem_low_pages_nopanic(x) \
|__alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0)

and we have
 #define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS)
for CONFIG_NOBOOTMEM.

Restore goal to 0 to fix ia64 crash, that Tony found.


Reported-by: Tony Luck 
Signed-off-by: Yinghai Lu 

---
 include/linux/bootmem.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/include/linux/bootmem.h
===
--- linux-2.6.orig/include/linux/bootmem.h
+++ linux-2.6/include/linux/bootmem.h
@@ -264,7 +264,7 @@ static inline void * __init memblock_vir
 {
 	if (!align)
 		align = SMP_CACHE_BYTES;
-	return __alloc_bootmem_low(size, align, BOOTMEM_LOW_LIMIT);
+	return __alloc_bootmem_low(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_low_nopanic(
@@ -272,7 +272,7 @@ static inline void * __init memblock_vir
 {
 	if (!align)
 		align = SMP_CACHE_BYTES;
-	return __alloc_bootmem_low_nopanic(size, align, BOOTMEM_LOW_LIMIT);
+	return __alloc_bootmem_low_nopanic(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_from_nopanic(


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Yinghai Lu
On Wed, Jan 29, 2014 at 3:07 PM, Tony Luck  wrote:
> Hmmph.  ia64 is broken too.  git bisect says:
>
> commit ad6492b80f60a2139fa9bf8fd79b182fe5e3647c
> Author: Yinghai Lu 
> Date:   Mon Jan 27 17:06:49 2014 -0800
>
> memblock, nobootmem: add memblock_virt_alloc_low()
>
> is to blame.  But this patch doesn't fix it.  Still dies with:
>
> PID hash table entries: 4096 (order: -1, 32768 bytes)
> Sorting __ex_table...
> kernel BUG at mm/bootmem.c:504!

that's another path with memblock_virt wrapper for bootmem.

Let's me check that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Tony Luck
Hmmph.  ia64 is broken too.  git bisect says:

commit ad6492b80f60a2139fa9bf8fd79b182fe5e3647c
Author: Yinghai Lu 
Date:   Mon Jan 27 17:06:49 2014 -0800

memblock, nobootmem: add memblock_virt_alloc_low()

is to blame.  But this patch doesn't fix it.  Still dies with:

PID hash table entries: 4096 (order: -1, 32768 bytes)
Sorting __ex_table...
kernel BUG at mm/bootmem.c:504!
swapper[0]: bugcheck! 0 [1]
Modules linked in:

CPU: 0 PID: 0 Comm: swapper Not tainted 3.13.0-bisect-09219-g5e345db #10
task: a0010104 ti: a00101040f10 task.ti: a00101040f10
psr : 1010084a2018 ifs : 8797 ip  :
[]Not tainted (3.13.0-bisect-09219-g5e345db)
ip is at alloc_bootmem_bdata+0x230/0x790
unat:  pfs : 0797 rsc : 0003
rnat: a00100dff0ee bsps:  pr  : 96669601598a95a9
ldrs:  ccv :  fpsr: 0009804c8a70433f
csd : 093000063000 ssd : 093000063000
b0  : a00100eea530 b6  : a001005f4040 b7  : a001005f3e00
f6  : 0 f7  : 1003e
f8  : 1003e0044b82fa09b5a53 f9  : 1003e1680
f10 : 1003e0008 f11 : 1003e02d0
r1  : a001017ce170 r2  : a0010158e0a0 r3  : a001015ced80
r8  : 001f r9  : 0664 r10 : 
r11 :  r12 : a0010104fe20 r13 : a0010104
r14 : a0010158e0a8 r15 : a0010158e0a8 r16 : 06640332
r17 :  r18 : 7fff r19 : 
r20 : a00101727e98 r21 : 0058 r22 : a00101616c98
r23 : a00101616c00 r24 : a00101616c00 r25 : 03f8
r26 : a00100e901a8 r27 : a00100f59480 r28 : 0058
r29 : 0057 r30 : 16d0 r31 : 0030
Unable to handle kernel NULL pointer dereference (address )
swapper[0]: Oops 11012296146944 [2]

-Tony

On Tue, Jan 28, 2014 at 5:50 PM, Konrad Rzeszutek Wilk
 wrote:
> On Tue, Jan 28, 2014 at 02:47:57PM -0800, Yinghai Lu wrote:
>> On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen  wrote:
>> > On 01/28/2014 02:04 PM, Yinghai Lu wrote:
>> >> In original bootmem wrapper for memblock, we have limit checking.
>> >>
>> >> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
>> >>
>> >> Signed-off-by: Yinghai Lu 
>> >
>> > Do you have a git tree or cumulative set of patches that you'd like us
>> > to all test?  I'm happy to boot it on my system, I just want to make
>> > sure I've got the same set that you're testing.
>>
>> This one should only affect on arm and x86 the 32 bit kernel with more
>> then 4G RAM.
>
> Tested-by: Konrad Rzeszutek Wilk 
>
> It fixes the issue I saw with Xen and 32-bit dom0 blowing up.
>
>>
>> thanks
>>
>> Yinghai
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Tony Luck
Hmmph.  ia64 is broken too.  git bisect says:

commit ad6492b80f60a2139fa9bf8fd79b182fe5e3647c
Author: Yinghai Lu ying...@kernel.org
Date:   Mon Jan 27 17:06:49 2014 -0800

memblock, nobootmem: add memblock_virt_alloc_low()

is to blame.  But this patch doesn't fix it.  Still dies with:

PID hash table entries: 4096 (order: -1, 32768 bytes)
Sorting __ex_table...
kernel BUG at mm/bootmem.c:504!
swapper[0]: bugcheck! 0 [1]
Modules linked in:

CPU: 0 PID: 0 Comm: swapper Not tainted 3.13.0-bisect-09219-g5e345db #10
task: a0010104 ti: a00101040f10 task.ti: a00101040f10
psr : 1010084a2018 ifs : 8797 ip  :
[a00100eea530]Not tainted (3.13.0-bisect-09219-g5e345db)
ip is at alloc_bootmem_bdata+0x230/0x790
unat:  pfs : 0797 rsc : 0003
rnat: a00100dff0ee bsps:  pr  : 96669601598a95a9
ldrs:  ccv :  fpsr: 0009804c8a70433f
csd : 093000063000 ssd : 093000063000
b0  : a00100eea530 b6  : a001005f4040 b7  : a001005f3e00
f6  : 0 f7  : 1003e
f8  : 1003e0044b82fa09b5a53 f9  : 1003e1680
f10 : 1003e0008 f11 : 1003e02d0
r1  : a001017ce170 r2  : a0010158e0a0 r3  : a001015ced80
r8  : 001f r9  : 0664 r10 : 
r11 :  r12 : a0010104fe20 r13 : a0010104
r14 : a0010158e0a8 r15 : a0010158e0a8 r16 : 06640332
r17 :  r18 : 7fff r19 : 
r20 : a00101727e98 r21 : 0058 r22 : a00101616c98
r23 : a00101616c00 r24 : a00101616c00 r25 : 03f8
r26 : a00100e901a8 r27 : a00100f59480 r28 : 0058
r29 : 0057 r30 : 16d0 r31 : 0030
Unable to handle kernel NULL pointer dereference (address )
swapper[0]: Oops 11012296146944 [2]

-Tony

On Tue, Jan 28, 2014 at 5:50 PM, Konrad Rzeszutek Wilk
konrad.w...@oracle.com wrote:
 On Tue, Jan 28, 2014 at 02:47:57PM -0800, Yinghai Lu wrote:
 On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen dave.han...@intel.com wrote:
  On 01/28/2014 02:04 PM, Yinghai Lu wrote:
  In original bootmem wrapper for memblock, we have limit checking.
 
  Add it to memblock_virt_alloc, to address arm and x86 booting crash.
 
  Signed-off-by: Yinghai Lu ying...@kernel.org
 
  Do you have a git tree or cumulative set of patches that you'd like us
  to all test?  I'm happy to boot it on my system, I just want to make
  sure I've got the same set that you're testing.

 This one should only affect on arm and x86 the 32 bit kernel with more
 then 4G RAM.

 Tested-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com

 It fixes the issue I saw with Xen and 32-bit dom0 blowing up.


 thanks

 Yinghai
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Yinghai Lu
On Wed, Jan 29, 2014 at 3:07 PM, Tony Luck tony.l...@gmail.com wrote:
 Hmmph.  ia64 is broken too.  git bisect says:

 commit ad6492b80f60a2139fa9bf8fd79b182fe5e3647c
 Author: Yinghai Lu ying...@kernel.org
 Date:   Mon Jan 27 17:06:49 2014 -0800

 memblock, nobootmem: add memblock_virt_alloc_low()

 is to blame.  But this patch doesn't fix it.  Still dies with:

 PID hash table entries: 4096 (order: -1, 32768 bytes)
 Sorting __ex_table...
 kernel BUG at mm/bootmem.c:504!

that's another path with memblock_virt wrapper for bootmem.

Let's me check that.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Yinghai Lu
On Wed, Jan 29, 2014 at 3:39 PM, Yinghai Lu ying...@kernel.org wrote:
 On Wed, Jan 29, 2014 at 3:07 PM, Tony Luck tony.l...@gmail.com wrote:
 Hmmph.  ia64 is broken too.  git bisect says:

 commit ad6492b80f60a2139fa9bf8fd79b182fe5e3647c
 Author: Yinghai Lu ying...@kernel.org
 Date:   Mon Jan 27 17:06:49 2014 -0800

 memblock, nobootmem: add memblock_virt_alloc_low()

 is to blame.  But this patch doesn't fix it.  Still dies with:

 PID hash table entries: 4096 (order: -1, 32768 bytes)
 Sorting __ex_table...
 kernel BUG at mm/bootmem.c:504!

 that's another path with memblock_virt wrapper for bootmem.

Please check attached patch.

Thanks

Yinghai
Subject: [PATCH] memblock, bootmem: Restore goal for alloc_low

Now we have memblock_virt_alloc_low to replace original bootmem api
in swiotlb.

But we should not use BOOTMEM_LOW_LIMIT for arch that does not support
CONFIG_NOBOOTMEM, as old api take 0.

| #define alloc_bootmem_low(x) \
|__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
|#define alloc_bootmem_low_pages_nopanic(x) \
|__alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0)

and we have
 #define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS)
for CONFIG_NOBOOTMEM.

Restore goal to 0 to fix ia64 crash, that Tony found.


Reported-by: Tony Luck tony.l...@gmail.com
Signed-off-by: Yinghai Lu ying...@kernel.org

---
 include/linux/bootmem.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/include/linux/bootmem.h
===
--- linux-2.6.orig/include/linux/bootmem.h
+++ linux-2.6/include/linux/bootmem.h
@@ -264,7 +264,7 @@ static inline void * __init memblock_vir
 {
 	if (!align)
 		align = SMP_CACHE_BYTES;
-	return __alloc_bootmem_low(size, align, BOOTMEM_LOW_LIMIT);
+	return __alloc_bootmem_low(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_low_nopanic(
@@ -272,7 +272,7 @@ static inline void * __init memblock_vir
 {
 	if (!align)
 		align = SMP_CACHE_BYTES;
-	return __alloc_bootmem_low_nopanic(size, align, BOOTMEM_LOW_LIMIT);
+	return __alloc_bootmem_low_nopanic(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_from_nopanic(


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Tony Luck
Applying on top of Linus' tree (commit =
dda68a8c1707b4011dc3c656fa1b2c6de6f7f304) I just get:

patching file include/linux/bootmem.h
Hunk #1 FAILED at 264.
Hunk #2 FAILED at 272.
2 out of 2 hunks FAILED -- saving rejects to file include/linux/bootmem.h.rej

- not a promising start :-(

-Tony
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Andrew Morton
On Wed, 29 Jan 2014 16:12:13 -0800 Tony Luck tony.l...@gmail.com wrote:

 Applying on top of Linus' tree (commit =
 dda68a8c1707b4011dc3c656fa1b2c6de6f7f304) I just get:
 
 patching file include/linux/bootmem.h
 Hunk #1 FAILED at 264.
 Hunk #2 FAILED at 272.
 2 out of 2 hunks FAILED -- saving rejects to file include/linux/bootmem.h.rej
 
 - not a promising start :-(
 

It applies for me.  MIME getting you down?


From: Yinghai Lu ying...@kernel.org
Subject: memblock, bootmem: restore goal for alloc_low

Now we have memblock_virt_alloc_low to replace original bootmem api
in swiotlb.

But we should not use BOOTMEM_LOW_LIMIT for arch that does not support
CONFIG_NOBOOTMEM, as old api take 0.

| #define alloc_bootmem_low(x) \
|__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
|#define alloc_bootmem_low_pages_nopanic(x) \
|__alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0)

and we have
 #define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS)
for CONFIG_NOBOOTMEM.

Restore goal to 0 to fix ia64 crash, that Tony found.

Signed-off-by: Yinghai Lu ying...@kernel.org
Reported-by: Tony Luck tony.l...@gmail.com
Signed-off-by: Andrew Morton a...@linux-foundation.org
---

 include/linux/bootmem.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN include/linux/bootmem.h~memblock-bootmem-restore-goal-for-alloc_low 
include/linux/bootmem.h
--- a/include/linux/bootmem.h~memblock-bootmem-restore-goal-for-alloc_low
+++ a/include/linux/bootmem.h
@@ -264,7 +264,7 @@ static inline void * __init memblock_vir
 {
if (!align)
align = SMP_CACHE_BYTES;
-   return __alloc_bootmem_low(size, align, BOOTMEM_LOW_LIMIT);
+   return __alloc_bootmem_low(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_low_nopanic(
@@ -272,7 +272,7 @@ static inline void * __init memblock_vir
 {
if (!align)
align = SMP_CACHE_BYTES;
-   return __alloc_bootmem_low_nopanic(size, align, BOOTMEM_LOW_LIMIT);
+   return __alloc_bootmem_low_nopanic(size, align, 0);
 }
 
 static inline void * __init memblock_virt_alloc_from_nopanic(
_

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Tony Luck
On Wed, Jan 29, 2014 at 4:34 PM, Andrew Morton
a...@linux-foundation.org wrote:
 It applies for me.  MIME getting you down?

Perhaps - Gmail's web client showed me a downward pointing arrow when I
moused over the attachment icon in Yinghai's e-mail. So I clicked it ... and
it looked like it downloaded a patch-like looking file. So I ran
patch -p1  file
and whoops - that wasn't so great after all :-(

Your plain text e-mail version applied just fine.

GUI: 0 CLI: 1

Patch works - my ia64 boots again.  Thanks.

Tested-by: Tony Luck tony.l...@intel.com

-Tony
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-29 Thread Sachin Kamat
On 29 January 2014 03:34, Yinghai Lu ying...@kernel.org wrote:
 In original bootmem wrapper for memblock, we have limit checking.

 Add it to memblock_virt_alloc, to address arm and x86 booting crash.

 Signed-off-by: Yinghai Lu ying...@kernel.org

 ---

Confirmed that this patch fixes the boot crash issue on Exynos (ARM
based) boards.

Tested-by: Sachin Kamat sachin.ka...@linaro.org

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Konrad Rzeszutek Wilk
On Tue, Jan 28, 2014 at 02:47:57PM -0800, Yinghai Lu wrote:
> On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen  wrote:
> > On 01/28/2014 02:04 PM, Yinghai Lu wrote:
> >> In original bootmem wrapper for memblock, we have limit checking.
> >>
> >> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
> >>
> >> Signed-off-by: Yinghai Lu 
> >
> > Do you have a git tree or cumulative set of patches that you'd like us
> > to all test?  I'm happy to boot it on my system, I just want to make
> > sure I've got the same set that you're testing.
> 
> This one should only affect on arm and x86 the 32 bit kernel with more
> then 4G RAM.

Tested-by: Konrad Rzeszutek Wilk 

It fixes the issue I saw with Xen and 32-bit dom0 blowing up.

> 
> thanks
> 
> Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Kevin Hilman
On Tue, Jan 28, 2014 at 2:04 PM, Yinghai Lu  wrote:
> In original bootmem wrapper for memblock, we have limit checking.
>
> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
>
> Signed-off-by: Yinghai Lu 
>
> ---
>  mm/memblock.c |3 +++
>  1 file changed, 3 insertions(+)
>
> Index: linux-2.6/mm/memblock.c
> ===
> --- linux-2.6.orig/mm/memblock.c
> +++ linux-2.6/mm/memblock.c
> @@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
> if (!align)
> align = SMP_CACHE_BYTES;
>
> +   if (max_addr > memblock.current_limit)
> +   max_addr = memblock.current_limit;
> +
>  again:
> alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
> nid);

Tested-by: Kevin Hilman 

Verified various ARM boots to be passing again.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Dave Hansen
On 01/28/2014 02:47 PM, Yinghai Lu wrote:
> On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen  wrote:
>> On 01/28/2014 02:04 PM, Yinghai Lu wrote:
>>> In original bootmem wrapper for memblock, we have limit checking.
>>>
>>> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
>>>
>> Do you have a git tree or cumulative set of patches that you'd like us
>> to all test?  I'm happy to boot it on my system, I just want to make
>> sure I've got the same set that you're testing.
> 
> This one should only affect on arm and x86 the 32 bit kernel with more
> then 4G RAM.

OK, let me rephrase.

Does anyone want me to test this on a 1TB 64-bit x86 system?  If yes,
please tell me which patches you want me to test, and on top of which
kernel.  I have three patches in this area, I think, but I don't want to
waste my time testing and reporting the wrong thing.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Yinghai Lu
On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen  wrote:
> On 01/28/2014 02:04 PM, Yinghai Lu wrote:
>> In original bootmem wrapper for memblock, we have limit checking.
>>
>> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
>>
>> Signed-off-by: Yinghai Lu 
>
> Do you have a git tree or cumulative set of patches that you'd like us
> to all test?  I'm happy to boot it on my system, I just want to make
> sure I've got the same set that you're testing.

This one should only affect on arm and x86 the 32 bit kernel with more
then 4G RAM.

thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Andrew Morton
On Tue, 28 Jan 2014 14:04:25 -0800 Yinghai Lu  wrote:

> In original bootmem wrapper for memblock, we have limit checking.
> 
> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
> 
> ...
>
> --- linux-2.6.orig/mm/memblock.c
> +++ linux-2.6/mm/memblock.c
> @@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
>   if (!align)
>   align = SMP_CACHE_BYTES;
>  
> + if (max_addr > memblock.current_limit)
> + max_addr = memblock.current_limit;
> +
>  again:
>   alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
>   nid);

Thanks.

Kevin, Olof and Konrad (at least) have been hitting this.  It would be
great to get some tested-by's, please?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Olof Johansson
On Tue, Jan 28, 2014 at 2:04 PM, Yinghai Lu  wrote:
> In original bootmem wrapper for memblock, we have limit checking.
>
> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
>
> Signed-off-by: Yinghai Lu 

Tested-by: Olof Johansson 

Verified to resolve the crashes on boot on ARM.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Dave Hansen
On 01/28/2014 02:04 PM, Yinghai Lu wrote:
> In original bootmem wrapper for memblock, we have limit checking.
> 
> Add it to memblock_virt_alloc, to address arm and x86 booting crash.
> 
> Signed-off-by: Yinghai Lu 

Do you have a git tree or cumulative set of patches that you'd like us
to all test?  I'm happy to boot it on my system, I just want to make
sure I've got the same set that you're testing.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Yinghai Lu
In original bootmem wrapper for memblock, we have limit checking.

Add it to memblock_virt_alloc, to address arm and x86 booting crash.

Signed-off-by: Yinghai Lu 

---
 mm/memblock.c |3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/mm/memblock.c
===
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
if (!align)
align = SMP_CACHE_BYTES;
 
+   if (max_addr > memblock.current_limit)
+   max_addr = memblock.current_limit;
+
 again:
alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
nid);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Yinghai Lu
In original bootmem wrapper for memblock, we have limit checking.

Add it to memblock_virt_alloc, to address arm and x86 booting crash.

Signed-off-by: Yinghai Lu ying...@kernel.org

---
 mm/memblock.c |3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/mm/memblock.c
===
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
if (!align)
align = SMP_CACHE_BYTES;
 
+   if (max_addr  memblock.current_limit)
+   max_addr = memblock.current_limit;
+
 again:
alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
nid);
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Dave Hansen
On 01/28/2014 02:04 PM, Yinghai Lu wrote:
 In original bootmem wrapper for memblock, we have limit checking.
 
 Add it to memblock_virt_alloc, to address arm and x86 booting crash.
 
 Signed-off-by: Yinghai Lu ying...@kernel.org

Do you have a git tree or cumulative set of patches that you'd like us
to all test?  I'm happy to boot it on my system, I just want to make
sure I've got the same set that you're testing.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Andrew Morton
On Tue, 28 Jan 2014 14:04:25 -0800 Yinghai Lu ying...@kernel.org wrote:

 In original bootmem wrapper for memblock, we have limit checking.
 
 Add it to memblock_virt_alloc, to address arm and x86 booting crash.
 
 ...

 --- linux-2.6.orig/mm/memblock.c
 +++ linux-2.6/mm/memblock.c
 @@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
   if (!align)
   align = SMP_CACHE_BYTES;
  
 + if (max_addr  memblock.current_limit)
 + max_addr = memblock.current_limit;
 +
  again:
   alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
   nid);

Thanks.

Kevin, Olof and Konrad (at least) have been hitting this.  It would be
great to get some tested-by's, please?

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Olof Johansson
On Tue, Jan 28, 2014 at 2:04 PM, Yinghai Lu ying...@kernel.org wrote:
 In original bootmem wrapper for memblock, we have limit checking.

 Add it to memblock_virt_alloc, to address arm and x86 booting crash.

 Signed-off-by: Yinghai Lu ying...@kernel.org

Tested-by: Olof Johansson o...@lixom.net

Verified to resolve the crashes on boot on ARM.


-Olof
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Yinghai Lu
On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen dave.han...@intel.com wrote:
 On 01/28/2014 02:04 PM, Yinghai Lu wrote:
 In original bootmem wrapper for memblock, we have limit checking.

 Add it to memblock_virt_alloc, to address arm and x86 booting crash.

 Signed-off-by: Yinghai Lu ying...@kernel.org

 Do you have a git tree or cumulative set of patches that you'd like us
 to all test?  I'm happy to boot it on my system, I just want to make
 sure I've got the same set that you're testing.

This one should only affect on arm and x86 the 32 bit kernel with more
then 4G RAM.

thanks

Yinghai
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Dave Hansen
On 01/28/2014 02:47 PM, Yinghai Lu wrote:
 On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen dave.han...@intel.com wrote:
 On 01/28/2014 02:04 PM, Yinghai Lu wrote:
 In original bootmem wrapper for memblock, we have limit checking.

 Add it to memblock_virt_alloc, to address arm and x86 booting crash.

 Do you have a git tree or cumulative set of patches that you'd like us
 to all test?  I'm happy to boot it on my system, I just want to make
 sure I've got the same set that you're testing.
 
 This one should only affect on arm and x86 the 32 bit kernel with more
 then 4G RAM.

OK, let me rephrase.

Does anyone want me to test this on a 1TB 64-bit x86 system?  If yes,
please tell me which patches you want me to test, and on top of which
kernel.  I have three patches in this area, I think, but I don't want to
waste my time testing and reporting the wrong thing.


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Kevin Hilman
On Tue, Jan 28, 2014 at 2:04 PM, Yinghai Lu ying...@kernel.org wrote:
 In original bootmem wrapper for memblock, we have limit checking.

 Add it to memblock_virt_alloc, to address arm and x86 booting crash.

 Signed-off-by: Yinghai Lu ying...@kernel.org

 ---
  mm/memblock.c |3 +++
  1 file changed, 3 insertions(+)

 Index: linux-2.6/mm/memblock.c
 ===
 --- linux-2.6.orig/mm/memblock.c
 +++ linux-2.6/mm/memblock.c
 @@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
 if (!align)
 align = SMP_CACHE_BYTES;

 +   if (max_addr  memblock.current_limit)
 +   max_addr = memblock.current_limit;
 +
  again:
 alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
 nid);

Tested-by: Kevin Hilman khil...@linaro.org

Verified various ARM boots to be passing again.

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] memblock: Add limit checking to memblock_virt_alloc

2014-01-28 Thread Konrad Rzeszutek Wilk
On Tue, Jan 28, 2014 at 02:47:57PM -0800, Yinghai Lu wrote:
 On Tue, Jan 28, 2014 at 2:08 PM, Dave Hansen dave.han...@intel.com wrote:
  On 01/28/2014 02:04 PM, Yinghai Lu wrote:
  In original bootmem wrapper for memblock, we have limit checking.
 
  Add it to memblock_virt_alloc, to address arm and x86 booting crash.
 
  Signed-off-by: Yinghai Lu ying...@kernel.org
 
  Do you have a git tree or cumulative set of patches that you'd like us
  to all test?  I'm happy to boot it on my system, I just want to make
  sure I've got the same set that you're testing.
 
 This one should only affect on arm and x86 the 32 bit kernel with more
 then 4G RAM.

Tested-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com

It fixes the issue I saw with Xen and 32-bit dom0 blowing up.

 
 thanks
 
 Yinghai
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/