Re: [PATCH -next] openrisc: Define __ro_after_init to avoid crash

2016-09-27 Thread Guenter Roeck

On 09/27/2016 07:15 AM, Stafford Horne wrote:



On Sat, 24 Sep 2016, Guenter Roeck wrote:


openrisc qemu tests fail with the following crash.

Unable to handle kernel access at virtual address 0xc0300c34

Oops#: 0001
CPU #: 0
  PC: c016c710SR: ae67SP: c1017e04
  GPR00:  GPR01: c1017e04 GPR02: c0300c34 GPR03: c0300c34
  GPR04:  GPR05: c0300cb0 GPR06: c0300c34 GPR07: 00ff
  GPR08: c107f074 GPR09: c0199ef4 GPR10: c1016000 GPR11: 
  GPR12:  GPR13: c107f044 GPR14: c0473774 GPR15: 07ce
  GPR16:  GPR17: c107ed8a GPR18: 9600 GPR19: c107f044
  GPR20: c107ee74 GPR21: 0003 GPR22: c0473770 GPR23: 0033
  GPR24: 00bf GPR25: 0019 GPR26: c046400c GPR27: 0001
  GPR28: c0464028 GPR29: c1018000 GPR30: 0006 GPR31: ccf37483
RES:  oGPR11: 
Process swapper (pid: 1, stackpage=c1001960)

Stack: Stack dump [0xc1017cf8]:
sp + 00: 0xc1017e04
sp + 04: 0xc0300c34
sp + 08: 0xc0300c34
sp + 12: 0x
...

Bisect points to commit d2ec3f77de8e ("pty: make ptmx file ops read-only
after init"). Fix by defining __ro_after_init for the openrisc
architecture, similar to parisc.


Thanks for finding this one.
Just for clatify __read_mostly falls back to default blank in openrisc, so it 
gets no special section treatment.



Yes, I understand. It falls back to the pre-_ro_after_init behavior, which 
should be
perfectly fine here.

Guenter



Acked-by: Stafford Horne 



Fixes: d2ec3f77de8e ("pty: make ptmx file ops read-only after init")
Cc: Kees Cook 
Signed-off-by: Guenter Roeck 
---
arch/openrisc/include/asm/cache.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/include/asm/cache.h 
b/arch/openrisc/include/asm/cache.h
index 4ce7a01a252d..5f55da9cbfd5 100644
--- a/arch/openrisc/include/asm/cache.h
+++ b/arch/openrisc/include/asm/cache.h
@@ -23,6 +23,8 @@
 * they shouldn't be hard-coded!
 */

+#define __ro_after_init __read_mostly
+
#define L1_CACHE_BYTES 16
#define L1_CACHE_SHIFT 4

--
2.5.0








Re: [PATCH -next] openrisc: Define __ro_after_init to avoid crash

2016-09-27 Thread Guenter Roeck

On 09/27/2016 07:15 AM, Stafford Horne wrote:



On Sat, 24 Sep 2016, Guenter Roeck wrote:


openrisc qemu tests fail with the following crash.

Unable to handle kernel access at virtual address 0xc0300c34

Oops#: 0001
CPU #: 0
  PC: c016c710SR: ae67SP: c1017e04
  GPR00:  GPR01: c1017e04 GPR02: c0300c34 GPR03: c0300c34
  GPR04:  GPR05: c0300cb0 GPR06: c0300c34 GPR07: 00ff
  GPR08: c107f074 GPR09: c0199ef4 GPR10: c1016000 GPR11: 
  GPR12:  GPR13: c107f044 GPR14: c0473774 GPR15: 07ce
  GPR16:  GPR17: c107ed8a GPR18: 9600 GPR19: c107f044
  GPR20: c107ee74 GPR21: 0003 GPR22: c0473770 GPR23: 0033
  GPR24: 00bf GPR25: 0019 GPR26: c046400c GPR27: 0001
  GPR28: c0464028 GPR29: c1018000 GPR30: 0006 GPR31: ccf37483
RES:  oGPR11: 
Process swapper (pid: 1, stackpage=c1001960)

Stack: Stack dump [0xc1017cf8]:
sp + 00: 0xc1017e04
sp + 04: 0xc0300c34
sp + 08: 0xc0300c34
sp + 12: 0x
...

Bisect points to commit d2ec3f77de8e ("pty: make ptmx file ops read-only
after init"). Fix by defining __ro_after_init for the openrisc
architecture, similar to parisc.


Thanks for finding this one.
Just for clatify __read_mostly falls back to default blank in openrisc, so it 
gets no special section treatment.



Yes, I understand. It falls back to the pre-_ro_after_init behavior, which 
should be
perfectly fine here.

Guenter



Acked-by: Stafford Horne 



Fixes: d2ec3f77de8e ("pty: make ptmx file ops read-only after init")
Cc: Kees Cook 
Signed-off-by: Guenter Roeck 
---
arch/openrisc/include/asm/cache.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/include/asm/cache.h 
b/arch/openrisc/include/asm/cache.h
index 4ce7a01a252d..5f55da9cbfd5 100644
--- a/arch/openrisc/include/asm/cache.h
+++ b/arch/openrisc/include/asm/cache.h
@@ -23,6 +23,8 @@
 * they shouldn't be hard-coded!
 */

+#define __ro_after_init __read_mostly
+
#define L1_CACHE_BYTES 16
#define L1_CACHE_SHIFT 4

--
2.5.0








Re: [PATCH -next] openrisc: Define __ro_after_init to avoid crash

2016-09-27 Thread Stafford Horne



On Sat, 24 Sep 2016, Guenter Roeck wrote:


openrisc qemu tests fail with the following crash.

Unable to handle kernel access at virtual address 0xc0300c34

Oops#: 0001
CPU #: 0
  PC: c016c710SR: ae67SP: c1017e04
  GPR00:  GPR01: c1017e04 GPR02: c0300c34 GPR03: c0300c34
  GPR04:  GPR05: c0300cb0 GPR06: c0300c34 GPR07: 00ff
  GPR08: c107f074 GPR09: c0199ef4 GPR10: c1016000 GPR11: 
  GPR12:  GPR13: c107f044 GPR14: c0473774 GPR15: 07ce
  GPR16:  GPR17: c107ed8a GPR18: 9600 GPR19: c107f044
  GPR20: c107ee74 GPR21: 0003 GPR22: c0473770 GPR23: 0033
  GPR24: 00bf GPR25: 0019 GPR26: c046400c GPR27: 0001
  GPR28: c0464028 GPR29: c1018000 GPR30: 0006 GPR31: ccf37483
RES:  oGPR11: 
Process swapper (pid: 1, stackpage=c1001960)

Stack: Stack dump [0xc1017cf8]:
sp + 00: 0xc1017e04
sp + 04: 0xc0300c34
sp + 08: 0xc0300c34
sp + 12: 0x
...

Bisect points to commit d2ec3f77de8e ("pty: make ptmx file ops read-only
after init"). Fix by defining __ro_after_init for the openrisc
architecture, similar to parisc.


Thanks for finding this one.
Just for clatify __read_mostly falls back to default blank in openrisc, so 
it gets no special section treatment.


Acked-by: Stafford Horne 



Fixes: d2ec3f77de8e ("pty: make ptmx file ops read-only after init")
Cc: Kees Cook 
Signed-off-by: Guenter Roeck 
---
arch/openrisc/include/asm/cache.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/include/asm/cache.h 
b/arch/openrisc/include/asm/cache.h
index 4ce7a01a252d..5f55da9cbfd5 100644
--- a/arch/openrisc/include/asm/cache.h
+++ b/arch/openrisc/include/asm/cache.h
@@ -23,6 +23,8 @@
 * they shouldn't be hard-coded!
 */

+#define __ro_after_init __read_mostly
+
#define L1_CACHE_BYTES 16
#define L1_CACHE_SHIFT 4

--
2.5.0




Re: [PATCH -next] openrisc: Define __ro_after_init to avoid crash

2016-09-27 Thread Stafford Horne



On Sat, 24 Sep 2016, Guenter Roeck wrote:


openrisc qemu tests fail with the following crash.

Unable to handle kernel access at virtual address 0xc0300c34

Oops#: 0001
CPU #: 0
  PC: c016c710SR: ae67SP: c1017e04
  GPR00:  GPR01: c1017e04 GPR02: c0300c34 GPR03: c0300c34
  GPR04:  GPR05: c0300cb0 GPR06: c0300c34 GPR07: 00ff
  GPR08: c107f074 GPR09: c0199ef4 GPR10: c1016000 GPR11: 
  GPR12:  GPR13: c107f044 GPR14: c0473774 GPR15: 07ce
  GPR16:  GPR17: c107ed8a GPR18: 9600 GPR19: c107f044
  GPR20: c107ee74 GPR21: 0003 GPR22: c0473770 GPR23: 0033
  GPR24: 00bf GPR25: 0019 GPR26: c046400c GPR27: 0001
  GPR28: c0464028 GPR29: c1018000 GPR30: 0006 GPR31: ccf37483
RES:  oGPR11: 
Process swapper (pid: 1, stackpage=c1001960)

Stack: Stack dump [0xc1017cf8]:
sp + 00: 0xc1017e04
sp + 04: 0xc0300c34
sp + 08: 0xc0300c34
sp + 12: 0x
...

Bisect points to commit d2ec3f77de8e ("pty: make ptmx file ops read-only
after init"). Fix by defining __ro_after_init for the openrisc
architecture, similar to parisc.


Thanks for finding this one.
Just for clatify __read_mostly falls back to default blank in openrisc, so 
it gets no special section treatment.


Acked-by: Stafford Horne 



Fixes: d2ec3f77de8e ("pty: make ptmx file ops read-only after init")
Cc: Kees Cook 
Signed-off-by: Guenter Roeck 
---
arch/openrisc/include/asm/cache.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/include/asm/cache.h 
b/arch/openrisc/include/asm/cache.h
index 4ce7a01a252d..5f55da9cbfd5 100644
--- a/arch/openrisc/include/asm/cache.h
+++ b/arch/openrisc/include/asm/cache.h
@@ -23,6 +23,8 @@
 * they shouldn't be hard-coded!
 */

+#define __ro_after_init __read_mostly
+
#define L1_CACHE_BYTES 16
#define L1_CACHE_SHIFT 4

--
2.5.0




[PATCH -next] openrisc: Define __ro_after_init to avoid crash

2016-09-24 Thread Guenter Roeck
openrisc qemu tests fail with the following crash.

Unable to handle kernel access at virtual address 0xc0300c34

Oops#: 0001
CPU #: 0
   PC: c016c710SR: ae67SP: c1017e04
   GPR00:  GPR01: c1017e04 GPR02: c0300c34 GPR03: c0300c34
   GPR04:  GPR05: c0300cb0 GPR06: c0300c34 GPR07: 00ff
   GPR08: c107f074 GPR09: c0199ef4 GPR10: c1016000 GPR11: 
   GPR12:  GPR13: c107f044 GPR14: c0473774 GPR15: 07ce
   GPR16:  GPR17: c107ed8a GPR18: 9600 GPR19: c107f044
   GPR20: c107ee74 GPR21: 0003 GPR22: c0473770 GPR23: 0033
   GPR24: 00bf GPR25: 0019 GPR26: c046400c GPR27: 0001
   GPR28: c0464028 GPR29: c1018000 GPR30: 0006 GPR31: ccf37483
 RES:  oGPR11: 
 Process swapper (pid: 1, stackpage=c1001960)

 Stack: Stack dump [0xc1017cf8]:
 sp + 00: 0xc1017e04
 sp + 04: 0xc0300c34
 sp + 08: 0xc0300c34
 sp + 12: 0x
...

Bisect points to commit d2ec3f77de8e ("pty: make ptmx file ops read-only
after init"). Fix by defining __ro_after_init for the openrisc
architecture, similar to parisc.

Fixes: d2ec3f77de8e ("pty: make ptmx file ops read-only after init")
Cc: Kees Cook 
Signed-off-by: Guenter Roeck 
---
 arch/openrisc/include/asm/cache.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/include/asm/cache.h 
b/arch/openrisc/include/asm/cache.h
index 4ce7a01a252d..5f55da9cbfd5 100644
--- a/arch/openrisc/include/asm/cache.h
+++ b/arch/openrisc/include/asm/cache.h
@@ -23,6 +23,8 @@
  * they shouldn't be hard-coded!
  */
 
+#define __ro_after_init __read_mostly
+
 #define L1_CACHE_BYTES 16
 #define L1_CACHE_SHIFT 4
 
-- 
2.5.0



[PATCH -next] openrisc: Define __ro_after_init to avoid crash

2016-09-24 Thread Guenter Roeck
openrisc qemu tests fail with the following crash.

Unable to handle kernel access at virtual address 0xc0300c34

Oops#: 0001
CPU #: 0
   PC: c016c710SR: ae67SP: c1017e04
   GPR00:  GPR01: c1017e04 GPR02: c0300c34 GPR03: c0300c34
   GPR04:  GPR05: c0300cb0 GPR06: c0300c34 GPR07: 00ff
   GPR08: c107f074 GPR09: c0199ef4 GPR10: c1016000 GPR11: 
   GPR12:  GPR13: c107f044 GPR14: c0473774 GPR15: 07ce
   GPR16:  GPR17: c107ed8a GPR18: 9600 GPR19: c107f044
   GPR20: c107ee74 GPR21: 0003 GPR22: c0473770 GPR23: 0033
   GPR24: 00bf GPR25: 0019 GPR26: c046400c GPR27: 0001
   GPR28: c0464028 GPR29: c1018000 GPR30: 0006 GPR31: ccf37483
 RES:  oGPR11: 
 Process swapper (pid: 1, stackpage=c1001960)

 Stack: Stack dump [0xc1017cf8]:
 sp + 00: 0xc1017e04
 sp + 04: 0xc0300c34
 sp + 08: 0xc0300c34
 sp + 12: 0x
...

Bisect points to commit d2ec3f77de8e ("pty: make ptmx file ops read-only
after init"). Fix by defining __ro_after_init for the openrisc
architecture, similar to parisc.

Fixes: d2ec3f77de8e ("pty: make ptmx file ops read-only after init")
Cc: Kees Cook 
Signed-off-by: Guenter Roeck 
---
 arch/openrisc/include/asm/cache.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/include/asm/cache.h 
b/arch/openrisc/include/asm/cache.h
index 4ce7a01a252d..5f55da9cbfd5 100644
--- a/arch/openrisc/include/asm/cache.h
+++ b/arch/openrisc/include/asm/cache.h
@@ -23,6 +23,8 @@
  * they shouldn't be hard-coded!
  */
 
+#define __ro_after_init __read_mostly
+
 #define L1_CACHE_BYTES 16
 #define L1_CACHE_SHIFT 4
 
-- 
2.5.0