Re: [PATCH v2 6/9] arm64: kexec: no need to ClearPageReserved()

2019-01-14 Thread Bhupesh Sharma
Hi David, Thanks for the patch. On Mon, Jan 14, 2019 at 6:29 PM David Hildenbrand wrote: > > This will be done by free_reserved_page(). > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Bhupesh Sharma > Cc: James Morse > Cc: Marc Zyngier > Cc: Dave Kleikamp > Cc: Mark Rutland > Cc: Andrew

Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved

2019-01-14 Thread Bhupesh Sharma
Hi David, On Mon, Jan 14, 2019 at 6:30 PM David Hildenbrand wrote: > > The crashkernel is reserved via memblock_reserve(). memblock_free_all() > will call free_low_memory_core_early(), which will go over all reserved > memblocks, marking the pages as PG_reserved. > > So manually marking pages as

Re: ppc64le reliable stack unwinder and scheduled tasks

2019-01-14 Thread Josh Poimboeuf
On Mon, Jan 14, 2019 at 11:46:59AM -0500, Joe Lawrence wrote: > @@ -158,11 +158,21 @@ save_stack_trace_tsk_reliable(struct task_struct *tsk, > return 1; /* invalid backlink, too far up. */ > } > > + /* We can only trust the bottom frame's backlink,

Re: [PATCH 1/3] dma-mapping: remove the default map_resource implementation

2019-01-14 Thread Christoph Hellwig
On Mon, Jan 14, 2019 at 01:12:33PM +, Robin Murphy wrote: > Ignoring the offset was kind of intentional there, because at the time I > was primarily thinking about it in terms of the Keystone 2 platform where > the peripherals are all in the same place (0-2GB) in both the bus and CPU >

Re: [PATCH 2/3] dma-mapping: don't BUG when calling dma_map_resource on RAM

2019-01-14 Thread Robin Murphy
On 11/01/2019 18:17, Christoph Hellwig wrote: Use WARN_ON_ONCE to print a stack trace and return a proper error code instead. I was racking my brain to remember the reasoning behind BUG_ON() being the only viable way to prevent errors getting through unhandled, but of course that was before

Re: ppc64le reliable stack unwinder and scheduled tasks

2019-01-14 Thread Joe Lawrence
On Mon, Jan 14, 2019 at 08:21:40AM +0100, Nicolai Stange wrote: > Joe Lawrence writes: > > > We should be careful when inspecting the bottom-most stack frame (the > > first to be unwound), particularly for scheduled-out tasks. As Nicolai > > Stange explains, "If I'm reading the code in

Re: [PATCH] pseries/hotplug: Add more delay in pseries_cpu_die while waiting for rtas-stop

2019-01-14 Thread Michael Bringmann
On 1/9/19 12:08 AM, Gautham R Shenoy wrote: > I did some testing during the holidays. Here are the observations: > > 1) With just your patch (without any additional debug patch), if I run > DLPAR on /off operations on a system that has SMT=off, I am able to > see a crash involving RTAS stack

Re: [PATCH] soc: fsl: dpio: fix cpu range check

2019-01-14 Thread Li Yang
On Sun, Jan 13, 2019 at 11:13 PM Bharat Bhushan wrote: > > cpu_possible(cpu) will always return true when cpu parameter > is from cpumask_next(). > Check for nr_cpu_ids rather than !cpu_possible(cpu). There is another patch pending merge seems to cover this issue too. Please let me know if it

Re: ppc64le reliable stack unwinder and scheduled tasks

2019-01-14 Thread Joe Lawrence
On 1/14/19 12:09 PM, Josh Poimboeuf wrote: On Mon, Jan 14, 2019 at 11:46:59AM -0500, Joe Lawrence wrote: @@ -158,11 +158,21 @@ save_stack_trace_tsk_reliable(struct task_struct *tsk, return 1; /* invalid backlink, too far up. */ } + /* We can only

[PATCH] powerpc: Allow CPU selection of G4/74xx variant

2019-01-14 Thread Mathieu Malaterre
GCC supports -mcpu=G4 This patch gives the opportunity to select ALTIVEC for this variant. Signed-off-by: Mathieu Malaterre --- arch/powerpc/platforms/Kconfig.cputype | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/platforms/Kconfig.cputype

Re: [PATCH v2 00/15] powerpc/32s: Use BATs/LTLBs for STRICT_KERNEL_RWX

2019-01-14 Thread Christophe Leroy
Le 13/01/2019 à 22:02, Jonathan Neuschäfer a écrit : On Sun, Jan 13, 2019 at 08:43:07PM +0100, Christophe Leroy wrote: Le 13/01/2019 à 19:16, Jonathan Neuschäfer a écrit : I just tested the whole series on my Wii (I didn't test any intermediate steps). Without CONFIG_STRICT_KERNEL_RWX, it

Re: [PATCH v2 00/15] powerpc/32s: Use BATs/LTLBs for STRICT_KERNEL_RWX

2019-01-14 Thread Jonathan Neuschäfer
On Mon, Jan 14, 2019 at 07:23:07PM +0100, Christophe Leroy wrote: > > > Le 13/01/2019 à 22:02, Jonathan Neuschäfer a écrit : > > On Sun, Jan 13, 2019 at 08:43:07PM +0100, Christophe Leroy wrote: > > > Le 13/01/2019 à 19:16, Jonathan Neuschäfer a écrit : > > > > I just tested the whole series on

Re: [RFC 5/6] powerpc/pci/hotplug: Use common drcinfo parsing

2019-01-14 Thread Bjorn Helgaas
On Fri, Dec 14, 2018 at 02:51:31PM -0600, Michael Bringmann wrote: > The implementation of the pseries-specific drc info properties > is currently implemented in pseries-specific and non-pseries-specific > files. This patch set uses a new implementation of the device-tree > parsing code for the

[PATCH v9 03/22] char/nvram: Re-order functions to remove forward declarations and #ifdefs

2019-01-14 Thread Finn Thain
Also give functions more sensible names: nvram_misc_* for misc device ops, nvram_proc_* for proc file ops and nvram_module_* for init and exit functions. This prevents name collisions with nvram.h helper functions and improves readability. Signed-off-by: Finn Thain --- drivers/char/nvram.c |

[PATCH v9 04/22] nvram: Replace nvram_* function exports with static functions

2019-01-14 Thread Finn Thain
Replace nvram_* functions with static functions in nvram.h. These will become wrappers for struct nvram_ops method calls. This patch effectively disables existing NVRAM functionality so as to allow the rest of the series to be bisected without build failures. That functionality is gradually

[PATCH v9 05/22] m68k/atari: Implement arch_nvram_ops struct

2019-01-14 Thread Finn Thain
By implementing an arch_nvram_ops struct, a platform can re-use the drivers/char/nvram.c module without needing any arch-specific code in that module. Atari does so here. Acked-by: Geert Uytterhoeven Signed-off-by: Finn Thain --- Changed since v8: - Added static inline wrapper functions to

[PATCH v9 06/22] powerpc: Replace nvram_* extern declarations with standard header

2019-01-14 Thread Finn Thain
Remove the nvram_read_byte() and nvram_write_byte() declarations in powerpc/include/asm/nvram.h and use the cross-platform static functions in linux/nvram.h instead. Tested-by: Stan Johnson Signed-off-by: Finn Thain --- Changed since v8: - Added nvram_read_byte() and nvram_write_byte()

[PATCH v9 11/22] m68k/mac: Adopt naming and calling conventions for PRAM routines

2019-01-14 Thread Finn Thain
Adopt the existing *_read_byte and *_write_byte naming convention. Rename via_pram_readbyte and via_pram_writebyte to avoid confusion. Adjust calling conventions of mac_pram_* functions to match the struct nvram_ops methods. Acked-by: Geert Uytterhoeven Tested-by: Stan Johnson Signed-off-by:

[PATCH v9 08/22] char/nvram: Allow the set_checksum and initialize ioctls to be omitted

2019-01-14 Thread Finn Thain
The drivers/char/nvram.c module has previously supported only RTC "CMOS" NVRAM, for which it provides appropriate checksum ioctls. Make these ioctls optional so the module can be re-used with other kinds of NVRAM. The ops struct methods that implement the ioctls now return error codes so that a

[PATCH v9 14/22] macintosh/via-cuda: Don't rely on Cuda to end a transfer

2019-01-14 Thread Finn Thain
Certain Cuda transfers have to be ended by the driver. According to Apple's open source Cuda driver, as found in mkLinux and XNU, this applies to any "open ended request such as PRAM read". This fixes an infinite polling loop in cuda_pram_read_byte(). Tested-by: Stan Johnson Signed-off-by: Finn

[PATCH] powerpc: PCI does not require PowerNV

2019-01-14 Thread Jason A. Donenfeld
Commit 0e759bd75285 moved around the declaration of pnv_npu2_init, but did not conditionalize it inside of the PCI pSeries driver. This meant that CONFIG_PCI && CONFIG_PPC_PSERIES && !CONFIG_PPC_POWERNV resulted in: powerpc64le-pc-linux-gnu-ld: arch/powerpc/platforms/pseries/pci.o: in function

[PATCH v9 01/22] scsi/atari_scsi: Don't select CONFIG_NVRAM

2019-01-14 Thread Finn Thain
On powerpc, setting CONFIG_NVRAM=n builds a kernel with no NVRAM support. Setting CONFIG_NVRAM=m enables the /dev/nvram misc device module without enabling NVRAM support in drivers. Setting CONFIG_NVRAM=y enables the misc device (built-in) and also enables NVRAM support in drivers. m68k shares

[PATCH v9 07/22] char/nvram: Adopt arch_nvram_ops

2019-01-14 Thread Finn Thain
NVRAMs on different platforms and architectures have different attributes and access methods. E.g. some platforms have byte-at-a-time accessor functions while others have byte-range accessor functions. Some have checksum functionality while others do not. By calling ops struct methods via the

[PATCH v9 20/22] powerpc: Enable HAVE_ARCH_NVRAM_OPS and disable GENERIC_NVRAM

2019-01-14 Thread Finn Thain
Switch PPC32 kernels from the generic_nvram module to the nvram module. Also fix a theoretical bug where CHRP omits the chrp_nvram_init() call when CONFIG_NVRAM_MODULE=m. Tested-by: Stan Johnson Signed-off-by: Finn Thain --- The change in the name of the module is visible to userspace. The

[PATCH v9 21/22] char/generic_nvram: Remove as unused

2019-01-14 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/Makefile| 6 +- drivers/char/generic_nvram.c | 160 --- 2 files changed, 1 insertion(+), 165 deletions(-) delete mode 100644 drivers/char/generic_nvram.c diff --git a/drivers/char/Makefile

[PATCH v9 18/22] powerpc: Implement nvram ioctls

2019-01-14 Thread Finn Thain
Add the powerpc-specific ioctls to the nvram module. This allows the nvram module to replace the generic_nvram module. Tested-by: Stan Johnson Signed-off-by: Finn Thain --- On PPC32, the IOC_NVRAM_SYNC ioctl call always returns 0, even for those platforms that don't implement ppc_md.nvram_sync.

[PATCH v9 22/22] powerpc: Adopt nvram module for PPC64

2019-01-14 Thread Finn Thain
Adopt nvram module to reduce code duplication. This means CONFIG_NVRAM becomes available to PPC64 builds. Previously it was only available to PPC32 builds because it depended on CONFIG_GENERIC_NVRAM. The IOC_NVRAM_GET_OFFSET ioctl as implemented on PPC64 validates the offset returned by

RE: [PATCH] soc: fsl: dpio: fix cpu range check

2019-01-14 Thread Bharat Bhushan
> -Original Message- > From: Li Yang > Sent: Tuesday, January 15, 2019 12:47 AM > To: Bharat Bhushan > Cc: Roy Pledge ; linux-ker...@vger.kernel.org; > linuxppc-dev@lists.ozlabs.org; linux-arm-ker...@lists.infradead.org; > bharatb.ya...@gmail.com > Subject: Re: [PATCH] soc: fsl: dpio:

[RFC PATCH] powerpc: Enable kcov

2019-01-14 Thread Andrew Donnellan
kcov provides kernel coverage data that's useful for fuzzing tools like syzkaller. Wire up kcov support on powerpc. Disable kcov instrumentation on the same files where we currently disable gcov and UBSan instrumentation. Signed-off-by: Andrew Donnellan --- kcov looks like it's working okay,

[PATCH v9 02/22] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2019-01-14 Thread Finn Thain
Move the m68k-specific code out of the driver to make the driver generic. I've used 'SPDX-License-Identifier: GPL-2.0+' for the new file because the old file is covered by MODULE_LICENSE("GPL"). Acked-by: Geert Uytterhoeven Signed-off-by: Finn Thain --- Changed since v8: - Fixed an old bug by

[PATCH v9 09/22] char/nvram: Implement NVRAM read/write methods

2019-01-14 Thread Finn Thain
Refactor the RTC "CMOS" NVRAM functions so that they can be used as arch_nvram_ops methods. Checksumming logic is moved from the misc device operations to the nvram read/write operations. This makes the misc device implementation more generic. This preserves the locking mechanism such that "read

[PATCH v9 13/22] m68k/mac: Fix PRAM accessors

2019-01-14 Thread Finn Thain
PMU-based m68k Macs pre-date PowerMac-style NVRAM. Use the appropriate PMU commands. Also implement the missing XPRAM accessors for VIA-based Macs. Acked-by: Geert Uytterhoeven Tested-by: Stan Johnson Signed-off-by: Finn Thain --- Changed since v7: - Revised PMU response decoding due to

[PATCH v9 16/22] char/nvram: Add "devname:nvram" module alias

2019-01-14 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index adcc213c331e..c9e295d73dc5 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c @@ -503,3 +503,4 @@ module_exit(nvram_module_exit);

[PATCH v9 00/22] Re-use nvram module

2019-01-14 Thread Finn Thain
The "generic" NVRAM module, drivers/char/generic_nvram.c, implements a /dev/nvram misc device. This module is used only by 32-bit PowerPC platforms. The RTC "CMOS" NVRAM module, drivers/char/nvram.c, also implements a /dev/nvram misc device. This module is now used only by x86 and m68k thanks to

[PATCH v9 10/22] m68k/atari: Implement arch_nvram_ops methods and enable CONFIG_HAVE_ARCH_NVRAM_OPS

2019-01-14 Thread Finn Thain
Atari RTC NVRAM uses a checksum so implement the remaining arch_nvram_ops methods for the set_checksum and initialize ioctls. Enable CONFIG_HAVE_ARCH_NVRAM_OPS. Acked-by: Geert Uytterhoeven Signed-off-by: Finn Thain --- Changed since v8: - Moved the HAVE_ARCH_NVRAM_OPS symbol to common code as

[PATCH v9 12/22] m68k/mac: Use macros for RTC accesses not magic numbers

2019-01-14 Thread Finn Thain
This is intended to improve code style and not affect code behaviour. Acked-by: Geert Uytterhoeven Tested-by: Stan Johnson Signed-off-by: Finn Thain --- arch/m68k/mac/misc.c | 59 ++-- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git

[PATCH v9 15/22] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2019-01-14 Thread Finn Thain
A multi-platform kernel binary has to decide at run-time how to dispatch the arch_nvram_ops calls. Add a platform-independent arch_nvram_ops struct for this, to replace the atari-specific one. Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs. Acked-by: Geert Uytterhoeven Tested-by: Stan Johnson

[PATCH v9 17/22] powerpc: Define missing ppc_md.nvram_size for CHRP and PowerMac

2019-01-14 Thread Finn Thain
Add the nvram_size() function to those PowerPC platforms that don't already have one: CHRP and PowerMac. This means that the ppc_md.nvram_size() function can be called by nvram_get_size(). Since we are addressing CHRP inconsistencies here, rename chrp_nvram_read and chrp_nvram_write, which break

[PATCH v9 19/22] powerpc, fbdev: Use NV_CMODE and NV_VMODE only when CONFIG_PPC32 && CONFIG_PPC_PMAC && CONFIG_NVRAM

2019-01-14 Thread Finn Thain
This patch addresses inconsistencies in Mac framebuffer drivers and their use of Kconfig symbols relating to NVRAM, so PPC64 can use CONFIG_NVRAM. The defined(CONFIG_NVRAM) condition is replaced with the weaker IS_REACHABLE(CONFIG_NVRAM) condition, like atari_scsi. Macintosh framebuffer drivers

Re: [PATCH] powerpc: PCI does not require PowerNV

2019-01-14 Thread Alexey Kardashevskiy
On 15/01/2019 11:47, Jason A. Donenfeld wrote: > Commit 0e759bd75285 moved around the declaration of pnv_npu2_init, but > did not conditionalize it inside of the PCI pSeries driver. This meant > that CONFIG_PCI && CONFIG_PPC_PSERIES && !CONFIG_PPC_POWERNV resulted > in: > >

[PATCH] powerpc/syscalls: Fix syscall tracing

2019-01-14 Thread Michael Ellerman
Recently in commit fbf508da7440 ("powerpc: split compat syscall table out from native table") we changed the layout of the system call table. Instead of having two entries for each syscall number, one for the regular entry point and one for the compat entry point, we now have separate tables for

[PATCH] powerpc/64: Make sys_switch_endian() traceable

2019-01-14 Thread Michael Ellerman
We weren't using SYSCALL_DEFINE for sys_switch_endian(), which means it wasn't able to be traced by CONFIG_FTRACE_SYSCALLS. By using the macro we create the right metadata and the syscall is visible. eg: # cd /sys/kernel/debug/tracing # echo 1 | tee events/syscalls/sys_*_switch_endian/enable

Re: [PATCH v3 1/3] powerpc/mm: prepare kernel for KAsan on PPC32

2019-01-14 Thread Christophe Leroy
On 01/14/2019 09:34 AM, Dmitry Vyukov wrote: On Sat, Jan 12, 2019 at 12:16 PM Christophe Leroy wrote: In kernel/cputable.c, explicitly use memcpy() in order to allow GCC to replace it with __memcpy() when KASAN is selected. Since commit 400c47d81ca38 ("powerpc32: memset: only use dcbz

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-14 Thread Pingfan Liu
[...] > > > > I would appreciate a help with those architectures because I couldn't > > really grasp how the memoryless nodes are really initialized there. E.g. > > ppc only seem to call setup_node_data for online nodes but I couldn't > > find any special treatment for nodes without any memory. >

Re: [PATCH] powerpc/pseries: Split CPU readd for single CPU systems

2019-01-14 Thread Michael Ellerman
Michael Bringmann writes: > [FYI: Please post to linuxppc-dev mailing list when you are ready. > Good luck.] ??? I guess I'll ignore this and look at the other version you posted? :) cheers > We have encountered cases where DLPAR CPU 'readd' fails on single > CPU platforms, because the

Re: [PATCH v2 00/15] powerpc/32s: Use BATs/LTLBs for STRICT_KERNEL_RWX

2019-01-14 Thread Christophe Leroy
Le 15/01/2019 à 01:33, Jonathan Neuschäfer a écrit : On Mon, Jan 14, 2019 at 07:23:07PM +0100, Christophe Leroy wrote: Le 13/01/2019 à 22:02, Jonathan Neuschäfer a écrit : On Sun, Jan 13, 2019 at 08:43:07PM +0100, Christophe Leroy wrote: Le 13/01/2019 à 19:16, Jonathan Neuschäfer a écrit 

[PATCH] kbuild: mark prepare0 as PHONY to fix external module build

2019-01-14 Thread Masahiro Yamada
Commit c3ff2a5193fa ("powerpc/32: add stack protector support") caused kernel panic on PowerPC if an external module is used with CONFIG_STACKPROTECTOR because the 'prepare' target was not executed for the external module build. Commit e07db28eea38 ("kbuild: fix single target build for external

gcc 6.3 vs 8.2 Re: [RFC PATCH] powerpc: Enable kcov

2019-01-14 Thread Mathieu Malaterre
[Sorry to hijack this thread. ] On Tue, Jan 15, 2019 at 5:22 AM Andrew Donnellan wrote: > > kcov provides kernel coverage data that's useful for fuzzing tools like > syzkaller. > > Wire up kcov support on powerpc. Disable kcov instrumentation on the same > files where we currently disable gcov

[RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-14 Thread Michal Hocko
From: Michal Hocko Pingfan Liu has reported the following splat [5.772742] BUG: unable to handle kernel paging request at 2088 [5.773618] PGD 0 P4D 0 [5.773618] Oops: [#1] SMP NOPTI [5.773618] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.20.0-rc1+ #3 [

Re: [PATCH 15/15] arch: add pkey and rseq syscall numbers everywhere

2019-01-14 Thread Heiko Carstens
On Fri, Jan 11, 2019 at 06:30:43PM +0100, Arnd Bergmann wrote: > On Thu, Jan 10, 2019 at 9:36 PM Heiko Carstens > wrote: > > On Thu, Jan 10, 2019 at 05:24:35PM +0100, Arnd Bergmann wrote: > > > Since you only need/want the system call numbers, could you please > > change these lines to: > > > >

[PATCH V7 0/4] mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region

2019-01-14 Thread Aneesh Kumar K.V
ppc64 use CMA area for the allocation of guest page table (hash page table). We won't be able to start guest if we fail to allocate hash page table. We have observed hash table allocation failure because we failed to migrate pages out of CMA region because they were pinned. This happen when we

[PATCH V7 1/4] mm/cma: Add PF flag to force non cma alloc

2019-01-14 Thread Aneesh Kumar K.V
This patch adds PF_MEMALLOC_NOCMA which make sure any allocation in that context is marked non-movable and hence cannot be satisfied by CMA region. This is useful with get_user_pages_longterm where we want to take a page pin by migrating pages from CMA region. Marking the section

[PATCH V7 2/4] mm: Update get_user_pages_longterm to migrate pages allocated from CMA region

2019-01-14 Thread Aneesh Kumar K.V
This patch updates get_user_pages_longterm to migrate pages allocated out of CMA region. This makes sure that we don't keep non-movable pages (due to page reference count) in the CMA area. This will be used by ppc64 in a later patch to avoid pinning pages in the CMA region. ppc64 uses CMA region

[PATCH V7 2/4] mm: Update get_user_pages_longterm to migrate pages allocated from CMA region

2019-01-14 Thread Aneesh Kumar K.V
This patch updates get_user_pages_longterm to migrate pages allocated out of CMA region. This makes sure that we don't keep non-movable pages (due to page reference count) in the CMA area. This will be used by ppc64 in a later patch to avoid pinning pages in the CMA region. ppc64 uses CMA region

[PATCH V7 4/4] powerpc/mm/iommu: Allow large IOMMU page size only for hugetlb backing

2019-01-14 Thread Aneesh Kumar K.V
THP pages can get split during different code paths. An incremented reference count does imply we will not split the compound page. But the pmd entry can be converted to level 4 pte entries. Keep the code simpler by allowing large IOMMU page size only if the guest ram is backed by hugetlb pages.

Re: [PATCH 3/3] videobuf2: replace a layering violation with dma_map_resource

2019-01-14 Thread Christoph Hellwig
On Fri, Jan 11, 2019 at 05:54:16PM -0200, Mauro Carvalho Chehab wrote: > Em Fri, 11 Jan 2019 19:17:31 +0100 > Christoph Hellwig escreveu: > > > vb2_dc_get_userptr pokes into arm direct mapping details to get the > > resemblance of a dma address for a a physical address that does is > > not

Re: [PATCH v2 10/34] dt-bindings: arm: Convert Actions Semi bindings to jsonschema

2019-01-14 Thread Manivannan Sadhasivam
On Mon, Dec 03, 2018 at 03:31:59PM -0600, Rob Herring wrote: > Convert Actions Semi SoC bindings to DT schema format using json-schema. > Andreas, Shall I just apply this patch to Actions sub-tree? Thanks, Mani > Cc: "Andreas Färber" > Cc: Manivannan Sadhasivam > Cc: Mark Rutland > Cc:

Re: [PATCH 3/3] videobuf2: replace a layering violation with dma_map_resource

2019-01-14 Thread Marek Szyprowski
Hi Christoph, On 2019-01-11 19:17, Christoph Hellwig wrote: > vb2_dc_get_userptr pokes into arm direct mapping details to get the > resemblance of a dma address for a a physical address that does is > not backed by a page struct. Not only is this not portable to other > architectures with dma

[PATCH V7 5/5] testing

2019-01-14 Thread Aneesh Kumar K.V
--- mm/gup.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 6e8152594e83..91849c39931a 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1226,7 +1226,7 @@ static long check_and_migrate_cma_pages(unsigned long start, long nr_pages, * be

Re: powerpc/8xx: fix setting of pagetable for Abatron BDI debug tool.

2019-01-14 Thread Michael Ellerman
On Wed, 2019-01-09 at 20:30:07 UTC, Christophe Leroy wrote: > Commit 8c8c10b90d88 ("powerpc/8xx: fix handling of early NULL pointer > dereference") moved the loading of r6 earlier in the code. As some > functions are called inbetween, r6 needs to be loaded again with the > address of

[PATCH v2 8/9] ia64: perfmon: Don't mark buffer pages as PG_reserved

2019-01-14 Thread David Hildenbrand
In the old days, remap_pfn_range() required pages to be marked as PG_reserved, so they would e.g. never get swapped out. This was required for special mappings. Nowadays, this is fully handled via the VMA (VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP inside remap_pfn_range() to be precise).

[RFC PATCH 5/5] powerpc/syscalls: Use the number when building SPU syscall table

2019-01-14 Thread Michael Ellerman
Currently the macro that inserts entries into the SPU syscall table doesn't actually use the "nr" (syscall number) parameter. This does work, but it relies on the exact right number of syscall entries being emitted in order for the syscal numbers to line up with the array entries. If for example

[PATCH v2 4/9] riscv/vdso: don't clear PG_reserved

2019-01-14 Thread David Hildenbrand
The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Cc: Palmer Dabbelt Cc: Albert Ou

Re: [PATCH 1/3] dma-mapping: remove the default map_resource implementation

2019-01-14 Thread Robin Murphy
On 11/01/2019 18:17, Christoph Hellwig wrote: Just returning the physical address when not map_resource method is present is highly dangerous as it doesn't take any offset in the direct mapping into account and does the completely wrong thing for IOMMUs. Instead provide a proper implementation

Re: [PATCH v2 5/9] m68k/mm: use __ClearPageReserved()

2019-01-14 Thread Geert Uytterhoeven
On Mon, Jan 14, 2019 at 1:59 PM David Hildenbrand wrote: > The PG_reserved flag is cleared from memory that is part of the kernel > image (and therefore marked as PG_reserved). Avoid using PG_reserved > directly. > > Cc: Geert Uytterhoeven > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Matthew

Re: [2/2] powerpc/perf: Update perf_regs structure to include MMCRA

2019-01-14 Thread Michael Ellerman
On Sun, 2018-12-09 at 09:25:36 UTC, Madhavan Srinivasan wrote: > On each sample, Monitor Mode Control Register A (MMCRA) content > is saved in pt_regs. MMCRA does not have a entry as-is in the pt_regs > but instead, MMCRA content is saved in the "dsisr" register of pt_regs. > > Patch adds another

Re: powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group()

2019-01-14 Thread Michael Ellerman
On Wed, 2019-01-09 at 10:23:29 UTC, Dan Carpenter wrote: > There is a typo so we accidentally allocate enough memory for a pointer > when we wanted to allocate enough for a struct. > > Fixes: 0bd971676e68 ("powerpc/powernv/npu: Add compound IOMMU groups") > Signed-off-by: Dan Carpenter >

Re: [PATCH 3/3] videobuf2: replace a layering violation with dma_map_resource

2019-01-14 Thread Mauro Carvalho Chehab
Em Mon, 14 Jan 2019 11:31:39 +0100 Christoph Hellwig escreveu: > On Fri, Jan 11, 2019 at 05:54:16PM -0200, Mauro Carvalho Chehab wrote: > > Em Fri, 11 Jan 2019 19:17:31 +0100 > > Christoph Hellwig escreveu: > > > > > vb2_dc_get_userptr pokes into arm direct mapping details to get the > > >

[RFC PATCH 4/5] powerpc/syscalls: Allow none instead of sys_ni_syscall

2019-01-14 Thread Michael Ellerman
sys_ni_syscall is the "not-implemented" syscall syscall, which just returns -ENOSYS. But unless you know that it's not obvious what it does, and even if you do know what it means it doesn't stand out that well from other real syscalls. So teach the scripts to treat "none" as a synonym for

[PATCH v2 0/9] mm: PG_reserved cleanups and documentation

2019-01-14 Thread David Hildenbrand
Nothing major changed since the last version. I would be happy about additional ACKs. If there are no further comments, can this go via the mm-tree in one chunk? I was recently going over all users of PG_reserved. Short story: it is difficult and sometimes not really clear if setting/checking for

[PATCH v2 2/9] s390/vdso: don't clear PG_reserved

2019-01-14 Thread David Hildenbrand
The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Suggested-by: Martin Schwidefsky

[PATCH v2 5/9] m68k/mm: use __ClearPageReserved()

2019-01-14 Thread David Hildenbrand
The PG_reserved flag is cleared from memory that is part of the kernel image (and therefore marked as PG_reserved). Avoid using PG_reserved directly. Cc: Geert Uytterhoeven Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Signed-off-by: David Hildenbrand --- arch/m68k/mm/memory.c | 2

Re: [PATCH 14/15] arch: add split IPC system calls where needed

2019-01-14 Thread Michael Ellerman
Michael Ellerman writes: > Hi Arnd, > > Arnd Bergmann writes: >> The IPC system call handling is highly inconsistent across architectures, >> some use sys_ipc, some use separate calls, and some use both. We also >> have some architectures that require passing IPC_64 in the flags, and >> others

[RFC PATCH 3/5] powerpc/syscalls: Split SPU-ness out of ABI

2019-01-14 Thread Michael Ellerman
Using the ABI field to encode whether a syscall is usable by SPU programs or not is a bit of kludge. The ABI of the syscall doesn't change depending on the SPU-ness, but in order to make the syscall generation work we have to pretend that it does. It also means we have more duplicated syscall

[PATCH v2 6/9] arm64: kexec: no need to ClearPageReserved()

2019-01-14 Thread David Hildenbrand
This will be done by free_reserved_page(). Cc: Catalin Marinas Cc: Will Deacon Cc: Bhupesh Sharma Cc: James Morse Cc: Marc Zyngier Cc: Dave Kleikamp Cc: Mark Rutland Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Acked-by: James Morse Signed-off-by: David Hildenbrand ---

[PATCH V7 3/4] powerpc/mm/iommu: Allow migration of cma allocated pages during mm_iommu_do_alloc

2019-01-14 Thread Aneesh Kumar K.V
The current code doesn't do page migration if the page allocated is a compound page. With HugeTLB migration support, we can end up allocating hugetlb pages from CMA region. Also, THP pages can be allocated from CMA region. This patch updates the code to handle compound pages correctly. The patch

Re: Kconfig label updates

2019-01-14 Thread Michael Ellerman
Segher Boessenkool writes: > On Fri, Jan 11, 2019 at 05:06:12PM +1100, Michael Ellerman wrote: >> Tyrel Datwyler writes: >> > It is basically the predecessor to PAPR "Power Architecture Platform >> > Reference". >> > Which the LoPAPR document is available through power.org. Not sure if >> >

[RFC PATCH 2/5] powerpc/syscalls: Remove unused prefix parameter

2019-01-14 Thread Michael Ellerman
We never pass a prefix so remove the logic for it. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/syscalls/Makefile | 3 +-- arch/powerpc/kernel/syscalls/syscallhdr.sh | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/syscalls/Makefile

[PATCH v2 3/9] powerpc/vdso: don't clear PG_reserved

2019-01-14 Thread David Hildenbrand
The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Cc: Benjamin Herrenschmidt Cc:

[PATCH v2 9/9] mm: better document PG_reserved

2019-01-14 Thread David Hildenbrand
The usage of PG_reserved and how PG_reserved pages are to be treated is buried deep down in different parts of the kernel. Let's shine some light onto these details by documenting current users and expected behavior. Especially, clarify on the "Some of them might not even exist" case. These are

Re: powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group()

2019-01-14 Thread Michael Ellerman
On Wed, 2019-01-09 at 15:13:42 UTC, Frederic Barrat wrote: > With a recent change around IOMMU group, a system with an opencapi > adapter is no longer booting and we get a kernel oops: > > BUG: Kernel NULL pointer dereference at 0x0028 > Faulting instruction address: 0xc00aa38c >

Re: powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM

2019-01-14 Thread Michael Ellerman
On Wed, 2019-01-09 at 13:16:45 UTC, Breno Leitao wrote: > Commit e1c3743e1a20 ("powerpc/tm: Set MSR[TS] just prior to recheckpoint") > moved a code block around and this block uses a 'msr' variable outside of > the CONFIG_PPC_TRANSACTIONAL_MEM, however the 'msr' variable is declared > inside a

Re: fix a layering violation in videobuf2 and improve dma_map_resource

2019-01-14 Thread Marek Szyprowski
Hi Christoph, On 2019-01-11 19:17, Christoph Hellwig wrote: > Hi all, > > this series fixes a rather gross layering violation in videobuf2, which > pokes into arm DMA mapping internals to get a DMA address for memory that > does not have a page structure, and to do so fixes up the

[PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved

2019-01-14 Thread David Hildenbrand
The crashkernel is reserved via memblock_reserve(). memblock_free_all() will call free_low_memory_core_early(), which will go over all reserved memblocks, marking the pages as PG_reserved. So manually marking pages as PG_reserved is not necessary, they are already in the desired state (otherwise

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-14 Thread Michael Ellerman
Michal Hocko writes: > From: Michal Hocko > > Pingfan Liu has reported the following splat > [5.772742] BUG: unable to handle kernel paging request at 2088 > [5.773618] PGD 0 P4D 0 > [5.773618] Oops: [#1] SMP NOPTI > [5.773618] CPU: 2 PID: 1 Comm: swapper/0 Not

Re: [PATCH 3/3] videobuf2: replace a layering violation with dma_map_resource

2019-01-14 Thread Christoph Hellwig
On Mon, Jan 14, 2019 at 09:04:56AM -0200, Mauro Carvalho Chehab wrote: > It would be good if you could later send us a stable branch where > you merged, in order to allow us to run some tests with the new > DMA mapping patchset and be sure that it won't cause regressions > to videobuf2. I can do

[RFC PATCH 1/5] powerpc/syscalls: Remove unused offset parameter

2019-01-14 Thread Michael Ellerman
We never pass a value for offset, nor do we need to, so remove the offset logic. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/syscalls/Makefile | 6 ++ arch/powerpc/kernel/syscalls/syscallhdr.sh | 10 ++ arch/powerpc/kernel/syscalls/syscalltbl.sh | 8 ++-- 3

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-14 Thread Michal Hocko
On Mon 14-01-19 21:26:39, Michael Ellerman wrote: > Michal Hocko writes: > > > From: Michal Hocko > > > > Pingfan Liu has reported the following splat > > [5.772742] BUG: unable to handle kernel paging request at > > 2088 > > [5.773618] PGD 0 P4D 0 > > [5.773618] Oops:

[PATCH v2 1/9] agp: efficeon: no need to set PG_reserved on GATT tables

2019-01-14 Thread David Hildenbrand
The l1 GATT page table is kept in a special on-chip page with 64 entries. We allocate the l2 page table pages via get_zeroed_page() and enter them into the table. These l2 pages are modified accordingly when inserting/removing memory via efficeon_insert_memory and efficeon_remove_memory. Apart