Re: [PATCH 4/4] powerpc/eeh: Clean up edev cleanup for VFs

2020-04-02 Thread Oliver O'Halloran
On Mon, 2020-03-30 at 15:56 +1100, Sam Bobroff wrote: > Because the bus notifier calls eeh_rmv_from_parent_pe() (via > eeh_remove_device()) when a VF is removed, the call in > remove_sriov_vf_pdns() is redundant. eeh_rmv_from_parent_pe() won't actually remove the device if the recovering flag is

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

2020-04-02 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Tue, 2020-03-31 at 16:30 +1100, Michael Ellerman wrote: >> I have no attachment to 40x, and I'd certainly be happy to have less >> code in the tree, we struggle to keep even the modern platforms well >> maintained. >> >> At the same time I don't want to render

Re: [PATCH] powerpc/mm: ptdump: Add missing include

2020-04-02 Thread Michael Ellerman
YueHaibing writes: > gcc build fails: What config? Custom? > arch/powerpc/mm/ptdump/hashpagetable.c: In function ‘pseries_find’: > arch/powerpc/mm/ptdump/hashpagetable.c:262:18: error: ‘H_SUCCESS’ undeclared > (first use in this function); did you mean ‘FL_ACCESS’? >if (lpar_rc !=

Re: [PATCH 2/4] powerpc/eeh: Release EEH device state synchronously

2020-04-02 Thread Oliver O'Halloran
On Mon, 2020-03-30 at 15:56 +1100, Sam Bobroff wrote: > EEH device state is currently removed (by eeh_remove_device()) during > the device release handler, which is invoked as the device's reference > count drops to zero. This may take some time, or forever, as other > threads may hold references.

Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2020-04-02 Thread Hoan Tran
Hi All, On 3/31/20 7:31 AM, Baoquan He wrote: On 03/31/20 at 04:21pm, Michal Hocko wrote: On Tue 31-03-20 22:03:32, Baoquan He wrote: Hi Michal, On 03/31/20 at 10:55am, Michal Hocko wrote: On Tue 31-03-20 11:14:23, Mike Rapoport wrote: Maybe I mis-read the code, but I don't see how this

Re: [PATCH v4 03/25] powerpc/powernv: Map & release OpenCAPI LPC memory

2020-04-02 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Wed, 2020-04-01 at 01:48 -0700, Dan Williams wrote: >> > >> > +u64 pnv_ocxl_platform_lpc_setup(struct pci_dev *pdev, u64 size) >> > +{ >> > + struct pci_controller *hose = pci_bus_to_host(pdev->bus); >> > + struct pnv_phb *phb = hose->private_data;

Re: [PATCH 1/4] powerpc/eeh: fix pseries_eeh_configure_bridge()

2020-04-02 Thread Oliver O'Halloran
On Mon, 2020-03-30 at 15:56 +1100, Sam Bobroff wrote: > If a device is hot unplgged during EEH recovery, it's possible for the > RTAS call to ibm,configure-pe in pseries_eeh_configure() to return > parameter error (-3), however negative return values are not checked > for and this leads to an

[PATCH 2/2] powerpc/dt_cpu_ftrs: Advertise support for ISA v3.1 if selected

2020-04-02 Thread Alistair Popple
Enable Advertising support for cpu feature ISA v3.1 if advertised in the device-tree. Signed-off-by: Alistair Popple --- arch/powerpc/kernel/dt_cpu_ftrs.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c index

[PATCH 1/2] powerpc: Add base support for ISA v3.1

2020-04-02 Thread Alistair Popple
Newer ISA versions are enabled by clearing all bits in the PCR associated with previous versions of the ISA. Enable ISA v3.1 support by updating the PCR mask to include ISA v3.0. This ensures all PCR bits corresponding to earlier architecture versions get cleared thereby enabling ISA v3.1.

RE: [PATCH v4 08/25] ocxl: Emit a log message showing how much LPC memory was detected

2020-04-02 Thread Alastair D'Silva
> -Original Message- > From: Dan Williams > Sent: Wednesday, 1 April 2020 7:49 PM > To: Alastair D'Silva > Cc: Aneesh Kumar K . V ; Oliver O'Halloran > ; Benjamin Herrenschmidt > ; Paul Mackerras ; Michael > Ellerman ; Frederic Barrat ; > Andrew Donnellan ; Arnd Bergmann > ; Greg

RE: [PATCH v4 07/25] ocxl: Add functions to map/unmap LPC memory

2020-04-02 Thread Alastair D'Silva
> -Original Message- > From: Dan Williams > Sent: Wednesday, 1 April 2020 7:49 PM > To: Alastair D'Silva > Cc: Aneesh Kumar K . V ; Oliver O'Halloran > ; Benjamin Herrenschmidt > ; Paul Mackerras ; Michael > Ellerman ; Frederic Barrat ; > Andrew Donnellan ; Arnd Bergmann > ; Greg

Re: [RFC/PATCH 2/3] pseries/kvm: Clear PSSCR[ESL|EC] bits before guest entry

2020-04-02 Thread Nicholas Piggin
Gautham R. Shenoy's on March 31, 2020 10:10 pm: > From: "Gautham R. Shenoy" > > ISA v3.0 allows the guest to execute a stop instruction. For this, the > PSSCR[ESL|EC] bits need to be cleared by the hypervisor before > scheduling in the guest vCPU. > > Currently we always schedule in a vCPU with

Re: [RFC/PATCH 1/3] powerpc/kvm: Handle H_FAC_UNAVAIL when guest executes stop.

2020-04-02 Thread Nicholas Piggin
Gautham R. Shenoy's on March 31, 2020 10:10 pm: > From: "Gautham R. Shenoy" > > If a guest executes a stop instruction when the hypervisor has set the > PSSCR[ESL|EC] bits, the processor will throw an Hypervisor Facility > Unavailable exception. Currently when we receive this exception, we >

Re: [PATCH] powerpc/mce: Add MCE notification chain

2020-04-02 Thread Nicholas Piggin
Ganesh Goudar's on March 30, 2020 5:12 pm: > From: Santosh S > > Introduce notification chain which lets know about uncorrected memory > errors(UE). This would help prospective users in pmem or nvdimm subsystem > to track bad blocks for better handling of persistent memory allocations. > >

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-02 Thread Dan Williams
On Wed, Apr 1, 2020 at 8:08 PM Dan Williams wrote: [..] > > * "locked" : Indicating that nvdimm contents cant be modified > >until next power cycle. > > There is the generic NDD_LOCKED flag, can you use that? ...and in > general I wonder if we should try to unify all the

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Al Viro
On Thu, Apr 02, 2020 at 11:35:57AM -0700, Kees Cook wrote: > Yup, I think it's a weakness of the ARM implementation and I'd like to > not extend it further. AFAIK we should never nest, but I would not be > surprised at all if we did. > > If we were looking at a design goal for all architectures,

Re: [PATCH v4 16/25] nvdimm/ocxl: Implement the Read Error Log command

2020-04-02 Thread Dan Williams
On Tue, Mar 31, 2020 at 1:59 AM Alastair D'Silva wrote: > > The read error log command extracts information from the controller's > internal error log. > > This patch exposes this information in 2 ways: > - During probe, if an error occurs & a log is available, print it to the > console > -

Re: [PATCH v3 1/1] ppc/crash: Reset spinlocks during crash

2020-04-02 Thread Leonardo Bras
On Thu, 2020-04-02 at 22:28 +1100, Michael Ellerman wrote: > Leonardo Bras writes: > > During a crash, there is chance that the cpus that handle the NMI IPI > > are holding a spin_lock. If this spin_lock is needed by crashing_cpu it > > will cause a deadlock. (rtas.lock and printk logbuf_lock as

Re: [PATCH v2 01/22] powerpc/pkeys: Avoid using lockless page table walk

2020-04-02 Thread Ram Pai
On Thu, Mar 19, 2020 at 09:25:48AM +0530, Aneesh Kumar K.V wrote: > Fetch pkey from vma instead of linux page table. Also document the fact that > in > some cases the pkey returned in siginfo won't be the same as the one we took > keyfault on. Even with linux page table walk, we can end up in a

Re: [PATCH v4 03/16] powerpc: Use a datatype for instructions

2020-04-02 Thread Jordan Niethe
On Fri, Apr 3, 2020 at 10:45 AM Alistair Popple wrote: > > On Thursday, 2 April 2020 10:52:37 AM AEDT Jordan Niethe wrote: > > On Wed, Apr 1, 2020 at 9:32 PM Balamuruhan S wrote: > > > On Fri, 2020-03-20 at 16:17 +1100, Jordan Niethe wrote: > > > > Currently unsigned ints are used to represent

Re: [PATCH 1/4] scsi: cxlflash: Access interrupt trigger page from xive directly

2020-04-02 Thread Matthew R. Ochs
On Thu, Apr 02, 2020 at 05:43:49PM +0200, Frederic Barrat wrote: > xive is already mapping the trigger page in kernel space and it can be > accessed through standard APIs, so let's reuse it and simplify the code. > > Signed-off-by: Frederic Barrat > --- > drivers/scsi/cxlflash/ocxl_hw.c | 17

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-02 Thread Michael Ellerman
Vaibhav Jain writes: > Thanks for reviewing this patch Mpe, > Michael Ellerman writes: >> Vaibhav Jain writes: ... >> >>> + /* Check for various masks in bitmap and set the buffer */ >>> + if (health & PAPR_SCM_DIMM_UNARMED_MASK) >>> + rc += sprintf(buf, "not_armed "); >> >> I

Re: [PATCH v4 03/16] powerpc: Use a datatype for instructions

2020-04-02 Thread Alistair Popple
On Thursday, 2 April 2020 10:52:37 AM AEDT Jordan Niethe wrote: > On Wed, Apr 1, 2020 at 9:32 PM Balamuruhan S wrote: > > On Fri, 2020-03-20 at 16:17 +1100, Jordan Niethe wrote: > > > Currently unsigned ints are used to represent instructions on powerpc. > > > This has worked well as instructions

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

2020-04-02 Thread Leonardo Bras
On Fri, 2020-04-03 at 10:31 +1100, Oliver O'Halloran wrote: > On Fri, Apr 3, 2020 at 10:07 AM Leonardo Bras wrote: > > Hello Oliver, thank you for the feedback. > > Comments inline: > > > > On Fri, 2020-04-03 at 09:46 +1100, Oliver O'Halloran wrote: > > > I don't really understand why the flag

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

2020-04-02 Thread Oliver O'Halloran
On Fri, Apr 3, 2020 at 10:07 AM Leonardo Bras wrote: > > Hello Oliver, thank you for the feedback. > Comments inline: > > On Fri, 2020-04-03 at 09:46 +1100, Oliver O'Halloran wrote: > > > > I don't really understand why the flag is needed at all. According to > > PAPR any memory provided by

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

2020-04-02 Thread Leonardo Bras
Hello Oliver, thank you for the feedback. Comments inline: On Fri, 2020-04-03 at 09:46 +1100, Oliver O'Halloran wrote: > > I don't really understand why the flag is needed at all. According to > PAPR any memory provided by dynamic reconfiguration can be hot-removed > so why aren't we treating

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Russell Currey
On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: > Naveen N. Rao wrote: > > Russell Currey wrote: > > > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will > > > be one > > > W+X page at boot by default. This can be tested with > > > CONFIG_PPC_PTDUMP=y and

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

2020-04-02 Thread Oliver O'Halloran
On Fri, Apr 3, 2020 at 6:55 AM 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 kernel] powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory

2020-04-02 Thread Wen Xiong
I applied the patch on top of the latest upstream kernel. I ran HTX over pmem nodes for several hours and it works.   Tested-by: Wen Xiong   Thanks, Wendy - Original message -From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.orgCc: Alexey Kardashevskiy , David Gibson , Michael

Re: [PATCH v8 0/7] powerpc/perf: Add json file metric support for the hv_24x7 socket/chip level events

2020-04-02 Thread Jiri Olsa
On Thu, Apr 02, 2020 at 02:03:33AM +0530, Kajol Jain wrote: > Patchset adds json file metric support for the hv_24x7 socket/chip level > events. "hv_24x7" pmu interface events needs system dependent parameter > like socket/chip/core. For example, hv_24x7 chip level events needs > specific chip-id

Re: WARNING in ext4_da_update_reserve_space

2020-04-02 Thread Murilo Opsfelder Araújo
On Thursday, April 2, 2020 8:02:11 AM -03 syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:1a147b74 Merge branch 'DSA-mtu' > git tree: net-next > console output: https://syzkaller.appspot.com/x/log.txt?x=14237713e0 > kernel config:

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Linus Torvalds
On Thu, Apr 2, 2020 at 1:27 PM Kees Cook wrote: > > I was just speaking to design principles in this area: if the "enable" > is called when already enabled, Something Is Wrong. :) Well, the "something is wrong" could easily be "the hardware does not support this". I'm not at all interested in

Re: [PATCH v8 6/7] tools/perf: Enable Hz/hz prinitg for --metric-only option

2020-04-02 Thread Andi Kleen
> > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c > > index 9e757d18d713..679aaa655824 100644 > > --- a/tools/perf/util/stat-display.c > > +++ b/tools/perf/util/stat-display.c > > @@ -237,8 +237,6 @@ static bool valid_only_metric(const char *unit) > > if (!unit)

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Kees Cook
On Thu, Apr 02, 2020 at 12:26:52PM -0700, Linus Torvalds wrote: > On Thu, Apr 2, 2020 at 11:36 AM Kees Cook wrote: > > > > Yup, I think it's a weakness of the ARM implementation and I'd like to > > not extend it further. AFAIK we should never nest, but I would not be > > surprised at all if we

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

2020-04-02 Thread Leonardo Bras
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, which puts all hot-plugged memory in ZONE_MOVABLE, allowing it to

Re: [PATCH v2] qtpm2: Export tpm2_get_cc_attrs_tbl for ibmvtpm driver as module

2020-04-02 Thread Jarkko Sakkinen
On Wed, Apr 01, 2020 at 02:40:30PM +0530, Sachin Sant wrote: > > > > On 20-Mar-2020, at 1:27 AM, Jarkko Sakkinen > > wrote: > > > > On Wed, Mar 18, 2020 at 09:00:17PM -0400, Stefan Berger wrote: > >> From: Stefan Berger > >> > >> This patch fixes the following problem when the ibmvtpm

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Linus Torvalds
On Thu, Apr 2, 2020 at 11:36 AM Kees Cook wrote: > > Yup, I think it's a weakness of the ARM implementation and I'd like to > not extend it further. AFAIK we should never nest, but I would not be > surprised at all if we did. Wel, at least the user_access_begin/end() sections can't nest. objtool

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Naveen N. Rao
Naveen N. Rao wrote: Russell Currey wrote: With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Kees Cook
On Thu, Apr 02, 2020 at 06:50:32PM +0100, Al Viro wrote: > On Thu, Apr 02, 2020 at 07:03:28PM +0200, Christophe Leroy wrote: > > > user_access_begin() grants both read and write. > > > > This patch adds user_read_access_begin() and user_write_access_begin() but > > it doesn't remove

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Christophe Leroy
Le 02/04/2020 à 19:50, Al Viro a écrit : On Thu, Apr 02, 2020 at 07:03:28PM +0200, Christophe Leroy wrote: user_access_begin() grants both read and write. This patch adds user_read_access_begin() and user_write_access_begin() but it doesn't remove user_access_begin() Ouch... So the most

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Al Viro
On Thu, Apr 02, 2020 at 07:03:28PM +0200, Christophe Leroy wrote: > user_access_begin() grants both read and write. > > This patch adds user_read_access_begin() and user_write_access_begin() but > it doesn't remove user_access_begin() Ouch... So the most generic name is for the rarest case?

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Kees Cook
On Thu, Apr 02, 2020 at 07:03:28PM +0200, Christophe Leroy wrote: > > What should we do about arm and s390? There we want a cookie passed > > from beginning of block to its end; should that be a return value? > > That was the way I implemented it in January, see >

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

2020-04-02 Thread Leonardo Bras
Hello Bharata, thank you for reviewing and testing! During review of this new flag, it was suggested to change it's name to a better one (on platform's viewpoint). So I will have to change the flag name from DRCONF_MEM_HOTPLUGGED to DRCONF_MEM_HOTREMOVABLE. Everything should work the same as

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Christophe Leroy
Le 02/04/2020 à 18:29, Al Viro a écrit : On Thu, Apr 02, 2020 at 07:34:16AM +, Christophe Leroy wrote: Some architectures like powerpc64 have the capability to separate read access and write access protection. For get_user() and copy_from_user(), powerpc64 only open read access. For

Re: [PATCH v2] sched/core: fix illegal RCU from offline CPUs

2020-04-02 Thread Paul E. McKenney
On Thu, Apr 02, 2020 at 12:19:54PM -0400, Qian Cai wrote: > > > > On Apr 2, 2020, at 11:54 AM, Paul E. McKenney wrote: > > > > I do run this combination quite frequently, but only as part of > > rcutorture, which might not be a representative workload. For one thing, > > it has a minimal

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Al Viro
On Thu, Apr 02, 2020 at 07:34:16AM +, Christophe Leroy wrote: > Some architectures like powerpc64 have the capability to separate > read access and write access protection. > For get_user() and copy_from_user(), powerpc64 only open read access. > For put_user() and copy_to_user(), powerpc64

Re: [PATCH v2] sched/core: fix illegal RCU from offline CPUs

2020-04-02 Thread Qian Cai
> On Apr 2, 2020, at 11:54 AM, Paul E. McKenney wrote: > > I do run this combination quite frequently, but only as part of > rcutorture, which might not be a representative workload. For one thing, > it has a minimal userspace consisting only of a trivial init program. > I don't recall

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Naveen N. Rao
Russell Currey wrote: With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own alloc() for kprobes

Re: [PATCH v2] sched/core: fix illegal RCU from offline CPUs

2020-04-02 Thread Paul E. McKenney
On Thu, Apr 02, 2020 at 10:00:16AM -0400, Qian Cai wrote: > > > > On Apr 2, 2020, at 7:24 AM, Michael Ellerman wrote: > > > > Qian Cai writes: > >> From: Peter Zijlstra > >> > >> In the CPU-offline process, it calls mmdrop() after idle entry and the > >> subsequent call to

[PATCH 1/4] scsi: cxlflash: Access interrupt trigger page from xive directly

2020-04-02 Thread Frederic Barrat
xive is already mapping the trigger page in kernel space and it can be accessed through standard APIs, so let's reuse it and simplify the code. Signed-off-by: Frederic Barrat --- drivers/scsi/cxlflash/ocxl_hw.c | 17 +++-- drivers/scsi/cxlflash/ocxl_hw.h | 1 - 2 files changed, 7

[PATCH 2/4] ocxl: Access interrupt trigger page from xive directly

2020-04-02 Thread Frederic Barrat
We can access the trigger page through standard APIs so let's use it and avoid saving it when allocating the interrupt. It will also allow to simplify allocation in a later patch. Signed-off-by: Frederic Barrat --- drivers/misc/ocxl/afu_irq.c | 8 ++-- 1 file changed, 6 insertions(+), 2

[PATCH 4/4] ocxl: Remove custom service to allocate interrupts

2020-04-02 Thread Frederic Barrat
We now allocate interrupts through xive directly. Signed-off-by: Frederic Barrat --- arch/powerpc/include/asm/pnv-ocxl.h | 3 --- arch/powerpc/platforms/powernv/ocxl.c | 30 --- 2 files changed, 33 deletions(-) diff --git a/arch/powerpc/include/asm/pnv-ocxl.h

[PATCH 3/4] ocxl: Don't return trigger page when allocating an interrupt

2020-04-02 Thread Frederic Barrat
Existing users of ocxl_link_irq_alloc() have been converted to obtain the trigger page of an interrupt through xive directly, we therefore have no need to return the trigger page when allocating an interrupt. It also allows ocxl to use the xive native interface to allocate interrupts, instead of

[PATCH 0/4] ocxl: Cleanup AFU interrupt allocation

2020-04-02 Thread Frederic Barrat
Short series to cleanup AFU interrupt allocation for opencapi. Current code was using its own allocation service, calling opal directly to get the trigger page. This is not needed and we can use xive to achieve the same thing. The only caveat is that the trigger page address is only valid after

[PATCH v4 3/3] powerpc test_emulate_step: add testcases for divde[.] and divdeu[.] instructions

2020-04-02 Thread Balamuruhan S
add testcases for divde, divde., divdeu, divdeu. emulated instructions to cover few scenarios, * with same dividend and divisor to have undefine RT for divdeu[.] * with divide by zero to have undefine RT for both divde[.] and divdeu[.] * with negative

[PATCH v4 2/3] powerpc sstep: add support for divde[.] and divdeu[.] instructions

2020-04-02 Thread Balamuruhan S
This patch adds emulation support for divde, divdeu instructions, * Divide Doubleword Extended (divde[.]) * Divide Doubleword Extended Unsigned (divdeu[.]) Reviewed-by: Sandipan Das Signed-off-by: Balamuruhan S Acked-by: Naveen N. Rao --- arch/powerpc/lib/sstep.c | 13

[PATCH v4 1/3] powerpc ppc-opcode: add divde and divdeu opcodes

2020-04-02 Thread Balamuruhan S
include instruction opcodes for divde and divdeu as macros. Reviewed-by: Sandipan Das Signed-off-by: Balamuruhan S Acked-by: Naveen N. Rao --- arch/powerpc/include/asm/ppc-opcode.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/include/asm/ppc-opcode.h

[PATCH v4 0/3] Add support for divde[.] and divdeu[.] instruction emulation

2020-04-02 Thread Balamuruhan S
Hi All, This patchset adds support to emulate divde, divde., divdeu and divdeu. instructions and testcases for it. Changes in v4: - Fix review comments from Naveen, * replace TEST_DIVDEU() instead of wrongly used TEST_DIVDEU_DOT() in divdeu testcase. * Include `acked-by` tag from

RE: [PATCH 0/6] Kill setup_irq()

2020-04-02 Thread Brian Cain
> -Original Message- > From: linux-hexagon-ow...@vger.kernel.org ow...@vger.kernel.org> On Behalf Of afzal mohammed ... > On Fri, Mar 27, 2020 at 09:48:38PM -0500, Brian Cain wrote: > > > > Note 2: hexagon final image creation fails even w/o my patch > > > What's the nature of the

Re: [PATCH v2] sched/core: fix illegal RCU from offline CPUs

2020-04-02 Thread Qian Cai
> On Apr 2, 2020, at 7:24 AM, Michael Ellerman wrote: > > Qian Cai writes: >> From: Peter Zijlstra >> >> 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

[PATCH] powerpc/mm: ptdump: Add missing include

2020-04-02 Thread YueHaibing
gcc build fails: arch/powerpc/mm/ptdump/hashpagetable.c: In function ‘pseries_find’: arch/powerpc/mm/ptdump/hashpagetable.c:262:18: error: ‘H_SUCCESS’ undeclared (first use in this function); did you mean ‘FL_ACCESS’? if (lpar_rc != H_SUCCESS) ^

Re: [PATCH v4 00/25] Add support for OpenCAPI Persistent Memory devices

2020-04-02 Thread Greg Kurz
On Thu, 02 Apr 2020 21:06:01 +1100 Michael Ellerman wrote: > "Oliver O'Halloran" writes: > > On Thu, Apr 2, 2020 at 2:42 PM Michael Ellerman wrote: > >> "Alastair D'Silva" writes: > >> >> -Original Message- > >> >> From: Dan Williams > >> >> > >> >> On Sun, Mar 29, 2020 at 10:23 PM

Re: [PATCH v8 6/7] tools/perf: Enable Hz/hz prinitg for --metric-only option

2020-04-02 Thread Jiri Olsa
On Thu, Apr 02, 2020 at 02:03:39AM +0530, Kajol Jain wrote: > Commit 54b5091606c18 ("perf stat: Implement --metric-only mode") > added function 'valid_only_metric()' which drops "Hz" or "hz", > if it is part of "ScaleUnit". This patch enable it since hv_24x7 > supports couple of frequency events.

[PATCH v2] powerpc/64: Update Speculation_Store_Bypass in /proc//status

2020-04-02 Thread Michael Ellerman
Currently we don't report anything useful in /proc//status: $ grep Speculation_Store_Bypass /proc/self/status Speculation_Store_Bypass: unknown Our mitigation is currently always a barrier instruction, which doesn't map that well onto the existing possibilities for the PR_SPEC values.

[PATCH] powerpc/64s: Fix doorbell wakeup msgclr optimisation

2020-04-02 Thread Nicholas Piggin
Commit 3282a3da25bd ("powerpc/64: Implement soft interrupt replay in C") broke the doorbell wakeup optimisation introduced by commit a9af97aa0a12 ("powerpc/64s: msgclr when handling doorbell exceptions from system reset"). This patch restores it, in C code. It's moved explicitly to the system

[PATCH] Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled"

2020-04-02 Thread Nicholas Piggin
This reverts commit ebb37cf3ffd39fdb6ec5b07111f8bb2f11d92c5f. That commit does not play well with soft-masked irq state manipulations in idle, interrupt replay, and possibly others due to tracing code sometimes using irq_work_queue (e.g., in trace_hardirqs_on()). That can cause PACA_IRQ_DEC to

Re: [PATCH v3 1/1] ppc/crash: Reset spinlocks during crash

2020-04-02 Thread Michael Ellerman
Leonardo Bras writes: > During a crash, there is chance that the cpus that handle the NMI IPI > are holding a spin_lock. If this spin_lock is needed by crashing_cpu it > will cause a deadlock. (rtas.lock and printk logbuf_lock as of today) > > This is a problem if the system has kdump set up,

Re: [PATCH v2] sched/core: fix illegal RCU from offline CPUs

2020-04-02 Thread Michael Ellerman
Qian Cai writes: > From: Peter Zijlstra > > 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 > lockdep complaining when mmdrop()

WARNING in ext4_da_update_reserve_space

2020-04-02 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:1a147b74 Merge branch 'DSA-mtu' git tree: net-next console output: https://syzkaller.appspot.com/x/log.txt?x=14237713e0 kernel config: https://syzkaller.appspot.com/x/.config?x=46ee14d4915944bc dashboard link:

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-02 Thread Michael Ellerman
Vaibhav Jain writes: > 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 big-endian integers which are then stored in 'struct > papr_scm_priv' and subsequently partially exposed to user-space via >

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

2020-04-02 Thread Arnd Bergmann
On Wed, Apr 1, 2020 at 11:07 PM Arnd Bergmann wrote: > > On Tue, Mar 31, 2020 at 7:51 PM Segher Boessenkool > wrote: > > > > On Tue, Mar 31, 2020 at 08:56:23AM +0200, Christophe Leroy wrote: > > > While we are at it, can we also remove the 601 ? This one is also full > > > of workarounds and

Re: [PATCH V2 3/5] selftests/powerpc: Add NX-GZIP engine compress testcase

2020-04-02 Thread Michael Ellerman
Daniel Axtens writes: > Raphael Moreira Zinsly writes: > >> Add a compression testcase for the powerpc NX-GZIP engine. >> >> Signed-off-by: Bulent Abali >> Signed-off-by: Raphael Moreira Zinsly ... >> diff --git a/tools/testing/selftests/powerpc/nx-gzip/gzip_vas.c >>

Re: [PATCH v4 03/25] powerpc/powernv: Map & release OpenCAPI LPC memory

2020-04-02 Thread Benjamin Herrenschmidt
On Wed, 2020-04-01 at 01:48 -0700, Dan Williams wrote: > > > > +u64 pnv_ocxl_platform_lpc_setup(struct pci_dev *pdev, u64 size) > > +{ > > + struct pci_controller *hose = pci_bus_to_host(pdev->bus); > > + struct pnv_phb *phb = hose->private_data; > > Is calling the local variable

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

2020-04-02 Thread Benjamin Herrenschmidt
On Tue, 2020-03-31 at 16:30 +1100, Michael Ellerman wrote: > I have no attachment to 40x, and I'd certainly be happy to have less > code in the tree, we struggle to keep even the modern platforms well > maintained. > > At the same time I don't want to render anyone's hardware obsolete >

Re: [PATCH v1 06/46] powerpc/kasan: Refactor update of early shadow mappings

2020-04-02 Thread Christophe Leroy
Michael, Le 16/03/2020 à 13:35, Christophe Leroy a écrit : kasan_remap_early_shadow_ro() and kasan_unmap_early_shadow_vmalloc() are both updating the early shadow mapping: the first one sets the mapping read-only while the other clears the mapping. Refactor and create

Re: [PATCH v1 39/46] powerpc/8xx: Add a function to early map kernel via huge pages

2020-04-02 Thread Christophe Leroy
Le 17/03/2020 à 15:43, Christophe Leroy a écrit : Le 17/03/2020 à 02:39, kbuild test robot a écrit : Hi Christophe, Thank you for the patch! Yet something to improve: [auto build test ERROR on next-20200316] [cannot apply to powerpc/next v5.6-rc6 v5.6-rc5 v5.6-rc4 v5.6-rc6] [if your

Re: [PATCH v4 00/25] Add support for OpenCAPI Persistent Memory devices

2020-04-02 Thread Michael Ellerman
"Oliver O'Halloran" writes: > On Thu, Apr 2, 2020 at 2:42 PM Michael Ellerman wrote: >> "Alastair D'Silva" writes: >> >> -Original Message- >> >> From: Dan Williams >> >> >> >> On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva >> >> wrote: >> >> > >> >> > *snip* >> >> Are OPAL calls

[powerpc:next] BUILD SUCCESS c17eb4dca5a353a9dbbb8ad6934fe57af7165e91

2020-04-02 Thread kbuild test robot
randconfig-a001-20200401 parisc randconfig-a001-20200401 riscvrandconfig-a001-20200401 alpharandconfig-a001-20200402 m68k randconfig-a001-20200402 mips randconfig-a001-20200402 nds32randconfig-a001-20200402

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

2020-04-02 Thread Bharata B Rao
On Wed, Apr 1, 2020 at 8:38 PM Leonardo Bras wrote: > > On Thu, 2020-03-05 at 20:32 -0300, Leonardo Bras wrote: > > --- > > The new flag was already proposed on Power Architecture documentation, > > and it's waiting for approval. > > > > I would like to get your comments on this change, but it's

[PATCH v8 7/7] powerpc/32: use set_memory_attr()

2020-04-02 Thread Russell Currey
From: Christophe Leroy Use set_memory_attr() instead of the PPC32 specific change_page_attr() change_page_attr() was checking that the address was not mapped by blocks and was handling highmem, but that's unneeded because the affected pages can't be in highmem and block mapping verification is

[PATCH v8 6/7] powerpc/mm: implement set_memory_attr()

2020-04-02 Thread Russell Currey
From: Christophe Leroy In addition to the set_memory_xx() functions which allows to change the memory attributes of not (yet) used memory regions, implement a set_memory_attr() function to: - set the final memory protection after init on currently used kernel regions. - enable/disable kernel

[PATCH v8 5/7] powerpc/configs: Enable STRICT_MODULE_RWX in skiroot_defconfig

2020-04-02 Thread Russell Currey
skiroot_defconfig is the only powerpc defconfig with STRICT_KERNEL_RWX enabled, and if you want memory protection for kernel text you'd want it for modules too, so enable STRICT_MODULE_RWX there. Acked-by: Joel Stanley Signed-off-by: Russell Currey --- arch/powerpc/configs/skiroot_defconfig |

[PATCH v8 4/7] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX

2020-04-02 Thread Russell Currey
To enable strict module RWX on powerpc, set: CONFIG_STRICT_MODULE_RWX=y You should also have CONFIG_STRICT_KERNEL_RWX=y set to have any real security benefit. ARCH_HAS_STRICT_MODULE_RWX is set to require ARCH_HAS_STRICT_KERNEL_RWX. This is due to a quirk in arch/Kconfig and

[PATCH v8 3/7] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime

2020-04-02 Thread Russell Currey
Very rudimentary, just echo 1 > [debugfs]/check_wx_pages and check the kernel log. Useful for testing strict module RWX. Updated the Kconfig entry to reflect this. Also fixed a typo. Reviewed-by: Kees Cook Signed-off-by: Russell Currey --- arch/powerpc/Kconfig.debug | 6

[PATCH v8 1/7] powerpc/mm: Implement set_memory() routines

2020-04-02 Thread Russell Currey
The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, and are generally useful primitives to have. This implementation is designed to be completely generic across powerpc's many MMUs. It's possible that this could be optimised to be faster for specific MMUs, but the focus

[PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Russell Currey
With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own alloc() for kprobes like other architectures

Re: [PATCH v10 03/14] powerpc/vas: Alloc and setup IRQ and trigger port address

2020-04-02 Thread Cédric Le Goater
On 4/2/20 9:10 AM, Haren Myneni wrote: > > Allocate a xive irq on each chip with a vas instance. The NX coprocessor > raises a host CPU interrupt via vas if it encounters page fault on user > space request buffer. Subsequent patches register the trigger port with > the NX coprocessor, and create

Re: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA)

2020-04-02 Thread Michal Hocko
On Wed 01-04-20 10:51:55, Mike Rapoport wrote: > Hi, > > On Wed, Apr 01, 2020 at 01:42:27PM +0800, Baoquan He wrote: [...] > > From above information, we can remove HAVE_MEMBLOCK_NODE_MAP, and > > replace it with CONFIG_NUMA. That sounds more sensible to store nid into > > memblock when NUMA

Re: [PATCH RESEND 2/4] uaccess: Selectively open read or write user access

2020-04-02 Thread Christophe Leroy
Le 02/04/2020 à 09:51, Kees Cook a écrit : On Thu, Apr 02, 2020 at 07:34:17AM +, Christophe Leroy wrote: [...] diff --git a/kernel/compat.c b/kernel/compat.c index 843dd17e6078..705ca7e418c6 100644 --- a/kernel/compat.c +++ b/kernel/compat.c @@ -199,7 +199,7 @@ long

Re: [PATCH RESEND 3/4] drm/i915/gem: Replace user_access_begin by user_write_access_begin

2020-04-02 Thread Christophe Leroy
Le 02/04/2020 à 09:52, Kees Cook a écrit : On Thu, Apr 02, 2020 at 07:34:18AM +, Christophe Leroy wrote: When i915_gem_execbuffer2_ioctl() is using user_access_begin(), that's only to perform unsafe_put_user() so use user_write_access_begin() in order to only open write access.

Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Kees Cook
On Thu, Apr 02, 2020 at 07:34:16AM +, Christophe Leroy wrote: > Some architectures like powerpc64 have the capability to separate > read access and write access protection. > For get_user() and copy_from_user(), powerpc64 only open read access. > For put_user() and copy_to_user(), powerpc64

Re: [PATCH RESEND 4/4] powerpc/uaccess: Implement user_read_access_begin and user_write_access_begin

2020-04-02 Thread Kees Cook
On Thu, Apr 02, 2020 at 07:34:19AM +, Christophe Leroy wrote: > Add support for selective read or write user access with > user_read_access_begin/end and user_write_access_begin/end. > > Signed-off-by: Christophe Leroy Reviewed-by: Kees Cook -Kees > --- >

Re: [PATCH RESEND 3/4] drm/i915/gem: Replace user_access_begin by user_write_access_begin

2020-04-02 Thread Kees Cook
On Thu, Apr 02, 2020 at 07:34:18AM +, Christophe Leroy wrote: > When i915_gem_execbuffer2_ioctl() is using user_access_begin(), > that's only to perform unsafe_put_user() so use > user_write_access_begin() in order to only open write access. > > Signed-off-by: Christophe Leroy Why is this

Re: [PATCH RESEND 2/4] uaccess: Selectively open read or write user access

2020-04-02 Thread Kees Cook
On Thu, Apr 02, 2020 at 07:34:17AM +, Christophe Leroy wrote: > [...] > diff --git a/kernel/compat.c b/kernel/compat.c > index 843dd17e6078..705ca7e418c6 100644 > --- a/kernel/compat.c > +++ b/kernel/compat.c > @@ -199,7 +199,7 @@ long compat_get_bitmap(unsigned long *mask, const >

Re: [PATCH v4 6/6] pseries/sysfs: Minimise IPI noise while reading [idle_][s]purr

2020-04-02 Thread Naveen N. Rao
Gautham R Shenoy wrote: Hello Naveen, On Wed, Apr 01, 2020 at 03:28:48PM +0530, Naveen N. Rao wrote: Gautham R. Shenoy wrote: >From: "Gautham R. Shenoy" > [..snip..] >+ >+static ssize_t show_purr(struct device *dev, >+struct device_attribute *attr, char *buf) > { >-

[PATCH RESEND 3/4] drm/i915/gem: Replace user_access_begin by user_write_access_begin

2020-04-02 Thread Christophe Leroy
When i915_gem_execbuffer2_ioctl() is using user_access_begin(), that's only to perform unsafe_put_user() so use user_write_access_begin() in order to only open write access. Signed-off-by: Christophe Leroy --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 11 ++- 1 file changed, 6

[PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end

2020-04-02 Thread Christophe Leroy
Some architectures like powerpc64 have the capability to separate read access and write access protection. For get_user() and copy_from_user(), powerpc64 only open read access. For put_user() and copy_to_user(), powerpc64 only open write access. But when using unsafe_get_user() or

[PATCH RESEND 4/4] powerpc/uaccess: Implement user_read_access_begin and user_write_access_begin

2020-04-02 Thread Christophe Leroy
Add support for selective read or write user access with user_read_access_begin/end and user_write_access_begin/end. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/kup.h | 4 ++-- arch/powerpc/include/asm/kup.h | 14 +-

[PATCH RESEND 2/4] uaccess: Selectively open read or write user access

2020-04-02 Thread Christophe Leroy
When opening user access to only perform reads, only open read access. When opening user access to only perform writes, only open write access. Signed-off-by: Christophe Leroy --- fs/readdir.c| 12 ++-- kernel/compat.c | 12 ++-- kernel/exit.c | 12

[PATCH v10 14/14] powerpc: Use mm_context vas_windows counter to issue CP_ABORT

2020-04-02 Thread Haren Myneni
set_thread_uses_vas() sets used_vas flag for a process that opened VAS window and issue CP_ABORT during context switch for only that process. In multi-thread application, windows can be shared. For example Thread A can open a window and Thread B can run COPY/PASTE instructions to send NX request

  1   2   >