[RFC PATCH v4 1/2] powerpc/xmon: Allow listing active breakpoints in read-only mode

2019-08-14 Thread Christopher M. Riedl
Xmon can enter read-only mode dynamically due to changes in kernel lockdown state. This transition does not clear active breakpoints and any these breakpoints should remain visible to the xmon'er. Signed-off-by: Christopher M. Riedl --- arch/powerpc/xmon/xmon.c | 19 ++- 1 file

[RFC PATCH v4 0/2] Restrict xmon when kernel is locked down

2019-08-14 Thread Christopher M. Riedl
Xmon should be either fully or partially disabled depending on the kernel lockdown state. Put xmon into read-only mode for lockdown=integrity and completely disable xmon when lockdown=confidentiality. Since this can occur dynamically, there may be pre-existing, active breakpoints in xmon when

[RFC PATCH v4 2/2] powerpc/xmon: Restrict when kernel is locked down

2019-08-14 Thread Christopher M. Riedl
Xmon should be either fully or partially disabled depending on the kernel lockdown state. Put xmon into read-only mode for lockdown=integrity and completely disable xmon when lockdown=confidentiality. Xmon checks the lockdown state and takes appropriate action: (1) during xmon_setup to prevent

[PATCH] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva Heads Up: This patch cannot be submitted to Linus's tree, as the affected assembler functions have already been converted to C. When calling flush_(inval_)dcache_range with a size >4GB, we were masking off the upper 32 bits, so we would incorrectly flush a range smaller

[PATCH 6/6] powerpc: Don't flush caches when adding memory

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva This operation takes a significant amount of time when hotplugging large amounts of memory (~50 seconds with 890GB of persistent memory). This was orignally in commit fb5924fddf9e ("powerpc/mm: Flush cache on memory hot(un)plug") to support memtrace, but the flush on add

[PATCH 5/6] powerpc: Remove 'extern' from func prototypes in cache headers

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva The 'extern' keyword does not value-add for function prototypes. Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/cache.h | 8 arch/powerpc/include/asm/cacheflush.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

[PATCH 4/6] powerpc: Chunk calls to flush_dcache_range in arch_*_memory

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva When presented with large amounts of memory being hotplugged (in my test case, ~890GB), the call to flush_dcache_range takes a while (~50 seconds), triggering RCU stalls. This patch breaks up the call into 16GB chunks, calling cond_resched() inbetween to allow the

[PATCH 3/6] powerpc: Convert flush_icache_range & friends to C

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva Similar to commit 22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") this patch converts flush_icache_range() to C, and reimplements the following functions as wrappers around it: __flush_dcache_icache __flush_dcache_icache_phys This was done as

[PATCH 2/6] powerpc: define helpers to get L1 icache sizes

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva This patch adds helpers to retrieve icache sizes, and renames the existing helpers to make it clear that they are for dcache. Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/cache.h | 29 +++

[PATCH 0/6] powerpc: convert cache asm to C

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva This series addresses a few issues discovered in how we flush caches: 1. Flushes were truncated at 4GB, so larger flushes were incorrect. 2. Flushing the dcache in arch_add_memory was unnecessary This series also converts much of the cache assembler to C, with the aim of

[PATCH 1/6] powerpc: Allow flush_icache_range to work across ranges >4GB

2019-08-14 Thread Alastair D'Silva
From: Alastair D'Silva When calling flush_icache_range with a size >4GB, we were masking off the upper 32 bits, so we would incorrectly flush a range smaller than intended. This patch replaces the 32 bit shifts with 64 bit ones, so that the full size is accounted for. Signed-off-by: Alastair

Re: [5.3.0-rc4-next][bisected 882632][qla2xxx] WARNING: CPU: 10 PID: 425 at drivers/scsi/qla2xxx/qla_isr.c:2784 qla2x00_status_entry.isra

2019-08-14 Thread Bart Van Assche
On 8/14/19 10:18 AM, Abdul Haleem wrote: On Wed, 2019-08-14 at 10:05 -0700, Bart Van Assche wrote: On 8/14/19 9:52 AM, Abdul Haleem wrote: Greeting's Today's linux-next kernel (5.3.0-rc4-next-20190813) booted with warning on my powerpc power 8 lpar The WARN_ON_ONCE() was introduced by

[PATCH v10 7/7] powerpc: add machine check safe copy_to_user

2019-08-14 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

[PATCH v10 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-14 Thread Santosh Sivaraj
From: Balbir Singh If we take a UE on one of the instructions with a fixup entry, set nip to continue execution at the fixup entry. Stop processing the event further or print it. Co-developed-by: Reza Arbab Signed-off-by: Reza Arbab Signed-off-by: Balbir Singh Signed-off-by: Santosh Sivaraj

[PATCH v10 5/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-08-14 Thread Santosh Sivaraj
From: Balbir Singh The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check exceptions into a return value on failure in case a machine check exception is encountered during the memcpy. The return value is the number of bytes remaining to be copied. This patch

[PATCH v10 4/7] extable: Add function to search only kernel exception table

2019-08-14 Thread Santosh Sivaraj
Certain architecture specific operating modes (e.g., in powerpc machine check handler that is unable to access vmalloc memory), the search_exception_tables cannot be called because it also searches the module exception tables if entry is not found in the kernel exception table. Cc: Thomas

[PATCH v10 3/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-14 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v10 2/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-14 Thread Santosh Sivaraj
From: Balbir Singh The current code would fail on huge pages addresses, since the shift would be incorrect. Use the correct page shift value returned by __find_linux_pte() to get the correct physical address. The code is more generic and can handle both regular and compound pages. Fixes:

[PATCH v10 1/7] powerpc/mce: Schedule work from irq_work

2019-08-14 Thread Santosh Sivaraj
schedule_work() cannot be called from MCE exception context as MCE can interrupt even in interrupt disabled context. fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") Suggested-by: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj Reviewed-by: Mahesh Salgaonkar Acked-by:

[PATCH v10 0/7] powerpc: implement machine check safe memcpy

2019-08-14 Thread Santosh Sivaraj
During a memcpy from a pmem device, if a machine check exception is generated we end up in a panic. In case of fsdax read, this should only result in a -EIO. Avoid MCE by implementing memcpy_mcsafe. Before this patch series: ``` bash-4.4# mount -o dax /dev/pmem0 /mnt/pmem/ [ 7621.714094]

[PATCH v4 3/3] x86/kasan: support KASAN_VMALLOC

2019-08-14 Thread Daniel Axtens
In the case where KASAN directly allocates memory to back vmalloc space, don't map the early shadow page over it. We prepopulate pgds/p4ds for the range that would otherwise be empty. This is required to get it synced to hardware on boot, allowing the lower levels of the page tables to be filled

[PATCH v4 2/3] fork: support VMAP_STACK with KASAN_VMALLOC

2019-08-14 Thread Daniel Axtens
Supporting VMAP_STACK with KASAN_VMALLOC is straightforward: - clear the shadow region of vmapped stacks when swapping them in - tweak Kconfig to allow VMAP_STACK to be turned on with KASAN Reviewed-by: Dmitry Vyukov Signed-off-by: Daniel Axtens --- arch/Kconfig | 9 +

[PATCH v4 1/3] kasan: support backing vmalloc space with real shadow memory

2019-08-14 Thread Daniel Axtens
Hook into vmalloc and vmap, and dynamically allocate real shadow memory to back the mappings. Most mappings in vmalloc space are small, requiring less than a full page of shadow space. Allocating a full shadow page per mapping would therefore be wasteful. Furthermore, to ensure that different

[PATCH v4 0/3] kasan: support backing vmalloc space with real shadow memory

2019-08-14 Thread Daniel Axtens
Currently, vmalloc space is backed by the early shadow page. This means that kasan is incompatible with VMAP_STACK, and it also provides a hurdle for architectures that do not have a dedicated module space (like powerpc64). This series provides a mechanism to back vmalloc space with real,

Re: [PATCH v9 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-14 Thread Santosh Sivaraj
Hi Balbir, Balbir Singh writes: > On 12/8/19 7:22 pm, Santosh Sivaraj wrote: >> If we take a UE on one of the instructions with a fixup entry, set nip >> to continue execution at the fixup entry. Stop processing the event >> further or print it. >> >> Co-developed-by: Reza Arbab >>

Re: [PATCH v9 7/7] powerpc: add machine check safe copy_to_user

2019-08-14 Thread Santosh Sivaraj
Hi Balbir, Balbir Singh writes: > On 12/8/19 7:22 pm, Santosh Sivaraj wrote: >> Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() >> >> Signed-off-by: Santosh Sivaraj >> --- >> arch/powerpc/Kconfig | 1 + >> arch/powerpc/include/asm/uaccess.h | 14

[PATCH 3/6] powerpc: export arch_sync_dma_for_*()

2019-08-14 Thread Rob Clark
From: Rob Clark Signed-off-by: Rob Clark --- arch/powerpc/mm/dma-noncoherent.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c index c617282d5b2a..80d53b950821 100644 --- a/arch/powerpc/mm/dma-noncoherent.c +++

[bug report] powerpc/iommu: Implement IOMMU pools to improve multiqueue adapter performance

2019-08-14 Thread Dan Carpenter
[ Ancient code. The warning is correct but the bug seems harmless. -- dan ] Hello Anton Blanchard, The patch b4c3a8729ae5: "powerpc/iommu: Implement IOMMU pools to improve multiqueue adapter performance" from Jun 7, 2012, leads to the following static checker warning:

[PATCH 0/6] drm+dma: cache support for arm, etc

2019-08-14 Thread Rob Clark
From: Rob Clark This is a replacement for a previous patches[1] that was adding arm64 support for drm_clflush. I've also added a patch to solve a similar cache issue in vgem. The first few patches just export arch_sync_dma_for_*(). Possibly instead the EXPORT_SYMBOL_GPL() should be somewere

[PATCH v5 06/18] compat_ioctl: move WDIOC handling into wdt drivers

2019-08-14 Thread Arnd Bergmann
All watchdog drivers implement the same set of ioctl commands, and fortunately all of them are compatible between 32-bit and 64-bit architectures. Modern drivers always go through drivers/watchdog/wdt.c as an abstraction layer, but older ones implement their own file_operations on a character

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #25 from Christophe Leroy (christophe.le...@c-s.fr) --- You can use get_zeroed_page(GFP_NOFS) instead of __get_free_page(GFP_NOFS | __GFP_ZERO) -- You are receiving this mail because: You are on the CC list for the bug.

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #24 from Christophe Leroy (christophe.le...@c-s.fr) --- It confirms what I suspected: due to some debug options, kzalloc() doesn't provide aligned areas. In __load_free_space_cache() can you replace e->bitmap = kzalloc(PAGE_SIZE,

Re: [PATCH 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-14 Thread Segher Boessenkool
Hi Christophe, On Tue, Aug 13, 2019 at 09:59:35AM +, Christophe Leroy wrote: > + rldicr \r, \r, 32, 31 Could you please write this as sldi\r, \r, 32 ? It's much easier to read, imo (it's the exact same instruction). You can do a lot cheaper sequences if you

Re: [PATCH v5 2/7] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-14 Thread Segher Boessenkool
On Wed, Aug 14, 2019 at 08:46:15PM +1000, Michael Ellerman wrote: > Claudio Carvalho writes: > > +_GLOBAL(ucall_norets) > > +EXPORT_SYMBOL_GPL(ucall_norets) > > + mfcrr0 > > + stw r0,8(r1) > > + > > + sc 2 /* Invoke the ultravisor */ > > + > > + lwz r0,8(r1)

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #23 from Erhard F. (erhar...@mailbox.org) --- On Wed, 14 Aug 2019 16:10:53 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #19 from Christophe Leroy

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #284071|0 |1 is obsolete|

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #21 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284399 --> https://bugzilla.kernel.org/attachment.cgi?id=284399=edit dmesg (PowerMac G4 DP, kernel 5.3-rc4 + debug patch) /dev/sdb2 mounted at boot, dmesg after

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #20 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284397 --> https://bugzilla.kernel.org/attachment.cgi?id=284397=edit dmesg (PowerMac G4 DP, kernel 5.3-rc4 + debug patch) /dev/sdb2 mounted after booting, dmesg after

Re: [5.3.0-rc4-next][bisected 882632][qla2xxx] WARNING: CPU: 10 PID: 425 at drivers/scsi/qla2xxx/qla_isr.c:2784 qla2x00_status_entry.isra

2019-08-14 Thread Abdul Haleem
On Wed, 2019-08-14 at 10:05 -0700, Bart Van Assche wrote: > On 8/14/19 9:52 AM, Abdul Haleem wrote: > > Greeting's > > > > Today's linux-next kernel (5.3.0-rc4-next-20190813) booted with warning on > > my powerpc power 8 lpar > > > > The WARN_ON_ONCE() was introduced by commit 88263208 (scsi:

Re: [PATCH v4 18/25] powernv/fadump: process architected register state data provided by firmware

2019-08-14 Thread Mahesh J Salgaonkar
On 2019-07-16 17:04:08 Tue, Hari Bathini wrote: > From: Hari Bathini > > Firmware provides architected register state data at the time of crash. > Process this data and build CPU notes to append to ELF core. > > Signed-off-by: Hari Bathini > Signed-off-by: Vasant Hegde > --- >

Re: [5.3.0-rc4-next][bisected 882632][qla2xxx] WARNING: CPU: 10 PID: 425 at drivers/scsi/qla2xxx/qla_isr.c:2784 qla2x00_status_entry.isra

2019-08-14 Thread Bart Van Assche
On 8/14/19 9:52 AM, Abdul Haleem wrote: > Greeting's > > Today's linux-next kernel (5.3.0-rc4-next-20190813) booted with warning on > my powerpc power 8 lpar > > The WARN_ON_ONCE() was introduced by commit 88263208 (scsi: qla2xxx: Complain > if sp->done() is not...) > > boot logs: > >

[PATCH 2/3] powerpc/xive: Fix dump of XIVE interrupt under pseries

2019-08-14 Thread Cédric Le Goater
The xmon 'dxi' command calls OPAL to query the XIVE configuration of a interrupt. This can only be done on baremetal (PowerNV) and it will crash a pseries machine. Introduce a new XIVE get_irq_config() operation which implements a different query depending on the platform, PowerNV or pseries, and

[PATCH 3/3] powerpc/xmon: Add a dump of all XIVE interrupts

2019-08-14 Thread Cédric Le Goater
Modify the xmon 'dxi' command to query all interrupts if no IRQ number is specified. Signed-off-by: Cédric Le Goater --- arch/powerpc/xmon/xmon.c | 21 + 1 file changed, 21 insertions(+) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index

[PATCH 0/3] powerpc/xmon: Fix dump of XIVE interrupt under pseries

2019-08-14 Thread Cédric Le Goater
Hello, The xmon 'dx*' commands call OPAL to query information on XIVE but this can only be done on baremetal (PowerNV) and it crashes a pseries machine. This little series fixes support on pseries and extend the 'dxi' command. Thanks, C. Cédric Le Goater (3): powerpc/xmon: Check for HV mode

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #19 from Christophe Leroy (christophe.le...@c-s.fr) --- Created attachment 284389 --> https://bugzilla.kernel.org/attachment.cgi?id=284389=edit Patch to trace misaligned destination in copy_page() in asm on PPC32 Oops. Can you

[PATCH 2/3] kbuild: rebuild modules when module linker scripts are updated

2019-08-14 Thread Masahiro Yamada
Currently, the timestamp of module linker scripts are not checked. Add them to the dependency of modules so they are correctly rebuilt. Signed-off-by: Masahiro Yamada --- Documentation/kbuild/makefiles.rst | 5 + Makefile | 3 ++- arch/arm/Makefile

Re: [PATCH 6/6] driver core: initialize a default DMA mask for platform device

2019-08-14 Thread Robin Murphy
On 11/08/2019 09:05, Christoph Hellwig wrote: We still treat devices without a DMA mask as defaulting to 32-bits for both mask, but a few releases ago we've started warning about such cases, as they require special cases to work around this sloppyness. Add a dma_mask field to struct

[PATCH 1/3] powerpc/xmon: Check for HV mode when dumping XIVE info from OPAL

2019-08-14 Thread Cédric Le Goater
Currently, the xmon 'dx' command calls OPAL to dump the XIVE state in the OPAL logs and also outputs some of the fields of the internal XIVE structures in Linux. The OPAL calls can only be done on baremetal (PowerNV) and they crash a pseries machine. Fix by checking the hypervisor feature of the

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #18 from Erhard F. (erhar...@mailbox.org) --- On Wed, 14 Aug 2019 08:56:34 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #17 from Christophe Leroy

[PATCH] powerpc/mm: don't display empty early ioremap area

2019-08-14 Thread Christophe Leroy
On the 8xx, the layout displayed at boot is: [0.00] Memory: 121856K/131072K available (5728K kernel code, 592K rwdata, 1248K rodata, 560K init, 448K bss, 9216K reserved, 0K cma-reserved) [0.00] Kernel virtual memory layout: [0.00] * 0xffefc000..0xc000 : fixmap [

Re: [PATCH] powerpc: use the generic dma coherent remap allocator

2019-08-14 Thread Christoph Hellwig
On Wed, Aug 14, 2019 at 04:20:34PM +0200, Christophe Leroy wrote: >> index 56a7c814160d..afe71b89dec3 100644 >> --- a/arch/powerpc/platforms/Kconfig.cputype >> +++ b/arch/powerpc/platforms/Kconfig.cputype >> @@ -450,8 +450,10 @@ config NOT_COHERENT_CACHE >> depends on 4xx || PPC_8xx || E200

Re: [PATCH] powerpc: use the generic dma coherent remap allocator

2019-08-14 Thread Christophe Leroy
Le 14/08/2019 à 15:22, Christoph Hellwig a écrit : This switches to using common code for the DMA allocations, including potential use of the CMA allocator if configured. Switching to the generic code enables DMA allocations from atomic context, which is required by the DMA API

Re: [PATCH] powerpc: use the generic dma coherent remap allocator

2019-08-14 Thread Christophe Leroy
Le 14/08/2019 à 15:22, Christoph Hellwig a écrit : This switches to using common code for the DMA allocations, including potential use of the CMA allocator if configured. Switching to the generic code enables DMA allocations from atomic context, which is required by the DMA API

[PATCH] powerpc: use the generic dma coherent remap allocator

2019-08-14 Thread Christoph Hellwig
This switches to using common code for the DMA allocations, including potential use of the CMA allocator if configured. Switching to the generic code enables DMA allocations from atomic context, which is required by the DMA API documentation, and also adds various other minor features drivers

use the generic DMA direct remap code on powerpc

2019-08-14 Thread Christoph Hellwig
Hi powerpc maintainers, this patch convers powerpc to use the generic dma remapping code for the uncached coherent allocation on non-coherent CPUs. Christophe Leroy tested a slightly earlier version on ppc8xx. Note that I plan to move the need for the arch to call dma_atomic_pool_init in this

Re: [PATCH 1/5] powerpc/ptdump: fix addresses display on PPC32

2019-08-14 Thread Christophe Leroy
Michael, Le 14/08/2019 à 14:36, Christophe Leroy a écrit : Commit 453d87f6a8ae ("powerpc/mm: Warn if W+X pages found on boot") wrongly changed KERN_VIRT_START from 0 to PAGE_OFFSET, leading to a shift in the displayed addresses. Lets revert that change to resync walk_pagetables()'s addr val

[PATCH 5/5] powerpc/ptdump: drop non vital #ifdefs

2019-08-14 Thread Christophe Leroy
hashpagetable.c is only compiled when CONFIG_PPC_BOOK3S_64 is defined, so drop the test and its 'else' branch. Use IS_ENABLED(CONFIG_PPC_PSERIES) instead of #ifdef, this allows the code to be checked at any build. It is still optimised out by GCC. Use IS_ENABLED(CONFIG_PPC_64K_PAGES) instead of

[PATCH 2/5] powerpc/ptdump: fix walk_pagetables() address mismatch

2019-08-14 Thread Christophe Leroy
walk_pagetables() always walk the entire pgdir from address 0 but considers PAGE_OFFSET or KERN_VIRT_START as the starting address of the walk, resulting in a possible mismatch in the displayed addresses. Ex: on PPC32, when KERN_VIRT_START was locally defined as PAGE_OFFSET, ptdump displayed

[PATCH 1/5] powerpc/ptdump: fix addresses display on PPC32

2019-08-14 Thread Christophe Leroy
Commit 453d87f6a8ae ("powerpc/mm: Warn if W+X pages found on boot") wrongly changed KERN_VIRT_START from 0 to PAGE_OFFSET, leading to a shift in the displayed addresses. Lets revert that change to resync walk_pagetables()'s addr val and pgd_t pointer for PPC32. Fixes: 453d87f6a8ae ("powerpc/mm:

[PATCH 3/5] powerpc/ptdump: drop dummy KERN_VIRT_START on PPC32

2019-08-14 Thread Christophe Leroy
PPC32 doesn't have KERN_VIRT_START. Make PAGE_OFFSET the default starting address for the dump, and drop the dummy definition of KERN_VIRT_START. Only use KERN_VIRT_START for non radix PPC64. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ptdump/ptdump.c | 18 -- 1 file

[PATCH 4/5] powerpc/ptdump: get out of note_prot_wx() when CONFIG_PPC_DEBUG_WX is not selected.

2019-08-14 Thread Christophe Leroy
When CONFIG_PPC_DEBUG_WX, note_prot_wx() is useless. Get out of it early and inconditionnally in that case, so that GCC can kick all the code out. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ptdump/ptdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v5 5/7] powerpc/mm: Write to PTCR only if ultravisor disabled

2019-08-14 Thread Michael Ellerman
Claudio Carvalho writes: > In ultravisor enabled systems, PTCR becomes ultravisor privileged only > for writing and an attempt to write to it will cause a Hypervisor > Emulation Assitance interrupt. > > This patch adds the try_set_ptcr(val) macro as an accessor to > mtspr(SPRN_PTCR, val), which

Re: [PATCH v5 4/7] powerpc/mm: Use UV_WRITE_PATE ucall to register a PATE

2019-08-14 Thread Michael Ellerman
Hi Claudio, Claudio Carvalho writes: > From: Michael Anderson > > In ultravisor enabled systems, the ultravisor creates and maintains the > partition table in secure memory where the hypervisor cannot access, and ^ which? >

Re: [PATCH v4 14/25] powernv/fadump: process the crashdump by exporting it as /proc/vmcore

2019-08-14 Thread Hari Bathini
On 14/08/19 3:48 PM, Mahesh J Salgaonkar wrote: > On 2019-07-16 17:03:38 Tue, Hari Bathini wrote: >> Add support in the kernel to process the crash'ed kernel's memory >> preserved during MPIPL and export it as /proc/vmcore file for the >> userland scripts to filter and analyze it later. >> >>

Re: [PATCH v3 08/16] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-08-14 Thread Michael Ellerman
Thiago Jung Bauermann writes: > Michael Ellerman writes: >> Thiago Jung Bauermann writes: >>> From: Anshuman Khandual >>> >>> LPPACA structures need to be shared with the host. Hence they need to be in >>> shared memory. Instead of allocating individual chunks of memory for a >>> given

Re: [PATCH v5 2/7] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-14 Thread Michael Ellerman
Claudio Carvalho writes: > diff --git a/arch/powerpc/kernel/ucall.S b/arch/powerpc/kernel/ucall.S > new file mode 100644 > index ..de9133e45d21 > --- /dev/null > +++ b/arch/powerpc/kernel/ucall.S > @@ -0,0 +1,20 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Generic code to

Re: [PATCH v4 11/25] powernv/fadump: register kernel metadata address with opal

2019-08-14 Thread Mahesh Jagannath Salgaonkar
On 8/14/19 12:36 PM, Hari Bathini wrote: > > > On 13/08/19 4:11 PM, Mahesh J Salgaonkar wrote: >> On 2019-07-16 17:03:15 Tue, Hari Bathini wrote: >>> OPAL allows registering address with it in the first kernel and >>> retrieving it after MPIPL. Setup kernel metadata and register its >>> address

Re: [PATCH v4 14/25] powernv/fadump: process the crashdump by exporting it as /proc/vmcore

2019-08-14 Thread Mahesh J Salgaonkar
On 2019-07-16 17:03:38 Tue, Hari Bathini wrote: > Add support in the kernel to process the crash'ed kernel's memory > preserved during MPIPL and export it as /proc/vmcore file for the > userland scripts to filter and analyze it later. > > Signed-off-by: Hari Bathini > --- >

Re: [PATCHv6 1/2] PCI: layerscape: Add the bar_fixed_64bit property in EP driver.

2019-08-14 Thread Lorenzo Pieralisi
On Wed, Aug 14, 2019 at 09:48:00AM +, Xiaowei Bao wrote: > > > > -Original Message- > > From: Lorenzo Pieralisi > > Sent: 2019年8月14日 17:30 > > To: Xiaowei Bao > > Cc: M.h. Lian ; Mingkai Hu > > ; Roy Zang ; > > bhelg...@google.com; linuxppc-dev@lists.ozlabs.org; > >

[PATCH v2] powerpc/32s: fix boot failure with DEBUG_PAGEALLOC without KASAN.

2019-08-14 Thread Christophe Leroy
When KASAN is selected, the definitive hash table has to be set up later, but there is already an early temporary one. When KASAN is not selected, there is no early hash table, so the setup of the definitive hash table cannot be delayed. Reported-by: Jonathan Neuschafer Fixes: 72f208c6a8f7

[PATCH v2 2/2] powerpc/32: replace LOAD_MSR_KERNEL() by LOAD_REG_IMMEDIATE()

2019-08-14 Thread Christophe Leroy
LOAD_MSR_KERNEL() and LOAD_REG_IMMEDIATE() are doing the same thing in the same way. Drop LOAD_MSR_KERNEL() Signed-off-by: Christophe Leroy --- v2: no change arch/powerpc/kernel/entry_32.S | 18 +- arch/powerpc/kernel/head_32.h | 21 - 2 files changed, 13

[PATCH v2 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-14 Thread Christophe Leroy
Today LOAD_REG_IMMEDIATE() is a basic #define which loads all parts on a value into a register, including the parts that are NUL. This means always 2 instructions on PPC32 and always 5 instructions on PPC64. And those instructions cannot run in parallele as they are updating the same register.

RE: [PATCHv6 1/2] PCI: layerscape: Add the bar_fixed_64bit property in EP driver.

2019-08-14 Thread Xiaowei Bao
> -Original Message- > From: Lorenzo Pieralisi > Sent: 2019年8月14日 17:30 > To: Xiaowei Bao > Cc: M.h. Lian ; Mingkai Hu > ; Roy Zang ; > bhelg...@google.com; linuxppc-dev@lists.ozlabs.org; > linux-...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; > linux-ker...@vger.kernel.org

Re: [PATCH 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-14 Thread Christophe Leroy
Le 14/08/2019 à 04:08, Paul Mackerras a écrit : On Tue, Aug 13, 2019 at 09:59:35AM +, Christophe Leroy wrote: [snip] +.macro __LOAD_REG_IMMEDIATE r, x + .if \x & ~0x != 0 + __LOAD_REG_IMMEDIATE_32 \r, (\x) >> 32 + rldicr \r, \r, 32, 31 +

Re: [PATCH v9 7/7] powerpc: add machine check safe copy_to_user

2019-08-14 Thread Balbir Singh
On 12/8/19 7:22 pm, Santosh Sivaraj wrote: > Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() > > Signed-off-by: Santosh Sivaraj > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/include/asm/uaccess.h | 14 ++ > 2 files changed, 15 insertions(+)

Re: [PATCH v9 4/7] extable: Add function to search only kernel exception table

2019-08-14 Thread Santosh Sivaraj
Balbir Singh writes: > On 12/8/19 7:22 pm, Santosh Sivaraj wrote: >> Certain architecture specific operating modes (e.g., in powerpc machine >> check handler that is unable to access vmalloc memory), the >> search_exception_tables cannot be called because it also searches the >> module exception

Re: [PATCH v9 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-14 Thread Balbir Singh
On 12/8/19 7:22 pm, Santosh Sivaraj wrote: > If we take a UE on one of the instructions with a fixup entry, set nip > to continue execution at the fixup entry. Stop processing the event > further or print it. > > Co-developed-by: Reza Arbab > Signed-off-by: Reza Arbab > Cc: Mahesh Salgaonkar

Re: [PATCHv6 1/2] PCI: layerscape: Add the bar_fixed_64bit property in EP driver.

2019-08-14 Thread Lorenzo Pieralisi
I asked you to remove the period at the end of the patch $SUBJECT and you did not, either you do not read what I write or explain me what's going on. On Wed, Aug 14, 2019 at 10:03:29AM +0800, Xiaowei Bao wrote: > The PCIe controller of layerscape just have 4 BARs, BAR0 and BAR1 > is 32bit, BAR2

[PATCH] powerpc/futex: fix warning: 'oldval' may be used uninitialized in this function

2019-08-14 Thread Christophe Leroy
CC kernel/futex.o kernel/futex.c: In function 'do_futex': kernel/futex.c:1676:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized] return oldval == cmparg; ^ kernel/futex.c:1651:6: note: 'oldval' was declared here int oldval, ret;

Re: [PATCH v9 4/7] extable: Add function to search only kernel exception table

2019-08-14 Thread Balbir Singh
On 12/8/19 7:22 pm, Santosh Sivaraj wrote: > Certain architecture specific operating modes (e.g., in powerpc machine > check handler that is unable to access vmalloc memory), the > search_exception_tables cannot be called because it also searches the > module exception tables if entry is not

Re: [PATCH v9 1/7] powerpc/mce: Schedule work from irq_work

2019-08-14 Thread Balbir Singh
On 12/8/19 7:22 pm, Santosh Sivaraj wrote: > schedule_work() cannot be called from MCE exception context as MCE can > interrupt even in interrupt disabled context. > > fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") > Suggested-by: Mahesh Salgaonkar > Signed-off-by:

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #17 from Christophe Leroy (christophe.le...@c-s.fr) --- Created attachment 284379 --> https://bugzilla.kernel.org/attachment.cgi?id=284379=edit Patch to trace misaligned destination in copy_page() on PPC32 Can you try the attached

[PATCH 3/3] papr/scm: Add bad memory ranges to nvdimm bad ranges

2019-08-14 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Signed-off-by: Santosh Sivaraj --- arch/powerpc/platforms/pseries/papr_scm.c | 65 +++ 1 file changed, 65 insertions(+) diff --git

[PATCH 2/3] of_pmem: Add memory ranges which took a mce to bad range

2019-08-14 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Signed-off-by: Santosh Sivaraj --- drivers/nvdimm/of_pmem.c | 122 +-- 1 file changed, 103 insertions(+), 19 deletions(-) diff --git

[PATCH 1/3] powerpc/mce: Add MCE notification chain

2019-08-14 Thread Santosh Sivaraj
This is needed to report bad blocks for persistent memory. Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h | 3 +++ arch/powerpc/kernel/mce.c | 15 +++ 2 files changed, 18 insertions(+) diff --git a/arch/powerpc/include/asm/mce.h

[PATCH 0/3] Add bad pmem bad blocks to bad range

2019-08-14 Thread Santosh Sivaraj
This series, which should be based on top of the still un-merged "powerpc: implement machine check safe memcpy" series, adds support to add the bad blocks which generated an MCE to the NVDIMM bad blocks. The next access of the same memory will be blocked by the NVDIMM layer itself. Santosh

Re: [PATCH v9 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-14 Thread Mahesh Jagannath Salgaonkar
On 8/12/19 2:52 PM, Santosh Sivaraj wrote: > If we take a UE on one of the instructions with a fixup entry, set nip > to continue execution at the fixup entry. Stop processing the event > further or print it. > > Co-developed-by: Reza Arbab > Signed-off-by: Reza Arbab > Cc: Mahesh Salgaonkar >

Re: [PATCH] powerpc/32s: fix boot failure with DEBUG_PAGEALLOC without KASAN.

2019-08-14 Thread Jonathan Neuschäfer
On Wed, Aug 14, 2019 at 05:28:35AM +, Christophe Leroy wrote: > When KASAN is selected, the definitive hash table has to be > set up later, but there is already an early temporary one. > > When KASAN is not selected, there is no early hash table, > so the setup of the definitive hash table

[PATCH v1 4/4] mmc: sdhci-of-esdhc: add erratum A011334 support in ls1028a 1.0 SoC

2019-08-14 Thread Yinbo Zhu
This patch is to add erratum A011334 support in ls1028a 1.0 SoC Signed-off-by: Yinbo Zhu --- drivers/mmc/host/sdhci-of-esdhc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index b16f7d440f78..eb2b290447fc 100644 ---

[PATCH v1 3/4] arm64: dts: ls1028a: fix little-big endian issue for dcfg

2019-08-14 Thread Yinbo Zhu
dcfg use little endian that SoC register value will be correct Signed-off-by: Yinbo Zhu --- arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi

[PATCH v1 2/4] soc: fsl: guts: Add definition for LS1028A

2019-08-14 Thread Yinbo Zhu
Adding compatible string "ls1028a-dcfg" to initialize guts driver for ls1028 and SoC die attribute definition for LS1028A Signed-off-by: Yinbo Zhu --- drivers/soc/fsl/guts.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index

[PATCH v1 1/4] arm64: dts: ls1028a-rdb: enable emmc hs400 mode

2019-08-14 Thread Yinbo Zhu
This patch is to enable emmc hs400 mode for ls1028ardb Signed-off-by: Yinbo Zhu --- arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts

Re: [PATCH v4 13/25] powernv/fadump: support copying multiple kernel memory regions

2019-08-14 Thread Hari Bathini
On 13/08/19 8:33 PM, Mahesh J Salgaonkar wrote: > On 2019-07-16 17:03:30 Tue, Hari Bathini wrote: >> Firmware uses 32-bit field for region size while copying/backing-up >> memory during MPIPL. So, the maximum copy size for a region would >> be a page less than 4GB (aligned to pagesize) but

Re: [PATCH] powerpc: remove the ppc44x ocm.c file

2019-08-14 Thread Christophe Leroy
Le 14/08/2019 à 08:32, Christoph Hellwig a écrit : The on chip memory allocator is entirely unused in the kernel tree. Signed-off-by: Christoph Hellwig Since this driver was added in Linux 3.9, functions ppc4xx_ocm_alloc() and ppc4xx_ocm_free() have never been used in any driver, and are

Re: [PATCH v4 12/25] powernv/fadump: define register/un-register callback functions

2019-08-14 Thread Hari Bathini
On 13/08/19 8:04 PM, Mahesh J Salgaonkar wrote: > On 2019-07-16 17:03:23 Tue, Hari Bathini wrote: >> Make OPAL calls to register and un-register with firmware for MPIPL. >> >> Signed-off-by: Hari Bathini >> --- >> arch/powerpc/platforms/powernv/opal-fadump.c | 71 >>

Re: [PATCH v4 11/25] powernv/fadump: register kernel metadata address with opal

2019-08-14 Thread Hari Bathini
On 13/08/19 4:11 PM, Mahesh J Salgaonkar wrote: > On 2019-07-16 17:03:15 Tue, Hari Bathini wrote: >> OPAL allows registering address with it in the first kernel and >> retrieving it after MPIPL. Setup kernel metadata and register its >> address with OPAL to use it for processing the crash dump.

Re: [PATCH v4 06/25] pseries/fadump: define register/un-register callback functions

2019-08-14 Thread Hari Bathini
On 12/08/19 9:31 PM, Mahesh J Salgaonkar wrote: > On 2019-07-16 17:02:38 Tue, Hari Bathini wrote: >> Make RTAS calls to register and un-register for FADump. Also, update >> how fadump_region contents are diplayed to provide more information. >> >> Signed-off-by: Hari Bathini >> --- >>

Re: [PATCH v4 05/25] pseries/fadump: introduce callbacks for platform specific operations

2019-08-14 Thread Hari Bathini
On 12/08/19 3:12 PM, Mahesh J Salgaonkar wrote: > On 2019-07-16 17:02:30 Tue, Hari Bathini wrote: >> Introduce callback functions for platform specific operations like >> register, unregister, invalidate & such. Also, define place-holders >> for the same on pSeries platform. >> >>

[PATCH] powerpc: remove the ppc44x ocm.c file

2019-08-14 Thread Christoph Hellwig
The on chip memory allocator is entirely unused in the kernel tree. Signed-off-by: Christoph Hellwig --- arch/powerpc/configs/ppc40x_defconfig | 1 - arch/powerpc/include/asm/ppc4xx_ocm.h | 31 -- arch/powerpc/platforms/44x/Kconfig| 8 - arch/powerpc/platforms/4xx/Makefile | 1 -

Re: [PATCH v4 1/2] powerpc/time: Only set CONFIG_ARCH_HAS_SCALED_CPUTIME on PPC64

2019-08-14 Thread Christophe Leroy
Hi Nick, Le 07/06/2018 à 03:43, Nicholas Piggin a écrit : On Wed, 6 Jun 2018 14:21:08 + (UTC) Christophe Leroy wrote: scaled cputime is only meaningfull when the processor has SPURR and/or PURR, which means only on PPC64. [...] I wonder if we could make this depend on PPC_PSERIES

  1   2   >