[PATCH v2] soc: fsl: enable acpi support

2020-08-18 Thread Ran Wang
From: Peng Ma This patch enables ACPI support in RCPM driver. Signed-off-by: Peng Ma Signed-off-by: Ran Wang --- Change in v2: - Update acpi_device_id to fix conflict with other driver drivers/soc/fsl/rcpm.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-08-18 Thread Michal Hocko
On Tue 18-08-20 09:32:52, David Hildenbrand wrote: > On 12.08.20 08:01, Srikar Dronamraju wrote: > > Hi Andrew, Michal, David > > > > * Andrew Morton [2020-08-06 21:32:11]: > > > >> On Fri, 3 Jul 2020 18:28:23 +0530 Srikar Dronamraju > >> wrote: > >> > The memory hotplug changes that

Re: [PATCH v2] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Christoph Hellwig
On Mon, Aug 17, 2020 at 06:46:58PM -0300, Thiago Jung Bauermann wrote: > POWER secure guests (i.e., guests which use the Protection Execution > Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but > they don't need the SWIOTLB memory to be in low addresses since the >

Re: [PATCH v2 1/3] powerpc/numa: Introduce logical numa id

2020-08-18 Thread Aneesh Kumar K.V
Srikar Dronamraju writes: > * Aneesh Kumar K.V [2020-08-17 17:04:24]: > >> On 8/17/20 4:29 PM, Srikar Dronamraju wrote: >> > * Aneesh Kumar K.V [2020-08-17 16:02:36]: >> > >> > > We use ibm,associativity and ibm,associativity-lookup-arrays to derive >> > > the numa >> > > node numbers. These

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-18 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: > On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: >> Excerpts from pet...@infradead.org's message of August 7, 2020 9:11 pm: >> > >> > What's wrong with something like this? >> > >> > AFAICT there's no

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-08-18 Thread David Hildenbrand
On 12.08.20 08:01, Srikar Dronamraju wrote: > Hi Andrew, Michal, David > > * Andrew Morton [2020-08-06 21:32:11]: > >> On Fri, 3 Jul 2020 18:28:23 +0530 Srikar Dronamraju >> wrote: >> The memory hotplug changes that somehow because you can hotremove numa nodes and therefore make the

[PATCH v6 3/3] powerpc/numa: Offline memoryless cpuless node 0

2020-08-18 Thread Srikar Dronamraju
Currently Linux kernel with CONFIG_NUMA on a system with multiple possible nodes, marks node 0 as online at boot. However in practice, there are systems which have node 0 as memoryless and cpuless. This can cause numa_balancing to be enabled on systems with only one node with memory and CPUs.

[PATCH v6 2/3] powerpc/numa: Prefer node id queried from vphn

2020-08-18 Thread Srikar Dronamraju
Node id queried from the static device tree may not be correct. For example: it may always show 0 on a shared processor. Hence prefer the node id queried from vphn and fallback on the device tree based node id if vphn query fails. Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...@kvack.org Cc:

Re: [PATCH v5 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-08-18 Thread Srikar Dronamraju
* Michal Hocko [2020-08-18 09:37:12]: > On Tue 18-08-20 09:32:52, David Hildenbrand wrote: > > On 12.08.20 08:01, Srikar Dronamraju wrote: > > > Hi Andrew, Michal, David > > > > > > * Andrew Morton [2020-08-06 21:32:11]: > > > > > >> On Fri, 3 Jul 2020 18:28:23 +0530 Srikar Dronamraju > > >>

Re: [PATCH 1/2] powerpc/64s: remove PROT_SAO support

2020-08-18 Thread Nicholas Piggin
Excerpts from Shawn Anastasio's message of August 18, 2020 5:14 am: > I'm a bit concerned about the removal of PROT_SAO. > > From what I can see, a feature like this would be extremely useful for > emulating architectures with stronger memory models. QEMU's multi- > threaded TCG project in

[PATCH v6 0/3] Offline memoryless cpuless node 0

2020-08-18 Thread Srikar Dronamraju
Changelog v5:->v6: - Now the fix is Powerpc specific. (David Hildenbrand, Michal Hocko, Christopher Lamater) - rebased to v5.8 link v5: https://lore.kernel.org/linuxppc-dev/20200624092846.9194-1-sri...@linux.vnet.ibm.com/t/#u Changelog v4:->v5: - rebased to v5.8 link v4:

[PATCH v6 1/3] powerpc/numa: Set numa_node for all possible cpus

2020-08-18 Thread Srikar Dronamraju
A Powerpc system with multiple possible nodes and with CONFIG_NUMA enabled always used to have a node 0, even if node 0 does not any cpus or memory attached to it. As per PAPR, node affinity of a cpu is only available once its present / online. For all cpus that are possible but not present,

Re: [Virtual ppce500] virtio_gpu virtio0: swiotlb buffer is full

2020-08-18 Thread Gerd Hoffmann
On Mon, Aug 17, 2020 at 11:19:58AM +0200, Christian Zigotzky wrote: > Hello > > I compiled the RC1 of kernel 5.9 today. Unfortunately the issue with the > VirtIO-GPU (see below) still exists. Therefore we still need the patch (see > below) for using the VirtIO-GPU in a virtual e5500 PPC64 QEMU

Re: [PATCH 06/20] ethernet: chelsio: convert tasklets to use new tasklet_setup() API

2020-08-18 Thread Allen
> > You need to adjust kdoc when you change functions: > > drivers/net/ethernet/chelsio/cxgb4/sge.c:2664: warning: Function parameter or > member 't' not described in 'restart_ctrlq' > drivers/net/ethernet/chelsio/cxgb4/sge.c:2664: warning: Excess function > parameter 'data' description in

Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

2020-08-18 Thread Allen
> > Well, then at the next time, please mention it explicitly in the cover > letter. Usually this kind of API conversion isn't done during rc. Or > it's done systematically via script or such. So unless mentioned, > it's not expected to be carried to 5.9. Sorry for having missed the detail.

Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

2020-08-18 Thread Mark Brown
On Tue, Aug 18, 2020 at 12:25:31PM +0200, Takashi Iwai wrote: > Mark, may I apply those ASoC patches through my tree together with > others? Those seem targeting to 5.9, and I have a patch set to > convert to tasklet for 5.10, which would be better manageable when > based on top of those

Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

2020-08-18 Thread Takashi Iwai
On Tue, 18 Aug 2020 12:44:32 +0200, Mark Brown wrote: > > On Tue, Aug 18, 2020 at 12:25:31PM +0200, Takashi Iwai wrote: > > > Mark, may I apply those ASoC patches through my tree together with > > others? Those seem targeting to 5.9, and I have a patch set to > > convert to tasklet for 5.10,

Re: [Virtual ppce500] virtio_gpu virtio0: swiotlb buffer is full

2020-08-18 Thread Christian Zigotzky
On 18 August 2020 at 10:18 am, Gerd Hoffmann wrote: On Mon, Aug 17, 2020 at 11:19:58AM +0200, Christian Zigotzky wrote: Hello I compiled the RC1 of kernel 5.9 today. Unfortunately the issue with the VirtIO-GPU (see below) still exists. Therefore we still need the patch (see below) for using

Re: [PATCH v2] soc: fsl: enable acpi support

2020-08-18 Thread kernel test robot
Hi Ran, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.9-rc1 next-20200818] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented

[PATCH] powerpc/pseries: Do not initiate shutdown when system is running on UPS

2020-08-18 Thread Vasant Hegde
As per PAPR specification whenever system is running on UPS we have to wait for predefined time (default 10mins) before initiating shutdown. We have user space tool (rtas_errd) to monitor for EPOW events and initiate shutdown after predefined time. Hence do not initiate shutdown whenever we get

Re: [powerpc] 5.9.0-rc1 boot failure on POWER9 PowerVM LPAR

2020-08-18 Thread Michael Ellerman
Sachin Sant writes: > 5.9.0-rc1 fails to boot on POWER9 PowerVM LPAR with following message Looks like: https://lore.kernel.org/linuxppc-dev/20200814150509.225615-1-vaib...@linux.ibm.com/ cheers > Starting udev Kernel Device Manager... > [ OK ] Started udev Kernel Device

Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

2020-08-18 Thread Takashi Iwai
On Mon, 17 Aug 2020 10:56:53 +0200, Allen Pais wrote: > > From: Allen Pais > > Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")' > introduced a new tasklet initialization API. This series converts > all the sound drivers to use the new tasklet_setup() API > > Allen Pais (10):

Re: [PATCH] powerpc/fixmap: Fix the size of the early debug area

2020-08-18 Thread Michael Ellerman
On Mon, 17 Aug 2020 06:03:26 + (UTC), Christophe Leroy wrote: > Commit ("03fd42d458fb powerpc/fixmap: Fix FIX_EARLY_DEBUG_BASE when > page size is 256k") reworked the setup of the early debug area and > mistakenly replaced 128 * 1024 by SZ_128. > > Change to SZ_128K to restore the original

[PATCH v3 01/17] KVM: PPC: Book3S HV: simplify kvm_cma_reserve()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport The memory size calculation in kvm_cma_reserve() traverses memblock.memory rather than simply call memblock_phys_mem_size(). The comment in that function suggests that at some point there should have been call to memblock_analyze() before memblock_phys_mem_size() could be

Re: [PATCH] powerpc/32s: Fix is_module_segment() when MODULES_VADDR is defined

2020-08-18 Thread Michael Ellerman
On Wed, 5 Aug 2020 15:27:28 + (UTC), Christophe Leroy wrote: > When MODULES_VADDR is defined, is_module_segment() shall check the > address against it instead of checking agains VMALLOC_START. Applied to powerpc/fixes. [1/1] powerpc/32s: Fix is_module_segment() when MODULES_VADDR is defined

Re: [PATCH] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled

2020-08-18 Thread Michael Ellerman
On Mon, 17 Aug 2020 16:03:01 +0530, Aneesh Kumar K.V wrote: > IS_ENABLED() instead of #ifdef still requires variable declaration. > In this specific case, default_uamor is declared in asm/pkeys.h which > is only included if PPC_MEM_KEYS is enabled. > > arch/powerpc/mm/book3s64/hash_utils.c: In

[PATCH v3 06/17] riscv: drop unneeded node initialization

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport RISC-V does not (yet) support NUMA and for UMA architectures node 0 is used implicitly during early memory initialization. There is no need to call memblock_set_node(), remove this call and the surrounding code. Signed-off-by: Mike Rapoport --- arch/riscv/mm/init.c | 9

[PATCH v3 09/17] memblock: make memblock_debug and related functionality private

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport The only user of memblock_dbg() outside memblock was s390 setup code and it is converted to use pr_debug() instead. This allows to stop exposing memblock_debug and memblock_dbg() to the rest of the kernel. Signed-off-by: Mike Rapoport Reviewed-by: Baoquan He ---

[PATCH v3 14/17] x86/setup: simplify reserve_crashkernel()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport * Replace magic numbers with defines * Replace memblock_find_in_range() + memblock_reserve() with memblock_phys_alloc_range() * Stop checking for low memory size in reserve_crashkernel_low(). The allocation from limited range will anyway fail if there is no enough

[PATCH v3 04/17] arm64: numa: simplify dummy_numa_init()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport dummy_numa_init() loops over memblock.memory and passes nid=0 to numa_add_memblk() which essentially wraps memblock_set_node(). However, memblock_set_node() can cope with entire memory span itself, so the loop over memblock.memory regions is redundant. Using a single call to

Re: [Virtual ppce500] virtio_gpu virtio0: swiotlb buffer is full

2020-08-18 Thread Christian Zigotzky
On 18 August 2020 at 10:18 am, Gerd Hoffmann wrote: On Mon, Aug 17, 2020 at 11:19:58AM +0200, Christian Zigotzky wrote: Hello I compiled the RC1 of kernel 5.9 today. Unfortunately the issue with the VirtIO-GPU (see below) still exists. Therefore we still need the patch (see below) for using

[PATCH v3 03/17] arm, xtensa: simplify initialization of high memory pages

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport The function free_highpages() in both arm and xtensa essentially open-code for_each_free_mem_range() loop to detect high memory pages that were not reserved and that should be initialized and passed to the buddy allocator. Replace open-coded implementation of

[PATCH v3 07/17] mircoblaze: drop unneeded NUMA and sparsemem initializations

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport microblaze does not support neither NUMA not SPARSMEM, so there is no point to call memblock_set_node() and sparse_memory_present_with_active_regions() functions during microblaze memory initialization. Remove these calls and the surrounding code. Signed-off-by: Mike

[PATCH v3 15/17] memblock: remove unused memblock_mem_size()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport The only user of memblock_mem_size() was x86 setup code, it is gone now and memblock_mem_size() funciton can be removed. Signed-off-by: Mike Rapoport Reviewed-by: Baoquan He --- include/linux/memblock.h | 1 - mm/memblock.c| 15 --- 2 files

Re: Flushing transparent hugepages

2020-08-18 Thread Will Deacon
On Tue, Aug 18, 2020 at 04:07:36PM +0100, Matthew Wilcox wrote: > For example, arm64 seems confused in this scenario: > > void flush_dcache_page(struct page *page) > { > if (test_bit(PG_dcache_clean, >flags)) > clear_bit(PG_dcache_clean, >flags); > } > > ... > > void

[PATCH v3 10/17] memblock: reduce number of parameters in for_each_mem_range()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport Currently for_each_mem_range() and for_each_mem_range_rev() iterators are the most generic way to traverse memblock regions. As such, they have 8 parameters and they are hardly convenient to users. Most users choose to utilize one of their wrappers and the only user that

[PATCH v3 12/17] arch, drivers: replace for_each_membock() with for_each_mem_range()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport There are several occurrences of the following pattern: for_each_memblock(memory, reg) { start = __pfn_to_phys(memblock_region_memory_base_pfn(reg); end = __pfn_to_phys(memblock_region_memory_end_pfn(reg)); /* do

Re: [PATCH] powerpc/kasan: Fix KASAN_SHADOW_START on BOOK3S_32

2020-08-18 Thread Michael Ellerman
On Wed, 5 Aug 2020 15:27:29 + (UTC), Christophe Leroy wrote: > On BOOK3S_32, when we have modules and strict kernel RWX, modules > are not in vmalloc space but in a dedicated segment that is > below PAGE_OFFSET. > > So KASAN_SHADOW_START must take it into account. > > MODULES_VADDR can't be

[PATCH v3 00/17] memblock: seasonal cleaning^w cleanup

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches simplify several uses of memblock iterators and hide some of the memblock implementation details from the rest of the system. The patches are on top of v5.9-rc1 v3 changes: * rebase on v5.9-rc1, as the result this required some non-trivial changes in

[PATCH v3 05/17] h8300, nds32, openrisc: simplify detection of memory extents

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport Instead of traversing memblock.memory regions to find memory_start and memory_end, simply query memblock_{start,end}_of_DRAM(). Signed-off-by: Mike Rapoport Acked-by: Stafford Horne --- arch/h8300/kernel/setup.c| 8 +++- arch/nds32/kernel/setup.c| 8 ++--

[PATCH v3 11/17] arch, mm: replace for_each_memblock() with for_each_mem_pfn_range()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport There are several occurrences of the following pattern: for_each_memblock(memory, reg) { start_pfn = memblock_region_memory_base_pfn(reg); end_pfn = memblock_region_memory_end_pfn(reg); /* do something with start_pfn

[PATCH v3 16/17] memblock: implement for_each_reserved_mem_region() using __next_mem_region()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport Iteration over memblock.reserved with for_each_reserved_mem_region() used __next_reserved_mem_region() that implemented a subset of __next_mem_region(). Use __for_each_mem_range() and, essentially, __next_mem_region() with appropriate parameters to reduce code duplication.

[PATCH v3 17/17] memblock: use separate iterators for memory and reserved regions

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport for_each_memblock() is used to iterate over memblock.memory in a few places that use data from memblock_region rather than the memory ranges. Introduce separate for_each_mem_region() and for_each_reserved_mem_region() to improve encapsulation of memblock internals from its

Re: [PATCH v2] powerpc/pseries/hotplug-cpu: wait indefinitely for vCPU death

2020-08-18 Thread Michael Ellerman
On Tue, 11 Aug 2020 11:15:44 -0500, Michael Roth wrote: > For a power9 KVM guest with XIVE enabled, running a test loop > where we hotplug 384 vcpus and then unplug them, the following traces > can be seen (generally within a few loops) either from the unplugged > vcpu: > > [ 1767.353447] cpu

Flushing transparent hugepages

2020-08-18 Thread Matthew Wilcox
If your arch does not support HAVE_ARCH_TRANSPARENT_HUGEPAGE, you can stop reading now. Although maybe you're curious about adding support. $ git grep -w HAVE_ARCH_TRANSPARENT_HUGEPAGE arch arch/Kconfig:config HAVE_ARCH_TRANSPARENT_HUGEPAGE arch/arc/Kconfig:config HAVE_ARCH_TRANSPARENT_HUGEPAGE

[PATCH v3 02/17] dma-contiguous: simplify cma_early_percent_memory()

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport The memory size calculation in cma_early_percent_memory() traverses memblock.memory rather than simply call memblock_phys_mem_size(). The comment in that function suggests that at some point there should have been call to memblock_analyze() before memblock_phys_mem_size()

[PATCH v3 08/17] memblock: make for_each_memblock_type() iterator private

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport for_each_memblock_type() is not used outside mm/memblock.c, move it there from include/linux/memblock.h Signed-off-by: Mike Rapoport Reviewed-by: Baoquan He --- include/linux/memblock.h | 5 - mm/memblock.c| 5 + 2 files changed, 5 insertions(+), 5

[PATCH v3 13/17] x86/setup: simplify initrd relocation and reservation

2020-08-18 Thread Mike Rapoport
From: Mike Rapoport Currently, initrd image is reserved very early during setup and then it might be relocated and re-reserved after the initial physical memory mapping is created. The "late" reservation of memblock verifies that mapped memory size exceeds the size of initrd, then checks whether

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-18 Thread peterz
On Tue, Aug 18, 2020 at 05:22:33PM +1000, Nicholas Piggin wrote: > Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: > > On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: > >> Excerpts from pet...@infradead.org's message of August 7, 2020 9:11 pm: > >> > > >>

[PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
POWER secure guests (i.e., guests which use the Protection Execution Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but they don't need the SWIOTLB memory to be in low addresses since the hypervisor doesn't have any addressing limitation. This solves a SWIOTLB

[PATCH v2 02/25] powerpc/ptrace: Move declaration of ptrace_get_reg() and ptrace_set_reg()

2020-08-18 Thread Christophe Leroy
ptrace_get_reg() and ptrace_set_reg() are only used internally by ptrace. Move them in arch/powerpc/kernel/ptrace/ptrace-decl.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h| 6 -- arch/powerpc/kernel/ptrace/ptrace-decl.h | 3 +++

[PATCH v2 01/25] powerpc/signal: Move inline functions in signal.h

2020-08-18 Thread Christophe Leroy
To really be inlined, the functions need to be defined in the same C file as the caller, or in an included header. Move functions defined inline from signal .c in signal.h Fixes: 3dd4eb83a9c0 ("powerpc: move common register copy functions from signal_32.c to signal.c") Signed-off-by: Christophe

[PATCH v2 10/25] powerpc/signal: Call get_tm_stackpointer() from get_sigframe()

2020-08-18 Thread Christophe Leroy
Instead of calling get_tm_stackpointer() from the caller, call it directly from get_sigframe(). This avoids a double call and allows get_tm_stackpointer() to become static and be inlined into get_sigframe() by GCC. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal.c| 9

[PATCH v2 15/25] powerpc/signal32: Misc changes to make handle_[rt_]_signal32() more similar

2020-08-18 Thread Christophe Leroy
Miscellaneous changes to clean and make handle_signal32() and handle_rt_signal32() even more similar. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git

[PATCH v2 14/25] powerpc/signal32: Rename local pointers in handle_rt_signal32()

2020-08-18 Thread Christophe Leroy
Rename pointers in handle_rt_signal32() to make it more similar to handle_signal32() tm_frame becomes tm_mctx frame becomes mctx rt_sf becomes frame Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 51 - 1 file changed, 25 insertions(+), 26

Re: [PATCH 07/11] x86: move PAGE_OFFSET, TASK_SIZE & friends to page_{32,64}_types.h

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:08AM +0200, Christoph Hellwig wrote: > At least for 64-bit this moves them closer to some of the defines > they are based on, and it prepares for using the TASK_SIZE_MAX > definition from assembly. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --

Re: [PATCH] powerpc/pseries: Do not initiate shutdown when system is running on UPS

2020-08-18 Thread Tyrel Datwyler
On 8/18/20 3:54 AM, Vasant Hegde wrote: > As per PAPR specification whenever system is running on UPS we have to > wait for predefined time (default 10mins) before initiating shutdown. The wording in PAPR seems a little unclear. It states for an EPOW_SYSTEM_SHUTDOWN action code that an EPOW error

Re: [PATCH 03/11] fs: don't allow splice read/write without explicit ops

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:04AM +0200, Christoph Hellwig wrote: > default_file_splice_write is the last piece of generic code that uses > set_fs to make the uaccess routines operate on kernel pointers. It > implements a "fallback loop" for splicing from files that do not actually > provide a

Re: [PATCH 09/11] x86: remove address space overrides using set_fs()

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:10AM +0200, Christoph Hellwig wrote: > Stop providing the possibility to override the address space using > set_fs() now that there is no need for that any more. To properly > handle the TASK_SIZE_MAX checking for 4 vs 5-level page tables on > x86 a new alternative

Re: [PATCH 08/11] x86: make TASK_SIZE_MAX usable from assembly code

2020-08-18 Thread Kees Cook
On Tue, Aug 18, 2020 at 09:55:39PM +0200, Christoph Hellwig wrote: > On Tue, Aug 18, 2020 at 12:44:49PM -0700, Kees Cook wrote: > > On Mon, Aug 17, 2020 at 09:32:09AM +0200, Christoph Hellwig wrote: > > > For 64-bit the only hing missing was a strategic _AC, and for 32-bit we > > > > typo: thing

Re: [PATCH 03/11] fs: don't allow splice read/write without explicit ops

2020-08-18 Thread Christoph Hellwig
On Tue, Aug 18, 2020 at 12:58:07PM -0700, Kees Cook wrote: > On Tue, Aug 18, 2020 at 09:54:46PM +0200, Christoph Hellwig wrote: > > On Tue, Aug 18, 2020 at 12:39:34PM -0700, Kees Cook wrote: > > > On Mon, Aug 17, 2020 at 09:32:04AM +0200, Christoph Hellwig wrote: > > > > default_file_splice_write

Re: fsl_espi errors on v5.7.15

2020-08-18 Thread Chris Packham
Hi Again, On 17/08/20 9:09 am, Chris Packham wrote: > > On 14/08/20 6:19 pm, Heiner Kallweit wrote: >> On 14.08.2020 04:48, Chris Packham wrote: >>> Hi, >>> >>> I'm seeing a problem with accessing spi-nor after upgrading a T2081 >>> based system to linux v5.7.15 >>> >>> For this board u-boot and

Re: [PATCH v3 10/17] memblock: reduce number of parameters in for_each_mem_range()

2020-08-18 Thread Miguel Ojeda
On Tue, Aug 18, 2020 at 5:19 PM Mike Rapoport wrote: > > .clang-format | 2 ++ For the .clang-format bit: Acked-by: Miguel Ojeda Cheers, Miguel

[Bug 208957] New: 5.9-rc1 fails to build for a PowerMac G5: .../book3s64/hash_utils.c:1119:21: error: ‘default_uamor’ undeclared (first use in this function) 1119 | mtspr(SPRN_UAMOR, default_uamor)

2020-08-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208957 Bug ID: 208957 Summary: 5.9-rc1 fails to build for a PowerMac G5: .../book3s64/hash_utils.c:1119:21: error: ‘default_uamor’ undeclared (first use in this function)

[PATCH v2 13/25] powerpc/signal32: Move handle_signal32() close to handle_rt_signal32()

2020-08-18 Thread Christophe Leroy
Those two functions are similar and serving the same purpose. To ease refactorisation, move them close to each other. This is pure move, no code change, no cosmetic. Yes, checkpatch is not happy, most will clear later. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 170

[PATCH v2 12/25] powerpc/signal32: Simplify logging in handle_rt_signal32()

2020-08-18 Thread Christophe Leroy
If something is bad in the frame, there is no point in knowing which part of the frame exactly is wrong as it got allocated as a single block. Always print the root address of the frame in case of failed user access, just like handle_signal32(). Signed-off-by: Christophe Leroy ---

[PATCH v2 24/25] powerpc/signal32: Isolate non-copy actions in save_user_regs() and save_tm_user_regs()

2020-08-18 Thread Christophe Leroy
Reorder actions in save_user_regs() and save_tm_user_regs() to regroup copies together in order to switch to user_access_begin() logic in a later patch. Move non-copy actions into new functions called prepare_save_user_regs() and prepare_save_tm_user_regs(). Signed-off-by: Christophe Leroy ---

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc

2020-08-18 Thread Christophe Leroy
Le 18/08/2020 à 20:05, Christoph Hellwig a écrit : On Tue, Aug 18, 2020 at 07:46:22PM +0200, Christophe Leroy wrote: I gave it a go on my powerpc mpc832x. I tested it on top of my newest series that reworks the 32 bits signal handlers (see

Re: [PATCH 06/11] lkdtm: disable set_fs-based tests for !CONFIG_SET_FS

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:07AM +0200, Christoph Hellwig wrote: > Once we can't manipulate the address limit, we also can't test what > happens when the manipulation is abused. > > Signed-off-by: Christoph Hellwig > --- > drivers/misc/lkdtm/bugs.c | 2 ++ > drivers/misc/lkdtm/core.c

Re: [PATCH v2] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Mon, Aug 17, 2020 at 06:46:58PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't need the SWIOTLB memory to be

Re: [PATCH 08/11] x86: make TASK_SIZE_MAX usable from assembly code

2020-08-18 Thread Kees Cook
On Tue, Aug 18, 2020 at 10:00:16PM +0200, Christoph Hellwig wrote: > On Tue, Aug 18, 2020 at 12:59:05PM -0700, Kees Cook wrote: > > > I didn't see a problem bisecting, do you have something particular in > > > mind? > > > > Oh, I misunderstood this patch to be a fix for compilation. Is this just

[PATCH v2 05/25] powerpc/signal: Don't manage floating point regs when no FPU

2020-08-18 Thread Christophe Leroy
There is no point in copying floating point regs when there is no FPU and MATH_EMULATION is not selected. Create a new CONFIG_PPC_FPU_REGS bool that is selected by CONFIG_MATH_EMULATION and CONFIG_PPC_FPU, and use it to opt out everything related to fp_state in thread_struct. The asm const used

[PATCH v2 08/25] powerpc/signal: Move access_ok() out of get_sigframe()

2020-08-18 Thread Christophe Leroy
This access_ok() will soon be performed by user_access_begin(). So move it out of get_sigframe(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal.c| 4 arch/powerpc/kernel/signal_32.c | 4 ++-- arch/powerpc/kernel/signal_64.c | 2 +- 3 files changed, 3 insertions(+), 7

[PATCH v2 19/25] powerpc/signal32: Remove ifdefery in middle of if/else

2020-08-18 Thread Christophe Leroy
MSR_TM_ACTIVE() is always defined and returns always 0 when CONFIG_PPC_TRANSACTIONAL_MEM is not selected, so the awful ifdefery in the middle of an if/else can be removed. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 22 -- 1 file changed, 8

[PATCH v2 21/25] powerpc/signal32: Add and use unsafe_put_sigset_t()

2020-08-18 Thread Christophe Leroy
put_sigset_t() calls copy_to_user() for copying two words. This is terribly inefficient for copying two words. By switching to unsafe_put_user(), we end up with something as simple as: 3cc: 81 3d 00 00 lwz r9,0(r29) 3d0: 91 26 00 b4 stw r9,180(r6) 3d4: 81 3d 00 04

[PATCH v2 25/25] powerpc/signal32: Transform save_user_regs() and save_tm_user_regs() in 'unsafe' version

2020-08-18 Thread Christophe Leroy
Change those two functions to be used within a user access block. For that, change save_general_regs() to and unsafe_save_general_regs(), then replace all user accesses by unsafe_ versions. This series leads to a reduction from 2.55s to 1.73s of the system CPU time with the following microbench

Re: [PATCH 01/11] mem: remove duplicate ops for /dev/zero and /dev/null

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:02AM +0200, Christoph Hellwig wrote: > There is no good reason to implement both the traditional ->read and > ->write as well as the iter based ops. So implement just the iter > based ones. > > Suggested-by: Al Viro > Signed-off-by: Christoph Hellwig Reviewed-by:

Re: [PATCH 05/11] test_bitmap: skip user bitmap tests for !CONFIG_SET_FS

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:06AM +0200, Christoph Hellwig wrote: > We can't run the tests for userspace bitmap parsing if set_fs() doesn't > exist. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook

[PATCH v2 00/25] powerpc: Switch signal 32 to using unsafe_put_user() and friends

2020-08-18 Thread Christophe Leroy
This series leads to a reduction from 2.55s to 1.73s of the system CPU time with the following microbench app on an mpc832x with KUAP (approx 32%) This series replaces copies to users by unsafe_put_user() and friends with user_write_access_begin() dance in signal32. The advantages are: - No KUAP

[PATCH v2 06/25] powerpc/32s: Allow deselecting CONFIG_PPC_FPU on mpc832x

2020-08-18 Thread Christophe Leroy
The e300c2 core which is embedded in mpc832x CPU doesn't have an FPU. Make it possible to not select CONFIG_PPC_FPU when building a kernel dedicated to that target. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 4 arch/powerpc/platforms/Kconfig.cputype | 11

[PATCH v2 16/25] powerpc/signal32: Move signal trampoline setup to handle_[rt_]signal32

2020-08-18 Thread Christophe Leroy
Move signal trampoline setup into handle_signal32() and handle_rt_signal32(). At the same time, remove the define which hides the mc_pad field used for trampoline. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 61 - 1 file changed, 22

[PATCH v2 17/25] powerpc/signal32: Switch handle_signal32() to user_access_begin() logic

2020-08-18 Thread Christophe Leroy
Replace the access_ok() by user_access_begin() and change all user accesses to unsafe_ version. Move flush_icache_range() outside the user access block. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 29 - 1 file changed, 16 insertions(+), 13

Re: [PATCH 02/11] fs: don't allow kernel reads and writes without iter ops

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:03AM +0200, Christoph Hellwig wrote: > Don't allow calling ->read or ->write with set_fs as a preparation for > killing off set_fs. All the instances that we use kernel_read/write on > are using the iter ops already. > > If a file has both the regular ->read/->write

Re: [PATCH 08/11] x86: make TASK_SIZE_MAX usable from assembly code

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:09AM +0200, Christoph Hellwig wrote: > For 64-bit the only hing missing was a strategic _AC, and for 32-bit we typo: thing > need to use __PAGE_OFFSET instead of PAGE_OFFSET in the TASK_SIZE > definition to escape the explicit unsigned long cast. This just works >

Re: [PATCH 08/11] x86: make TASK_SIZE_MAX usable from assembly code

2020-08-18 Thread Christoph Hellwig
On Tue, Aug 18, 2020 at 12:44:49PM -0700, Kees Cook wrote: > On Mon, Aug 17, 2020 at 09:32:09AM +0200, Christoph Hellwig wrote: > > For 64-bit the only hing missing was a strategic _AC, and for 32-bit we > > typo: thing > > > need to use __PAGE_OFFSET instead of PAGE_OFFSET in the TASK_SIZE > >

Re: [PATCH 03/11] fs: don't allow splice read/write without explicit ops

2020-08-18 Thread Christoph Hellwig
On Tue, Aug 18, 2020 at 12:39:34PM -0700, Kees Cook wrote: > On Mon, Aug 17, 2020 at 09:32:04AM +0200, Christoph Hellwig wrote: > > default_file_splice_write is the last piece of generic code that uses > > set_fs to make the uaccess routines operate on kernel pointers. It > > implements a

[PATCH v2 03/25] powerpc/ptrace: Consolidate reg index calculation

2020-08-18 Thread Christophe Leroy
Today we have: #ifdef CONFIG_PPC32 index = addr >> 2; if ((addr & 3) || child->thread.regs == NULL) #else index = addr >> 3; if ((addr & 7)) #endif sizeof(long) has value 4 for PPC32 and value 8 for PPC64.

[PATCH v2 07/25] powerpc/signal: Remove BUG_ON() in handler_signal functions

2020-08-18 Thread Christophe Leroy
There is already the same BUG_ON() check in do_signal() which is the only caller of handle_rt_signal64() handle_rt_signal32() and handle_signal32(). Remove those three redundant BUG_ON(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 4

[PATCH v2 09/25] powerpc/signal: Remove get_clean_sp()

2020-08-18 Thread Christophe Leroy
get_clean_sp() is only used once in kernel/signal.c . GCC is smart enough to see that x & 0x is a nop calculation on PPC32, no need of a special PPC32 trivial version. Include the logic from the PPC64 version of get_clean_sp() directly in get_sigframe(). Signed-off-by: Christophe Leroy

[PATCH v2 11/25] powerpc/signal: Refactor bad frame logging

2020-08-18 Thread Christophe Leroy
The logging of bad frame appears half a dozen of times and is pretty similar. Create signal_fault() fonction to perform that logging. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal.c| 11 +++ arch/powerpc/kernel/signal.h| 3 +++ arch/powerpc/kernel/signal_32.c

[PATCH v2 20/25] signal: Add unsafe_put_compat_sigset()

2020-08-18 Thread Christophe Leroy
Implement 'unsafe' version of put_compat_sigset() For the bigendian, use unsafe_put_user() directly to avoid intermediate copy through the stack. For the littleendian, use a straight unsafe_copy_to_user(). Signed-off-by: Christophe Leroy --- include/linux/compat.h | 32

[PATCH v2 18/25] powerpc/signal32: Switch handle_rt_signal32() to user_access_begin() logic

2020-08-18 Thread Christophe Leroy
On the same way as handle_signal32(), replace all user accesses with equivalent unsafe_ versions, and move the trampoline code icache flush outside the user access block. Functions that have no unsafe_ equivalent also remains outside the access block. Signed-off-by: Christophe Leroy ---

[PATCH v2 23/25] powerpc/signal: Create 'unsafe' versions of copy_[ck][fpr/vsx]_to_user()

2020-08-18 Thread Christophe Leroy
For the non VSX version, that's trivial. Just use unsafe_copy_to_user() instead of __copy_to_user(). For the VSX version, remove the intermediate step through a buffer and use unsafe_put_user() directly. This generates a far smaller code which is acceptable to inline, see below: Standard VSX

[PATCH v2 22/25] powerpc/signal32: Switch swap_context() to user_access_begin() logic

2020-08-18 Thread Christophe Leroy
As this was the last user of put_sigset_t(), remove it as well. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc

2020-08-18 Thread Christophe Leroy
Le 17/08/2020 à 09:32, Christoph Hellwig a écrit : Hi all, this series removes the last set_fs() used to force a kernel address space for the uaccess code in the kernel read/write/splice code, and then stops implementing the address space overrides entirely for x86 and powerpc. The file

Re: [PATCH 08/11] x86: make TASK_SIZE_MAX usable from assembly code

2020-08-18 Thread Christoph Hellwig
On Tue, Aug 18, 2020 at 12:59:05PM -0700, Kees Cook wrote: > > I didn't see a problem bisecting, do you have something particular in > > mind? > > Oh, I misunderstood this patch to be a fix for compilation. Is this just > a correctness fix? It prepares for using the definition from assembly,

[PATCH v2 04/25] powerpc/ptrace: Create ptrace_get_fpr() and ptrace_put_fpr()

2020-08-18 Thread Christophe Leroy
On the same model as ptrace_get_reg() and ptrace_put_reg(), create ptrace_get_fpr() and ptrace_put_fpr() to get/set the floating points registers. We move the boundary checkings in them. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 1 +

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc

2020-08-18 Thread Christoph Hellwig
On Tue, Aug 18, 2020 at 07:46:22PM +0200, Christophe Leroy wrote: > I gave it a go on my powerpc mpc832x. I tested it on top of my newest > series that reworks the 32 bits signal handlers (see > https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=196278) with > the microbenchmark

Re: [PATCH 04/11] uaccess: add infrastructure for kernel builds with set_fs()

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 09:32:05AM +0200, Christoph Hellwig wrote: > Add a CONFIG_SET_FS option that is selected by architecturess that > implement set_fs, which is all of them initially. If the option is not > set stubs for routines related to overriding the address space are > provided so that

Re: [PATCH 03/11] fs: don't allow splice read/write without explicit ops

2020-08-18 Thread Kees Cook
On Tue, Aug 18, 2020 at 09:54:46PM +0200, Christoph Hellwig wrote: > On Tue, Aug 18, 2020 at 12:39:34PM -0700, Kees Cook wrote: > > On Mon, Aug 17, 2020 at 09:32:04AM +0200, Christoph Hellwig wrote: > > > default_file_splice_write is the last piece of generic code that uses > > > set_fs to make

  1   2   >