Re: [PATCH] powerpc/kprobes: Use probe_address() to read instructions

2020-06-08 Thread Christoph Hellwig
On Tue, Jun 09, 2020 at 03:28:38PM +1000, Michael Ellerman wrote: > On Mon, 24 Feb 2020 18:02:10 + (UTC), Christophe Leroy wrote: > > In order to avoid Oopses, use probe_address() to read the > > instruction at the address where the trap happened. > > Applied to powerpc/next. > > [1/1] powerp

Re: [PATCH v8 22.5/30] powerpc/optprobes: Add register argument to patch_imm64_load_insns()

2020-06-08 Thread Michael Ellerman
On Sat, 2020-05-16 at 11:54:49 UTC, Michael Ellerman wrote: > From: Jordan Niethe > > Currently patch_imm32_load_insns() is used to load an instruction to > r4 to be emulated by emulate_step(). For prefixed instructions we > would like to be able to load a 64bit immediate to r4. To prepare for >

Re: [PATCH v2] powerpc/pseries: Make vio and ibmebus initcalls pseries specific

2020-06-08 Thread Michael Ellerman
On Tue, 21 Apr 2020 18:15:39 +1000, Oliver O'Halloran wrote: > The vio and ibmebus buses are used for pseries specific paravirtualised > devices and currently they're initialised by the generic initcall types. > This is mostly fine, but it can result in some nuisance errors in dmesg > when booting

Re: [PATCH] hw_breakpoint: Fix build warnings with clang

2020-06-08 Thread Michael Ellerman
On Tue, 2 Jun 2020 09:42:08 +0530, Ravi Bangoria wrote: > kbuild test robot reported few build warnings with hw_breakpoint code > when compiled with clang[1]. Fix those. > > [1]: > https://lore.kernel.org/linuxppc-dev/202005192233.oi9cjrta%25...@intel.com/ Applied to powerpc/next. [1/1] hw-brea

Re: [PATCH 1/7] powerpc/powernv/npu: Clean up compound table group initialisation

2020-06-08 Thread Michael Ellerman
On Mon, 6 Apr 2020 13:07:39 +1000, Oliver O'Halloran wrote: > Re-work the control flow a bit so what's going on is a little clearer. > This also ensures the table_group is only initialised once in the P9 > case. This shouldn't be a functional change since all the GPU PCI > devices should have the s

Re: [PATCH] powerpc/powernv/pci: Add an explaination for PNV_IODA_PE_BUS_ALL

2020-06-08 Thread Michael Ellerman
On Wed, 15 Apr 2020 09:35:02 +1000, Oliver O'Halloran wrote: > It's pretty obsecure and confused me for a long time so I figured it's > worth documenting properly. Applied to powerpc/next. [1/1] powerpc/powernv/pci: Add an explaination for PNV_IODA_PE_BUS_ALL https://git.kernel.org/powerpc/

Re: [PATCH] powerpc/powernv: Add a print indicating when an IODA PE is released

2020-06-08 Thread Michael Ellerman
On Wed, 8 Apr 2020 21:22:13 +1000, Oliver O'Halloran wrote: > Quite useful to know in some cases. Applied to powerpc/next. [1/1] powerpc/powernv: Add a print indicating when an IODA PE is released https://git.kernel.org/powerpc/c/e5500ab657c51bec5af8dcf564a096de48e7a132 cheers

Re: [PATCH] powerpc/64s: Fix early_init_mmu section mismatch

2020-06-08 Thread Michael Ellerman
On Wed, 29 Apr 2020 17:02:47 +1000, Nicholas Piggin wrote: > Christian reports: > > MODPOST vmlinux.o > WARNING: modpost: vmlinux.o(.text.unlikely+0x1a0): Section mismatch in > reference from the function .early_init_mmu() to the function > .init.text:.radix__early_init_mmu() > The funct

Re: [PATCH] powerpc/64: refactor interrupt exit irq disabling sequence

2020-06-08 Thread Michael Ellerman
On Wed, 29 Apr 2020 16:24:21 +1000, Nicholas Piggin wrote: > The same complicated sequence for juggling EE, RI, soft mask, and > irq tracing is repeated 3 times, tidy these up into one function. > > This differs qiute a bit between sub architectures, so this makes > the ppc32 port cleaner as well.

Re: [PATCH] powerpc/64s/radix: Don't prefetch DAR in update_mmu_cache

2020-06-08 Thread Michael Ellerman
On Mon, 4 May 2020 22:29:07 +1000, Nicholas Piggin wrote: > The idea behind this prefetch was to kick off a page table walk before > returning from the fault, getting some pipelining advantage. > > But this never showed up any noticable performance advantage, and in > fact with KUAP the prefetches

Re: [PATCH 1/4] powerpc/powernv/pci: Add helper to find ioda_pe from BDFN

2020-06-08 Thread Michael Ellerman
On Fri, 17 Apr 2020 17:35:05 +1000, Oliver O'Halloran wrote: > For each PHB we maintain a reverse-map that can be used to find the > PE that a BDFN is currently mapped to. Add a helper for doing this > lookup so we can check if a PE has been configured without looking > at pdn->pe_number. Applied

Re: [PATCH 0/3] powerpc/module_64: Fix _mcount() stub

2020-06-08 Thread Michael Ellerman
On Tue, 21 Apr 2020 23:05:42 +0530, Naveen N. Rao wrote: > This series addresses the crash reported by Qian Cai on ppc64le with > -mprofile-kernel here: > https://lore.kernel.org/r/15ac5b0e-a221-4b8c-9039-fa96b8ef7...@lca.pw > > While fixing patch_instruction() should address the crash, we should

Re: [PATCH] powerpc/wii: Fix declaration made after definition

2020-06-08 Thread Michael Ellerman
On Mon, 13 Apr 2020 12:06:45 -0700, Nathan Chancellor wrote: > A 0day randconfig uncovered an error with clang, trimmed for brevity: > > arch/powerpc/platforms/embedded6xx/wii.c:195:7: error: attribute > declaration must precede definition [-Werror,-Wignored-attributes] > if (!machine_is(w

Re: [PATCH] powerpc/xmon: Show task->thread.regs in process display

2020-06-08 Thread Michael Ellerman
On Wed, 20 May 2020 21:17:40 +1000, Michael Ellerman wrote: > Show the address of the tasks regs in the process listing in xmon. The > regs should always be on the stack page that we also print the address > of, but it's still helpful not to have to find them by hand. Applied to powerpc/next. [1/

Re: [PATCH v4 1/2] powerpc/64s/hash: Add stress_slb kernel boot option to increase SLB faults

2020-06-08 Thread Michael Ellerman
On Mon, 11 May 2020 22:58:24 +1000, Michael Ellerman wrote: > This option increases the number of SLB misses by limiting the number > of kernel SLB entries, and increased flushing of cached lookaside > information. This helps stress test difficult to hit paths in the > kernel. > > [mpe: Relocate t

Re: [RFC PATCH 1/4] powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()

2020-06-08 Thread Michael Ellerman
On Thu, 28 May 2020 00:58:40 +1000, Michael Ellerman wrote: > __init_FSCR() was added originally in commit 2468dcf641e4 ("powerpc: > Add support for context switching the TAR register") (Feb 2013), and > only set FSCR_TAR. > > At that point FSCR (Facility Status and Control Register) was not > con

Re: [PATCH v2] powerpc: Add ppc_inst_as_u64()

2020-06-08 Thread Michael Ellerman
On Tue, 26 May 2020 17:26:30 +1000, Michael Ellerman wrote: > The code patching code wants to get the value of a struct ppc_inst as > a u64 when the instruction is prefixed, so we can pass the u64 down to > __put_user_asm() and write it with a single store. > > The optprobes code wants to load a s

Re: [PATCH] input: i8042: Remove special PowerPC handling

2020-06-08 Thread Michael Ellerman
On Mon, 18 May 2020 11:10:43 -0700, Nathan Chancellor wrote: > This causes a build error with CONFIG_WALNUT because kb_cs and kb_data > were removed in commit 917f0af9e5a9 ("powerpc: Remove arch/ppc and > include/asm-ppc"). > > ld.lld: error: undefined symbol: kb_cs > > referenced by i8042-ppcio.h

Re: [PATCH v2] powerpc: Add ppc_inst_next()

2020-06-08 Thread Michael Ellerman
On Fri, 22 May 2020 23:33:18 +1000, Michael Ellerman wrote: > In a few places we want to calculate the address of the next > instruction. Previously that was simple, we just added 4 bytes, or if > using a u32 * we incremented that pointer by 1. > > But prefixed instructions make it more complicate

Re: [PATCH] powerpc/configs/64s: Enable CONFIG_PRINTK_CALLER

2020-06-08 Thread Michael Ellerman
On Wed, 20 May 2020 22:12:57 +1000, Michael Ellerman wrote: > This adds the CPU or thread number to printk messages. This helps a > lot when deciphering concurrent oopses that have been interleaved. > > Example output, of PID1 (T1) triggering a warning: > > [1.581678][T1] WARNING: CPU:

Re: [PATCH] powerpc: Add ppc_inst_as_u64()

2020-06-08 Thread Michael Ellerman
On Mon, 25 May 2020 15:50:04 +1000, Michael Ellerman wrote: > The code patching code wants to get the value of a struct ppc_inst as > a u64 when the instruction is prefixed, so we can pass the u64 down to > __put_user_asm() and write it with a single store. > > This is a bit awkward because the va

Re: [PATCH] powerpc/4xx: Don't unmap NULL mbase

2020-06-08 Thread Michael Ellerman
On Thu, 21 May 2020 17:26:48 +1000, Michael Ellerman wrote: > Applied to powerpc/next. [1/1] powerpc/4xx: Don't unmap NULL mbase https://git.kernel.org/powerpc/c/bcec081ecc940fc38730b29c743bbee661164161 cheers

Re: [PATCH] powerpc/tm: Document h/rfid and mtmsrd quirk

2020-06-08 Thread Michael Ellerman
On Wed, 25 Mar 2020 15:05:46 +1100, Michael Neuling wrote: > The ISA has a quirk that's useful for the Linux implementation. > Document it here so others are less likely to trip over it. Applied to powerpc/next. [1/1] powerpc/tm: Document h/rfid and mtmsrd quirk https://git.kernel.org/power

Re: [PATCH] powerpc: Fix misleading small cores print

2020-06-08 Thread Michael Ellerman
On Fri, 29 May 2020 09:07:31 +1000, Michael Neuling wrote: > Currently when we boot on a big core system, we get this print: > [0.040500] Using small cores at SMT level > > This is misleading as we've actually detected big cores. > > This patch clears up the print to say we've detect big co

Re: [PATCH] powerpc/configs: Add LIBNVDIMM to ppc64_defconfig

2020-06-08 Thread Michael Ellerman
On Tue, 19 May 2020 14:30:09 +1000, Michael Neuling wrote: > This gives us OF_PMEM which is useful in mambo. > > This adds 153K to the text of ppc64le_defconfig which 0.8% of the > total text. > > LIBNVDIMM text databss dec hex > Without 18574833 5518150 1539240 25632223 18

Re: [PATCH v2 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms

2020-06-08 Thread Michael Ellerman
On Mon, 30 Mar 2020 15:32:15 +0200, Michal Simek wrote: > recently we wanted to update xilinx intc driver and we found that function > which we wanted to remove is still wired by ancient Xilinx PowerPC > platforms. Here is the thread about it. > https://lore.kernel.org/linux-next/48d3232d-0f1d-42ea

Re: [PATCH v3 1/1] powerpc/kernel: Enables memory hot-remove after reboot on pseries guests

2020-06-08 Thread Michael Ellerman
On Thu, 2 Apr 2020 16:51:57 -0300, Leonardo Bras wrote: > While providing guests, it's desirable to resize it's memory on demand. > > By now, it's possible to do so by creating a guest with a small base > memory, hot-plugging all the rest, and using 'movable_node' kernel > command-line parameter,

Re: [PATCH v3] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.

2020-06-08 Thread Michael Ellerman
On Sat, 25 Apr 2020 19:05:18 -0700, Ram Pai wrote: > >From 10ea2eaf492ca3f22f67a5a63a2b7865e45299ad Mon Sep 17 00:00:00 2001 > From: Ram Pai > Date: Mon, 24 Feb 2020 01:09:48 -0500 > Subject: [PATCH v3] powerpc/XIVE: SVM: share the event-queue page with the > Hypervisor. > > XIVE interrupt contr

Re: [PATCH v6 0/2] Implement reentrant rtas call

2020-06-08 Thread Michael Ellerman
On Mon, 18 May 2020 20:42:43 -0300, Leonardo Bras wrote: > Patch 2 implement rtas_call_reentrant() for reentrant rtas-calls: > "ibm,int-on", "ibm,int-off",ibm,get-xive" and "ibm,set-xive", > according to LoPAPR Version 1.1 (March 24, 2016). > > For that, it's necessary that every call uses a diff

Re: [PATCH v2 1/1] powerpc/crash: Use NMI context for printk when starting to crash

2020-06-08 Thread Michael Ellerman
On Tue, 12 May 2020 18:45:35 -0300, Leonardo Bras wrote: > Currently, if printk lock (logbuf_lock) is held by other thread during > crash, there is a chance of deadlocking the crash on next printk, and > blocking a possibly desired kdump. > > At the start of default_machine_crash_shutdown, make pr

Re: [PATCH v10 0/5] powerpc/hv-24x7: Expose chip/sockets info to add json file metric support for the hv_24x7 socket/chip level events

2020-06-08 Thread Michael Ellerman
On Mon, 25 May 2020 16:13:02 +0530, Kajol Jain wrote: > Patchset fixes the inconsistent results we are getting when > we run multiple 24x7 events. > > "hv_24x7" pmu interface events needs system dependent parameter > like socket/chip/core. For example, hv_24x7 chip level events needs > specific ch

Re: [PATCHv4] powerpc/crashkernel: take "mem=" option into account

2020-06-08 Thread Michael Ellerman
On Wed, 1 Apr 2020 22:00:44 +0800, Pingfan Liu wrote: > 'mem=" option is an easy way to put high pressure on memory during some > test. Hence after applying the memory limit, instead of total mem, the > actual usable memory should be considered when reserving mem for > crashkernel. Otherwise the bo

Re: [PATCH] powerpc/fadump: account for memory_limit while reserving memory

2020-06-08 Thread Michael Ellerman
On Wed, 27 May 2020 15:14:35 +0530, Hari Bathini wrote: > If the memory chunk found for reserving memory overshoots the memory > limit imposed, do not proceed with reserving memory. Default behavior > was this until commit 140777a3d8df ("powerpc/fadump: consider reserved > ranges while reserving me

Re: [PATCH] macintosh/ams-input: switch to using input device polling mode

2020-06-08 Thread Michael Ellerman
On Wed, 2 Oct 2019 14:48:54 -0700, Dmitry Torokhov wrote: > Now that instances of input_dev support polling mode natively, > we no longer need to create input_polled_dev instance. Applied to powerpc/next. [1/1] macintosh/ams-input: switch to using input device polling mode https://git.kerne

Re: [PATCH v5 00/13] Modernise powerpc 40x

2020-06-08 Thread Michael Ellerman
On Thu, 21 May 2020 16:55:51 + (UTC), Christophe Leroy wrote: > v1 and v2 of this series were aiming at removing 40x entirely, > but it led to protests. > > v3 is trying to start modernising powerpc 40x: > - Rework TLB miss handlers to not use PTE_ATOMIC_UPDATES and _PAGE_HWWRITE > - Remove ol

Re: [PATCH 0/3] powerpc/xive: PCI hotplug fixes under PowerVM

2020-06-08 Thread Michael Ellerman
On Wed, 29 Apr 2020 09:51:19 +0200, Cédric Le Goater wrote: > Here are a couple of fixes for PCI hotplug issues for machines running > under the POWER hypervisor using hash MMU and the XIVE interrupt mode. > > Commit 1ca3dec2b2df ("powerpc/xive: Prevent page fault issues in the > machine crash ha

Re: [PATCH v4 00/45] Use hugepages to map kernel mem on 8xx

2020-06-08 Thread Michael Ellerman
On Tue, 19 May 2020 05:48:42 + (UTC), Christophe Leroy wrote: > The main purpose of this big series is to: > - reorganise huge page handling to avoid using mm_slices. > - use huge pages to map kernel memory on the 8xx. > > The 8xx supports 4 page sizes: 4k, 16k, 512k and 8M. > It uses 2 Level

Re: [PATCH v2] powerpc/32s: Fix another build failure with CONFIG_PPC_KUAP_DEBUG

2020-06-08 Thread Michael Ellerman
On Sat, 30 May 2020 17:16:33 + (UTC), Christophe Leroy wrote: > 'thread' doesn't exist in kuap_check() macro. > > Use 'current' instead. Applied to powerpc/next. [1/1] powerpc/32s: Fix another build failure with CONFIG_PPC_KUAP_DEBUG https://git.kernel.org/powerpc/c/74016701fe5f873ae23

Re: [PATCH] powerpc/32: disable KASAN with pages bigger than 16k

2020-06-08 Thread Michael Ellerman
On Thu, 28 May 2020 10:17:04 + (UTC), Christophe Leroy wrote: > Mapping of early shadow area is implemented by using a single static > page table having all entries pointing to the same early shadow page. > The shadow area must therefore occupy full PGD entries. > > The shadow area has a size

Re: [PATCH v2 01/12] powerpc/52xx: Blacklist functions running with MMU disabled for kprobe

2020-06-08 Thread Michael Ellerman
On Tue, 31 Mar 2020 16:03:36 + (UTC), Christophe Leroy wrote: > kprobe does not handle events happening in real mode, all > functions running with MMU disabled have to be blacklisted. Applied to powerpc/next. [01/12] powerpc/52xx: Blacklist functions running with MMU disabled for kprobe

Re: [PATCH] powerpc/uaccess: Don't set KUEP by default on book3s/32

2020-06-08 Thread Michael Ellerman
On Wed, 15 Apr 2020 14:57:11 + (UTC), Christophe Leroy wrote: > On book3s/32, KUEP is an heavy process as it requires to > set/unset the NX bit in each of the 12 user segments > everytime the kernel is entered/exited from/to user space. > > Don't select KUEP by default on book3s/32. Applied t

Re: [PATCH] powerpc/uaccess: Don't set KUAP by default on book3s/32

2020-06-08 Thread Michael Ellerman
On Wed, 15 Apr 2020 14:57:09 + (UTC), Christophe Leroy wrote: > On book3s/32, KUAP is an heavy process as it requires to > determine which segments are impacted and unlock/lock > each of them. > > And since the implementation of user_access_begin/end, it > is even worth for the time being beca

Re: [PATCH] powerpc/kprobes: Use probe_address() to read instructions

2020-06-08 Thread Michael Ellerman
On Mon, 24 Feb 2020 18:02:10 + (UTC), Christophe Leroy wrote: > In order to avoid Oopses, use probe_address() to read the > instruction at the address where the trap happened. Applied to powerpc/next. [1/1] powerpc/kprobes: Use probe_address() to read instructions https://git.kernel.org

Re: [PATCH] powerpc/8xx: Reduce time spent in allow_user_access() and friends

2020-06-08 Thread Michael Ellerman
On Wed, 15 Apr 2020 10:06:09 + (UTC), Christophe Leroy wrote: > To enable/disable kernel access to user space, the 8xx has to > modify the properties of access group 1. This is done by writing > predefined values into SPRN_Mx_AP registers. > > As of today, a __put_user() gives: > > 0d64 :

Re: [PATCH -next] powerpc/powernv: add NULL check after kzalloc

2020-06-08 Thread Michael Ellerman
On Sat, 9 May 2020 10:08:38 +0800, Chen Zhou wrote: > Fixes coccicheck warning: > > ./arch/powerpc/platforms/powernv/opal.c:813:1-5: > alloc with no test, possible model on line 814 > > Add NULL check after kzalloc. Applied to powerpc/next. [1/1] powerpc/powernv: add NULL check after kzal

Re: [PATCH v3] powerpc/64s/pgtable: fix an undefined behaviour

2020-06-08 Thread Michael Ellerman
On Thu, 5 Mar 2020 23:48:52 -0500, Qian Cai wrote: > Booting a power9 server with hash MMU could trigger an undefined > behaviour because pud_offset(p4d, 0) will do, > > 0 >> (PAGE_SHIFT:16 + PTE_INDEX_SIZE:8 + H_PMD_INDEX_SIZE:10) > > Fix it by converting pud_index() and friends to static inline

Re: [PATCH] powerpc/book3s64/radix/tlb: Determine hugepage flush correctly

2020-06-08 Thread Michael Ellerman
On Wed, 13 May 2020 08:36:16 +0530, Aneesh Kumar K.V wrote: > With a 64K page size flush with start and end value as below > (start, end) = (721f680d, 721f680e) results in > (hstart, hend) = (721f6820, 721f6800) > > Avoid doing a __tlbie_va_range with the wrong hstart and hend valu

Re: [PATCH] powerpc/book3s64/kvm: Fix secondary page table walk warning during migration

2020-06-08 Thread Michael Ellerman
On Thu, 28 May 2020 13:34:56 +0530, Aneesh Kumar K.V wrote: > This patch fix the below warning reported during migration. > > find_kvm_secondary_pte called with kvm mmu_lock not held > CPU: 23 PID: 5341 Comm: qemu-system-ppc Tainted: GW > 5.7.0-rc5-kvm-00211-g9ccf10d6d088 #432 >

Re: [PATCH v3 0/7] Base support for POWER10

2020-06-08 Thread Michael Ellerman
On Thu, 21 May 2020 11:43:34 +1000, Alistair Popple wrote: > This series brings together several previously posted patches required for > POWER10 support and introduces a new patch enabling POWER10 architected > mode to enable booting as a POWER10 pseries guest. > > It includes support for enablin

Re: [PATCH] ocxl: Fix misleading comment

2020-06-08 Thread Michael Ellerman
On Wed, 26 Feb 2020 15:39:23 +1100, Andrew Donnellan wrote: > In ocxl_context_free() we note that the AFU reference we're releasing was > taken in "ocxl_context_init", a function that doesn't actually exist. > > Fix it to say ocxl_context_alloc() instead, which I expect was what was > intended. A

Re: [PATCH] cxl: Remove dead Kconfig options

2020-06-08 Thread Michael Ellerman
On Tue, 2 Jun 2020 14:03:41 +1000, Andrew Donnellan wrote: > The CXL_AFU_DRIVER_OPS and CXL_LIB Kconfig options were added to coordinate > merging of new features. They no longer serve any purpose, so remove them. Applied to powerpc/next. [1/1] cxl: Remove dead Kconfig options https://git.k

Re: [PATCH 5/5] powerpc: Add LKDTM test to hijack a patch mapping

2020-06-08 Thread Christopher M. Riedl
On Wed Jun 3, 2020 at 9:20 AM, Christophe Leroy wrote: > > > > > Le 03/06/2020 à 07:19, Christopher M. Riedl a écrit : > > When live patching with STRICT_KERNEL_RWX, the CPU doing the patching > > must use a temporary mapping which allows for writing to kernel text. > > During the entire window o

Re: [PATCH 4/5] powerpc/lib: Add LKDTM accessor for patching addr

2020-06-08 Thread Christopher M. Riedl
On Wed Jun 3, 2020 at 9:14 AM, Christophe Leroy wrote: > > > > > Le 03/06/2020 à 07:19, Christopher M. Riedl a écrit : > > When live patching a STRICT_RWX kernel, a mapping is installed at a > > "patching address" with temporary write permissions. Provide a > > LKDTM-only accessor function for th

[PATCH v2] selftests: powerpc: Fix CPU affinity for child process

2020-06-08 Thread Harish
On systems with large number of cpus, test fails trying to set affinity for child process by calling sched_setaffinity() with smaller size for cpuset. This patch fixes it by making sure that the size of allocated cpu set is dependent on the number of CPUs as reported by get_nprocs(). Fixes: 00b7e

Re: [PATCH v2] mm/debug_vm_pgtable: Fix kernel crash by checking for THP support

2020-06-08 Thread Anshuman Khandual
On 06/08/2020 06:22 PM, Aneesh Kumar K.V wrote: > Architectures can have CONFIG_TRANSPARENT_HUGEPAGE enabled but > no THP support enabled based on platforms. For ex: with 4K > PAGE_SIZE ppc64 supports THP only with radix translation. > > This results in below crash when running with hash transl

[PATCH kernel] KVM: PPC: Protect kvm_vcpu_read_guest with srcu locks

2020-06-08 Thread Alexey Kardashevskiy
The kvm_vcpu_read_guest/kvm_vcpu_write_guest used for nested guests eventually call srcu_dereference_check to dereference a memslot and lockdep produces a warning as neither kvm->slots_lock nor kvm->srcu lock is held and kvm->users_count is above zero (>100 in fact). This wraps mentioned VCPU read

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-08 Thread Dan Williams
On Mon, Jun 8, 2020 at 5:16 PM kernel test robot wrote: > > Hi Vaibhav, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on powerpc/next] > [also build test WARNING on linus/master v5.7 next-20200605] > [cannot apply to linux-nvdimm/libnvdimm-for-next scottwo

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-08 Thread kernel test robot
Hi Vaibhav, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on powerpc/next] [also build test WARNING on linus/master v5.7 next-20200605] [cannot apply to linux-nvdimm/libnvdimm-for-next scottwood/next] [if your patch is applied to the wrong git tree, please drop u

[PATCH AUTOSEL 4.4 21/37] powerpc/spufs: fix copy_to_user while atomic

2020-06-08 Thread Sasha Levin
From: Jeremy Kerr [ Upstream commit 88413a6bfbbe2f648df399b62f85c934460b7a4d ] Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffer for the context save ar

[PATCH AUTOSEL 4.9 29/50] powerpc/spufs: fix copy_to_user while atomic

2020-06-08 Thread Sasha Levin
From: Jeremy Kerr [ Upstream commit 88413a6bfbbe2f648df399b62f85c934460b7a4d ] Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffer for the context save ar

[PATCH AUTOSEL 4.14 42/72] powerpc/spufs: fix copy_to_user while atomic

2020-06-08 Thread Sasha Levin
From: Jeremy Kerr [ Upstream commit 88413a6bfbbe2f648df399b62f85c934460b7a4d ] Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffer for the context save ar

[PATCH AUTOSEL 4.19 054/106] powerpc/spufs: fix copy_to_user while atomic

2020-06-08 Thread Sasha Levin
From: Jeremy Kerr [ Upstream commit 88413a6bfbbe2f648df399b62f85c934460b7a4d ] Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffer for the context save ar

[PATCH AUTOSEL 4.19 049/106] sched/core: Fix illegal RCU from offline CPUs

2020-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit bf2c59fce4074e55d622089b34be3a6bc95484fb ] In the CPU-offline process, it calls mmdrop() after idle entry and the subsequent call to cpuhp_report_idle_dead(). Once execution passes the call to rcu_report_dead(), RCU is ignoring the CPU, which results in loc

[PATCH AUTOSEL 5.4 097/175] powerpc/spufs: fix copy_to_user while atomic

2020-06-08 Thread Sasha Levin
From: Jeremy Kerr [ Upstream commit 88413a6bfbbe2f648df399b62f85c934460b7a4d ] Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffer for the context save ar

[PATCH AUTOSEL 5.4 089/175] sched/core: Fix illegal RCU from offline CPUs

2020-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit bf2c59fce4074e55d622089b34be3a6bc95484fb ] In the CPU-offline process, it calls mmdrop() after idle entry and the subsequent call to cpuhp_report_idle_dead(). Once execution passes the call to rcu_report_dead(), RCU is ignoring the CPU, which results in loc

[PATCH AUTOSEL 5.6 150/606] powerpc/64s: Disable STRICT_KERNEL_RWX

2020-06-08 Thread Sasha Levin
From: Michael Ellerman commit 8659a0e0efdd975c73355dbc033f79ba3b31e82c upstream. Several strange crashes have been eventually traced back to STRICT_KERNEL_RWX and its interaction with code patching. Various paths in our ftrace, kprobes and other patching code need to be hardened against patchin

[PATCH AUTOSEL 5.6 117/606] ibmvnic: Skip fatal error reset after passive init

2020-06-08 Thread Sasha Levin
From: Juliet Kim [ Upstream commit f9c6cea0b38518741c8dcf26ac056d26ee2fd61d ] During MTU change, the following events may happen. Client-driven CRQ initialization fails due to partner’s CRQ closed, causing client to enqueue a reset task for FATAL_ERROR. Then passive (server-driven) CRQ initializ

[PATCH AUTOSEL 5.6 115/606] scsi: ibmvscsi: Fix WARN_ON during event pool release

2020-06-08 Thread Sasha Levin
From: Tyrel Datwyler [ Upstream commit b36522150e5b85045f868768d46fbaaa034174b2 ] While removing an ibmvscsi client adapter a WARN_ON like the following is seen in the kernel log: drmgr: drmgr: -r -c slot -s U9080.M9S.783AEC8-V11-C11 -w 5 -d 1 WARNING: CPU: 9 PID: 24062 at ../kernel/dma/mapping

[PATCH AUTOSEL 5.6 069/606] powerpc/uaccess: Evaluate macro arguments once, before user access is allowed

2020-06-08 Thread Sasha Levin
From: Nicholas Piggin commit d02f6b7dab8228487268298ea1f21081c0b4b3eb upstream. get/put_user() can be called with nontrivial arguments. fs/proc/page.c has a good example: if (put_user(stable_page_flags(ppage), out)) { stable_page_flags() is quite a lot of code, including spin locks in the

[PATCH AUTOSEL 5.6 070/606] powerpc/ima: Fix secure boot rules in ima arch policy

2020-06-08 Thread Sasha Levin
From: Nayna Jain commit fa4f3f56ccd28ac031ab275e673ed4098855fed4 upstream. To prevent verifying the kernel module appended signature twice (finit_module), once by the module_sig_check() and again by IMA, powerpc secure boot rules define an IMA architecture specific policy rule only if CONFIG_MOD

[PATCH AUTOSEL 5.6 039/606] powerpc/32s: Fix build failure with CONFIG_PPC_KUAP_DEBUG

2020-06-08 Thread Sasha Levin
From: Christophe Leroy commit 4833ce06e6855d526234618b746ffb71d6612c9a upstream. gpr2 is not a parametre of kuap_check(), it doesn't exist. Use gpr instead. Fixes: a68c31fc01ef ("powerpc/32s: Implement Kernel Userspace Access Protection") Signed-off-by: Christophe Leroy Signed-off-by: Michae

[PATCH AUTOSEL 5.6 038/606] powerpc/vdso32: Fallback on getres syscall when clock is unknown

2020-06-08 Thread Sasha Levin
From: Christophe Leroy commit e963b7a28b2bf2416304e1a15df967fcf662aff5 upstream. There are other clocks than the standard ones, for instance per process clocks. Therefore, being above the last standard clock doesn't mean it is a bad clock. So, fallback to syscall instead of returning -EINVAL inc

[PATCH AUTOSEL 5.7 161/274] powerpc/spufs: fix copy_to_user while atomic

2020-06-08 Thread Sasha Levin
From: Jeremy Kerr [ Upstream commit 88413a6bfbbe2f648df399b62f85c934460b7a4d ] Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffer for the context save ar

[PATCH AUTOSEL 5.7 145/274] sched/core: Fix illegal RCU from offline CPUs

2020-06-08 Thread Sasha Levin
From: Peter Zijlstra [ Upstream commit bf2c59fce4074e55d622089b34be3a6bc95484fb ] In the CPU-offline process, it calls mmdrop() after idle entry and the subsequent call to cpuhp_report_idle_dead(). Once execution passes the call to rcu_report_dead(), RCU is ignoring the CPU, which results in loc

[PATCH AUTOSEL 5.7 038/274] soc: fsl: dpio: properly compute the consumer index

2020-06-08 Thread Sasha Levin
From: Ioana Ciornei [ Upstream commit 7596ac9d19a9df25707ecaac0675881f62dd8c18 ] Mask the consumer index before using it. Without this, we would be writing frame descriptors beyond the ring size supported by the QBMAN block. Fixes: 3b2abda7d28c ("soc: fsl: dpio: Replace QMAN array mode with rin

[PATCH v12 2/6] seq_buf: Export seq_buf_printf

2020-06-08 Thread Vaibhav Jain
'seq_buf' provides a very useful abstraction for writing to a string buffer without needing to worry about it over-flowing. However even though the API has been stable for couple of years now its still not exported to kernel loadable modules limiting its usage. Hence this patch proposes update to

[PATCH v12 6/6] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-08 Thread Vaibhav Jain
This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' that returns a newly introduced 'struct nd_papr_pdsm_health' instance containing dimm health information back to user space in response to ND_CMD_CALL. This functionality is implemented in newly introduced papr_pdsm_health() that que

[PATCH v12 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-08 Thread Vaibhav Jain
Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm module and add the command family NVDIMM_FAMILY_PAPR to the white list of NVDIMM command sets. Also advertise support for ND_CMD_CALL for the nvdimm command mask and implement necessary scaffolding in the module to handle ND_CMD_

[PATCH v12 4/6] powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl()

2020-06-08 Thread Vaibhav Jain
Since papr_scm_ndctl() can be called from outside papr_scm, its exposed to the possibility of receiving NULL as value of 'cmd_rc' argument. This patch updates papr_scm_ndctl() to protect against such possibility by assigning it pointer to a local variable in case cmd_rc == NULL. Finally the patch

[PATCH v12 3/6] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-08 Thread Vaibhav Jain
Implement support for fetching nvdimm health information via H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of 64-bit bitmap, bitwise-and of which is then stored in 'struct papr_scm_priv' and subsequently partially exposed to user-space via newly introduced dimm specific attri

[PATCH v12 1/6] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-08 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Acked-by: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v11..v1

[PATCH v12 0/6] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-08 Thread Vaibhav Jain
Changes since v11 [1]: * Minor update to 'papr_pdsm.h' fixing a misleading comment about 'possible' padding being added by GCC which doesn't apply in case structs are marked as __packed. * Fix the order of initialization of 'struct nd_papr_pdsm_health' in papr_pdsm_health(). * Added acks from

Re: [PATCH v11 6/6] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-08 Thread Vaibhav Jain
Thanks Ira, Ira Weiny writes: > On Sun, Jun 07, 2020 at 06:43:39PM +0530, Vaibhav Jain wrote: >> This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' >> that returns a newly introduced 'struct nd_papr_pdsm_health' instance >> containing dimm health information back to user space in

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-08 Thread Vaibhav Jain
Ira Weiny writes: > On Sun, Jun 07, 2020 at 06:43:38PM +0530, Vaibhav Jain wrote: >> Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm >> module and add the command family NVDIMM_FAMILY_PAPR to the white list >> of NVDIMM command sets. Also advertise support for ND_CMD_CALL

Re: [PATCH v11 3/6] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-08 Thread Vaibhav Jain
Hi Ira, During v9 you had provided your ack to this patch [1] and also had made a review comment in a later patch regarding an avoidable 'goto' statement. I have since updated the patch addressing that review comment. Can you please provide your ack to this patch too. [1] https://lore.kernel.org/

[PATCH] selftests: powerpc: Fix online CPU selection

2020-06-08 Thread Harish
On systems with large number of cpus, test fails trying to set affinity by calling sched_setaffinity() with smaller size for cpuset. This patch fixes it by making sure that the size of allocated cpu set is dependent on the number of CPUs as reported by get_nprocs(). Reported-by: Shirisha Ganta Si

Re: [PATCH v11 6/6] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-08 Thread Ira Weiny
On Sun, Jun 07, 2020 at 06:43:39PM +0530, Vaibhav Jain wrote: > This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' > that returns a newly introduced 'struct nd_papr_pdsm_health' instance > containing dimm health information back to user space in response to > ND_CMD_CALL. This functi

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-08 Thread Ira Weiny
On Sun, Jun 07, 2020 at 06:43:38PM +0530, Vaibhav Jain wrote: > Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm > module and add the command family NVDIMM_FAMILY_PAPR to the white list > of NVDIMM command sets. Also advertise support for ND_CMD_CALL for the > nvdimm command ma

Re: [PATCH v11 4/6] powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl()

2020-06-08 Thread Ira Weiny
On Sun, Jun 07, 2020 at 06:43:37PM +0530, Vaibhav Jain wrote: > Since papr_scm_ndctl() can be called from outside papr_scm, its > exposed to the possibility of receiving NULL as value of 'cmd_rc' > argument. This patch updates papr_scm_ndctl() to protect against such > possibility by assigning it p

Re: [PATCH] selftests: powerpc: Fix online CPU selection

2020-06-08 Thread Kamalesh Babulal
On 6/8/20 8:12 PM, Sandipan Das wrote: > The size of the cpu set must be large enough for systems > with a very large number of CPUs. Otherwise, tests which > try to determine the first online CPU by calling > sched_getaffinity() will fail. This makes sure that the > size of the allocated cpu set i

[PATCH] selftests: powerpc: Fix online CPU selection

2020-06-08 Thread Sandipan Das
The size of the cpu set must be large enough for systems with a very large number of CPUs. Otherwise, tests which try to determine the first online CPU by calling sched_getaffinity() will fail. This makes sure that the size of the allocated cpu set is dependent on the number of CPUs as reported by

[PATCH v2] mm/debug_vm_pgtable: Fix kernel crash by checking for THP support

2020-06-08 Thread Aneesh Kumar K.V
Architectures can have CONFIG_TRANSPARENT_HUGEPAGE enabled but no THP support enabled based on platforms. For ex: with 4K PAGE_SIZE ppc64 supports THP only with radix translation. This results in below crash when running with hash translation and 4K PAGE_SIZE. kernel BUG at arch/powerpc/include/a

[PATCH] KVM: PPC: Book3S HV: increase KVMPPC_NR_LPIDS on POWER8 and POWER9

2020-06-08 Thread Cédric Le Goater
POWER8 and POWER9 have 12-bit LPIDs. Change LPID_RSVD to support up to (4096 - 2) guests on these processors. POWER7 is kept the same with a limitation of (1024 - 2), but it might be time to drop KVM support for POWER7. Tested with 2048 guests * 4 vCPUs on a witherspoon system with 512G RAM and a

Re: [PATCH] mm/debug_vm_pgtable: Fix kernel crash with page table validate

2020-06-08 Thread Anshuman Khandual
On 06/08/2020 04:46 PM, Aneesh Kumar K.V wrote: > On 6/8/20 4:31 PM, Anshuman Khandual wrote: >> Hi Aneesh, >> >> On 06/08/2020 11:57 AM, Aneesh Kumar K.V wrote: >>> Architectures can have CONFIG_TRANSPARENT_HUGEPAGE enabled but >>> no THP support enabled based on platforms. For ex: with 4K >>>

Re: [v1 PATCH 1/2] Refactoring carrying over IMA measuremnet logs over Kexec.

2020-06-08 Thread Mimi Zohar
Hi Prakhar, On Sun, 2020-06-07 at 16:33 -0700, Prakhar Srivastava wrote: > This patch moves the non-architecture specific code out of powerpc and > adds to security/ima. > Update the arm64 and powerpc kexec file load paths to carry the IMA > measurement > logs. >From your patch description, th

Re: [PATCH] mm/debug_vm_pgtable: Fix kernel crash with page table validate

2020-06-08 Thread Aneesh Kumar K.V
On 6/8/20 4:31 PM, Anshuman Khandual wrote: Hi Aneesh, On 06/08/2020 11:57 AM, Aneesh Kumar K.V wrote: Architectures can have CONFIG_TRANSPARENT_HUGEPAGE enabled but no THP support enabled based on platforms. For ex: with 4K PAGE_SIZE ppc64 supports THP only with radix translation. Good catch

Re: [PATCH] mm/debug_vm_pgtable: Fix kernel crash with page table validate

2020-06-08 Thread Anshuman Khandual
Hi Aneesh, On 06/08/2020 11:57 AM, Aneesh Kumar K.V wrote: > Architectures can have CONFIG_TRANSPARENT_HUGEPAGE enabled but > no THP support enabled based on platforms. For ex: with 4K > PAGE_SIZE ppc64 supports THP only with radix translation. Good catch, never hit this before. > > This result

[RFC PATCH v0 3/4] powerpc/pseries: H_REGISTER_PROC_TBL should ask for GTSE only if enabled

2020-06-08 Thread Bharata B Rao
H_REGISTER_PROC_TBL asks for GTSE by default. GTSE flag bit should be set only when GTSE is supported. Signed-off-by: Bharata B Rao --- arch/powerpc/platforms/pseries/lpar.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/

[RFC PATCH v0 4/4] powerpc/mm/book3s64/radix: Off-load TLB invalidations to host when !GTSE

2020-06-08 Thread Bharata B Rao
From: Nicholas Piggin When platform doesn't support GTSE, let TLB invalidation requests for radix guests be off-loaded to the host using H_RPT_INVALIDATE hcall Signed-off-by: Nicholas Piggin Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 1 + arch/powerpc/inclu

[RFC PATCH v0 1/4] powerpc/mm: Make GTSE as MMU FTR

2020-06-08 Thread Bharata B Rao
Make GTSE as an MMU feature and enable it by default for radix. However for guest, conditionally enable it if hypervisor supports it via OV5 vector. Making GTSE as a MMU feature will make it easy to enable radix without GTSE. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/mmu.h|

  1   2   >