Re: [PATCH v5 1/2] powerpc/32: add stack protector support

2019-01-12 Thread Samuel Holland
Hello all, On 09/27/18 02:05, Christophe Leroy wrote: [..snip..] > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile > index 07d9dce7eda6..45b8eb4d8fe7 100644 > --- a/arch/powerpc/Makefile > +++ b/arch/powerpc/Makefile > @@ -112,6 +112,9 @@ KBUILD_LDFLAGS+= -m elf$(BITS)$(LDEMULATION)

Re: use generic DMA mapping code in powerpc V4

2019-01-12 Thread Christian Zigotzky
Next step: 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 (swiotlb: remove swiotlb_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 Output: You are in 'detached HEAD' state. You can look around, make experim

[PATCH 0/2] powerpc: wii.dts: GPIO interrupt and button support

2019-01-12 Thread Jonathan Neuschäfer
This patchset adds the necessary bits to wii.dts to enable interrupt support in the GPIO controller, and defines two GPIO-based buttons, the POWER button and the EJECT button. I will send another patchset which will implement interrupt support in the GPIO driver (gpio-hlwd.c). Jonathan Neuschäfer

[PATCH 2/2] powerpc: wii.dts: Add GPIO keys

2019-01-12 Thread Jonathan Neuschäfer
The Wii has POWER and EJECT buttons, which are connected through normalization logic to the GPIO controller (the length of an assertion of these signals is always the same, regardless of how long the user pressed the buttons). Signed-off-by: Jonathan Neuschäfer --- arch/powerpc/boot/dts/wii.dts

[PATCH 1/2] powerpc: wii.dts: Add interrupt-related properties to GPIO node

2019-01-12 Thread Jonathan Neuschäfer
The Hollywood GPIO controller is connected to the Hollywood PIC (&PIC1) at IRQs 10 and 11; IRQ 10 for GPIO lines that are configured for access by the PPC, 11 for GPIO lines that are configured for access by the ARM926. Signed-off-by: Jonathan Neuschäfer --- arch/powerpc/boot/dts/wii.dts | 5 +++

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Matthew Wilcox
On Sat, Jan 12, 2019 at 02:49:29PM +0100, Christophe Leroy wrote: > As far as I can see, > > #define GFP_KERNEL_ACCOUNT (GFP_KERNEL | __GFP_ACCOUNT) > > So what's the difference between: > > (GFP_KERNEL_ACCOUNT | __GFP_ZERO) & ~__GFP_ACCOUNT > > and > > (GFP_KERNEL | __GFP_ZERO) & ~__GFP_ACCOU

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Christophe Leroy
Le 12/01/2019 à 13:12, Matthew Wilcox a écrit : On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote: All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | __GFP_ZERO) and using it for allocating page table pages. Except that's not true. +++ b/arch/x86/m

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Anshuman Khandual
On 01/12/2019 05:42 PM, Matthew Wilcox wrote: > On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote: >> All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | >> __GFP_ZERO) and using it for allocating page table pages. > > Except that's not true. > >> +++ b/

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Matthew Wilcox
On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote: > All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > __GFP_ZERO) and using it for allocating page table pages. Except that's not true. > +++ b/arch/x86/mm/pgtable.c > @@ -13,19 +13,17 @@ phys_addr_t phys

[PATCH v3 3/3] powerpc/32: Add KASAN support

2019-01-12 Thread Christophe Leroy
This patch adds KASAN support for PPC32. Note that on book3s it will only work on the 603 because the other ones use hash table and can therefore not share a single PTE table covering the entire early KASAN shadow area. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig

[PATCH v3 2/3] powerpc/32: Move early_init() in a separate file

2019-01-12 Thread Christophe Leroy
In preparation of KASAN, move early_init() into a separate file in order to allow deactivation of KASAN for that function. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kernel/early_32.c | 35 +++ arch/powerpc/kernel/setu

[PATCH v3 1/3] powerpc/mm: prepare kernel for KAsan on PPC32

2019-01-12 Thread Christophe Leroy
In kernel/cputable.c, explicitly use memcpy() in order to allow GCC to replace it with __memcpy() when KASAN is selected. Since commit 400c47d81ca38 ("powerpc32: memset: only use dcbz once cache is enabled"), memset() can be used before activation of the cache, so no need to use memset_io() for ze

[PATCH v3 0/3] KASAN for powerpc/32

2019-01-12 Thread Christophe Leroy
This serie adds KASAN support to powerpc/32 Tested on nohash/32 (8xx) and book3s/32 (mpc832x ie 603) Changes in v3: - Removed the printk() in kasan_early_init() to avoid build failure (see https://github.com/linuxppc/issues/issues/218) - Added necessary changes in asm/book3s/32/pgtable.h to get

Re: [PATCH] powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group()

2019-01-12 Thread Dan Carpenter
On Sat, Jan 12, 2019 at 01:34:42AM -0600, Segher Boessenkool wrote: > On Sat, Jan 12, 2019 at 08:44:26AM +0300, Dan Carpenter wrote: > > On Sat, Jan 12, 2019 at 11:30:35AM +1100, Balbir Singh wrote: > > > On Wed, Jan 09, 2019 at 01:23:29PM +0300, Dan Carpenter wrote: > > > > There is a typo so we a

[PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Anshuman Khandual
All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | __GFP_ZERO) and using it for allocating page table pages. This causes some code duplication which can be easily avoided. GFP_KERNEL allocated and cleared out pages (__GFP_ZERO) are required for page tables on any given arch

[PATCH v13 09/10] powerpc/64: Remove CURRENT_THREAD_INFO

2019-01-12 Thread Christophe Leroy
Now that current_thread_info is located at the beginning of 'current' task struct, CURRENT_THREAD_INFO macro is not really needed any more. This patch replaces it by loads of the value at PACACURRENT(r13). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/exception-64s.h | 4 +

[PATCH v13 10/10] powerpc: clean stack pointers naming

2019-01-12 Thread Christophe Leroy
Some stack pointers used to also be thread_info pointers and were called tp. Now that they are only stack pointers, rename them sp. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/irq.c | 17 +++-- arch/powerpc/kernel/setup_64.c | 11 +++ 2 files changed, 10 inse

[PATCH v13 08/10] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU

2019-01-12 Thread Christophe Leroy
Now that thread_info is similar to task_struct, its address is in r2 so CURRENT_THREAD_INFO() macro is useless. This patch removes it. At the same time, as the 'cpu' field is not anymore in thread_info, this patch renames it to TASK_CPU. Signed-off-by: Christophe Leroy --- arch/powerpc/Makefile

[PATCH v13 07/10] powerpc: 'current_set' is now a table of task_struct pointers

2019-01-12 Thread Christophe Leroy
The table of pointers 'current_set' has been used for retrieving the stack and current. They used to be thread_info pointers as they were pointing to the stack and current was taken from the 'task' field of the thread_info. Now, the pointers of 'current_set' table are now both pointers to task_str

[PATCH v13 06/10] powerpc: regain entire stack space

2019-01-12 Thread Christophe Leroy
thread_info is not anymore in the stack, so the entire stack can now be used. There is also no risk anymore of corrupting task_cpu(p) with a stack overflow so the patch removes the test. When doing this, an explicit test for NULL stack pointer is needed in validate_sp() as it is not anymore impli

[PATCH v13 05/10] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK

2019-01-12 Thread Christophe Leroy
This patch activates CONFIG_THREAD_INFO_IN_TASK which moves the thread_info into task_struct. Moving thread_info into task_struct has the following advantages: - It protects thread_info from corruption in the case of stack overflows. - Its address is harder to determine if stack addresses are leak

[PATCH v13 04/10] powerpc: Prepare for moving thread_info into task_struct

2019-01-12 Thread Christophe Leroy
This patch cleans the powerpc kernel before activating CONFIG_THREAD_INFO_IN_TASK: - The purpose of the pointer given to call_do_softirq() and call_do_irq() is to point the new stack ==> change it to void* and rename it 'sp' - Don't use CURRENT_THREAD_INFO() to locate the stack. - Fix a few comment

[PATCH v13 03/10] powerpc: Only use task_struct 'cpu' field on SMP

2019-01-12 Thread Christophe Leroy
When moving to CONFIG_THREAD_INFO_IN_TASK, the thread_info 'cpu' field gets moved into task_struct and only defined when CONFIG_SMP is set. This patch ensures that TI_CPU is only used when CONFIG_SMP is set and that task_struct 'cpu' field is not used directly out of SMP code. Signed-off-by: Chri

[PATCH v13 02/10] book3s/64: avoid circular header inclusion in mmu-hash.h

2019-01-12 Thread Christophe Leroy
When activating CONFIG_THREAD_INFO_IN_TASK, linux/sched.h includes asm/current.h. This generates a circular dependency. To avoid that, asm/processor.h shall not be included in mmu-hash.h In order to do that, this patch moves into a new header called asm/task_size_user64.h the information from asm/

[PATCH v13 00/10] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK

2019-01-12 Thread Christophe Leroy
The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which moves the thread_info into task_struct. Moving thread_info into task_struct has the following advantages: - It protects thread_info from corruption in the case of stack overflows. - Its address is harder to determine if stac

[PATCH v13 01/10] powerpc/irq: use memblock functions returning virtual address

2019-01-12 Thread Christophe Leroy
Since only the virtual address of allocated blocks is used, lets use functions returning directly virtual address. Those functions have the advantage of also zeroing the block. Suggested-by: Mike Rapoport Acked-by: Mike Rapoport Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/irq.c

Re: ppc64le reliable stack unwinder and scheduled tasks

2019-01-12 Thread Segher Boessenkool
On Sat, Jan 12, 2019 at 12:09:14PM +1100, Balbir Singh wrote: > Could you please define interesting frame on top a bit more? Usually > the topmost return address is in LR There is no reliable way (other than DWARF unwind info) to find out where the value of LR at function entry currently lives (if