Re: [PATCH v15 6/9] namei: LOOKUP_{IN_ROOT,BENEATH}: permit limited ".." resolution

2019-11-12 Thread Aleksa Sarai
On 2019-11-13, Al Viro wrote: > On Tue, Nov 05, 2019 at 08:05:50PM +1100, Aleksa Sarai wrote: > > > One other possible alternative (which previous versions of this patch > > used) would be to check with path_is_under() if there was a racing > > rename or mount (after re-taking the relevant

Re: [PATCH v15 4/9] namei: LOOKUP_BENEATH: O_BENEATH-like scoped resolution

2019-11-12 Thread Aleksa Sarai
On 2019-11-13, Al Viro wrote: > Minor nit here - I'd split "move the conditional call of set_root() > into nd_jump_root()" into a separate patch before that one. Makes > for fewer distractions in this one. I'd probably fold "and be > ready for errors other than -ECHILD" into the same

[PATCH 3/3] powerpc: remove support for NULL dev in __phys_to_dma / __dma_to_phys

2019-11-12 Thread Christoph Hellwig
Support for calling the DMA API functions without a valid device pointer was removed a while ago, so remove the stale support for that from the powerpc __phys_to_dma / __dma_to_phys helpers. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-direct.h | 4 1 file changed, 4

[PATCH 1/3] dma-direct: unify the dma_capable definitions

2019-11-12 Thread Christoph Hellwig
Currently each architectures that wants to override dma_to_phys and phys_to_dma also has to provide dma_capable. But there isn't really any good reason for that. powerpc and mips just have copies of the generic one minus the latests fix, and the arm one was the inspiration for said fix, but

[PATCH 2/3] dma-direct: avoid a forward declaration for phys_to_dma

2019-11-12 Thread Christoph Hellwig
Move dma_capable down a bit so that we don't need a forward declaration for phys_to_dma. Signed-off-by: Christoph Hellwig --- include/linux/dma-direct.h | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/include/linux/dma-direct.h

unify the dma_capable definition

2019-11-12 Thread Christoph Hellwig
Hi all, there is no good reason to have different version of dma_capable. This series removes the arch overrides and also adds a few cleanups in the same area.

Re: [PATCH v4 00/47] QUICC Engine support on ARM and ARM64

2019-11-12 Thread Rasmus Villemoes
On 12/11/2019 21.45, Li Yang wrote: > On Mon, Nov 11, 2019 at 5:39 PM Li Yang wrote: >> >> On Fri, Nov 8, 2019 at 7:05 AM Rasmus Villemoes >> wrote: >>> >> >> I'm generally ok with these enhencements and cleanups. But as the >> whole patch series touched multiple subsystems, I would like to >>

[PATCH v3] libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h

2019-11-12 Thread Masahiro Yamada
The DTC v1.5.1 added references to (U)INT32_MAX. This is no problem for user-space programs since defines (U)INT32_MAX along with (u)int32_t. For the kernel space, libfdt_env.h needs to be adjusted before we pull in the changes. In the kernel, we usually use s/u32 instead of (u)int32_t for the

Re: [PATCH v4 0/3] Append new variables to vmcoreinfo (TCR_EL1.T1SZ for arm64 and MAX_PHYSMEM_BITS for all archs)

2019-11-12 Thread AKASHI Takahiro
Hi Bhupesh, Do you have a corresponding patch for userspace tools, including crash util and/or makedumpfile? Otherwise, we can't verify that a generated core file is correctly handled. Thanks, -Takahiro Akashi On Mon, Nov 11, 2019 at 01:31:19PM +0530, Bhupesh Sharma wrote: > Changes since v3: >

Re: [PATCH v10 7/8] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-11-12 Thread Ram Pai
On Wed, Nov 13, 2019 at 11:14:27AM +1100, Paul Mackerras wrote: > On Tue, Nov 12, 2019 at 06:45:55AM -0800, Ram Pai wrote: > > On Tue, Nov 12, 2019 at 10:32:04PM +1100, Paul Mackerras wrote: > > > On Mon, Nov 11, 2019 at 11:52:15PM -0800, Ram Pai wrote: > > > > There is subtle problem removing

Re: [PATCH v4 00/23] mm/gup: track dma-pinned pages: FOLL_PIN, FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 8:26 PM, John Hubbard wrote: > OK, here we go. Any VFIO and Infiniband runtime testing from anyone, is > especially welcome here. > Oh, and to make that easier, there is a git repo and branch, here: g...@github.com:johnhubbard/linux.git pin_user_pages_tracking_v4 thanks, --

[PATCH v4 23/23] mm/gup: remove support for gup(FOLL_LONGTERM)

2019-11-12 Thread John Hubbard
Now that all other kernel callers of get_user_pages(FOLL_LONGTERM) have been converted to pin_longterm_pages(), lock it down: 1) Add an assertion to get_user_pages(), preventing callers from passing FOLL_LONGTERM (in addition to the existing assertion that prevents FOLL_PIN). 2) Remove the

[PATCH v4 06/23] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-11-12 Thread John Hubbard
And get rid of the mmap_sem calls, as part of that. Note that get_user_pages_fast() will, if necessary, fall back to __gup_longterm_unlocked(), which takes the mmap_sem as needed. Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Signed-off-by: John Hubbard ---

[PATCH v4 09/23] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-12 Thread John Hubbard
Introduce pin_user_pages*() variations of get_user_pages*() calls, and also pin_longterm_pages*() variations. These variants all set FOLL_PIN, which is also introduced, and thoroughly documented. The pin_longterm*() variants also set FOLL_LONGTERM, in addition to FOLL_PIN: pin_user_pages()

[PATCH v4 20/23] mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"

2019-11-12 Thread John Hubbard
Fix the gup benchmark flags to use the symbolic FOLL_WRITE, instead of a hard-coded "1" value. Also, clean up the filtering of gup flags a little, by just doing it once before issuing any of the get_user_pages*() calls. This makes it harder to overlook, instead of having little "gup_flags & 1"

[PATCH v4 22/23] selftests/vm: run_vmtests: invoke gup_benchmark with basic FOLL_PIN coverage

2019-11-12 Thread John Hubbard
It's good to have basic unit test coverage of the new FOLL_PIN behavior. Fortunately, the gup_benchmark unit test is extremely fast (a few milliseconds), so adding it the the run_vmtests suite is going to cause no noticeable change in running time. So, add two new invocations to run_vmtests: 1)

[PATCH v4 07/23] media/v4l2-core: set pages dirty upon releasing DMA buffers

2019-11-12 Thread John Hubbard
After DMA is complete, and the device and CPU caches are synchronized, it's still required to mark the CPU pages as dirty, if the data was coming from the device. However, this driver was just issuing a bare put_page() call, without any set_page_dirty*() call. Fix the problem, by calling

[PATCH v4 02/23] mm/gup: factor out duplicate code from four routines

2019-11-12 Thread John Hubbard
There are four locations in gup.c that have a fair amount of code duplication. This means that changing one requires making the same changes in four places, not to mention reading the same code four times, and wondering if there are subtle differences. Factor out the common code into static

[PATCH v4 18/23] vfio, mm: pin_longterm_pages (FOLL_PIN) and put_user_page() conversion

2019-11-12 Thread John Hubbard
1. Change vfio from get_user_pages(FOLL_LONGTERM), to pin_longterm_pages(), which sets both FOLL_LONGTERM and FOLL_PIN. 2. Because all FOLL_PIN-acquired pages must be released via put_user_page(), also convert the put_page() call over to put_user_pages(). Note that this effectively changes the

[PATCH v4 12/23] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-11-12 Thread John Hubbard
Convert process_vm_access to use the new pin_user_pages_remote() call, which sets FOLL_PIN. Setting FOLL_PIN is now required for code that requires tracking of pinned pages. Also, release the pages via put_user_page*(). Also, rename "pages" to "pinned_pages", as this makes for easier reading of

[PATCH v4 04/23] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-12 Thread John Hubbard
An upcoming patch changes and complicates the refcounting and especially the "put page" aspects of it. In order to keep everything clean, refactor the devmap page release routines: * Rename put_devmap_managed_page() to page_is_devmap_managed(), and limit the functionality to "read only": return

[PATCH v4 21/23] mm/gup_benchmark: support pin_user_pages() and related calls

2019-11-12 Thread John Hubbard
Up until now, gup_benchmark supported testing of the following kernel functions: * get_user_pages(): via the '-U' command line option * get_user_pages_longterm(): via the '-L' command line option * get_user_pages_fast(): as the default (no options required) Add test coverage for the new

[PATCH v4 19/23] powerpc: book3s64: convert to pin_longterm_pages() and put_user_page()

2019-11-12 Thread John Hubbard
1. Convert from get_user_pages(FOLL_LONGTERM) to pin_longterm_pages(). 2. As required by pin_user_pages(), release these pages via put_user_page(). In this case, do so via put_user_pages_dirty_lock(). That has the side effect of calling set_page_dirty_lock(), instead of set_page_dirty(). This is

[PATCH v4 16/23] mm/gup: track FOLL_PIN pages

2019-11-12 Thread John Hubbard
Add tracking of pages that were pinned via FOLL_PIN. As mentioned in the FOLL_PIN documentation, callers who effectively set FOLL_PIN are required to ultimately free such pages via put_user_page(). The effect is similar to FOLL_GET, and may be thought of as "FOLL_GET for DIO and/or RDMA use".

[PATCH v4 01/23] mm/gup: pass flags arg to __gup_device_* functions

2019-11-12 Thread John Hubbard
A subsequent patch requires access to gup flags, so pass the flags argument through to the __gup_device_* functions. Also placate checkpatch.pl by shortening a nearby line. Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Cc: Kirill A. Shutemov Signed-off-by: John Hubbard --- mm/gup.c | 28

[PATCH v4 15/23] net/xdp: set FOLL_PIN via pin_user_pages()

2019-11-12 Thread John Hubbard
Convert net/xdp to use the new pin_longterm_pages() call, which sets FOLL_PIN. Setting FOLL_PIN is now required for code that requires tracking of pinned pages. In partial anticipation of this work, the net/xdp code was already calling put_user_page() instead of put_page(). Therefore, in order to

[PATCH v4 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
As it says in the updated comment in gup.c: current FOLL_LONGTERM behavior is incompatible with FAULT_FLAG_ALLOW_RETRY because of the FS DAX check requirement on vmas. However, the corresponding restriction in get_user_pages_remote() was slightly stricter than is actually required: it forbade all

[PATCH v4 17/23] media/v4l2-core: pin_longterm_pages (FOLL_PIN) and put_user_page() conversion

2019-11-12 Thread John Hubbard
1. Change v4l2 from get_user_pages(FOLL_LONGTERM), to pin_longterm_pages(), which sets both FOLL_LONGTERM and FOLL_PIN. 2. Because all FOLL_PIN-acquired pages must be released via put_user_page(), also convert the put_page() call over to put_user_pages_dirty_lock(). Acked-by: Hans Verkuil

[PATCH v4 05/23] goldish_pipe: rename local pin_user_pages() routine

2019-11-12 Thread John Hubbard
1. Avoid naming conflicts: rename local static function from "pin_user_pages()" to "pin_goldfish_pages()". An upcoming patch will introduce a global pin_user_pages() function. Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John Hubbard ---

[PATCH v4 10/23] goldish_pipe: convert to pin_user_pages() and put_user_page()

2019-11-12 Thread John Hubbard
1. Call the new global pin_user_pages_fast(), from pin_goldfish_pages(). 2. As required by pin_user_pages(), release these pages via put_user_page(). In this case, do so via put_user_pages_dirty_lock(). That has the side effect of calling set_page_dirty_lock(), instead of set_page_dirty(). This

[PATCH v4 11/23] IB/{core, hw, umem}: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-11-12 Thread John Hubbard
Convert infiniband to use the new wrapper calls, and stop explicitly setting FOLL_LONGTERM at the call sites. The new pin_longterm_*() calls replace get_user_pages*() calls, and set both FOLL_LONGTERM and a new FOLL_PIN flag. The FOLL_PIN flag requires that the caller must return the pages via

[PATCH v4 14/23] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-11-12 Thread John Hubbard
Convert fs/io_uring to use the new pin_user_pages() call, which sets FOLL_PIN. Setting FOLL_PIN is now required for code that requires tracking of pinned pages, and therefore for any code that calls put_user_page(). In partial anticipation of this work, the io_uring code was already calling

[PATCH v4 00/23] mm/gup: track dma-pinned pages: FOLL_PIN, FOLL_LONGTERM

2019-11-12 Thread John Hubbard
OK, here we go. Any VFIO and Infiniband runtime testing from anyone, is especially welcome here. Changes since v3: * VFIO fix (patch 8): applied further cleanup: removed a pre-existing, unnecessary release and reacquire of mmap_sem. Moved the DAX vma checks from the vfio call site, to gup

[PATCH v4 03/23] mm/gup: move try_get_compound_head() to top, fix minor issues

2019-11-12 Thread John Hubbard
An upcoming patch uses try_get_compound_head() more widely, so move it to the top of gup.c. Also fix a tiny spelling error and a checkpatch.pl warning. Signed-off-by: John Hubbard --- mm/gup.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git

[PATCH v4 13/23] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-11-12 Thread John Hubbard
Convert drm/via to use the new pin_user_pages_fast() call, which sets FOLL_PIN. Setting FOLL_PIN is now required for code that requires tracking of pinned pages, and therefore for any code that calls put_user_page(). In partial anticipation of this work, the drm/via driver was already calling

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Sergey Senozhatsky
On (19/11/13 02:41), Dmitry Safonov wrote: [..] > > I don't strongly disagree, but if you look at those results: > git grep 'printk("%s.*", \(lvl\|level\)' > > it seems to be used in quite a few places. Yes, you are right, it is used in some places. That's why I said that I'd prefer to keep

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Dmitry Safonov
On 11/12/19 4:25 AM, Sergey Senozhatsky wrote: > On (19/11/12 02:40), Dmitry Safonov wrote: > [..] >> In my point of view the cost of one-time [mostly build] testing every >> architecture is cheaper than introducing some new smart code that will >> live forever. > > Well, there may be the need to

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Dmitry Safonov
On 11/13/19 1:23 AM, Sergey Senozhatsky wrote: > On (19/11/12 19:12), Sergey Senozhatsky wrote: >> On (19/11/12 09:35), Petr Mladek wrote: >> [..] >>> This is getting too complicated. It would introduce too many >>> hidden rules. While the explicitly passed loglevel parameter >>> is

Re: [PATCH 00/50] Add log level to show_stack()

2019-11-12 Thread Sergey Senozhatsky
On (19/11/12 19:12), Sergey Senozhatsky wrote: > On (19/11/12 09:35), Petr Mladek wrote: > [..] > > This is getting too complicated. It would introduce too many > > hidden rules. While the explicitly passed loglevel parameter > > is straightforward and clear. > > If loglevel is DEFAULT or NOTICE

Re: [PATCH v15 5/9] namei: LOOKUP_IN_ROOT: chroot-like scoped resolution

2019-11-12 Thread Aleksa Sarai
On 2019-11-13, Al Viro wrote: > On Wed, Nov 13, 2019 at 01:44:14PM +1100, Aleksa Sarai wrote: > > On 2019-11-13, Al Viro wrote: > > > On Tue, Nov 05, 2019 at 08:05:49PM +1100, Aleksa Sarai wrote: > > > > > > > @@ -2277,12 +2277,20 @@ static const char *path_init(struct nameidata > > > > *nd,

Re: [PATCH 31/33] powerpc/64: make buildable without CONFIG_COMPAT

2019-11-12 Thread Nicholas Piggin
Michal Suchanek's on November 13, 2019 2:52 am: > There are numerous references to 32bit functions in generic and 64bit > code so ifdef them out. > > Signed-off-by: Michal Suchanek For the most part these seem okay to me. > diff --git a/arch/powerpc/kernel/Makefile

Re: [PATCH v15 5/9] namei: LOOKUP_IN_ROOT: chroot-like scoped resolution

2019-11-12 Thread Al Viro
On Wed, Nov 13, 2019 at 01:44:14PM +1100, Aleksa Sarai wrote: > On 2019-11-13, Al Viro wrote: > > On Tue, Nov 05, 2019 at 08:05:49PM +1100, Aleksa Sarai wrote: > > > > > @@ -2277,12 +2277,20 @@ static const char *path_init(struct nameidata > > > *nd, unsigned flags) > > > > > > nd->m_seq =

RE: [PATCH v4 47/47] soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE

2019-11-12 Thread Qiang Zhao
On Fri, Nov 8, 2019 at 21:01, Rasmus Villemoes wrote: > -Original Message- > From: Rasmus Villemoes > Sent: 2019年11月8日 21:01 > To: Qiang Zhao ; Leo Li ; > Christophe Leroy > Cc: linuxppc-dev@lists.ozlabs.org; linux-arm-ker...@lists.infradead.org; > linux-ker...@vger.kernel.org; Scott

Re: [PATCH v15 5/9] namei: LOOKUP_IN_ROOT: chroot-like scoped resolution

2019-11-12 Thread Aleksa Sarai
On 2019-11-13, Al Viro wrote: > On Tue, Nov 05, 2019 at 08:05:49PM +1100, Aleksa Sarai wrote: > > > @@ -2277,12 +2277,20 @@ static const char *path_init(struct nameidata *nd, > > unsigned flags) > > > > nd->m_seq = read_seqbegin(_lock); > > > > - /* Figure out the starting path and

Re: [PATCH v15 7/9] open: introduce openat2(2) syscall

2019-11-12 Thread Aleksa Sarai
On 2019-11-13, Al Viro wrote: > On Tue, Nov 05, 2019 at 08:05:51PM +1100, Aleksa Sarai wrote: > > +/* > > + * Arguments for how openat2(2) should open the target path. If @resolve is > > + * zero, then openat2(2) operates very similarly to openat(2). > > + * > > + * However, unlike openat(2),

Re: [PATCH RFC 02/15] powerpc/eeh: Rename eeh_pe_get() to eeh_pe_find()

2019-11-12 Thread Oliver O'Halloran
On Wed, Oct 2, 2019 at 4:03 PM Sam Bobroff wrote: > > There are now functions eeh_get_pe() and eeh_pe_get() which seems > likely to cause confusion. > > Keep eeh_get_pe() because "get" is commonly used to refer to acquiring > a reference (which it does), and rename eeh_pe_get() to eeh_pe_find() >

Re: [PATCH v15 7/9] open: introduce openat2(2) syscall

2019-11-12 Thread Al Viro
On Tue, Nov 05, 2019 at 08:05:51PM +1100, Aleksa Sarai wrote: > +/* > + * Arguments for how openat2(2) should open the target path. If @resolve is > + * zero, then openat2(2) operates very similarly to openat(2). > + * > + * However, unlike openat(2), unknown bits in @flags result in -EINVAL

Re: [PATCH v15 6/9] namei: LOOKUP_{IN_ROOT,BENEATH}: permit limited ".." resolution

2019-11-12 Thread Al Viro
On Tue, Nov 05, 2019 at 08:05:50PM +1100, Aleksa Sarai wrote: > One other possible alternative (which previous versions of this patch > used) would be to check with path_is_under() if there was a racing > rename or mount (after re-taking the relevant seqlocks). While this does > work, it results

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 5:35 PM, Dan Williams wrote: > On Tue, Nov 12, 2019 at 5:08 PM John Hubbard wrote: >> >> On 11/12/19 4:58 PM, Dan Williams wrote: >> ... > It's not redundant relative to upstream which does not do anything the > FOLL_LONGTERM in the gup-slow path... but I have not looked at

Re: [PATCH v15 5/9] namei: LOOKUP_IN_ROOT: chroot-like scoped resolution

2019-11-12 Thread Al Viro
On Tue, Nov 05, 2019 at 08:05:49PM +1100, Aleksa Sarai wrote: > @@ -2277,12 +2277,20 @@ static const char *path_init(struct nameidata *nd, > unsigned flags) > > nd->m_seq = read_seqbegin(_lock); > > - /* Figure out the starting path and root (if needed). */ > - if (*s == '/') {

[PATCH AUTOSEL 4.4 21/48] KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR

2019-11-12 Thread Sasha Levin
From: Cameron Kaiser [ Upstream commit 1006284c5e411872333967b1970c2ca46a9e225f ] When an OS (currently only classic Mac OS) is running in KVM-PR and makes a linked jump from code with split hack addressing enabled into code that does not, LR is not correctly updated and reflects the previously

[PATCH AUTOSEL 4.4 15/48] powerpc/pseries: Fix how we iterate over the DTL entries

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit 9258227e9dd1da8feddb07ad9702845546a581c9 ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we look up dtl_idx in the lppaca to determine the number of entries in the buffer. Since lppaca is in big endian, we need to do an endian conversion before using

[PATCH AUTOSEL 4.4 14/48] powerpc/pseries: Fix DTL buffer registration

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit db787af1b8a6b4be428ee2ea7d409dafcaa4a43c ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL buffer for a cpu when the associated file under powerpc/dtl in debugfs is opened. When doing so, we need to set the size of the buffer being

[PATCH AUTOSEL 4.9 65/68] misc: cxl: Fix possible null pointer dereference

2019-11-12 Thread Sasha Levin
From: zhong jiang [ Upstream commit 3dac3583bf1a61db6aaf31dfd752c677a4400afd ] It is not safe to dereference an object before a null test. It is not needed and just remove them. Ftrace can be used instead. Signed-off-by: zhong jiang Acked-by: Andrew Donnellan Acked-by: Frederic Barrat

[PATCH AUTOSEL 4.9 29/68] KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR

2019-11-12 Thread Sasha Levin
From: Cameron Kaiser [ Upstream commit 1006284c5e411872333967b1970c2ca46a9e225f ] When an OS (currently only classic Mac OS) is running in KVM-PR and makes a linked jump from code with split hack addressing enabled into code that does not, LR is not correctly updated and reflects the previously

[PATCH AUTOSEL 4.9 20/68] powerpc/pseries: Fix how we iterate over the DTL entries

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit 9258227e9dd1da8feddb07ad9702845546a581c9 ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we look up dtl_idx in the lppaca to determine the number of entries in the buffer. Since lppaca is in big endian, we need to do an endian conversion before using

[PATCH AUTOSEL 4.9 19/68] powerpc/pseries: Fix DTL buffer registration

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit db787af1b8a6b4be428ee2ea7d409dafcaa4a43c ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL buffer for a cpu when the associated file under powerpc/dtl in debugfs is opened. When doing so, we need to set the size of the buffer being

[PATCH AUTOSEL 4.14 114/115] powerpc/time: Fix clockevent_decrementer initalisation for PR KVM

2019-11-12 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit b4d16ab58c41ff0125822464bdff074cebd0fe47 ] In the recent commit 8b78fdb045de ("powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer") we changed the way we initialise the decrementer clockevent(s). We no longer

[PATCH AUTOSEL 4.14 106/115] misc: cxl: Fix possible null pointer dereference

2019-11-12 Thread Sasha Levin
From: zhong jiang [ Upstream commit 3dac3583bf1a61db6aaf31dfd752c677a4400afd ] It is not safe to dereference an object before a null test. It is not needed and just remove them. Ftrace can be used instead. Signed-off-by: zhong jiang Acked-by: Andrew Donnellan Acked-by: Frederic Barrat

[PATCH AUTOSEL 4.14 055/115] KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR

2019-11-12 Thread Sasha Levin
From: Cameron Kaiser [ Upstream commit 1006284c5e411872333967b1970c2ca46a9e225f ] When an OS (currently only classic Mac OS) is running in KVM-PR and makes a linked jump from code with split hack addressing enabled into code that does not, LR is not correctly updated and reflects the previously

[PATCH AUTOSEL 4.14 048/115] powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer

2019-11-12 Thread Sasha Levin
From: Anton Blanchard [ Upstream commit 8b78fdb045de60a4eb35460092bbd3cffa925353 ] We currently cap the decrementer clockevent at 4 seconds, even on systems with large decrementer support. Fix this by converting the code to use clockevents_register_device() which calculates the upper bound

[PATCH AUTOSEL 4.14 033/115] powerpc/xive: Move a dereference below a NULL test

2019-11-12 Thread Sasha Levin
From: zhong jiang [ Upstream commit cd5ff94577e004e0a4457e70d0ef3a030f4010b8 ] Move the dereference of xc below the NULL test. Signed-off-by: zhong jiang Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/xive/common.c | 7 --- 1 file changed, 4

[PATCH AUTOSEL 4.14 032/115] powerpc/pseries: Fix how we iterate over the DTL entries

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit 9258227e9dd1da8feddb07ad9702845546a581c9 ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we look up dtl_idx in the lppaca to determine the number of entries in the buffer. Since lppaca is in big endian, we need to do an endian conversion before using

[PATCH AUTOSEL 4.14 031/115] powerpc/pseries: Fix DTL buffer registration

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit db787af1b8a6b4be428ee2ea7d409dafcaa4a43c ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL buffer for a cpu when the associated file under powerpc/dtl in debugfs is opened. When doing so, we need to set the size of the buffer being

[PATCH AUTOSEL 4.14 022/115] KVM: PPC: Inform the userspace about TCE update failures

2019-11-12 Thread Sasha Levin
From: Alexey Kardashevskiy [ Upstream commit f7960e299f13f069d6f3d4e157d91bfca2669677 ] We return H_TOO_HARD from TCE update handlers when we think that the next handler (realmode -> virtual mode -> user mode) has a chance to handle the request; H_HARDWARE/H_CLOSED otherwise. This changes the

Re: [PATCH v15 4/9] namei: LOOKUP_BENEATH: O_BENEATH-like scoped resolution

2019-11-12 Thread Al Viro
On Tue, Nov 05, 2019 at 08:05:48PM +1100, Aleksa Sarai wrote: Minor nit here - I'd split "move the conditional call of set_root() into nd_jump_root()" into a separate patch before that one. Makes for fewer distractions in this one. I'd probably fold "and be ready for errors other than -ECHILD"

[PATCH AUTOSEL 4.19 207/209] powerpc/time: Fix clockevent_decrementer initalisation for PR KVM

2019-11-12 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit b4d16ab58c41ff0125822464bdff074cebd0fe47 ] In the recent commit 8b78fdb045de ("powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer") we changed the way we initialise the decrementer clockevent(s). We no longer

[PATCH AUTOSEL 4.19 196/209] misc: cxl: Fix possible null pointer dereference

2019-11-12 Thread Sasha Levin
From: zhong jiang [ Upstream commit 3dac3583bf1a61db6aaf31dfd752c677a4400afd ] It is not safe to dereference an object before a null test. It is not needed and just remove them. Ftrace can be used instead. Signed-off-by: zhong jiang Acked-by: Andrew Donnellan Acked-by: Frederic Barrat

[PATCH AUTOSEL 4.19 122/209] soc: fsl: bman_portals: defer probe after bman's probe

2019-11-12 Thread Sasha Levin
From: Laurentiu Tudor [ Upstream commit e0940b34c40e95d1879691d2474d182c57aae0de ] A crash in bman portal probing could not be triggered (as is the case with qman portals) but it does make calls [1] into the bman driver so lets make sure the bman portal probing happens after bman's. [1]

[PATCH AUTOSEL 4.19 095/209] KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR

2019-11-12 Thread Sasha Levin
From: Cameron Kaiser [ Upstream commit 1006284c5e411872333967b1970c2ca46a9e225f ] When an OS (currently only classic Mac OS) is running in KVM-PR and makes a linked jump from code with split hack addressing enabled into code that does not, LR is not correctly updated and reflects the previously

[PATCH AUTOSEL 4.19 085/209] powerpc/64s/radix: Explicitly flush ERAT with local LPID invalidation

2019-11-12 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit 053c5a753e951c5dd1729af2cf4d8107f2e6e09b ] Local radix TLB flush operations that operate on congruence classes have explicit ERAT flushes for POWER9. The process scoped LPID flush did not have a flush, so add it. Signed-off-by: Nicholas Piggin

[PATCH AUTOSEL 4.19 084/209] powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer

2019-11-12 Thread Sasha Levin
From: Anton Blanchard [ Upstream commit 8b78fdb045de60a4eb35460092bbd3cffa925353 ] We currently cap the decrementer clockevent at 4 seconds, even on systems with large decrementer support. Fix this by converting the code to use clockevents_register_device() which calculates the upper bound

[PATCH AUTOSEL 4.19 057/209] powerpc/xive: Move a dereference below a NULL test

2019-11-12 Thread Sasha Levin
From: zhong jiang [ Upstream commit cd5ff94577e004e0a4457e70d0ef3a030f4010b8 ] Move the dereference of xc below the NULL test. Signed-off-by: zhong jiang Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/xive/common.c | 7 --- 1 file changed, 4

[PATCH AUTOSEL 4.19 056/209] powerpc/pseries: Fix how we iterate over the DTL entries

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit 9258227e9dd1da8feddb07ad9702845546a581c9 ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we look up dtl_idx in the lppaca to determine the number of entries in the buffer. Since lppaca is in big endian, we need to do an endian conversion before using

[PATCH AUTOSEL 4.19 055/209] powerpc/pseries: Fix DTL buffer registration

2019-11-12 Thread Sasha Levin
From: "Naveen N. Rao" [ Upstream commit db787af1b8a6b4be428ee2ea7d409dafcaa4a43c ] When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL buffer for a cpu when the associated file under powerpc/dtl in debugfs is opened. When doing so, we need to set the size of the buffer being

[PATCH AUTOSEL 4.19 042/209] KVM: PPC: Inform the userspace about TCE update failures

2019-11-12 Thread Sasha Levin
From: Alexey Kardashevskiy [ Upstream commit f7960e299f13f069d6f3d4e157d91bfca2669677 ] We return H_TOO_HARD from TCE update handlers when we think that the next handler (realmode -> virtual mode -> user mode) has a chance to handle the request; H_HARDWARE/H_CLOSED otherwise. This changes the

Re: [PATCH v15 3/9] namei: LOOKUP_NO_XDEV: block mountpoint crossing

2019-11-12 Thread Al Viro
On Tue, Nov 05, 2019 at 08:05:47PM +1100, Aleksa Sarai wrote: > @@ -862,6 +870,8 @@ static int nd_jump_root(struct nameidata *nd) > void nd_jump_link(struct path *path) > { > struct nameidata *nd = current->nameidata; > + > + nd->last_magiclink.same_mnt = (nd->path.mnt == path->mnt);

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 5:08 PM John Hubbard wrote: > > On 11/12/19 4:58 PM, Dan Williams wrote: > ... > >>> It's not redundant relative to upstream which does not do anything the > >>> FOLL_LONGTERM in the gup-slow path... but I have not looked at patches > >>> 1-7 to see if something there made

Re: [PATCH v15 2/9] namei: LOOKUP_NO_MAGICLINKS: block magic-link resolution

2019-11-12 Thread Al Viro
On Tue, Nov 05, 2019 at 08:05:46PM +1100, Aleksa Sarai wrote: > @@ -1078,6 +1079,10 @@ const char *get_link(struct nameidata *nd) > } else { > res = get(dentry, inode, >done); > } > + if (nd->flags & LOOKUP_MAGICLINK_JUMPED) { > +

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 4:58 PM, Dan Williams wrote: ... It's not redundant relative to upstream which does not do anything the FOLL_LONGTERM in the gup-slow path... but I have not looked at patches 1-7 to see if something there made it redundant. Oh, the hunk John had below for get_user_pages_remote()

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 3:43 PM Jason Gunthorpe wrote: > > On Tue, Nov 12, 2019 at 02:45:51PM -0800, Dan Williams wrote: > > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > > > > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > > > ... > > > >> -} > > > >> +ret =

Re: [PATCH v15 0/9] open: introduce openat2(2) syscall

2019-11-12 Thread Aleksa Sarai
On 2019-11-12, Kees Cook wrote: > On Tue, Nov 12, 2019 at 12:24:04AM +1100, Aleksa Sarai wrote: > > On 2019-11-05, Aleksa Sarai wrote: > > > This patchset is being developed here: > > > > > > > > > Patch changelog: > > > v15: > > > *

Re: [PATCH v10 7/8] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-11-12 Thread Paul Mackerras
On Tue, Nov 12, 2019 at 06:45:55AM -0800, Ram Pai wrote: > On Tue, Nov 12, 2019 at 10:32:04PM +1100, Paul Mackerras wrote: > > On Mon, Nov 11, 2019 at 11:52:15PM -0800, Ram Pai wrote: > > > There is subtle problem removing that code from the assembly. > > > > > > If the H_SVM_INIT_ABORT hcall

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Jason Gunthorpe
On Tue, Nov 12, 2019 at 02:45:51PM -0800, Dan Williams wrote: > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > > ... > > >> -} > > >> +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | > > >> FOLL_LONGTERM, > > >>

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 3:14 PM, Dan Williams wrote: ... >> >> Is that OK, or did you want to go further (possibly in a follow-up >> patchset, as I'm hoping to get this one in soon)? > > That looks ok. Something to maybe push down into the core in a future Great! I'll post a cleaned up v4 (with the

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 2:45 PM, Dan Williams wrote: > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: >> >> On 11/12/19 12:43 PM, Jason Gunthorpe wrote: >> ... -} +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, +page,

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 3:08 PM John Hubbard wrote: > > On 11/12/19 2:43 PM, Dan Williams wrote: > ... > > Ah, sorry. This was the first time I had looked at this series and > > jumped in without reading the background. > > > > Your patch as is looks ok, I assume you've removed the FOLL_LONGTERM

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 2:43 PM, Dan Williams wrote: ... > Ah, sorry. This was the first time I had looked at this series and > jumped in without reading the background. > > Your patch as is looks ok, I assume you've removed the FOLL_LONGTERM > warning in get_user_pages_remote in another patch? >

Re: [PATCH v15 0/9] open: introduce openat2(2) syscall

2019-11-12 Thread Christian Brauner
On Tue, Nov 12, 2019 at 03:01:26PM -0800, Kees Cook wrote: > On Tue, Nov 12, 2019 at 12:24:04AM +1100, Aleksa Sarai wrote: > > On 2019-11-05, Aleksa Sarai wrote: > > > This patchset is being developed here: > > > > > > > > > Patch

Re: [PATCH v15 0/9] open: introduce openat2(2) syscall

2019-11-12 Thread Kees Cook
On Tue, Nov 12, 2019 at 12:24:04AM +1100, Aleksa Sarai wrote: > On 2019-11-05, Aleksa Sarai wrote: > > This patchset is being developed here: > > > > > > Patch changelog: > > v15: > > * Fix code style for LOOKUP_IN_ROOT handling in

Re: Bug 205201 - overflow of DMA mask and bus mask

2019-11-12 Thread Christian Zigotzky
On 12 November 2019 at 3:41 pm, Christoph Hellwig wrote: On Mon, Nov 11, 2019 at 01:22:55PM +0100, Christian Zigotzky wrote: Now, I can definitely say that this patch does not solve the issue. Do you have another patch for testing or shall I bisect? I'm still interested in the .config and

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > ... > >> -} > >> +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, > >> +page, vmas, NULL); > >> +/* > >> + * The

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 2:24 PM John Hubbard wrote: > > On 11/12/19 1:57 PM, Dan Williams wrote: > ... > >> diff --git a/drivers/vfio/vfio_iommu_type1.c > >> b/drivers/vfio/vfio_iommu_type1.c > >> index d864277ea16f..017689b7c32b 100644 > >> --- a/drivers/vfio/vfio_iommu_type1.c > >> +++

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 12:43 PM, Jason Gunthorpe wrote: ... >> -} >> +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, >> +page, vmas, NULL); >> +/* >> + * The lifetime of a vaddr_get_pfn() page pin is >> + *

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 1:57 PM, Dan Williams wrote: ... >> diff --git a/drivers/vfio/vfio_iommu_type1.c >> b/drivers/vfio/vfio_iommu_type1.c >> index d864277ea16f..017689b7c32b 100644 >> --- a/drivers/vfio/vfio_iommu_type1.c >> +++ b/drivers/vfio/vfio_iommu_type1.c >> @@ -348,24 +348,20 @@ static int

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Mon, Nov 11, 2019 at 4:07 PM John Hubbard wrote: > > As it says in the updated comment in gup.c: current FOLL_LONGTERM > behavior is incompatible with FAULT_FLAG_ALLOW_RETRY because of the > FS DAX check requirement on vmas. > > However, the corresponding restriction in get_user_pages_remote()

Re: [PATCH v3 11/23] IB/{core,hw,umem}: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-11-12 Thread John Hubbard
On 11/12/19 12:44 PM, Jason Gunthorpe wrote: > On Mon, Nov 11, 2019 at 04:06:48PM -0800, John Hubbard wrote: >> @@ -542,7 +541,7 @@ static int ib_umem_odp_map_dma_single_page( >> } >> >> out: >> -put_user_page(page); >> +put_page(page); >> >> if (remove_existing_mapping) {

Re: [PATCH v3 00/23] mm/gup: track dma-pinned pages: FOLL_PIN, FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 12:38 PM, Jason Gunthorpe wrote: > On Mon, Nov 11, 2019 at 04:06:37PM -0800, John Hubbard wrote: >> Hi, >> >> The cover letter is long, so the more important stuff is first: >> >> * Jason, if you or someone could look at the the VFIO cleanup (patch 8) >> and conversion to FOLL_PIN

Re: [PATCH v2 11/29] vmlinux.lds.h: Replace RODATA with RO_DATA

2019-11-12 Thread Kees Cook
On Mon, Nov 11, 2019 at 07:08:51PM +0100, Geert Uytterhoeven wrote: > Hi Kees, > > On Mon, Nov 11, 2019 at 6:23 PM Kees Cook wrote: > > On Mon, Nov 11, 2019 at 05:58:06PM +0100, Geert Uytterhoeven wrote: > > > On Fri, Oct 11, 2019 at 2:07 AM Kees Cook wrote: > > > > There's no reason to keep

Re: [PATCH v4 00/47] QUICC Engine support on ARM and ARM64

2019-11-12 Thread Li Yang
On Mon, Nov 11, 2019 at 5:39 PM Li Yang wrote: > > On Fri, Nov 8, 2019 at 7:05 AM Rasmus Villemoes > wrote: > > > > I'm generally ok with these enhencements and cleanups. But as the > whole patch series touched multiple subsystems, I would like to > collect the Acked-by from Scott, Greg and

  1   2   >