[PATCH] powerpc/512x: Use dma_request_chan() instead dma_request_slave_channel()

2019-12-16 Thread Peter Ujfalusi
dma_request_slave_channel() is a wrapper on top of dma_request_chan() eating up the error code. By using dma_request_chan() directly the driver can support deferred probing against DMA. Signed-off-by: Peter Ujfalusi --- arch/powerpc/platforms/512x/mpc512x_lpbfifo.c | 6 +++--- 1 file changed, 3

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-16 Thread Jan Kara
Hi! On Mon 16-12-19 14:25:12, John Hubbard wrote: > Hi, > > This implements an API naming change (put_user_page*() --> > unpin_user_page*()), and also implements tracking of FOLL_PIN pages. It > extends that tracking to a few select subsystems. More subsystems will > be added in follow up work.

Re: [PATCH v11 23/25] mm/gup: track FOLL_PIN pages

2019-12-16 Thread Jan Kara
On Mon 16-12-19 14:18:59, John Hubbard wrote: > On 12/16/19 4:53 AM, Jan Kara wrote: > > With this fixed, the patch looks good to me so you can then add: > > > > Reviewed-by: Jan Kara > > > > Honza > > > > btw, thanks for the thorough

[RFC PATCH 1/2] mm/mmu_gather: Invalidate TLB correctly on batch allocation failure and flush

2019-12-16 Thread Aneesh Kumar K.V
Architectures for which we have hardware walkers of Linux page table should flush TLB on mmu gather batch allocation failures and batch flush. Some architectures like POWER supports multiple translation modes (hash and radix) and in the case of POWER only radix translation mode needs the above TLBI

[RFC PATCH 2/2] mm/mmu_gather: Avoid multiple page walk cache flush

2019-12-16 Thread Aneesh Kumar K.V
On tlb_finish_mmu() kernel does a tlb flush before mmu gather table invalidate. The mmu gather table invalidate depending on kernel config also does another TLBI. Avoid the later on tlb_finish_mmu(). Signed-off-by: Aneesh Kumar K.V --- mm/mmu_gather.c | 12 +--- 1 file changed, 9 insert

[RFC PATCH 2/2] mm/mmu_gather: Avoid multiple page walk cache flush

2019-12-16 Thread Aneesh Kumar K.V
On tlb_finish_mmu() kernel does a tlb flush before mmu gather table invalidate. The mmu gather table invalidate depending on kernel config also does another TLBI. Avoid the later on tlb_finish_mmu(). Signed-off-by: Aneesh Kumar K.V --- mm/mmu_gather.c | 12 +--- 1 file changed, 9 insert

[RFC PATCH 1/2] mm/mmu_gather: Invalidate TLB correctly on batch allocation failure and flush

2019-12-16 Thread Aneesh Kumar K.V
Architectures for which we have hardware walkers of Linux page table should flush TLB on mmu gather batch allocation failures and batch flush. Some architectures like POWER supports multiple translation modes (hash and radix) and in the case of POWER only radix translation mode needs the above TLBI

Re: [PATCH v18 11/13] open: introduce openat2(2) syscall

2019-12-16 Thread Aleksa Sarai
On 2019-12-16, Florian Weimer wrote: > > diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h > > index 1d338357df8a..58c3a0e543c6 100644 > > --- a/include/uapi/linux/fcntl.h > > +++ b/include/uapi/linux/fcntl.h > > @@ -93,5 +93,40 @@ > > > > #define AT_RECURSIVE 0

[PATCH V3 13/13] powerpc/vas: Free send window in VAS instance after credits returned

2019-12-16 Thread Haren Myneni
NX may be processing requests while trying to close window. Wait until all credits are returned and then free send window from VAS instance. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/

[PATCH V3 12/13] powerpc/vas: Display process stuck message

2019-12-16 Thread Haren Myneni
Process can not close send window until all requests are processed. Means wait until window state is not busy and send credits are returned. Display debug message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 26 +++

[PATCH V3 11/13] powerpc/VAS: Return credits after handling fault

2019-12-16 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 10 ++ arch/powerpc/platforms/powernv/vas-

[PATCH V3 10/13] powerpc/vas: Do not use default credits for receive window

2019-12-16 Thread Haren Myneni
System checkstops if RxFIFO overruns with more requests than the maximum possible number of CRBs allowed in FIFO at any time. So max credits value (rxattr.wcreds_max) is set and is passed to vas_rx_win_open() by the the driver. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas

[PATCH V3 09/13] powerpc/vas: Print CRB and FIFO values

2019-12-16 Thread Haren Myneni
Dump FIFO entry values if could not find send window and print CRB for debugging. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 41 ++ 1 file changed, 41 insertions(+) diff --git a/arch/powerpc/plat

[PATCH V3 08/13] powerpc/vas: Update CSB and notify process for fault CRBs

2019-12-16 Thread Haren Myneni
For each fault CRB, update fault address in CRB (fault_storage_addr) and translation error status in CSB so that user space can touch the fault address and resend the request. If the user space passed invalid CSB address send signal to process with SIGSEGV. Signed-off-by: Sukadev Bhattiprolu Si

[PATCH V3 07/13] powerpc/vas: Take reference to PID and mm for userspace windows

2019-12-16 Thread Haren Myneni
Process close windows after its requests are completed. In multi-thread applications, child can open a window but release FD will not be called upon its exit. Parent thread will be closing it later upon its exit. The parent can also send NX requests with this window and NX can generate page faul

[PATCH V3 06/13] powerpc/vas: Register NX with fault window ID and IRQ port value

2019-12-16 Thread Haren Myneni
For each user space send window, register NX with fault window ID and port value so that NX paste CRBs in this fault FIFO when it sees fault on the request buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 15 +

[PATCH V3 05/13] powerpc/vas: Setup thread IRQ handler per VAS instance

2019-12-16 Thread Haren Myneni
Setup thread IRQ handler per each VAS instance. When NX sees a fault on CRB, kernel gets an interrupt and vas_fault_handler will be executed to process fault CRBs. Read all valid CRBs from fault FIFO, determine the corresponding send window from CRB and process fault requests. Signed-off-by: Suk

[PATCH V3 04/13] powerpc/vas: Setup fault window per VAS instance

2019-12-16 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2 +- arch

[PATCH V3 03/13] powerpc/vas: Read interrupts and vas-port device tree properties

2019-12-16 Thread Haren Myneni
Read interrupts and vas-port device tree properties per each VAS instance. NX generates an interrupt when it sees page fault on the request buffer. Interrupts property is used to setup IRQ for handing the fault and set port value for each user space send window. Signed-off-by: Haren Myneni ---

[PATCH V3 02/13] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-12-16 Thread Haren Myneni
Kernel sets fault address and status in CRB for NX page fault on user space address after processing page fault. User space gets the signal and handles the fault mentioned in CRB by bringing the page in to memory and send NX request again. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

[PATCH V3 01/13] powerpc/vas: Describe vas-port and interrupts properties

2019-12-16 Thread Haren Myneni
Signed-off-by: Haren Myneni --- Documentation/devicetree/bindings/powerpc/ibm,vas.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/powerpc/ibm,vas.txt b/Documentation/devicetree/bindings/powerpc/ibm,vas.txt index bf11d2f..12de08b 100644 --- a/Docum

[Bug 205885] BUG: KASAN: null-ptr-deref in strncpy+0x3c/0x60

2019-12-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205885 Christophe Leroy (christophe.le...@c-s.fr) changed: What|Removed |Added CC||christophe.le

[PATCH V3 00/13] powerpc/vas: Page fault handling for user space NX requests

2019-12-16 Thread Haren Myneni
On power9, Virtual Accelerator Switchboard (VAS) allows user space or kernel to communicate with Nest Accelerator (NX) directly using COPY/PASTE instructions. NX provides verious functionalities such as compression, encryption and etc. But only compression (842 and GZIP formats) is supported in L

Re: [PATCH V2 07/13] powerpc/vas: Take reference to PID and mm for user space windows

2019-12-16 Thread Haren Myneni
On Thu, 2019-12-12 at 05:02 -0800, Christoph Hellwig wrote: > > + if (txwin->user_win) { > > + /* > > +* Window opened by child thread may not be closed when > > +* it exits. So take reference to its pid and release it > > +* when the window is free b

Re: [PATCH v3] powerpc/smp: Use nid as fallback for package_id

2019-12-16 Thread Vasant Hegde
On 12/16/19 7:51 PM, Srikar Dronamraju wrote: Package_id is to find out all cores that are part of the same chip. On PowerNV machines, package_id defaults to chip_id. However ibm,chip_id property is not present in device-tree of PowerVM Lpars. Hence lscpu output shows one core per socket and mult

Re: [PATCH kernel v2 2/4] powerpc/pseries: Allow not having ibm, hypertas-functions::hcall-multi-tce for DDW

2019-12-16 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > On 17/12/2019 10:07, Thiago Jung Bauermann wrote: >> >> Alexey Kardashevskiy writes: >> >>> By default a pseries guest supports a H_PUT_TCE hypercall which maps >>> a single IOMMU page in a DMA window. Additionally the hypervisor may >>> support H_PUT_TCE_INDIREC

[Bug 205885] BUG: KASAN: null-ptr-deref in strncpy+0x3c/0x60

2019-12-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205885 --- Comment #1 from Erhard F. (erhar...@mailbox.org) --- Created attachment 286333 --> https://bugzilla.kernel.org/attachment.cgi?id=286333&action=edit kernel .config (5.5-rc2, PowerMac G4 DP) -- You are receiving this mail because: You are wa

[Bug 205885] New: BUG: KASAN: null-ptr-deref in strncpy+0x3c/0x60

2019-12-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205885 Bug ID: 205885 Summary: BUG: KASAN: null-ptr-deref in strncpy+0x3c/0x60 Product: Platform Specific/Hardware Version: 2.5 Kernel Version: 5.5-rc2 Hardware: PPC-32 OS: Linux

Re: [PATCH kernel v2 2/4] powerpc/pseries: Allow not having ibm,hypertas-functions::hcall-multi-tce for DDW

2019-12-16 Thread Alexey Kardashevskiy
On 17/12/2019 10:07, Thiago Jung Bauermann wrote: > > Alexey Kardashevskiy writes: > >> By default a pseries guest supports a H_PUT_TCE hypercall which maps >> a single IOMMU page in a DMA window. Additionally the hypervisor may >> support H_PUT_TCE_INDIRECT/H_STUFF_TCE which update multiple

Re: [PATCH kernel v2 4/4] powerpc/pseries/svm: Allow IOMMU to work in SVM

2019-12-16 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > H_PUT_TCE_INDIRECT uses a shared page to send up to 512 TCE to > a hypervisor in a single hypercall. This does not work for secure VMs > as the page needs to be shared or the VM should use H_PUT_TCE instead. > > This disables H_PUT_TCE_INDIRECT by clearing the FW_

Re: [PATCH kernel v2 3/4] powerpc/pseries/iommu: Separate FW_FEATURE_MULTITCE to put/stuff features

2019-12-16 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > H_PUT_TCE_INDIRECT allows packing up to 512 TCE updates into a single > hypercall; H_STUFF_TCE can clear lots in a single hypercall too. > > However, unlike H_STUFF_TCE (which writes the same TCE to all entries), > H_PUT_TCE_INDIRECT uses a 4K page with new TCEs.

Re: [PATCH kernel v2 2/4] powerpc/pseries: Allow not having ibm, hypertas-functions::hcall-multi-tce for DDW

2019-12-16 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > By default a pseries guest supports a H_PUT_TCE hypercall which maps > a single IOMMU page in a DMA window. Additionally the hypervisor may > support H_PUT_TCE_INDIRECT/H_STUFF_TCE which update multiple TCEs at once; > this is advertised via the device tree /rtas/

Re: [PATCH kernel v2 1/4] Revert "powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests"

2019-12-16 Thread Thiago Jung Bauermann
Hello Alexey, Alexey Kardashevskiy writes: > From: Ram Pai > > This reverts commit edea902c1c1efb855f77e041f9daf1abe7a9768a. > > At the time the change allowed direct DMA ops for secure VMs; however > since then we switched on using SWIOTLB backed with IOMMU (direct mapping) > and to make thi

[PATCH v11 25/25] selftests/vm: run_vmtests: invoke gup_benchmark with basic FOLL_PIN coverage

2019-12-16 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) R

[PATCH v11 22/25] mm, tree-wide: rename put_user_page*() to unpin_user_page*()

2019-12-16 Thread John Hubbard
In order to provide a clearer, more symmetric API for pinning and unpinning DMA pages. This way, pin_user_pages*() calls match up with unpin_user_pages*() calls, and the API is a lot closer to being self-explanatory. Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- Documentation/core-api/p

[PATCH v11 07/25] vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call

2019-12-16 Thread John Hubbard
Update VFIO to take advantage of the recently loosened restriction on FOLL_LONGTERM with get_user_pages_remote(). Also, now it is possible to fix a bug: the VFIO caller is logically a FOLL_LONGTERM user, but it wasn't setting FOLL_LONGTERM. Also, remove an unnessary pair of calls that were releasi

[PATCH v11 12/25] IB/{core, hw, umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2019-12-16 Thread John Hubbard
Convert infiniband to use the new pin_user_pages*() calls. Also, revert earlier changes to Infiniband ODP that had it using put_user_page(). ODP is "Case 3" in Documentation/core-api/pin_user_pages.rst, which is to say, normal get_user_pages() and put_page() is the API to use there. The new pin_u

[PATCH v11 17/25] media/v4l2-core: set pages dirty upon releasing DMA buffers

2019-12-16 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 set_page_

[PATCH v11 21/25] mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"

2019-12-16 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" phr

[PATCH v11 23/25] mm/gup: track FOLL_PIN pages

2019-12-16 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 unpin_user_page(). The effect is similar to FOLL_GET, and may be thought of as "FOLL_GET for DIO and/or RDMA use". P

[PATCH v11 15/25] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-12-16 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 put_us

[PATCH v11 20/25] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2019-12-16 Thread John Hubbard
1. Convert from get_user_pages() to pin_user_pages(). 2. As required by pin_user_pages(), release these pages via put_user_page(). Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- arch/powerpc/mm/book3s64/iommu_api.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff -

[PATCH v11 08/25] mm/gup: allow FOLL_FORCE for get_user_pages_fast()

2019-12-16 Thread John Hubbard
Commit 817be129e6f2 ("mm: validate get_user_pages_fast flags") allowed only FOLL_WRITE and FOLL_LONGTERM to be passed to get_user_pages_fast(). This, combined with the fact that get_user_pages_fast() falls back to "slow gup", which *does* accept FOLL_FORCE, leads to an odd situation: if you need FO

[PATCH v11 16/25] net/xdp: set FOLL_PIN via pin_user_pages()

2019-12-16 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 v11 10/25] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-12-16 Thread John Hubbard
Introduce pin_user_pages*() variations of get_user_pages*() calls, and also pin_longterm_pages*() variations. For now, these are placeholder calls, until the various call sites are converted to use the correct get_user_pages*() or pin_user_pages*() API. These variants will eventually all set FOLL

[PATCH v11 05/25] goldish_pipe: rename local pin_user_pages() routine

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

[PATCH v11 09/25] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-12-16 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: Leon Romanovsky Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Jason Gunthorpe Rev

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

2019-12-16 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 v11 19/25] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-12-16 Thread John Hubbard
1. Change vfio from get_user_pages_remote(), to pin_user_pages_remote(). 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(). Note that this effectively changes the code's behavior in vfio_iommu_type1.c:

[PATCH v11 18/25] media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-12-16 Thread John Hubbard
1. Change v4l2 from get_user_pages() to pin_user_pages(). 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 Cc: Ira Weiny Signed-off-by: John Hubbard --- drivers/media/v4l2-

[PATCH v11 24/25] mm/gup_benchmark: support pin_user_pages() and related calls

2019-12-16 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 correspon

[PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-16 Thread John Hubbard
Hi, This implements an API naming change (put_user_page*() --> unpin_user_page*()), and also implements tracking of FOLL_PIN pages. It extends that tracking to a few select subsystems. More subsystems will be added in follow up work. Christoph Hellwig, a point of interest: a) I've moved the bulk

[PATCH v11 01/25] mm/gup: factor out duplicate code from four routines

2019-12-16 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 functi

[PATCH v11 06/25] mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM

2019-12-16 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 v11 13/25] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-12-16 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 p

[PATCH v11 14/25] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-12-16 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 put_

[PATCH v11 11/25] goldish_pipe: convert to pin_user_pages() and put_user_page()

2019-12-16 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 i

[PATCH v11 03/25] mm: Cleanup __put_devmap_managed_page() vs ->page_free()

2019-12-16 Thread John Hubbard
From: Dan Williams After the removal of the device-public infrastructure there are only 2 ->page_free() call backs in the kernel. One of those is a device-private callback in the nouveau driver, the other is a generic wakeup needed in the DAX case. In the hopes that all ->page_free() callbacks ca

[PATCH v11 02/25] mm/gup: move try_get_compound_head() to top, fix minor issues

2019-12-16 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. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup.c | 29 +++---

Re: [PATCH v11 23/25] mm/gup: track FOLL_PIN pages

2019-12-16 Thread John Hubbard
On 12/16/19 4:53 AM, Jan Kara wrote: ... I'd move this still a bit higher - just after VM_BUG_ON_PAGE() and before if (flags & FOLL_TOUCH) test. Because touch_pmd() can update page tables and we don't won't that if we're going to fail the fault. Done. I'll post a full v11 series shortly. Wi

Re: [PATCH v5 1/2] ASoC: dt-bindings: fsl_asrc: add compatible string for imx8qm & imx8qxp

2019-12-16 Thread Rob Herring
On Wed, 4 Dec 2019 20:00:18 +0800, Shengjiu Wang wrote: > Add compatible string "fsl,imx8qm-asrc" for imx8qm platform, > "fsl,imx8qxp-asrc" for imx8qxp platform. > > There are two asrc modules in imx8qm & imx8qxp, the clock mapping is > different for each other, so add new property "fsl,asrc-clk-

[PATCH v3 7/7] parisc/perf: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_SYS_PERFMON capability. Signed-off-

[PATCH v3 6/7] powerpc/perf: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_SYS_PERFMON capability. Signed-off-

[PATCH v3 5/7] trace/bpf_trace: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to bpf_trace monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to bpf_trace monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure bpf_trace monitoring is discouraged with respect to CAP_SYS_PERFMO

[PATCH v3 4/7] drm/i915/perf: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to i915_perf monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to i915_perf subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure i915_perf monitoring is discouraged with respect to CAP_SYS_PERFMON

[PATCH v3 3/7] perf tool: extend Perf tool with CAP_SYS_PERFMON capability support

2019-12-16 Thread Alexey Budankov
Extend error messages to mention CAP_SYS_PERFMON capability as an option to substitute CAP_SYS_ADMIN capability for secure system performance monitoring and observability. Make perf_event_paranoid_check() to be aware of CAP_SYS_PERFMON capability. Signed-off-by: Alexey Budankov --- tools/perf/

[PATCH v3 2/7] perf/core: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to perf_events monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to perf_events subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure perf_events monitoring is discouraged with respect to CAP_SYS_P

[PATCH v3 1/7] capabilities: introduce CAP_SYS_PERFMON to kernel and user space

2019-12-16 Thread Alexey Budankov
Introduce CAP_SYS_PERFMON capability devoted to secure system performance monitoring and observability so that CAP_SYS_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other subsystems of the kernel. CAP_SYS_PERFMON intends to harden system secur

[PATCH v3 0/7] Introduce CAP_SYS_PERFMON to secure system performance monitoring and observability

2019-12-16 Thread Alexey Budankov
Currently access to perf_events, i915_perf and other performance monitoring and observability subsystems of the kernel is open for a privileged process [1] with CAP_SYS_ADMIN capability enabled in the process effective set [2]. This patch set introduces CAP_SYS_PERFMON capability devoted to secu

RE: [PATCH v2 2/7] perf/core: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Lubashev, Igor
On Mon, Dec 16, 2019 at 2:15 AM, Alexey Budankov wrote: > > Open access to perf_events monitoring for CAP_SYS_PERFMON privileged > processes. > For backward compatibility reasons access to perf_events subsystem remains > open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage > for s

Re: [PATCH v2 1/7] capabilities: introduce CAP_SYS_PERFMON to kernel and user space

2019-12-16 Thread Stephen Smalley
On 12/16/19 2:14 AM, Alexey Budankov wrote: Introduce CAP_SYS_PERFMON capability devoted to secure system performance monitoring and observability operations so that CAP_SYS_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monit

[PATCH] powerpc/83xx: update kmeter1 defconfig and dts

2019-12-16 Thread Holger Brunck
From: Matteo Ghidoni The defconfig is synchronized and the missing MTD_PHYSMAP, DEVTMPFS and I2C MUX support are switched on. Additionally the I2C mux device is added to the DTS with its attached temperature sensors and I2C clock frequency is lowered. Signed-off-by: Matteo Ghidoni Signed-off-b

Re: [PATCH v18 11/13] open: introduce openat2(2) syscall

2019-12-16 Thread Florian Weimer
* Aleksa Sarai: > diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h > index 1d338357df8a..58c3a0e543c6 100644 > --- a/include/uapi/linux/fcntl.h > +++ b/include/uapi/linux/fcntl.h > @@ -93,5 +93,40 @@ > > #define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */

Re: [PATCH v2 2/7] perf/core: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
On 16.12.2019 19:12, Lubashev, Igor wrote: > On Mon, Dec 16, 2019 at 2:15 AM, Alexey Budankov > wrote: >> >> Open access to perf_events monitoring for CAP_SYS_PERFMON privileged >> processes. >> For backward compatibility reasons access to perf_events subsystem remains >> open for CAP_SYS_ADMIN

Re: [PATCH v2 2/7] perf/core: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
On 16.12.2019 19:12, Lubashev, Igor wrote: > On Mon, Dec 16, 2019 at 2:15 AM, Alexey Budankov > wrote: >> >> Open access to perf_events monitoring for CAP_SYS_PERFMON privileged >> processes. >> For backward compatibility reasons access to perf_events subsystem remains >> open for CAP_SYS_ADMIN p

Re: [PATCH net v2] net/ibmvnic: Fix typo in retry check

2019-12-16 Thread Thomas Falcon
On 12/13/19 7:27 PM, Jakub Kicinski wrote: On Wed, 11 Dec 2019 09:38:39 -0600, Thomas Falcon wrote: This conditional is missing a bang, with the intent being to break when the retry count reaches zero. Fixes: 476d96ca9c ("ibmvnic: Bound waits for device queries") Suggested-by: Juliet Kim Sig

Re: [v5 3/3] Documentation: dt: binding: fsl: Add 'fsl,ippdexpcr1-alt-addr' property

2019-12-16 Thread Rob Herring
On Tue, 3 Dec 2019 20:28:18 +0800, Biwen Li wrote: > The 'fsl,ippdexpcr1-alt-addr' property is used to handle an errata A-008646 > on LS1021A > > Signed-off-by: Biwen Li > --- > Change in v5: > - none > > Change in v4: > - rename property name > fsl,ippdexpcr-alt-addr -> fsl

Re: [PATCH 1/2] spi: fsl: don't map irq during probe

2019-12-16 Thread Sasha Levin
Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: 500a32abaf81 ("spi: fsl: Call irq_dispose_mapping in err path"). The bot has tested the following trees: v5.4.2, v5.3.15, v4.19.88, v4.14.158. v5.4.2: Build OK! v5.3.15: Failed to

[PATCH v5 5/5] powerpc/numa: Remove late request for home node associativity

2019-12-16 Thread Srikar Dronamraju
With commit ("powerpc/numa: Early request for home node associativity"), commit 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot") which was requesting home node associativity becomes redundant. Hence remove the late request for home node associativity. Signed-off-by: S

[PATCH v5 4/5] powerpc/numa: Early request for home node associativity

2019-12-16 Thread Srikar Dronamraju
Currently the kernel detects if its running on a shared lpar platform and requests home node associativity before the scheduler sched_domains are setup. However between the time NUMA setup is initialized and the request for home node associativity, workqueue initializes its per node cpumask. The pe

[PATCH v5 2/5] powerpc/numa: Handle extra hcall_vphn error cases

2019-12-16 Thread Srikar Dronamraju
Currently code handles H_FUNCTION, H_SUCCESS, H_HARDWARE return codes. However hcall_vphn can return other return codes. Now it also handles H_PARAMETER return code. Also the rest return codes are handled under the default case. Signed-off-by: Srikar Dronamraju Cc: Michael Ellerman Cc: Nicholas

[PATCH v5 3/5] powerpc/numa: Use cpu node map of first sibling thread

2019-12-16 Thread Srikar Dronamraju
All the sibling threads of a core have to be part of the same node. To ensure that all the sibling threads map to the same node, always lookup/update the cpu-to-node map of the first thread in the core. Signed-off-by: Srikar Dronamraju Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Nathan Lynch

[PATCH v5 0/5] Early node associativity

2019-12-16 Thread Srikar Dronamraju
Note: (Only patch 3 changes from v3) Abdul reported a warning on a shared lpar. "WARNING: workqueue cpumask: online intersect > possible intersect". This is because per node workqueue possible mask is set very early in the boot process even before the system was querying the home node associativi

[PATCH v5 1/5] powerpc/vphn: Check for error from hcall_vphn

2019-12-16 Thread Srikar Dronamraju
There is no value in unpacking associativity, if H_HOME_NODE_ASSOCIATIVITY hcall has returned an error. Signed-off-by: Srikar Dronamraju Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Nathan Lynch Cc: linuxppc-dev@lists.ozlabs.org Cc: Abdul Haleem Cc: Satheesh Rajendran Reported-by: Abdul Hale

[PATCH v5 0/5] Early node associativity

2019-12-16 Thread Srikar Dronamraju
Note: (Only patch 3 changes from v3) Abdul reported a warning on a shared lpar. "WARNING: workqueue cpumask: online intersect > possible intersect". This is because per node workqueue possible mask is set very early in the boot process even before the system was querying the home node associativi

[PATCH v3] powerpc/smp: Use nid as fallback for package_id

2019-12-16 Thread Srikar Dronamraju
Package_id is to find out all cores that are part of the same chip. On PowerNV machines, package_id defaults to chip_id. However ibm,chip_id property is not present in device-tree of PowerVM Lpars. Hence lscpu output shows one core per socket and multiple cores. To overcome this, use nid as the pa

[PATCH v3] powerpc: Fix __clear_user() with KUAP enabled

2019-12-16 Thread Michael Ellerman
From: Andrew Donnellan The KUAP implementation adds calls in clear_user() to enable and disable access to userspace memory. However, it doesn't add these to __clear_user(), which is used in the ptrace regset code. As there's only one direct user of __clear_user() (the regset code), and the time

Re: [PATCH v11 23/25] mm/gup: track FOLL_PIN pages

2019-12-16 Thread Jan Kara
On Fri 13-12-19 19:26:17, John Hubbard wrote: > 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 unpin_user_page(). > The effect is similar to FOLL_GET, and may

[PATCH 0/1] macintosh: replace i2c_new_probed_device with an ERR_PTR variant

2019-12-16 Thread Wolfram Sang
In the on-going mission to let i2c_new_* calls return an ERR_PTR instead of NULL, here is a series for this subsystem converting i2c_new_probed_device() to the newly introduced i2c_new_scanned_device(). Based on v5.5-rc1 and build tested. Please apply via your tree. Thanks, Wolfram Wolfram

[PATCH 1/1] macintosh: convert to i2c_new_scanned_device

2019-12-16 Thread Wolfram Sang
Move from the deprecated i2c_new_probed_device() to the new i2c_new_scanned_device(). Make use of the new ERRPTR if suitable. Signed-off-by: Wolfram Sang --- Build tested only. drivers/macintosh/therm_windtunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/m

Re: READ_ONCE() + STACKPROTECTOR_STRONG == :/ (was Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.5-2 tag (topic/kasan-bitops))

2019-12-16 Thread Arnd Bergmann
On Mon, Dec 16, 2019 at 11:28 AM Will Deacon wrote: > On Fri, Dec 13, 2019 at 02:17:08PM +0100, Arnd Bergmann wrote: > > On Thu, Dec 12, 2019 at 9:50 PM Linus Torvalds > > wrote: > > > On Thu, Dec 12, 2019 at 11:34 AM Will Deacon wrote: > > > > The root of my concern in all of this, and what sta

Applied "spi: fsl: use platform_get_irq() instead of of_irq_to_resource()" to the spi tree

2019-12-16 Thread Mark Brown
The patch spi: fsl: use platform_get_irq() instead of of_irq_to_resource() has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.5 All being well this means that it will be integrated into the linux-next tree (usually sometime in the nex

Re: READ_ONCE() + STACKPROTECTOR_STRONG == :/ (was Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.5-2 tag (topic/kasan-bitops))

2019-12-16 Thread Peter Zijlstra
On Mon, Dec 16, 2019 at 10:28:06AM +, Will Deacon wrote: > However, enabling this for 32-bit ARM is total carnage; as Linus mentioned, > a whole bunch of code appears to be relying on atomic 64-bit access of > READ_ONCE(); the perf ring buffer, io_uring, the scheduler, pm_runtime, > cpuidle, ..

[PATCH v2] powerpc/pseries/cmm: fix managed page counts when migrating pages between zones

2019-12-16 Thread David Hildenbrand
Commit 63341ab03706 (virtio-balloon: fix managed page counts when migrating pages between zones) fixed a long existing BUG in the virtio-balloon driver when pages would get migrated between zones. I did not try to reproduce on powerpc, but looking at the code, the same should apply to powerpc/cmm

Re: READ_ONCE() + STACKPROTECTOR_STRONG == :/ (was Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.5-2 tag (topic/kasan-bitops))

2019-12-16 Thread Will Deacon
On Fri, Dec 13, 2019 at 02:17:08PM +0100, Arnd Bergmann wrote: > On Thu, Dec 12, 2019 at 9:50 PM Linus Torvalds > wrote: > > On Thu, Dec 12, 2019 at 11:34 AM Will Deacon wrote: > > > The root of my concern in all of this, and what started me looking at it > > > in > > > the first place, is the i

[PATCH v2 7/7] parisc/perf: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_SYS_PERFMON capability. Signed-off-

[PATCH v2 6/7] powerpc/perf: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_SYS_PERFMON capability. Signed-off-

[PATCH v2 5/7] trace/bpf_trace: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to bpf_trace monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to bpf_trace monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure bpf_trace monitoring is discouraged with respect to CAP_SYS_PERFMO

[PATCH v2 4/7] drm/i915/perf: open access for CAP_SYS_PERFMON privileged process

2019-12-16 Thread Alexey Budankov
Open access to i915_perf monitoring for CAP_SYS_PERFMON privileged processes. For backward compatibility reasons access to i915_perf subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure i915_perf monitoring is discouraged with respect to CAP_SYS_PERFMON

[PATCH v2 3/7] perf tool: extend Perf tool with CAP_SYS_PERFMON capability support

2019-12-16 Thread Alexey Budankov
Extend error messages to mention CAP_SYS_PERFMON capability as an option to substitute CAP_SYS_ADMIN capability for secure system performance monitoring and observability operations [1]. Make perf_event_paranoid_check() to be aware of CAP_SYS_PERFMON capability. [1] https://www.kernel.org/doc/ht

  1   2   >