Re: [PATCH] arch/powerpc/mm: Enable compound page check for both THP and HugeTLB

2020-03-23 Thread Aneesh Kumar K.V
On 3/24/20 12:08 PM, Michael Ellerman wrote: "Aneesh Kumar K.V" writes: THP config can result in compound pages. Make sure kernel enables the PageCompound() check when only THP is enabled. Or else what happens ... nothing, rampant data corruption, something in between? We can get a stale i

Re: [PATCH] arch/powerpc/mm: Enable compound page check for both THP and HugeTLB

2020-03-23 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > THP config can result in compound pages. Make sure kernel enables the > PageCompound() check when only THP is enabled. Or else what happens ... nothing, rampant data corruption, something in between? And "when only THP is enabled" is not very clear, AFAIK there is no

Re: [PATCH] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_work_fn

2020-03-23 Thread Michael Ellerman
"Rafael J. Wysocki" writes: > On Monday, March 16, 2020 2:57:43 PM CET Pratik Rajesh Sampat wrote: >> The patch avoids allocating cpufreq_policy on stack hence fixing frame >> size overflow in 'powernv_cpufreq_work_fn' >> >> Fixes: 227942809b52 ("cpufreq: powernv: Restore cpu frequency to policy-

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Aneesh Kumar K.V
Alexey Kardashevskiy writes: > On 24/03/2020 04:22, Christoph Hellwig wrote: >> On Mon, Mar 23, 2020 at 09:07:38PM +0530, Aneesh Kumar K.V wrote: >>> >>> This is what I was trying, but considering I am new to DMA subsystem, I >>> am not sure I got all the details correct. The idea is to look at t

Re: [PATCH v5 10/13] powerpc/ptrace: split out ADV_DEBUG_REGS related functions.

2020-03-23 Thread Michael Ellerman
Christophe Leroy writes: > On 03/20/2020 02:12 AM, Michael Ellerman wrote: >> Christophe Leroy writes: >>> Move ADV_DEBUG_REGS functions out of ptrace.c, into >>> ptrace-adv.c and ptrace-noadv.c >>> >>> Signed-off-by: Christophe Leroy >>> --- >>> v4: Leave hw_breakpoint.h for ptrace.c >>> --- >>

Re: [PATCH v4 08/16] powerpc: Use an accessor for word instructions

2020-03-23 Thread Balamuruhan S
On Tue, 2020-03-24 at 14:18 +1100, Jordan Niethe wrote: > On Mon, Mar 23, 2020 at 10:13 PM Balamuruhan S wrote: > > On Fri, 2020-03-20 at 16:18 +1100, Jordan Niethe wrote: > > > In preparation for prefixed instructions where all instructions are no > > > longer words, use an accessor for getting a

Re: [PATCH] powerpc xmon: drop the option `i` in cacheflush

2020-03-23 Thread Balamuruhan S
On Tue, 2020-03-24 at 14:52 +1100, Michael Ellerman wrote: > "Naveen N. Rao" writes: > > Segher Boessenkool wrote: > > > On Mon, Mar 23, 2020 at 04:55:48PM +0530, Balamuruhan S wrote: > > > > Data Cache Block Invalidate (dcbi) instruction implemented in 32-bit > > > > designs prior to PowerPC arch

Re: [PATCH] powerpc xmon: drop the option `i` in cacheflush

2020-03-23 Thread Balamuruhan S
On Mon, 2020-03-23 at 07:46 -0500, Segher Boessenkool wrote: > On Mon, Mar 23, 2020 at 04:55:48PM +0530, Balamuruhan S wrote: > > Data Cache Block Invalidate (dcbi) instruction implemented in 32-bit > > designs prior to PowerPC architecture version 2.01 and got obsolete > > from version 2.01. > >

[5.6.0-rc7] Kernel crash while running ndctl tests

2020-03-23 Thread Sachin Sant
While running ndctl[1] tests against 5.6.0-rc7 following crash is encountered. Bisect leads me to commit d41e2f3bd546 mm/hotplug: fix hot remove failure in SPARSEMEM|!VMEMMAP case Reverting this commit helps and the tests complete without any crash. pmem0: detected capacity change from 0 to 10

Re: [PATCH v4 00/16] Initial Prefixed Instruction support

2020-03-23 Thread Nicholas Piggin
Jordan Niethe's on March 24, 2020 12:54 pm: > On Mon, Mar 23, 2020 at 9:21 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on March 23, 2020 7:25 pm: >> > On Mon, Mar 23, 2020 at 5:22 PM Nicholas Piggin wrote: >> >> >> >> Jordan Niethe's on March 20, 2020 3:17 pm: >> >> > A future revision of the

Re: [PATCH v4 14/16] powerpc64: Add prefixed instructions to instruction data type

2020-03-23 Thread Nicholas Piggin
Jordan Niethe's on March 24, 2020 9:45 am: > On Mon, Mar 23, 2020 at 6:37 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on March 20, 2020 3:18 pm: >> I'm a bit against using partially constructed opaque type for things >> like this, even if it is in the code that knows about the type. We >> coul

Re: [PATCH v3] powerpc/kprobes: Ignore traps that happened in real mode

2020-03-23 Thread Michael Ellerman
Christophe Leroy writes: > ping > > > Le 18/02/2020 à 20:38, Christophe Leroy a écrit : >> When a program check exception happens while MMU translation is >> disabled, following Oops happens in kprobe_handler() in the following >> code: > > Michael, we have several traps in assembly while MMU is s

Re: [PATCH v3] powerpc/pseries: Handle UE event for memcpy_mcsafe

2020-03-23 Thread Michael Ellerman
Ganesh Goudar writes: > If we hit UE at an instruction with a fixup entry, flag to > ignore the event and set nip to continue execution at the > fixup entry. You don't explain why we would want to do that. Or what the consequences are if we *don't* do it. As such it's unclear if this is an impor

[PATCH V2 2/3] mm/debug: Add tests validating arch advanced page table helpers

2020-03-23 Thread Anshuman Khandual
This adds new tests validating for these following arch advanced page table helpers. These tests create and test specific mapping types at various page table levels. 1. pxxp_set_wrprotect() 2. pxxp_get_and_clear() 3. pxxp_set_access_flags() 4. pxxp_get_and_clear_full() 5. pxxp_test_and_clear_young

[PATCH V2 1/3] mm/debug: Add tests validating arch page table helpers for core features

2020-03-23 Thread Anshuman Khandual
This adds new tests validating arch page table helpers for these following core memory features. These tests create and test specific mapping types at various page table levels. 1. SPECIAL mapping 2. PROTNONE mapping 3. DEVMAP mapping 4. SOFTDIRTY mapping 5. SWAP mapping 6. MIGRATION mapping 7. HU

[PATCH V2 0/3] mm/debug: Add more arch page table helper tests

2020-03-23 Thread Anshuman Khandual
This series adds more arch page table helper tests. The new tests here are either related to core memory functions and advanced arch pgtable helpers. This also creates a documentation file enlisting all expected semantics as suggested by Mike Rapoport (https://lkml.org/lkml/2020/1/30/40). This ser

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Alexey Kardashevskiy
On 24/03/2020 14:37, Alexey Kardashevskiy wrote: > > > On 24/03/2020 04:20, Christoph Hellwig wrote: >> On Mon, Mar 23, 2020 at 07:58:01PM +1100, Alexey Kardashevskiy wrote: > 0x100.. .. 0x101.. > > 2x4G, each is 1TB aligned. And we can map directly only the first 4

Re: Argh, can't find dcache properties !

2020-03-23 Thread Michael Ellerman
Chris Packham writes: > Hi All, > > Just booting up v5.5.11 on a Freescale T2080RDB and I'm seeing the > following mesage. > > kern.warning linuxbox kernel: Argh, can't find dcache properties ! > kern.warning linuxbox kernel: Argh, can't find icache properties ! > > This was changed from DBG() to

Re: [PATCH 4/4] hugetlbfs: clean up command line processing

2020-03-23 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
On 2020/3/24 8:43, Mina Almasry wrote: > On Wed, Mar 18, 2020 at 3:07 PM Mike Kravetz wrote: >> >> With all hugetlb page processing done in a single file clean up code. > > Now that all hugepage page processing is done in a single file, clean > up the code. > >> - Make code match desired sema

Re: [PATCH] powerpc xmon: drop the option `i` in cacheflush

2020-03-23 Thread Michael Ellerman
"Naveen N. Rao" writes: > Segher Boessenkool wrote: >> On Mon, Mar 23, 2020 at 04:55:48PM +0530, Balamuruhan S wrote: >>> Data Cache Block Invalidate (dcbi) instruction implemented in 32-bit >>> designs prior to PowerPC architecture version 2.01 and got obsolete >>> from version 2.01. We still su

Re: [PATCH v4 3/9] powerpc/vas: Add VAS user space API

2020-03-23 Thread Michael Ellerman
Daniel Axtens writes: > Michael Ellerman writes: >> Daniel Axtens writes: >>> Haren Myneni writes: diff --git a/arch/powerpc/platforms/powernv/vas-api.c b/arch/powerpc/platforms/powernv/vas-api.c new file mode 100644 index 000..7d049af --- /dev/null +++ b/arch

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Alexey Kardashevskiy
On 24/03/2020 04:20, Christoph Hellwig wrote: > On Mon, Mar 23, 2020 at 07:58:01PM +1100, Alexey Kardashevskiy wrote: 0x100.. .. 0x101.. 2x4G, each is 1TB aligned. And we can map directly only the first 4GB (because of the maximum IOMMU table size) but not the

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

2020-03-23 Thread Jordan Niethe
On Tue, Mar 24, 2020 at 1:58 PM Michael Ellerman wrote: > > Nicholas Piggin writes: > > Jordan Niethe's on March 23, 2020 7:28 pm: > >> On Mon, Mar 23, 2020 at 5:27 PM Nicholas Piggin wrote: > >>> Jordan Niethe's on March 20, 2020 3:17 pm: > >>> > Currently unsigned ints are used to represent in

Re: [PATCH v4 08/16] powerpc: Use an accessor for word instructions

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 10:13 PM Balamuruhan S wrote: > > On Fri, 2020-03-20 at 16:18 +1100, Jordan Niethe wrote: > > In preparation for prefixed instructions where all instructions are no > > longer words, use an accessor for getting a word instruction as a u32 > > from the instruction data type.

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Alexey Kardashevskiy
On 24/03/2020 04:22, Christoph Hellwig wrote: > On Mon, Mar 23, 2020 at 09:07:38PM +0530, Aneesh Kumar K.V wrote: >> >> This is what I was trying, but considering I am new to DMA subsystem, I >> am not sure I got all the details correct. The idea is to look at the >> cpu addr and see if that can

Re: [PATCH v4 00/16] Initial Prefixed Instruction support

2020-03-23 Thread Jordan Niethe
On Tue, Mar 24, 2020 at 1:54 PM Jordan Niethe wrote: > > On Mon, Mar 23, 2020 at 9:21 PM Nicholas Piggin wrote: > > > > Jordan Niethe's on March 23, 2020 7:25 pm: > > > On Mon, Mar 23, 2020 at 5:22 PM Nicholas Piggin wrote: > > >> > > >> Jordan Niethe's on March 20, 2020 3:17 pm: > > >> > A futu

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

2020-03-23 Thread Michael Ellerman
Nicholas Piggin writes: > Jordan Niethe's on March 23, 2020 7:28 pm: >> On Mon, Mar 23, 2020 at 5:27 PM Nicholas Piggin wrote: >>> Jordan Niethe's on March 20, 2020 3:17 pm: >>> > Currently unsigned ints are used to represent instructions on powerpc. >>> > This has worked well as instructions hav

Re: [PATCH 0/2] Fix SVM hang at startup

2020-03-23 Thread Paul Mackerras
On Fri, Mar 20, 2020 at 11:26:41AM +0100, Laurent Dufour wrote: > This series is fixing a SVM hang occurring when starting a SVM requiring > more secure memory than available. The hang happens in the SVM when calling > UV_ESM. > > The following is happening: > > 1. SVM calls UV_ESM > 2. Ultraviso

Re: [PATCH] KVM: PPC: Book3S HV: Skip kvmppc_uvmem_free if Ultravisor is not supported

2020-03-23 Thread Paul Mackerras
On Thu, Mar 19, 2020 at 07:55:10PM -0300, Fabiano Rosas wrote: > kvmppc_uvmem_init checks for Ultravisor support and returns early if > it is not present. Calling kvmppc_uvmem_free at module exit will cause > an Oops: > > $ modprobe -r kvm-hv > > Oops: Kernel access of bad area, sig: 11 [#1] >

Re: [PATCH v4 00/16] Initial Prefixed Instruction support

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 9:21 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 23, 2020 7:25 pm: > > On Mon, Mar 23, 2020 at 5:22 PM Nicholas Piggin wrote: > >> > >> Jordan Niethe's on March 20, 2020 3:17 pm: > >> > A future revision of the ISA will introduce prefixed instructions. A > >> >

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

2020-03-23 Thread Oliver O'Halloran
On Mon, Mar 23, 2020 at 8:28 PM Cédric Le Goater wrote: > > On 3/23/20 10:06 AM, Cédric Le Goater wrote: > > On 3/19/20 7:14 AM, Haren Myneni wrote: > >> > >> Alloc IRQ and get trigger port address for each VAS instance. Kernel > >> register this IRQ per VAS instance and sets this port for each se

Re: [PATCH v2] libnvdimm: Update persistence domain value for of_pmem and papr_scm device

2020-03-23 Thread Dan Williams
On Fri, Mar 20, 2020 at 2:25 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > > Dan Williams writes: > > ... > > > > > >> > >> Or are you suggesting that application should not infer any of those > >> details looking at persistence_domain value? If so what is the purpose > >> of exporting that attrib

Re: [PATCH v3] ocxl: control via sysfs whether the FPGA is reloaded on a link reset

2020-03-23 Thread Andrew Donnellan
On 18/3/20 9:02 pm, Frederic Barrat wrote: From: Philippe Bergheaud Some opencapi FPGA images allow to control if the FPGA should be reloaded on the next adapter reset. If it is supported, the image specifies it through a Vendor Specific DVSEC in the config space of function 0. Signed-off-by:

Re: [PATCH 1/2] KVM: PPC: Book3S HV: check caller of H_SVM_* Hcalls

2020-03-23 Thread Paul Mackerras
On Fri, Mar 20, 2020 at 01:22:48PM +0100, Greg Kurz wrote: > On Fri, 20 Mar 2020 11:26:42 +0100 > Laurent Dufour wrote: > > > The Hcall named H_SVM_* are reserved to the Ultravisor. However, nothing > > prevent a malicious VM or SVM to call them. This could lead to weird result > > and should be

Re: [PATCH 3/4] hugetlbfs: remove hugetlb_add_hstate() warning for existing hstate

2020-03-23 Thread Mike Kravetz
On 3/23/20 5:01 PM, Mina Almasry wrote: > On Wed, Mar 18, 2020 at 3:07 PM Mike Kravetz wrote: >> >> The routine hugetlb_add_hstate prints a warning if the hstate already >> exists. This was originally done as part of kernel command line >> parsing. If 'hugepagesz=' was specified more than once,

Re: [PATCH v4 14/16] powerpc64: Add prefixed instructions to instruction data type

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 6:37 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:18 pm: > > For powerpc64, redefine the ppc_inst type so both word and prefixed > > instructions can be represented. On powerpc32 the type will remain the > > same. Update places which had assumed instru

[PATCH] powerpc/maple: Fix declaration made after definition

2020-03-23 Thread Nathan Chancellor
When building ppc64 defconfig, Clang errors (trimmed for brevity): arch/powerpc/platforms/maple/setup.c:365:1: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] machine_device_initcall(maple, maple_cpc925_edac_setup); ^ machine_device_initcall expands to __define

RE: [patch V3 08/20] hexagon: Remove mm.h from asm/uaccess.h

2020-03-23 Thread Brian Cain
> -Original Message- > From: Thomas Gleixner ... > Subject: [patch V3 08/20] hexagon: Remove mm.h from asm/uaccess.h > > From: Sebastian Andrzej Siewior > > The defconfig compiles without linux/mm.h. With mm.h included the include > chain leands to: > | CC kernel/locking/percpu-r

Re: [PATCH] powerpc/legacy_serial: Use early_ioremap()

2020-03-23 Thread Chris Packham
Hi Christophe, On Wed, 2020-02-05 at 12:03 +, Christophe Leroy wrote: > [0.00] ioremap() called early from > find_legacy_serial_ports+0x3cc/0x474. Use early_ioremap() instead > I was just about to dig into this error message and found you patch. I applied it to a v5.5 base. > find_l

Re: [PATCH] powerpc/64: allow rtas to be called in real-mode, use this in machine check

2020-03-23 Thread Ganesh
On 3/20/20 8:58 PM, Nicholas Piggin wrote: rtas_call allocates and uses memory in failure paths, which is not safe for RMA. It also calls local_irq_save() which may not be safe in all real mode contexts. Particularly machine check may run with interrupts not "reconciled", and it may have hit w

Re: [PATCH v5 1/7] ASoC: dt-bindings: fsl_asrc: Add new property fsl,asrc-format

2020-03-23 Thread Nicolin Chen
On Fri, Mar 20, 2020 at 11:32:13AM -0600, Rob Herring wrote: > On Mon, Mar 09, 2020 at 02:19:44PM -0700, Nicolin Chen wrote: > > On Mon, Mar 09, 2020 at 11:58:28AM +0800, Shengjiu Wang wrote: > > > In order to support new EASRC and simplify the code structure, > > > We decide to share the common st

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

2020-03-23 Thread Haren Myneni
On Mon, 2020-03-23 at 10:27 +0100, Cédric Le Goater wrote: > On 3/23/20 10:06 AM, Cédric Le Goater wrote: > > On 3/19/20 7:14 AM, Haren Myneni wrote: > >> > >> Alloc IRQ and get trigger port address for each VAS instance. Kernel > >> register this IRQ per VAS instance and sets this port for each se

Re: [PATCH 0/10] NS 8250 UART Device Tree improvements

2020-03-23 Thread Rob Herring
On Fri, Mar 20, 2020 at 11:41 AM Lubomir Rintel wrote: > > Hi, > > this series aims to make it possible to validate NS 8250 compatible serial > port > nodes in Device Tree. It ultimately ends up converting the 8250.txt binding > specification to YAML for json-schema. > > It starts by fixing up a

Re: [PATCH 10/10] dt-bindings: serial: Convert 8250 to json-schema

2020-03-23 Thread Rob Herring
On Fri, Mar 20, 2020 at 11:41 AM Lubomir Rintel wrote: > > Some fixes were done during the conversion: Thanks for doing this! > > Slightly better examples. The original example was for an OMAP serial > port, which is not even described by this binding, but by > omap_serial.txt instead. > > Added

Re: [PATCH] Documentation: Clarify better about the rwsem non-owner release issue

2020-03-23 Thread Joel Fernandes
On Sun, Mar 22, 2020 at 08:51:15AM +0200, Kalle Valo wrote: > "Joel Fernandes (Google)" writes: > > > Reword and clarify better about the rwsem non-owner release issue. > > > > Link: https://lore.kernel.org/linux-pci/20200321212144.ga6...@google.com/ > > > > Signed-off-by: Joel Fernandes (Google)

Re: [PATCH v8 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2020-03-23 Thread Haren Myneni
On Mon, 2020-03-23 at 22:32 +1100, Michael Ellerman wrote: > Nicholas Piggin writes: > > Haren Myneni's on March 19, 2020 4:13 pm: > >> > >> Kernel sets fault address and status in CRB for NX page fault on user > >> space address after processing page fault. User space gets the signal > >> and ha

Re: [PATCH 08/10] powerpc/fsl: Make serial ports compatible with ns16550a

2020-03-23 Thread Rob Herring
On Fri, Mar 20, 2020 at 11:41 AM Lubomir Rintel wrote: > > There are separate compatible strings for ns16550 and ns16550a and the > Freescale serial port is compatible with the latter one, with working > FIFO. I don't think changing this is right. First, 'ns16550' is what's documented in the DT s

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Christoph Hellwig
On Mon, Mar 23, 2020 at 09:07:38PM +0530, Aneesh Kumar K.V wrote: > > This is what I was trying, but considering I am new to DMA subsystem, I > am not sure I got all the details correct. The idea is to look at the > cpu addr and see if that can be used in direct map fashion(is > bus_dma_limit the

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Christoph Hellwig
On Mon, Mar 23, 2020 at 07:58:01PM +1100, Alexey Kardashevskiy wrote: > >> 0x100.. .. 0x101.. > >> > >> 2x4G, each is 1TB aligned. And we can map directly only the first 4GB > >> (because of the maximum IOMMU table size) but not the other. And 1:1 on > >> that "pseries" is done with

Re: [RFC PATCH 0/3] Use per-CPU temporary mappings for patching

2020-03-23 Thread Christophe Leroy
Le 23/03/2020 à 17:49, Christopher M Riedl a écrit : On March 23, 2020 9:04 AM Christophe Leroy wrote: On 03/23/2020 11:30 AM, Christophe Leroy wrote: On 03/23/2020 04:52 AM, Christopher M. Riedl wrote: When compiled with CONFIG_STRICT_KERNEL_RWX, the kernel must create temporary ma

Re: hardcoded SIGSEGV in __die() ?

2020-03-23 Thread Joakim Tjernlund
On Mon, 2020-03-23 at 16:31 +0100, Christophe Leroy wrote: > > Le 23/03/2020 à 16:08, Joakim Tjernlund a écrit : > > On Mon, 2020-03-23 at 15:45 +0100, Christophe Leroy wrote: > > > CAUTION: This email originated from outside of the organization. Do not > > > click links or open attachments unles

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Aneesh Kumar K.V
Christoph Hellwig writes: > On Mon, Mar 23, 2020 at 09:37:05AM +0100, Christoph Hellwig wrote: >> > > +/* >> > > + * Allows IOMMU drivers to bypass dynamic translations if the >> > > DMA mask >> > > + * is large enough. >> > > + */ >> > > +if (dev->dma_ops

Re: hardcoded SIGSEGV in __die() ?

2020-03-23 Thread Christophe Leroy
Le 23/03/2020 à 16:08, Joakim Tjernlund a écrit : On Mon, 2020-03-23 at 15:45 +0100, Christophe Leroy wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. Le 23/03/2020

[PATCH] completion: Use lockdep_assert_RT_in_threaded_ctx() in complete_all()

2020-03-23 Thread Sebastian Siewior
The warning was intended to spot complete_all() users from hardirq context on PREEMPT_RT. The warning as-is will also trigger in interrupt handlers, which are threaded on PREEMPT_RT, which was not intended. Use lockdep_assert_RT_in_threaded_ctx() which triggers in non-preemptive context on PREEMPT

Re: hardcoded SIGSEGV in __die() ?

2020-03-23 Thread Joakim Tjernlund
On Mon, 2020-03-23 at 15:45 +0100, Christophe Leroy wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you recognize the sender and know the > content is safe. > > > Le 23/03/2020 à 15:43, Christophe Leroy a écrit : > > > >

Patch "mm, slub: prevent kmalloc_node crashes and memory leaks" has been added to the 5.4-stable tree

2020-03-23 Thread gregkh
This is a note to let you know that I've just added the patch titled mm, slub: prevent kmalloc_node crashes and memory leaks to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

Re: [PATCH v4 01/17] cpu: Add new {add,remove}_cpu() functions

2020-03-23 Thread Paul E. McKenney
On Mon, Mar 23, 2020 at 01:50:54PM +, Qais Yousef wrote: > The new functions use device_{online,offline}() which are userspace > safe. > > This is in preparation to move cpu_{up, down} kernel users to use > a safer interface that is not racy with userspace. > > Suggested-by: "Paul E. McKenney

Patch "mm, slub: prevent kmalloc_node crashes and memory leaks" has been added to the 4.19-stable tree

2020-03-23 Thread gregkh
This is a note to let you know that I've just added the patch titled mm, slub: prevent kmalloc_node crashes and memory leaks to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

Patch "mm, slub: prevent kmalloc_node crashes and memory leaks" has been added to the 4.14-stable tree

2020-03-23 Thread gregkh
This is a note to let you know that I've just added the patch titled mm, slub: prevent kmalloc_node crashes and memory leaks to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

Patch "mm, slub: prevent kmalloc_node crashes and memory leaks" has been added to the 4.9-stable tree

2020-03-23 Thread gregkh
This is a note to let you know that I've just added the patch titled mm, slub: prevent kmalloc_node crashes and memory leaks to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

Patch "mm, slub: prevent kmalloc_node crashes and memory leaks" has been added to the 4.4-stable tree

2020-03-23 Thread gregkh
This is a note to let you know that I've just added the patch titled mm, slub: prevent kmalloc_node crashes and memory leaks to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

Patch "mm, slub: prevent kmalloc_node crashes and memory leaks" has been added to the 5.5-stable tree

2020-03-23 Thread gregkh
This is a note to let you know that I've just added the patch titled mm, slub: prevent kmalloc_node crashes and memory leaks to the 5.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

Re: hardcoded SIGSEGV in __die() ?

2020-03-23 Thread Christophe Leroy
Le 23/03/2020 à 15:43, Christophe Leroy a écrit : Le 23/03/2020 à 15:17, Joakim Tjernlund a écrit : In __die(), see below, there is this call to notify_send() with SIGSEGV hardcoded, this seems odd to me as the variable "err" holds the true signal(in my case SIGBUS) Should not SIGSEGV be r

Re: hardcoded SIGSEGV in __die() ?

2020-03-23 Thread Christophe Leroy
Le 23/03/2020 à 15:17, Joakim Tjernlund a écrit : In __die(), see below, there is this call to notify_send() with SIGSEGV hardcoded, this seems odd to me as the variable "err" holds the true signal(in my case SIGBUS) Should not SIGSEGV be replaced with the true signal no.? As far as I can s

hardcoded SIGSEGV in __die() ?

2020-03-23 Thread Joakim Tjernlund
In __die(), see below, there is this call to notify_send() with SIGSEGV hardcoded, this seems odd to me as the variable "err" holds the true signal(in my case SIGBUS) Should not SIGSEGV be replaced with the true signal no.? Jocke static int __die(const char *str, struct pt_regs *regs, long err

Re: [PATCH 2/2] KVM: PPC: Book3S HV: H_SVM_INIT_START must call UV_RETURN

2020-03-23 Thread Fabiano Rosas
Laurent Dufour writes: > When the call to UV_REGISTER_MEM_SLOT is failing, for instance because > there is not enough free secured memory, the Hypervisor (HV) has to call > UV_RETURN to report the error to the Ultravisor (UV). Then the UV will call > H_SVM_INIT_ABORT to abort the securing phase a

Re: [RFC PATCH 0/3] Use per-CPU temporary mappings for patching

2020-03-23 Thread Christophe Leroy
On 03/23/2020 11:30 AM, Christophe Leroy wrote: On 03/23/2020 04:52 AM, Christopher M. Riedl wrote: When compiled with CONFIG_STRICT_KERNEL_RWX, the kernel must create temporary mappings when patching itself. These mappings temporarily override the strict RWX text protections to permit a wr

[PATCH v4 10/17] powerpc: Replace cpu_up/down with add/remove_cpu

2020-03-23 Thread Qais Yousef
The core device API performs extra housekeeping bits that are missing from directly calling cpu_up/down. See commit a6717c01ddc2 ("powerpc/rtas: use device model APIs and serialization during LPM") for an example description of what might go wrong. This also prepares to make cpu_up/down a private

[PATCH v4 01/17] cpu: Add new {add,remove}_cpu() functions

2020-03-23 Thread Qais Yousef
The new functions use device_{online,offline}() which are userspace safe. This is in preparation to move cpu_{up, down} kernel users to use a safer interface that is not racy with userspace. Suggested-by: "Paul E. McKenney" Signed-off-by: Qais Yousef CC: Thomas Gleixner CC: "Paul E. McKenney"

[PATCH v4 00/17] Convert cpu_up/down to device_online/offline

2020-03-23 Thread Qais Yousef
= Changes in v4 = * Split arm and arm64 patches so that the change to use reboot_cpu goes into its own separate patch (Russell) * Collected new Acked-by * Rebased on top of v5.6-rc6 * Trimmed the CC list on the cover letter as lists

Re: [PATCH 00/15] powerpc/watchpoint: Preparation for more than one watchpoint

2020-03-23 Thread Ravi Bangoria
On 3/18/20 6:22 PM, Ravi Bangoria wrote: On 3/16/20 8:35 PM, Christophe Leroy wrote: Le 09/03/2020 à 09:57, Ravi Bangoria a écrit : So far, powerpc Book3S code has been written with an assumption of only one watchpoint. But future power architecture is introducing second watchpoint regis

Re: [PATCH v4 3/9] powerpc/vas: Add VAS user space API

2020-03-23 Thread Daniel Axtens
Michael Ellerman writes: > Daniel Axtens writes: >> Haren Myneni writes: >> >>> On power9, userspace can send GZIP compression requests directly to NX >>> once kernel establishes NX channel / window with VAS. This patch provides >>> user space API which allows user space to establish channel us

Re: [PATCH] mm/debug: Add tests validating arch page table helpers for core features

2020-03-23 Thread Anshuman Khandual
On 03/03/2020 02:54 AM, Christophe Leroy wrote: > Anshuman Khandual a écrit : > >> On 02/27/2020 04:59 PM, Christophe Leroy wrote: >>> >>> >>> Le 27/02/2020 à 11:33, Anshuman Khandual a écrit : This adds new tests validating arch page table helpers for these following core memory fea

Re: [PATCH] powerpc xmon: drop the option `i` in cacheflush

2020-03-23 Thread Naveen N. Rao
Segher Boessenkool wrote: On Mon, Mar 23, 2020 at 04:55:48PM +0530, Balamuruhan S wrote: Data Cache Block Invalidate (dcbi) instruction implemented in 32-bit designs prior to PowerPC architecture version 2.01 and got obsolete from version 2.01. It was added back in 2.03. It also exists in 64-

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Christoph Hellwig
On Mon, Mar 23, 2020 at 12:14:08PM +, Robin Murphy wrote: > On 2020-03-20 2:16 pm, Christoph Hellwig wrote: >> Several IOMMU drivers have a bypass mode where they can use a direct >> mapping if the devices DMA mask is large enough. Add generic support >> to the core dma-mapping code to do that

Re: [PATCH] powerpc xmon: drop the option `i` in cacheflush

2020-03-23 Thread Segher Boessenkool
On Mon, Mar 23, 2020 at 04:55:48PM +0530, Balamuruhan S wrote: > Data Cache Block Invalidate (dcbi) instruction implemented in 32-bit > designs prior to PowerPC architecture version 2.01 and got obsolete > from version 2.01. It was added back in 2.03. It also exists in 64-bit designs (using categ

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Robin Murphy
On 2020-03-20 2:16 pm, Christoph Hellwig wrote: Several IOMMU drivers have a bypass mode where they can use a direct mapping if the devices DMA mask is large enough. Add generic support to the core dma-mapping code to do that to switch those drivers to a common solution. Hmm, this is _almost_,

Re: [PATCH v4 3/9] powerpc/vas: Add VAS user space API

2020-03-23 Thread Michael Ellerman
Daniel Axtens writes: > Haren Myneni writes: > >> On power9, userspace can send GZIP compression requests directly to NX >> once kernel establishes NX channel / window with VAS. This patch provides >> user space API which allows user space to establish channel using open >> VAS_TX_WIN_OPEN ioctl,

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

2020-03-23 Thread Cédric Le Goater
On 3/23/20 10:06 AM, Cédric Le Goater wrote: > On 3/19/20 7:14 AM, Haren Myneni wrote: >> >> Alloc IRQ and get trigger port address for each VAS instance. Kernel >> register this IRQ per VAS instance and sets this port for each send >> window. NX interrupts the kernel when it sees page fault. > >

Re: [RFC PATCH 0/3] Use per-CPU temporary mappings for patching

2020-03-23 Thread Christophe Leroy
On 03/23/2020 04:52 AM, Christopher M. Riedl wrote: When compiled with CONFIG_STRICT_KERNEL_RWX, the kernel must create temporary mappings when patching itself. These mappings temporarily override the strict RWX text protections to permit a write. Currently, powerpc allocates a per-CPU VM area

Re: [PATCH v8 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2020-03-23 Thread Michael Ellerman
Nicholas Piggin writes: > Haren Myneni's on March 19, 2020 4:13 pm: >> >> Kernel sets fault address and status in CRB for NX page fault on user >> space address after processing page fault. User space gets the signal >> and handles the fault mentioned in CRB by bringing the page in to >> memory a

[PATCH] powerpc xmon: drop the option `i` in cacheflush

2020-03-23 Thread Balamuruhan S
Data Cache Block Invalidate (dcbi) instruction implemented in 32-bit designs prior to PowerPC architecture version 2.01 and got obsolete from version 2.01. Attempt to use of this illegal instruction results in a hypervisor emulation assistance interrupt. So, drop the option `i` in cacheflush xmon a

Re: [PATCH v4 08/16] powerpc: Use an accessor for word instructions

2020-03-23 Thread Balamuruhan S
On Fri, 2020-03-20 at 16:18 +1100, Jordan Niethe wrote: > In preparation for prefixed instructions where all instructions are no > longer words, use an accessor for getting a word instruction as a u32 > from the instruction data type. > > Signed-off-by: Jordan Niethe > --- > v4: New to series > -

Re: [PATCH v4 09/16] powerpc: Use a function for reading instructions

2020-03-23 Thread Nicholas Piggin
Jordan Niethe's on March 23, 2020 8:09 pm: > On Mon, Mar 23, 2020 at 7:03 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on March 20, 2020 3:18 pm: >> > Prefixed instructions will mean there are instructions of different >> > length. As a result dereferencing a pointer to an instruction will not

Re: [PATCH] powerpc/64: allow rtas to be called in real-mode, use this in machine check

2020-03-23 Thread Nicholas Piggin
Ganesh's on March 23, 2020 8:19 pm: > > > On 3/20/20 8:58 PM, Nicholas Piggin wrote: >> rtas_call allocates and uses memory in failure paths, which is >> not safe for RMA. It also calls local_irq_save() which may not be safe >> in all real mode contexts. >> >> Particularly machine check may run w

Re: [PATCH v4 00/16] Initial Prefixed Instruction support

2020-03-23 Thread Nicholas Piggin
Jordan Niethe's on March 23, 2020 7:25 pm: > On Mon, Mar 23, 2020 at 5:22 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on March 20, 2020 3:17 pm: >> > A future revision of the ISA will introduce prefixed instructions. A >> > prefixed instruction is composed of a 4-byte prefix followed by a >> >

Re: [PATCH v4 09/16] powerpc: Use a function for reading instructions

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 7:03 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:18 pm: > > Prefixed instructions will mean there are instructions of different > > length. As a result dereferencing a pointer to an instruction will not > > necessarily give the desired result. Introduc

Re: [PATCH v4 16/16] powerpc sstep: Add support for prefixed fixed-point arithmetic

2020-03-23 Thread Balamuruhan S
On Fri, 2020-03-20 at 16:18 +1100, Jordan Niethe wrote: > This adds emulation support for the following prefixed Fixed-Point > Arithmetic instructions: > * Prefixed Add Immediate (paddi) > > Signed-off-by: Jordan Niethe Reviewed-by: Balamuruhan S > --- > v3: Since we moved the prefixed loads

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

2020-03-23 Thread Nicholas Piggin
Jordan Niethe's on March 23, 2020 7:28 pm: > On Mon, Mar 23, 2020 at 5:27 PM Nicholas Piggin wrote: >> >> Jordan Niethe's on March 20, 2020 3:17 pm: >> > Currently unsigned ints are used to represent instructions on powerpc. >> > This has worked well as instructions have always been 4 byte words.

Re: [PATCH v4 13/16] powerpc: Support prefixed instructions in alignment handler

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 6:09 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:18 pm: > > Alignment interrupts can be caused by prefixed instructions accessing > > memory. Prefixed instructions are not permitted to cross 64-byte > > boundaries. If they do the alignment interrupt is

Re: [PATCH v4 06/16] powerpc: Use a function for getting the instruction op code

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 5:54 PM Balamuruhan S wrote: > > On Fri, 2020-03-20 at 16:17 +1100, Jordan Niethe wrote: > > In preparation for using a data type for instructions that can not be > > directly used with the '>>' operator use a function for getting the op > > code of an instruction. > > we n

Re: [PATCH v4 07/16] powerpc: Introduce functions for instruction nullity and equality

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 5:46 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:18 pm: > > In preparation for an instruction data type that can not be directly > > used with the '==' operator use functions for checking equality and > > nullity. > > > > Signed-off-by: Jordan Niethe

Re: [PATCH v4 05/16] powerpc: Use a function for masking instructions

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 5:40 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:17 pm: > > In preparation for using an instruction data type that can not be used > > directly with the '&' operator, use a function to mask instructions. > > Hmm. ppc_inst_mask isn't such a good interfa

Re: [PATCH v4 04/16] powerpc: Use a macro for creating instructions from u32s

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 5:30 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:17 pm: > > In preparation for instructions having a more complex data type start > > using a macro, PPC_INST(), for making an instruction out of a u32. > > Currently this does nothing, but it will allow

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

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 5:27 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:17 pm: > > Currently unsigned ints are used to represent instructions on powerpc. > > This has worked well as instructions have always been 4 byte words. > > However, a future ISA version will introduce

Re: [PATCH v4 02/16] xmon: Move out-of-line instructions to text section

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 5:05 PM Balamuruhan S wrote: > > On Fri, 2020-03-20 at 16:17 +1100, Jordan Niethe wrote: > > To execute an instruction out of line after a breakpoint, the NIP is > > set > > to the address of struct bpt::instr. Here a copy of the instruction > > that > > was replaced with a

Re: [PATCH v4 00/16] Initial Prefixed Instruction support

2020-03-23 Thread Jordan Niethe
On Mon, Mar 23, 2020 at 5:22 PM Nicholas Piggin wrote: > > Jordan Niethe's on March 20, 2020 3:17 pm: > > A future revision of the ISA will introduce prefixed instructions. A > > prefixed instruction is composed of a 4-byte prefix followed by a > > 4-byte suffix. > > > > All prefixes have the majo

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

2020-03-23 Thread Cédric Le Goater
On 3/19/20 7:14 AM, Haren Myneni wrote: > > Alloc IRQ and get trigger port address for each VAS instance. Kernel > register this IRQ per VAS instance and sets this port for each send > window. NX interrupts the kernel when it sees page fault. I don't understand why this is not done by the OPAL dr

Re: [PATCH v8 00/14] powerpc/vas: Page fault handling for user space NX requests

2020-03-23 Thread Cédric Le Goater
On 3/19/20 7:08 AM, Haren Myneni wrote: > > On power9, Virtual Accelerator Switchboard (VAS) allows user space or > kernel to communicate with Nest Accelerator (NX) directly using COPY/PASTE > instructions. NX provides various functionalities such as compression, > encryption and etc. But only com

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-03-23 Thread Alexey Kardashevskiy
On 23/03/2020 19:37, Christoph Hellwig wrote: > On Mon, Mar 23, 2020 at 12:28:34PM +1100, Alexey Kardashevskiy wrote: > > [full quote deleted, please follow proper quoting rules] > >>> +static bool dma_alloc_direct(struct device *dev, const struct dma_map_ops >>> *ops) >>> +{ >>> + if (!ops

  1   2   >