[PATCH] serial: ucc_uart: make qe_uart_set_mctrl() static

2020-09-11 Thread Jason Yan
This eliminates the following sparse warning: drivers/tty/serial/ucc_uart.c:286:6: warning: symbol 'qe_uart_set_mctrl' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan --- drivers/tty/serial/ucc_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] powerpc/ps3: make two symbols static

2020-09-10 Thread Jason Yan
-by: Hulk Robot Signed-off-by: Jason Yan --- arch/powerpc/platforms/ps3/spu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c index 1193c294b8d0..0c252478e556 100644 --- a/arch/powerpc/platforms/ps3/spu.c +++ b

[PATCH] soc: fsl: dpio: remove set but not used 'addr_cena'

2020-09-10 Thread Jason Yan
addr_cena; | ^ Reported-by: Hulk Robot Signed-off-by: Jason Yan --- drivers/soc/fsl/dpio/qbman-portal.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/soc/fsl/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c index 0ab85bfb116f..659b4a570d5b 100644 ---

Re: [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE

2020-06-14 Thread Jason Yan
defconfig with CONFIG_RANDOMIZE_BASE set. Fixes: 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR infrastructure") Cc: sta...@vger.kernel.org Signed-off-by: Arseny Solokha --- arch/powerpc/mm/nohash/kaslr_booke.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Jason Yan

[PATCH] i2c: powermac: use true,false for bool variable

2020-04-26 Thread Jason Yan
In i2c_powermac_register_devices(), variable 'found_onyx' is bool and assigned '0' and 'true' in different places. Use 'false' instead of '0'. This fixes the following coccicheck warning: drivers/i2c/busses/i2c-powermac.c:318:6-16: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason

Re: [PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64

2020-04-25 Thread Jason Yan
instructions to 64-bit. v2->v3: Fix build error when KASLR is disabled. v1->v2: Add __kaslr_offset for the secondary cpu boot up. Jason Yan (6): powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init() powerpc/fsl_booke/64: introduce reloc_kernel_entr

Re: [PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64

2020-04-22 Thread Jason Yan
Hi Michael, What's the status of this series? Thanks, Jason 在 2020/3/30 10:20, Jason Yan 写道: This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718

[PATCH] soc: fsl: guts: remove unneeded semicolon in fsl_soc_die_match()

2020-04-18 Thread Jason Yan
Fix the following coccicheck warning: drivers/soc/fsl/guts.c:120:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Jason Yan --- drivers/soc/fsl/guts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index

Re: [PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64

2020-04-12 Thread Jason Yan
ping... 在 2020/3/30 10:20, Jason Yan 写道: This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718=* The implementation for Freescale BookE64 is similar

[PATCH] tty: hvc: remove hvcs_driver_string

2020-04-03 Thread Jason Yan
Signed-off-by: Jason Yan --- drivers/tty/hvc/hvcs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index ee0604cd9c6b..55105ac38f89 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -196,8 +196,6 @@ module_param

[PATCH v5 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2020-03-29 Thread Jason Yan
Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v5 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2020-03-29 Thread Jason Yan
The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH v5 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2020-03-29 Thread Jason Yan
Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v5 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-03-29 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/mm/nohash/kaslr_booke.c | 4

[PATCH v5 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-03-29 Thread Jason Yan
:1 mapping has been setup. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/exceptions

[PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-29 Thread Jason Yan
lr_offset by symbol instead of magic offsets. Use IS_ENABLED(CONFIG_PPC32) instead of #ifdef CONFIG_PPC32. Change kaslr-booke32 to kaslr-booke in index.rst Switch some instructions to 64-bit. v2->v3: Fix build error when KASLR is disabled. v1->v2: Add __kaslr_offset for the seconda

[PATCH v5 2/6] powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper

2020-03-29 Thread Jason Yan
Like the 32bit code, we introduce reloc_kernel_entry() helper to prepare for the KASLR 64bit version. And move the C declaration of this function out of CONFIG_PPC32 and use long instead of int for the parameter 'addr'. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

Re: [PATCH v4 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-20 Thread Jason Yan
_PPC32) instead of #ifdef CONFIG_PPC32. Change kaslr-booke32 to kaslr-booke in index.rst Switch some instructions to 64-bit. v2->v3: Fix build error when KASLR is disabled. v1->v2: Add __kaslr_offset for the secondary cpu boot up. Jason Yan (6): powerpc/fsl_booke/kaslr: refact

Re: [PATCH v4 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-16 Thread Jason Yan
ping... 在 2020/3/6 14:40, Jason Yan 写道: This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718=* The implementation for Freescale BookE64 is similar

[PATCH v4 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-03-05 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/mm/nohash/kaslr_booke.c | 4

[PATCH v4 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2020-03-05 Thread Jason Yan
The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH v4 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2020-03-05 Thread Jason Yan
Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v4 2/6] powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper

2020-03-05 Thread Jason Yan
Like the 32bit code, we introduce reloc_kernel_entry() helper to prepare for the KASLR 64bit version. And move the C declaration of this function out of CONFIG_PPC32 and use long instead of int for the parameter 'addr'. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

[PATCH v4 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-03-05 Thread Jason Yan
:1 mapping has been setup. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/exceptions

[PATCH v4 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-05 Thread Jason Yan
to kaslr-booke in index.rst Switch some instructions to 64-bit. v2->v3: Fix build error when KASLR is disabled. v1->v2: Add __kaslr_offset for the secondary cpu boot up. Jason Yan (6): powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init() powerpc/fs

[PATCH v4 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2020-03-05 Thread Jason Yan
Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-04 Thread Jason Yan
在 2020/3/5 5:21, Scott Wood 写道: On Wed, 2020-02-26 at 18:16 +1100, Daniel Axtens wrote: Hi Jason, This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718

Re: [PATCH v3 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-03-04 Thread Jason Yan
在 2020/3/5 5:53, Scott Wood 写道: On Thu, 2020-02-06 at 10:58 +0800, Jason Yan wrote: The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul

Re: [PATCH v3 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2020-03-04 Thread Jason Yan
在 2020/3/5 5:49, Scott Wood 写道: On Thu, 2020-02-06 at 10:58 +0800, Jason Yan wrote: The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc

Re: [PATCH v3 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-03-04 Thread Jason Yan
在 2020/3/5 5:44, Scott Wood 写道: On Thu, 2020-02-06 at 10:58 +0800, Jason Yan wrote: The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale BookE64 set up a TLB mapping of 1G during booting. Another difference is that ppc64 needs the kernel to be 64K

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-02 Thread Jason Yan
在 2020/3/2 16:47, Scott Wood 写道: On Mon, 2020-03-02 at 15:12 +0800, Jason Yan wrote: 在 2020/3/2 11:24, Scott Wood 写道: On Mon, 2020-03-02 at 10:17 +0800, Jason Yan wrote: 在 2020/3/1 6:54, Scott Wood 写道: On Sat, 2020-02-29 at 15:27 +0800, Jason Yan wrote: Turnning to %p may

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-01 Thread Jason Yan
在 2020/3/2 11:24, Scott Wood 写道: On Mon, 2020-03-02 at 10:17 +0800, Jason Yan wrote: 在 2020/3/1 6:54, Scott Wood 写道: On Sat, 2020-02-29 at 15:27 +0800, Jason Yan wrote: Turnning to %p may not be a good idea in this situation. So for the REG logs printed when dumping stack, we can disable

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-01 Thread Jason Yan
在 2020/3/1 6:54, Scott Wood 写道: On Sat, 2020-02-29 at 15:27 +0800, Jason Yan wrote: 在 2020/2/29 12:28, Scott Wood 写道: On Fri, 2020-02-28 at 14:47 +0800, Jason Yan wrote: 在 2020/2/28 13:53, Scott Wood 写道: I don't see any debug setting for %pK (or %p) to always print the actual address

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-28 Thread Jason Yan
在 2020/2/29 12:28, Scott Wood 写道: On Fri, 2020-02-28 at 14:47 +0800, Jason Yan wrote: 在 2020/2/28 13:53, Scott Wood 写道: On Wed, 2020-02-26 at 16:18 +0800, Jason Yan wrote: Hi Daniel, 在 2020/2/26 15:16, Daniel Axtens 写道: Maybe replacing the REG format string in KASLR mode would

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-27 Thread Jason Yan
在 2020/2/28 13:53, Scott Wood 写道: On Wed, 2020-02-26 at 16:18 +0800, Jason Yan wrote: Hi Daniel, 在 2020/2/26 15:16, Daniel Axtens 写道: Hi Jason, This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-26 Thread Jason Yan
在 2020/2/26 19:41, Daniel Axtens 写道: I suspect that you will find it easier to convince people to accept a change to %pK than removal:) BTW, I have a T4240RDB so I might be able to test this series at some point - do I need an updated bootloader to pass in a random seed, or is the kernel

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-26 Thread Jason Yan
e to do this, maybe we can use "%pK" so that they will be hidden from unprivileged users. Thanks, Jason Regards, Daniel v2->v3: Fix build error when KASLR is disabled. v1->v2: Add __kaslr_offset for the secondary cpu boot up. Jason Yan (6): powerpc/fsl_bo

Re: [RFC PATCH] Use IS_ENABLED() instead of #ifdefs

2020-02-25 Thread Jason Yan
在 2020/2/26 13:04, Christophe Leroy 写道: --- This works for me. Only had to leave the #ifdef around the map_mem_in_cams() Also had to set linear_sz and ram for the alternative case, otherwise I get Great. Thank you for the illustration. Jason

Re: [PATCH v3 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-02-25 Thread Jason Yan
在 2020/2/26 10:40, Jason Yan 写道: 在 2020/2/20 21:48, Christophe Leroy 写道: Le 06/02/2020 à 03:58, Jason Yan a écrit : The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale BookE64 set up a TLB mapping of 1G during booting. Another difference

Re: [PATCH v3 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2020-02-25 Thread Jason Yan
在 2020/2/20 21:50, Christophe Leroy 写道: Le 06/02/2020 à 03:58, Jason Yan a écrit : Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

Re: [PATCH v3 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-02-25 Thread Jason Yan
在 2020/2/20 21:49, Christophe Leroy 写道: Le 06/02/2020 à 03:58, Jason Yan a écrit : The original kernel still exists in the memory, clear it now. No such problem with PPC32 ? Or is that common ? PPC32 did this in relocate_init() in fsl_booke.c because PPC32 will not reach

Re: [PATCH v3 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-02-25 Thread Jason Yan
在 2020/2/20 21:48, Christophe Leroy 写道: Le 06/02/2020 à 03:58, Jason Yan a écrit : The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale BookE64 set up a TLB mapping of 1G during booting. Another difference is that ppc64 needs the kernel to be 64K

Re: [PATCH v3 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2020-02-25 Thread Jason Yan
在 2020/2/20 21:40, Christophe Leroy 写道: Le 06/02/2020 à 03:58, Jason Yan a écrit : Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-19 Thread Jason Yan
ping... on 2020/2/13 11:00, Jason Yan wrote: Hi everyone, any comments or suggestions? Thanks, Jason on 2020/2/6 10:58, Jason Yan wrote: This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-12 Thread Jason Yan
Hi everyone, any comments or suggestions? Thanks, Jason on 2020/2/6 10:58, Jason Yan wrote: This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718

[PATCH v3 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-02-05 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/mm/nohash/kaslr_booke.c | 4

[PATCH v3 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2020-02-05 Thread Jason Yan
Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v3 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2020-02-05 Thread Jason Yan
Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v3 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-02-05 Thread Jason Yan
:1 mapping has been setup. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/exceptions

[PATCH v3 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2020-02-05 Thread Jason Yan
The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-05 Thread Jason Yan
ter ideas, I would be happy to hear that. Thank you all. v2->v3: Fix build error when KASLR is disabled. v1->v2: Add __kaslr_offset for the secondary cpu boot up. Jason Yan (6): powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init() powerpc/fsl_b

[PATCH v3 2/6] powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper

2020-02-05 Thread Jason Yan
Like the 32bit code, we introduce reloc_kernel_entry() helper to prepare for the KASLR 64bit version. And move the C declaration of this function out of CONFIG_PPC32 and use long instead of int for the parameter 'addr'. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

[PATCH v2 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2020-02-04 Thread Jason Yan
Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v2 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2020-02-04 Thread Jason Yan
Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v2 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-02-04 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/mm/nohash/kaslr_booke.c | 4

[PATCH v2 2/6] powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper

2020-02-04 Thread Jason Yan
Like the 32bit code, we introduce reloc_kernel_entry() helper to prepare for the KASLR 64bit version. And move the C declaration of this function out of CONFIG_PPC32 and use long instead of int for the parameter 'addr'. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

[PATCH v2 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-02-04 Thread Jason Yan
:1 mapping has been setup. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/exceptions

[PATCH v2 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-04 Thread Jason Yan
ter ideas, I would be happy to hear that. Thank you all. v1->v2: Add __kaslr_offset for the secondary cpu boot up. Jason Yan (6): powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init() powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper power

[PATCH v2 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2020-02-04 Thread Jason Yan
The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2019-11-15 Thread Jason Yan
Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2019-11-15 Thread Jason Yan
The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2019-11-15 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/mm/nohash/kaslr_booke.c | 4

[PATCH 0/6] implement KASLR for powerpc/fsl_booke/64

2019-11-15 Thread Jason Yan
ter ideas, I would be happy to hear that. Thank you all. Jason Yan (6): powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init() powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper powerpc/fsl_booke/64: implement KASLR for fsl_booke64 powerpc/fsl_booke/64:

[PATCH 2/6] powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper

2019-11-15 Thread Jason Yan
Like the 32bit code, we introduce reloc_kernel_entry() helper to prepare for the KASLR 64bit version. And move the C declaration of this function out of CONFIG_PPC32 and use long instead of int for the parameter 'addr'. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

[PATCH 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2019-11-15 Thread Jason Yan
Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2019-11-15 Thread Jason Yan
. This can save some code to creat another TLB map at early boot. The disadvantage is that we only have about 1G/64K = 16384 slots to put the kernel in. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

Re: Pull request: scottwood/linux.git next

2019-11-13 Thread Jason Yan
On 2019/11/13 17:23, Michael Ellerman wrote: It needs to use PTRRELOC() for the kernstart_virt_addr accesses. I've made that change and squashed it into the series. I've pushed that as a branch to here: https://github.com/linuxppc/linux/commits/topic/kaslr-book3e32 That boots for me on

Re: Pull request: scottwood/linux.git next

2019-11-03 Thread Jason Yan
On 2019/11/2 18:38, Michael Ellerman wrote: Jason Yan writes: Hi Michael, Can you pull this to linux-next so that we can test it on linux-next for some time? Yes I plan to, I've just been busy doing other things. As Scott said it's in linux-next anyway. Yeah, I found it in linux-next

Re: Pull request: scottwood/linux.git next

2019-11-03 Thread Jason Yan
On 2019/11/2 1:01, Scott Wood wrote: On Thu, 2019-10-31 at 10:01 +0800, Jason Yan wrote: Hi Michael, Can you pull this to linux-next so that we can test it on linux-next for some time? Thanks, Jason FWIW, my tree is included in linux-next. Ah, I found it in linux-next. Thank you so

Re: Pull request: scottwood/linux.git next

2019-10-30 Thread Jason Yan
: Document KASLR implementation (2019-10-21 16:09:16 -0500) Jason Yan (12): powerpc: unify definition of M_IF_NEEDED powerpc: move memstart_addr and kernstart_addr to init-common.c powerpc: introduce

Re: [PATCH v7 00/12] implement KASLR for powerpc/fsl_booke/32

2019-10-20 Thread Jason Yan
On 2019/10/10 2:46, Scott Wood wrote: On Wed, 2019-10-09 at 16:41 +0800, Jason Yan wrote: Hi Scott, On 2019/10/9 15:13, Scott Wood wrote: On Wed, 2019-10-09 at 14:10 +0800, Jason Yan wrote: Hi Scott, Would you please take sometime to test this? Thank you so much. On 2019/9/24 13:52

Re: [PATCH v7 00/12] implement KASLR for powerpc/fsl_booke/32

2019-10-09 Thread Jason Yan
Hi Scott, On 2019/10/9 15:13, Scott Wood wrote: On Wed, 2019-10-09 at 14:10 +0800, Jason Yan wrote: Hi Scott, Would you please take sometime to test this? Thank you so much. On 2019/9/24 13:52, Jason Yan wrote: Hi Scott, Can you test v7 to see if it works to load a kernel at a non-zero

Re: [PATCH v7 00/12] implement KASLR for powerpc/fsl_booke/32

2019-10-09 Thread Jason Yan
Hi Scott, Would you please take sometime to test this? Thank you so much. On 2019/9/24 13:52, Jason Yan wrote: Hi Scott, Can you test v7 to see if it works to load a kernel at a non-zero address? Thanks, On 2019/9/20 17:45, Jason Yan wrote: This series implements KASLR for powerpc

Re: [PATCH v7 00/12] implement KASLR for powerpc/fsl_booke/32

2019-09-23 Thread Jason Yan
Hi Scott, Can you test v7 to see if it works to load a kernel at a non-zero address? Thanks, On 2019/9/20 17:45, Jason Yan wrote: This series implements KASLR for powerpc/fsl_booke/32, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals

[PATCH v7 08/12] powerpc/fsl_booke/kaslr: clear the original kernel if randomized

2019-09-20 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Christophe Leroy Reviewed-by: Diana Craciun

[PATCH v7 12/12] powerpc/fsl_booke/32: Document KASLR implementation

2019-09-20 Thread Jason Yan
Add document to explain how we implement KASLR for fsl_booke32. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- Documentation/powerpc/kaslr-booke32.rst | 42

[PATCH v7 10/12] powerpc/fsl_booke/kaslr: dump out kernel offset information on panic

2019-09-20 Thread Jason Yan
When kaslr is enabled, the kernel offset is different for every boot. This brings some difficult to debug the kernel. Dump out the kernel offset when panic so that we can easily debug the kernel. This code is derived from x86/arm64 which has similar functionality. Signed-off-by: Jason Yan Cc

[PATCH v7 11/12] powerpc/fsl_booke/kaslr: export offset in VMCOREINFO ELF notes

2019-09-20 Thread Jason Yan
Like all other architectures such as x86 or arm64, include KASLR offset in VMCOREINFO ELF notes to assist in debugging. After this, we can use crash --kaslr option to parse vmcore generated from a kaslr kernel. Note: The crash tool needs to support --kaslr too. Signed-off-by: Jason Yan Cc

[PATCH v7 09/12] powerpc/fsl_booke/kaslr: support nokaslr cmdline parameter

2019-09-20 Thread Jason Yan
One may want to disable kaslr when boot, so provide a cmdline parameter 'nokaslr' to support this. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Diana

[PATCH v7 06/12] powerpc/fsl_booke/32: implement KASLR infrastructure

2019-09-20 Thread Jason Yan
are not suitable to map the kernel directly in a randomized region, so we chose to copy the kernel to a proper place and restart to relocate. The offset of the kernel was not randomized yet(a fixed 64M is set). We will randomize it in the next patch. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael

[PATCH v7 07/12] powerpc/fsl_booke/32: randomize the kernel image offset

2019-09-20 Thread Jason Yan
/kaslr.c such as rotate_xor(). Credit goes to Kees and Ard. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Diana Craciun Tested-by: Diana Craciun Reviewed

[PATCH v7 05/12] powerpc/fsl_booke/32: introduce reloc_kernel_entry() helper

2019-09-20 Thread Jason Yan
Add a new helper reloc_kernel_entry() to jump back to the start of the new kernel. After we put the new kernel in a randomized place we can use this new helper to enter the kernel and begin to relocate again. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy

[PATCH v7 04/12] powerpc/fsl_booke/32: introduce create_kaslr_tlb_entry() helper

2019-09-20 Thread Jason Yan
Add a new helper create_kaslr_tlb_entry() to create a tlb entry by the virtual and physical address. This is a preparation to support boot kernel at a randomized address. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul

[PATCH v7 03/12] powerpc: introduce kernstart_virt_addr to store the kernel base

2019-09-20 Thread Jason Yan
Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we need a variable to store the kernel base. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed

[PATCH v7 01/12] powerpc: unify definition of M_IF_NEEDED

2019-09-20 Thread Jason Yan
M_IF_NEEDED is defined too many times. Move it to a common place and rename it to MAS2_M_IF_NEEDED which is much readable. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook

[PATCH v7 02/12] powerpc: move memstart_addr and kernstart_addr to init-common.c

2019-09-20 Thread Jason Yan
These two variables are both defined in init_32.c and init_64.c. Move them to init-common.c and make them __ro_after_init. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook

[PATCH v7 00/12] implement KASLR for powerpc/fsl_booke/32

2019-09-20 Thread Jason Yan
d_line - Do not print kaslr offset if kaslr is disabled Jason Yan (12): powerpc: unify definition of M_IF_NEEDED powerpc: move memstart_addr and kernstart_addr to init-common.c powerpc: introduce kernstart_virt_addr to store the kernel base powerpc/fsl_booke/32: introduce create_kaslr_tlb_en

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-09-09 Thread Jason Yan
Hi Scott, On 2019/8/28 12:05, Scott Wood wrote: On Fri, 2019-08-09 at 18:07 +0800, Jason Yan wrote: This series implements KASLR for powerpc/fsl_booke/32, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals. Since CONFIG_RELOCATABLE has

Re: [PATCH v6 06/12] powerpc/fsl_booke/32: implement KASLR infrastructure

2019-08-29 Thread Jason Yan
On 2019/8/28 13:47, Christophe Leroy wrote: Le 28/08/2019 à 06:54, Scott Wood a écrit : On Fri, Aug 09, 2019 at 06:07:54PM +0800, Jason Yan wrote: This patch add support to boot kernel from places other than KERNELBASE. Since CONFIG_RELOCATABLE has already supported, what we need to do

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-28 Thread Jason Yan
On 2019/8/28 12:59, Scott Wood wrote: On Tue, 2019-08-27 at 23:05 -0500, Scott Wood wrote: On Fri, 2019-08-09 at 18:07 +0800, Jason Yan wrote: Freescale Book-E parts expect lowmem to be mapped by fixed TLB entries(TLB1). The TLB1 entries are not suitable to map the kernel directly

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-28 Thread Jason Yan
On 2019/8/28 12:05, Scott Wood wrote: On Fri, 2019-08-09 at 18:07 +0800, Jason Yan wrote: This series implements KASLR for powerpc/fsl_booke/32, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals. Since CONFIG_RELOCATABLE has already

Re: [PATCH v6 06/12] powerpc/fsl_booke/32: implement KASLR infrastructure

2019-08-28 Thread Jason Yan
On 2019/8/28 12:54, Scott Wood wrote: On Fri, Aug 09, 2019 at 06:07:54PM +0800, Jason Yan wrote: This patch add support to boot kernel from places other than KERNELBASE. Since CONFIG_RELOCATABLE has already supported, what we need to do is map or copy kernel to a proper place and relocate

Re: [PATCH v6 04/12] powerpc/fsl_booke/32: introduce create_tlb_entry() helper

2019-08-27 Thread Jason Yan
Hi Scott, Thanks for your reply. On 2019/8/28 6:07, Scott Wood wrote: On Fri, Aug 09, 2019 at 06:07:52PM +0800, Jason Yan wrote: Add a new helper create_tlb_entry() to create a tlb entry by the virtual and physical address. This is a preparation to support boot kernel at a randomized address

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-26 Thread Jason Yan
A polite ping :) What else should I do now? Thanks On 2019/8/19 14:12, Jason Yan wrote: Hi Michael, Is there anything more I should do to get this feature meeting the requirements of the mainline? Thanks, Jason On 2019/8/9 18:07, Jason Yan wrote: This series implements KASLR for powerpc

[PATCH] soc/fsl/qbman: fix return value error in bm_shutdown_pool()

2019-08-21 Thread Jason Yan
as initialized prior to bootup") Signed-off-by: Jason Yan --- drivers/soc/fsl/qbman/bman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c index f4fb527d8301..c5dd026fe889 100644 --- a/drivers/soc/fsl/qbman/bman.c +

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-19 Thread Jason Yan
Hi Michael, Is there anything more I should do to get this feature meeting the requirements of the mainline? Thanks, Jason On 2019/8/9 18:07, Jason Yan wrote: This series implements KASLR for powerpc/fsl_booke/32, as a security feature that deters exploit attempts relying on knowledge

[PATCH v6 11/12] powerpc/fsl_booke/kaslr: export offset in VMCOREINFO ELF notes

2019-08-09 Thread Jason Yan
Like all other architectures such as x86 or arm64, include KASLR offset in VMCOREINFO ELF notes to assist in debugging. After this, we can use crash --kaslr option to parse vmcore generated from a kaslr kernel. Note: The crash tool needs to support --kaslr too. Signed-off-by: Jason Yan Cc

[PATCH v6 12/12] powerpc/fsl_booke/32: Document KASLR implementation

2019-08-09 Thread Jason Yan
Add document to explain how we implement KASLR for fsl_booke32. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- Documentation/powerpc/kaslr-booke32.rst | 42

[PATCH v6 09/12] powerpc/fsl_booke/kaslr: support nokaslr cmdline parameter

2019-08-09 Thread Jason Yan
One may want to disable kaslr when boot, so provide a cmdline parameter 'nokaslr' to support this. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Diana

[PATCH v6 08/12] powerpc/fsl_booke/kaslr: clear the original kernel if randomized

2019-08-09 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Christophe Leroy Reviewed-by: Diana Craciun

  1   2   >