Re: [PATCH kernel v2 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-28 Thread Alexey Kardashevskiy
On Fri, 29 Jun 2018 14:12:41 +1000 David Gibson wrote: > On Tue, Jun 26, 2018 at 03:59:26PM +1000, Alexey Kardashevskiy wrote: > > We already have a check in drivers/vfio/vfio_iommu_spapr_tce.c that > > an IOMMU page is contained in the physical page so the PCI hardware won't > > get access to

Re: [PATCH kernel v2 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-28 Thread David Gibson
On Fri, Jun 29, 2018 at 02:51:21PM +1000, Alexey Kardashevskiy wrote: > On Fri, 29 Jun 2018 14:12:41 +1000 > David Gibson wrote: > > > On Tue, Jun 26, 2018 at 03:59:26PM +1000, Alexey Kardashevskiy wrote: > > > We already have a check in drivers/vfio/vfio_iommu_spapr_tce.c that > > > an IOMMU

Re: [PATCH kernel v2 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-28 Thread Alexey Kardashevskiy
On Fri, 29 Jun 2018 14:57:02 +1000 David Gibson wrote: > On Fri, Jun 29, 2018 at 02:51:21PM +1000, Alexey Kardashevskiy wrote: > > On Fri, 29 Jun 2018 14:12:41 +1000 > > David Gibson wrote: > > > > > On Tue, Jun 26, 2018 at 03:59:26PM +1000, Alexey Kardashevskiy wrote: > > > > We already

Re: [PATCH v2 02/10] Revert "cxl: Add support for interrupts on the Mellanox CX4"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit a2f67d5ee8d950caaa7a6144cf0bfb256500b73e. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan --- arch/powerpc/platforms/powernv/pci-cxl.c

Re: [PATCH v2 08/10] Revert "cxl: Add cxl_slot_is_supported API"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: Remove abandonned capi support for the Mellanox CX4. This reverts commit 4e56f858bdde5cbfb70f61baddfaa56a8ed851bf. Signed-off-by: Frederic Barrat Acked-by: Andrew Donnellan --- drivers/misc/cxl/pci.c | 37 -

Re: [PATCH v2 10/10] cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: Remove a few XSL/CX4 oddities which are no longer needed. A simple revert of the initial commits was not possible (or not worth it) due to the history of the code. Signed-off-by: Frederic Barrat Acked-by: Andrew Donnellan ---

Re: [PATCH kernel] powerpc/powernv/ioda2: Reduce upper limit for DMA window size

2018-06-28 Thread Michael Ellerman
Alexey Kardashevskiy writes: > We use PHB in mode1 which uses bit 59 to select a correct DMA window. > However there is mode2 which uses bits 59:55 and allows up to 32 DMA > windows per a PE. Do we ever use mode2? > Even though documentation does not clearly specify that, it seems that > the

Re: [PATCH kernel v2 0/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-28 Thread Michael Ellerman
Alexey Kardashevskiy writes: > This is to improve page boundaries checking and should probably > be cc:stable. I came accross this while debugging nvlink2 passthrough > but the lack of checking might be exploited by the existing userspace. Do you really mean "exploited" ? As in there's a

Re: [PATCH v2 4/6] powerpc/pkeys: Preallocate execute-only key

2018-06-28 Thread Thiago Jung Bauermann
Hello, My understanding is that this patch isn't upstream yet and it's not too late for bikeshedding. Please ignore if this is not the case. Ram Pai writes: > @@ -326,48 +330,7 @@ static inline bool pkey_allows_readwrite(int pkey) > > int __execute_only_pkey(struct mm_struct *mm) > { > -

Re: [PATCH kernel v2 0/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-28 Thread David Gibson
On Fri, Jun 29, 2018 at 01:00:07PM +1000, Alexey Kardashevskiy wrote: > On Fri, 29 Jun 2018 11:55:40 +1000 > Michael Ellerman wrote: > > > Alexey Kardashevskiy writes: > > > > > This is to improve page boundaries checking and should probably > > > be cc:stable. I came accross this while

Re: [PATCH v4 1/6] powerpc/pseries: Defer the logging of rtas error to irq work queue.

2018-06-28 Thread Mahesh Jagannath Salgaonkar
On 06/28/2018 06:49 PM, Laurent Dufour wrote: > On 28/06/2018 13:10, Mahesh J Salgaonkar wrote: >> From: Mahesh Salgaonkar >> >> rtas_log_buf is a buffer to hold RTAS event data that are communicated >> to kernel by hypervisor. This buffer is then used to pass RTAS event >> data to user through

Re: [PATCH v4 1/6] powerpc/pseries: Defer the logging of rtas error to irq work queue.

2018-06-28 Thread Mahesh Jagannath Salgaonkar
On 06/29/2018 02:35 AM, kbuild test robot wrote: > Hi Mahesh, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on powerpc/next] > [also build test ERROR on v4.18-rc2 next-20180628] > [if your patch is applied to the wrong git tree,

Re: [PATCH v2 05/10] Revert "cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit b0b5e5918ad1babfd1d43d98c7281926a7b57b9f. Signed-off-by: Alastair D'Silva I was kinda proud at how dodgy this was and yet how it actually worked...

Re: [PATCH v2 04/10] Revert "cxl: Add kernel APIs to get & set the max irqs per context"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 79384e4b71240abf50c375eea56060b0d79c242a. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan --- drivers/misc/cxl/api.c | 27

Re: [PATCH v2 09/10] Revert "cxl: Allow a default context to be associated with an external pci_dev"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: Remove abandonned capi support for the Mellanox CX4. This reverts commit a19bd79e31769626d288cc016e21a31b6f47bf6f. Signed-off-by: Frederic Barrat Acked-by: Andrew Donnellan --- drivers/misc/cxl/Makefile | 2 +- drivers/misc/cxl/base.c | 35

Re: [PATCH 65/65] powerpc/mm/radix: Cputable update for radix

2018-06-28 Thread Benjamin Herrenschmidt
On Fri, 2016-04-01 at 15:04 +0530, Aneesh Kumar K.V wrote: > > commit 9c9d8b4f6a2c2210c90cbb3f5c6d33b2a642e8d2 > Author: Aneesh Kumar K.V > Date: Mon Feb 15 13:44:01 2016 +0530 > > powerpc/mm/radix: Cputable update for radix > > With P9 Radix we need to do > > * set UPRT

Re: [PATCH kernel v2 0/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-28 Thread Alexey Kardashevskiy
On Fri, 29 Jun 2018 11:55:40 +1000 Michael Ellerman wrote: > Alexey Kardashevskiy writes: > > > This is to improve page boundaries checking and should probably > > be cc:stable. I came accross this while debugging nvlink2 passthrough > > but the lack of checking might be exploited by the

Re: [PATCH v2 01/10] Revert "cxl: Add kernel API to allow a context to operate with relocate disabled"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. The symbol 'cxl_set_translation_mode' is never called, so ctx->real_mode is always false. This reverts commit 7a0d85d313c2066712e530e668bc02bb741a685c. Signed-off-by:

Re: [PATCH v2 07/10] Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 4361b03430d685610e5feea3ec7846e8b9ae795f. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan --- arch/powerpc/include/asm/pnv-pci.h

Re: [PATCH] powerpc/mm: fix always true/false warning in slice.c

2018-06-28 Thread Michael Ellerman
Christophe Leroy writes: > This patch fixes the following warnings (obtained with make W=1). > > arch/powerpc/mm/slice.c: In function 'slice_range_to_mask': > arch/powerpc/mm/slice.c:73:12: error: comparison is always true due to > limited range of data type [-Werror=type-limits] > if (start

Re: [PATCH kernel v2 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-28 Thread David Gibson
On Tue, Jun 26, 2018 at 03:59:26PM +1000, Alexey Kardashevskiy wrote: > We already have a check in drivers/vfio/vfio_iommu_spapr_tce.c that > an IOMMU page is contained in the physical page so the PCI hardware won't > get access to unassigned host memory. > > However we do not have this check in

Re: [PATCH v2 03/10] Revert "cxl: Add preliminary workaround for CX4 interrupt limitation"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit cbce0917e2e47d4bf5aa3b5fd6b1247f33e1a126. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan --- drivers/misc/cxl/api.c | 15

Re: [PATCH v2 06/10] Revert "cxl: Add support for using the kernel API with a real PHB"

2018-06-28 Thread Andrew Donnellan
On 28/06/18 20:05, Frederic Barrat wrote: From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 317f5ef1b363417b6f1e93b90dfd2ffd6be6e867. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan --- drivers/misc/cxl/pci.c | 3 ---

[PATCH] powerpc: Remove memtrace mmap

2018-06-28 Thread Michael Neuling
debugfs doesn't support mmap, so this code is never used. Signed-off-by: Michael Neuling --- arch/powerpc/platforms/powernv/memtrace.c | 29 --- 1 file changed, 29 deletions(-) diff --git a/arch/powerpc/platforms/powernv/memtrace.c

Re: [PATCH 1/2] powerpc/pkeys: preallocate execute_only key only if the key is available.

2018-06-28 Thread Thiago Jung Bauermann
Hello, Ram Pai writes: > Key 2 is preallocated and reserved for execute-only key. In rare > cases if key-2 is unavailable, mprotect(PROT_EXEC) will behave > incorrectly. NOTE: mprotect(PROT_EXEC) uses execute-only key. > > Ensure key 2 is available for preallocation before reserving it for >

Re: [PATCH 2/3] drivers/base: reorder consumer and its children behind suppliers

2018-06-28 Thread Pingfan Liu
On Wed, Jun 27, 2018 at 4:35 PM Dan Carpenter wrote: > > On Wed, Jun 27, 2018 at 10:34:54AM +0800, Pingfan Liu wrote: > > > 1b2a1e63 Pingfan Liu 2018-06-25 243} > > > 1b2a1e63 Pingfan Liu 2018-06-25 244} > > > 1b2a1e63 Pingfan Liu 2018-06-25 @245BUG_ON(!ret); > > > > > > If

Re: Oops in kmem_cache_free() via bioset_exit() (was Re: [next-20180601][nvme][ppc] Kernel Oops is triggered when creating lvm snapshots on nvme disks)

2018-06-28 Thread Jens Axboe
On 6/28/18 8:42 AM, Michael Ellerman wrote: > Kent, Jens, > > This looks like it might be related to the recent bioset changes? > > cheers > > Abdul Haleem writes: >> On Tue, 2018-06-26 at 23:36 +1000, Michael Ellerman wrote: >>> Abdul Haleem writes: > ... >> I was able to reproduce again

Re: [PATCH v4 1/6] powerpc/pseries: Defer the logging of rtas error to irq work queue.

2018-06-28 Thread Laurent Dufour
On 28/06/2018 13:10, Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > rtas_log_buf is a buffer to hold RTAS event data that are communicated > to kernel by hypervisor. This buffer is then used to pass RTAS event > data to user through proc fs. This buffer is allocated from vmalloc >

[PATCH v2 07/10] Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb"

2018-06-28 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 4361b03430d685610e5feea3ec7846e8b9ae795f. Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/pnv-pci.h| 7 -- arch/powerpc/platforms/powernv/pci-cxl.c | 115

[PATCH v2 06/10] Revert "cxl: Add support for using the kernel API with a real PHB"

2018-06-28 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 317f5ef1b363417b6f1e93b90dfd2ffd6be6e867. Signed-off-by: Alastair D'Silva --- drivers/misc/cxl/pci.c | 3 --- drivers/misc/cxl/vphb.c | 16 ++-- 2 files changed, 2 insertions(+), 17

[PATCH v2 01/10] Revert "cxl: Add kernel API to allow a context to operate with relocate disabled"

2018-06-28 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. The symbol 'cxl_set_translation_mode' is never called, so ctx->real_mode is always false. This reverts commit 7a0d85d313c2066712e530e668bc02bb741a685c. Signed-off-by: Alastair D'Silva --- drivers/misc/cxl/api.c|

[PATCH v4 2/6] powerpc/pseries: Fix endainness while restoring of r3 in MCE handler.

2018-06-28 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar During Machine Check interrupt on pseries platform, register r3 points RTAS extended event log passed by hypervisor. Since hypervisor uses r3 to pass pointer to rtas log, it stores the original r3 value at the start of the memory (first 8 bytes) pointed by r3. Since

[PATCH v4 3/6] powerpc/pseries: Define MCE error event section.

2018-06-28 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar On pseries, the machine check error details are part of RTAS extended event log passed under Machine check exception section. This patch adds the definition of rtas MCE event section and related helper functions. Signed-off-by: Mahesh Salgaonkar ---

[PATCH v4 1/6] powerpc/pseries: Defer the logging of rtas error to irq work queue.

2018-06-28 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar rtas_log_buf is a buffer to hold RTAS event data that are communicated to kernel by hypervisor. This buffer is then used to pass RTAS event data to user through proc fs. This buffer is allocated from vmalloc (non-linear mapping) area. On Machine check interrupt, register

[PATCH v4 5/6] powerpc/pseries: Display machine check error details.

2018-06-28 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Extract the MCE error details from RTAS extended log and display it to console. With this patch you should now see mce logs like below: [ 142.371818] Severe Machine check interrupt [Recovered] [ 142.371822] NIP [dca301b8]: init_module+0x1b8/0x338

[PATCH v2 08/10] Revert "cxl: Add cxl_slot_is_supported API"

2018-06-28 Thread Frederic Barrat
Remove abandonned capi support for the Mellanox CX4. This reverts commit 4e56f858bdde5cbfb70f61baddfaa56a8ed851bf. Signed-off-by: Frederic Barrat --- drivers/misc/cxl/pci.c | 37 - include/misc/cxl.h | 15 --- 2 files changed, 52 deletions(-)

[PATCH v4 4/6] powerpc/pseries: flush SLB contents on SLB MCE errors.

2018-06-28 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar On pseries, as of today system crashes if we get a machine check exceptions due to SLB errors. These are soft errors and can be fixed by flushing the SLBs so the kernel can continue to function instead of system crash. We do this in real mode before turning on MMU.

[PATCH v4 6/6] powerpc/pseries: Dump the SLB contents on SLB MCE errors.

2018-06-28 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar If we get a machine check exceptions due to SLB errors then dump the current SLB contents which will be very much helpful in debugging the root cause of SLB errors. Introduce an exclusive buffer per cpu to hold faulty SLB entries. In real mode mce handler saves the old

[PATCH v2 10/10] cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup

2018-06-28 Thread Frederic Barrat
Remove a few XSL/CX4 oddities which are no longer needed. A simple revert of the initial commits was not possible (or not worth it) due to the history of the code. Signed-off-by: Frederic Barrat --- drivers/misc/cxl/context.c | 2 +- drivers/misc/cxl/cxl.h | 12 --

[PATCH v2 09/10] Revert "cxl: Allow a default context to be associated with an external pci_dev"

2018-06-28 Thread Frederic Barrat
Remove abandonned capi support for the Mellanox CX4. This reverts commit a19bd79e31769626d288cc016e21a31b6f47bf6f. Signed-off-by: Frederic Barrat --- drivers/misc/cxl/Makefile | 2 +- drivers/misc/cxl/base.c | 35 --- drivers/misc/cxl/cxl.h| 6 --

[PATCH v4 0/6] powerpc/pseries: Machien check handler improvements.

2018-06-28 Thread Mahesh J Salgaonkar
This patch series includes some improvement to Machine check handler for pseries. Patch 1 fixes an issue where machine check handler crashes kernel while accessing vmalloc-ed buffer while in nmi context. Patch 2 fixes endain bug while restoring of r3 in MCE handler. Patch 4 implements a real mode

[PATCH v2 03/10] Revert "cxl: Add preliminary workaround for CX4 interrupt limitation"

2018-06-28 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit cbce0917e2e47d4bf5aa3b5fd6b1247f33e1a126. Signed-off-by: Alastair D'Silva --- drivers/misc/cxl/api.c | 15 --- drivers/misc/cxl/base.c| 17 -

[PATCH v2 04/10] Revert "cxl: Add kernel APIs to get & set the max irqs per context"

2018-06-28 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 79384e4b71240abf50c375eea56060b0d79c242a. Signed-off-by: Alastair D'Silva --- drivers/misc/cxl/api.c | 27 --- 1 file changed, 27 deletions(-) diff --git

Re: [PATCH] powerpc/kdump: handle crashkernel memory reservation failure

2018-06-28 Thread Dave Young
On 06/28/18 at 10:49am, Hari Bathini wrote: > Memory reservation for crashkernel could fail if there are holes around > kdump kernel offset (128M). Fail gracefully in such cases and print an > error message. > > Signed-off-by: Hari Bathini > --- > arch/powerpc/kernel/machine_kexec.c |7

[PATCH v2 05/10] Revert "cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards"

2018-06-28 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit b0b5e5918ad1babfd1d43d98c7281926a7b57b9f. Signed-off-by: Alastair D'Silva --- drivers/misc/cxl/Kconfig | 8 -- drivers/misc/cxl/pci.c | 236 +++

[PATCH v2 02/10] Revert "cxl: Add support for interrupts on the Mellanox CX4"

2018-06-28 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit a2f67d5ee8d950caaa7a6144cf0bfb256500b73e. Signed-off-by: Alastair D'Silva --- arch/powerpc/platforms/powernv/pci-cxl.c | 84 --- arch/powerpc/platforms/powernv/pci-ioda.c | 4

Re: [next-20180601][nvme][ppc] Kernel Oops is triggered when creating lvm snapshots on nvme disks

2018-06-28 Thread Abdul Haleem
On Tue, 2018-06-26 at 23:36 +1000, Michael Ellerman wrote: > Abdul Haleem writes: > > > Greeting's > > > > Kernel Oops is seen on 4.17.0-rc7-next-20180601 kernel on a bare-metal > > machine when running lvm snapshot tests on nvme disks. > > > > Machine Type: Power 8 bare-metal > > kernel :

[PATCH v2 00/10] cxl: Remove abandonned capi support for the Mellanox CX4

2018-06-28 Thread Frederic Barrat
An attempt was made to add capi support for the Mellanox CX4 card, so that it could operate in "traditional" PCI mode or capi mode. The project ended up being canceled and a different approach was taken for CX5. Mellanox never upstreamed any capi support in their CX4 driver. CX4 was not following

Re: [PATCH v4 1/6] powerpc/pseries: Defer the logging of rtas error to irq work queue.

2018-06-28 Thread kbuild test robot
Hi Mahesh, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v4.18-rc2 next-20180628] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Oops in kmem_cache_free() via bioset_exit() (was Re: [next-20180601][nvme][ppc] Kernel Oops is triggered when creating lvm snapshots on nvme disks)

2018-06-28 Thread Michael Ellerman
Kent, Jens, This looks like it might be related to the recent bioset changes? cheers Abdul Haleem writes: > On Tue, 2018-06-26 at 23:36 +1000, Michael Ellerman wrote: >> Abdul Haleem writes: ... > I was able to reproduce again with slub_debug=FZP and DEBUG_INFO enabled > on