Re: [PATCH v3 02/22] compat: provide compat_ptr() on all architectures

2020-01-07 Thread Arnd Bergmann
On Tue, Jan 7, 2020 at 3:05 AM Michael Ellerman wrote: > Arnd Bergmann writes: > > + > > +static inline compat_uptr_t ptr_to_compat(void __user *uptr) > > +{ > > + return (u32)(unsigned long)uptr; > > +} > > Is there a reason we cast to u32 directly instead of using compat_uptr_t? Probably

Re: [PATCH v3 02/22] compat: provide compat_ptr() on all architectures

2020-01-07 Thread H. Peter Anvin
,oprofile-l...@lists.sf.net,linux-s390 ,sparclinux From: h...@zytor.com Message-ID: <41625f06-d755-4c82-86df-a9415feee...@zytor.com> On January 7, 2020 12:08:31 AM PST, Arnd Bergmann wrote: >On Tue, Jan 7, 2020 at 3:05 AM Michael Ellerman >wrote: >> Arnd Bergmann writes: >> > + >> > +static

Re: [PATCH v6 3/5] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime

2020-01-07 Thread Michael Ellerman
Christophe Leroy writes: > Russell Currey a écrit : > >> Very rudimentary, just >> >> echo 1 > [debugfs]/check_wx_pages >> >> and check the kernel log. Useful for testing strict module RWX. > > For testing strict module RWX you could instead implement > module_arch_freeing_init() and

[Bug 206049] alg: skcipher: p8_aes_xts encryption unexpectedly succeeded on test vector "random: len=0 klen=64"; expected_error=-22, cfg="random: inplace may_sleep use_finup src_divs=[66.99%@+1

2020-01-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206049 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|ASSIGNED|NEEDINFO --

[PATCH] powerpc/32: don't restore r0, r6-r8 on exception entry path after trace_hardirqs_off()

2020-01-07 Thread Christophe Leroy
Since commit b86fb88855ea ("powerpc/32: implement fast entry for syscalls on non BOOKE") and commit 1a4b739bbb4f ("powerpc/32: implement fast entry for syscalls on BOOKE"), syscalls don't use the exception entry path anymore. It is therefore pointless to restore r0 and r6-r8 after calling

Re: [PATCH v3] powerpc/kernel/sysfs: Add new config option PMU_SYSFS to enable PMU SPRs sysfs file creation

2020-01-07 Thread Michael Ellerman
Kajol Jain writes: > diff --git a/arch/powerpc/platforms/Kconfig.cputype > b/arch/powerpc/platforms/Kconfig.cputype > index 12543e53fa96..58c72b9b8902 100644 > --- a/arch/powerpc/platforms/Kconfig.cputype > +++ b/arch/powerpc/platforms/Kconfig.cputype > @@ -417,6 +417,12 @@ config PPC_MM_SLICES

[Bug 206049] alg: skcipher: p8_aes_xts encryption unexpectedly succeeded on test vector "random: len=0 klen=64"; expected_error=-22, cfg="random: inplace may_sleep use_finup src_divs=[66.99%@+1

2020-01-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206049 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|NEW |ASSIGNED

Re: [PATCH] powerpc: add support for folded p4d page tables

2020-01-07 Thread Christophe Leroy
Le 05/01/2020 à 08:02, Mike Rapoport a écrit : On Thu, Jan 02, 2020 at 05:42:31PM +0100, Christophe Leroy wrote: Mike Rapoport a écrit : Any updates on this? Checkpatch reported several points, see https://patchwork.ozlabs.org/patch/1206344/ Well, for the most part checkpatch is

Re: [LKP] Re: [mm/debug] 87c4696d57: kernel_BUG_at_include/linux/mm.h

2020-01-07 Thread Rong Chen
On 1/7/20 2:46 PM, Anshuman Khandual wrote: On 12/27/2019 07:52 PM, kernel test robot wrote: [9.781974] kernel BUG at include/linux/mm.h:592! [9.782810] invalid opcode: [#1] PTI [9.783443] CPU: 0 PID: 1 Comm: swapper Not tainted 5.5.0-rc3-1-g87c4696d57b5e #1 [

Re: PPC64: G5 & 4k/64k page size (was: Re: Call for report - G5/PPC970 status)

2020-01-07 Thread Michel Dänzer
On 2020-01-06 8:11 p.m., Romain Dolbeau wrote: > > Unfortunately I don't have a PCIe OpenFirmware ATI card to test the > theory further. FWIW, a non-OF Radeon >= R(V)5xx card should work in Linux (though obviously won't light up in OF itself or MacOS). -- Earthling Michel Dänzer

[PATCH] powerpc/32: refactor pmd_offset(pud_offset(pgd_offset...

2020-01-07 Thread Christophe Leroy
At several places pmd pointer is retrieved through the same action: pmd = pmd_offset(pud_offset(pgd_offset(mm, addr), addr), addr); or pmd = pmd_offset(pud_offset(pgd_offset_k(addr), addr), addr); Refactor this by implementing two helpers pmd_ptr() and pmd_ptr_k() This will

[Bug 206049] alg: skcipher: p8_aes_xts encryption unexpectedly succeeded on test vector "random: len=0 klen=64"; expected_error=-22, cfg="random: inplace may_sleep use_finup src_divs=[66.99%@+1

2020-01-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206049 --- Comment #4 from Erhard F. (erhar...@mailbox.org) --- (In reply to Daniel Axtens from comment #2) > Hi Erhard, > > I'm having a look. Does this reproduce reliably/often? Or was it a one-off? Hi Daniel, This shows up every time booting the

Re: PPC64: G5 & 4k/64k page size

2020-01-07 Thread Bertrand
On 06/01/2020 19:30, Romain Dolbeau wrote: Le dim. 5 janv. 2020 à 16:06, Bertrand Dekoninck a écrit : I can now test on powermac 7,3 (with an ATI card) How can I build a deb package of this kernel ? Or is there a package to download somewhere ? I've tested the 5.5-rc package with the link

[RFT 02/13] alpha: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 02/13] sh: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 05/13] powerpc: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 08/13] drm/nouveau: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 11/13] net: wireless: rtl818x: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 12/13] ntb: intel: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

Re: [RFT 03/13] sh: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Arnd Bergmann
On Tue, Jan 7, 2020 at 5:54 PM Krzysztof Kozlowski wrote: > > The ioreadX() helpers have inconsistent interface. On some architectures > void *__iomem address argument is a pointer to const, on some not. > > Implementations of ioreadX() do not modify the memory under the address > so they can be

Re: [PATCH v4 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2020-01-07 Thread Ram Pai
On Mon, Jan 06, 2020 at 06:02:37PM -0800, Sukadev Bhattiprolu wrote: > Ram Pai [linux...@us.ibm.com] wrote: > > > > One small comment.. H_STATE is a better return code than H_UNSUPPORTED. > > > > Here is the updated patch - we now return H_STATE if the abort call is > made after the VM has gone

[RFT 03/13] alpha: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 04/13] parisc: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 07/13] drm/mgag200: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 10/13] net: wireless: ath5k: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

Re: [RFT 06/13] arc: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Arnd Bergmann
On Tue, Jan 7, 2020 at 5:54 PM Krzysztof Kozlowski wrote: > > The ioreadX() helpers have inconsistent interface. On some architectures > void *__iomem address argument is a pointer to const, on some not. > > Implementations of ioreadX() do not modify the memory under the > address so they can be

[RFT 06/13] arc: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

Re: PPC64: G5 & 4k/64k page size

2020-01-07 Thread Romain Dolbeau
Le mar. 7 janv. 2020 à 16:27, Bertrand a écrit : > I've tested the 5.5-rc package with the link you gave hereafter. When > you said "working kernel", did you mean it would not crash ? It doesn't > for me. I can boot successfully. Yes, unlike the default Debian build, this one has 4 KiB page

[RFT 00/13] iomap: Constify ioreadX() iomem argument

2020-01-07 Thread Krzysztof Kozlowski
Hi, The ioread8/16/32() and others have inconsistent interface among the architectures: some taking address as const, some not. It seems there is nothing really stopping all of them to take pointer to const. Patchset was really tested on all affected architectures. Build testing is in progress

[RFT 01/13] iomap: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 03/13] sh: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 09/13] media: fsl-viu: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[RFT 13/13] virtio: pci: Constify ioreadX() iomem argument (as in generic implementation)

2020-01-07 Thread Krzysztof Kozlowski
The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among

[PATCH 00/12] i2c: convert subsystem to use i2c_new_client_device()

2020-01-07 Thread Wolfram Sang
This patch series converts the I2C subsystem to use the new API. Drivers have been build tested. There is one user left in the SMBus part of the core which will need a seperate series because all users of this function need to be checked/converted, too. Except for documentation patches, the

Re: [PATCH v3 02/22] compat: provide compat_ptr() on all architectures

2020-01-07 Thread Heiko Carstens
On Thu, Jan 02, 2020 at 03:55:20PM +0100, Arnd Bergmann wrote: > In order to avoid needless #ifdef CONFIG_COMPAT checks, > move the compat_ptr() definition to linux/compat.h > where it can be seen by any file regardless of the > architecture. > > Only s390 needs a special definition, this can use

[PATCH 05/12] i2c: powermac: convert to use i2c_new_client_device()

2020-01-07 Thread Wolfram Sang
Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang --- Build tested only. drivers/i2c/busses/i2c-powermac.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-powermac.c

Re: PPC64: G5 & 4k/64k page size

2020-01-07 Thread Bertrand
On 07/01/2020 18:13, Romain Dolbeau wrote: Le mar. 7 janv. 2020 à 16:27, Bertrand a écrit : I've tested the 5.5-rc package with the link you gave hereafter. When you said "working kernel", did you mean it would not crash ? It doesn't for me. I can boot successfully. As your machine is

Re: Freescale network device not activated on mpc8360 (kmeter1 board)

2020-01-07 Thread Heiner Kallweit
On 07.01.2020 14:05, Matteo Ghidoni wrote: > Hi all, > > With the introduction of the following patch, we are facing an issue with the > activation of the Freescale network device (ucc_geth driver) on our kmeter1 > board based on a MPC8360: +Li as ucc_geth maintainer Can you describe the

Patch for '5.3.7 64-bits kernel doesn't boot on G5 Quad' found (was: Re: PPC64: G5 & 4k/64k page size)

2020-01-07 Thread Romain Dolbeau
Hello all, Great news: Aneesh sent me a patch that solves the problem on my G5 Quad :-) I don't know whether he considers it a 'workaround' or if it's the 'proper' patch for upstream, so beware. It's a one-liner so I attach it to this message: those affected can test it as well to confirm if

[PATCH v2 7/8] mm/memory_hotplug: Add pgprot_t to mhp_modifiers

2020-01-07 Thread Logan Gunthorpe
devm_memremap_pages() is currently used by the PCI P2PDMA code to create struct page mappings for IO memory. At present, these mappings are created with PAGE_KERNEL which implies setting the PAT bits to be WB. However, on x86, an mtrr register will typically override this and force the cache type

[PATCH v2 2/8] mm/memory_hotplug: Rename mhp_restrictions to mhp_modifiers

2020-01-07 Thread Logan Gunthorpe
The mhp_restrictions struct really doesn't specify anything resembling a restriction anymore so rename it to be mhp_modifiers. Signed-off-by: Logan Gunthorpe --- arch/arm64/mm/mmu.c| 4 ++-- arch/ia64/mm/init.c| 4 ++-- arch/powerpc/mm/mem.c | 4 ++--

[PATCH v2 6/8] s390/mm: Thread pgprot_t through vmem_add_mapping()

2020-01-07 Thread Logan Gunthorpe
In prepartion to support a pgprot_t argument for arch_add_memory(). Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Logan Gunthorpe --- arch/s390/include/asm/pgtable.h | 3 ++- arch/s390/mm/extmem.c | 3 ++- arch/s390/mm/init.c | 2 +-

Re: [PATCH v6 1/6] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_*

2020-01-07 Thread Hari Bathini
On 11/12/19 9:39 PM, Sourabh Jain wrote: > Add missing ABI documentation for existing FADump sysfs files. > > Signed-off-by: Sourabh Jain The patch series adds a new sysfs attribute that provides the amount of memory reserved for FADump. It also streamlines FADump specific sysfs interfaces.

[PATCH v2 8/8] mm/memremap: Set caching mode for PCI P2PDMA memory to WC

2020-01-07 Thread Logan Gunthorpe
PCI BAR IO memory should never be mapped as WB, however prior to this the PAT bits were set WB and it was typically overridden by MTRR registers set by the firmware. Set PCI P2PDMA memory to be WC (writecombining) as the only current user (the NVMe CMB) was originally mapped WC before the P2PDMA

[PATCH v2 1/8] mm/memory_hotplug: Drop the flags field from struct mhp_restrictions

2020-01-07 Thread Logan Gunthorpe
This variable is not used anywhere and should therefore be removed from the structure. Signed-off-by: Logan Gunthorpe --- include/linux/memory_hotplug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index

[PATCH v2 4/8] x86/mm: Introduce _set_memory_prot()

2020-01-07 Thread Logan Gunthorpe
For use in the 32bit arch_add_memory() to set the pgprot type of the memory to add. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: x...@kernel.org Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Signed-off-by: Logan Gunthorpe ---

[PATCH v2 5/8] powerpc/mm: Thread pgprot_t through create_section_mapping()

2020-01-07 Thread Logan Gunthorpe
In prepartion to support a pgprot_t argument for arch_add_memory(). Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Signed-off-by: Logan Gunthorpe --- arch/powerpc/include/asm/book3s/64/hash.h | 3 ++- arch/powerpc/include/asm/book3s/64/radix.h | 3 ++-

[PATCH v2 3/8] x86/mm: Thread pgprot_t through init_memory_mapping()

2020-01-07 Thread Logan Gunthorpe
In prepartion to support a pgprot_t argument for arch_add_memory(). It's required to move the prototype of init_memory_mapping() seeing the original location came before the definition of pgprot_t. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc:

[PATCH v2 0/8] Allow setting caching mode in arch_add_memory() for P2PDMA

2020-01-07 Thread Logan Gunthorpe
Hi, The main feedback from v1 was around the interface for arch_add_memory(). Per Dan's suggestions I've renamed the mhp_restrictions structure to mhp_modifiers and put a pgprot_t field in that structure. I've also included patch to drop the unused flags field. Thanks, Logan -- Changes in v2:

Re: PPC64: G5 & 4k/64k page size

2020-01-07 Thread Bertrand
Oups. Edit : swapon: /dev/sdb5 : pagesize doesn't fit with _swap_ space format On 07/01/2020 16:27, Bertrand wrote: swapon: /dev/sdb5 : pagesize doesn't fit with space space format

[PATCH v12 15/22] drm/via: set FOLL_PIN via pin_user_pages_fast()

2020-01-07 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

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

2020-01-07 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 v12 07/22] vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call

2020-01-07 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

Re: [PATCH v3] powerpc/kernel/sysfs: Add new config option PMU_SYSFS to enable PMU SPRs sysfs file creation

2020-01-07 Thread kajoljain
Hi Michael, On 1/7/20 4:40 PM, Michael Ellerman wrote: Kajol Jain writes: diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 12543e53fa96..58c72b9b8902 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++

Re: [PATCH v2 01/11] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-01-07 Thread Andrew Donnellan
On 22/11/19 12:49 am, Frederic Barrat wrote: The pci_dn structure used to store a pointer to the struct pci_dev, so taking a reference on the device was required. However, the pci_dev pointer was later removed from the pci_dn structure, but the reference was kept for the npu device. See commit

[PATCH] powerpc/papr_scm: Don't enable direct map for a region by default

2020-01-07 Thread Aneesh Kumar K.V
Setting ND_REGION_PAGEMAP flag implies namespace mode defaults to fsdax mode. This also means kernel ends up creating struct page backing for these namspace ranges. With large namespaces that is not the right thing to do. We should let the user select the mode he/she wants the namespace to be

[PATCH v12 05/22] goldish_pipe: rename local pin_user_pages() routine

2020-01-07 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 ---

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

2020-01-07 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 v12 18/22] media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2020-01-07 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 ---

[PATCH v12 17/22] net/xdp: set FOLL_PIN via pin_user_pages()

2020-01-07 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 v12 09/22] IB/umem: use get_user_pages_fast() to pin DMA pages

2020-01-07 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

[PATCH v12 13/22] IB/{core, hw, umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2020-01-07 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

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

2020-01-07 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 v12 20/22] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2020-01-07 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 v12 11/22] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2020-01-07 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

[Bug 206049] alg: skcipher: p8_aes_xts encryption unexpectedly succeeded on test vector "random: len=0 klen=64"; expected_error=-22, cfg="random: inplace may_sleep use_finup src_divs=[66.99%@+1

2020-01-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206049 --- Comment #6 from Daniel Axtens (d...@axtens.net) --- Patch sent: https://patchwork.ozlabs.org/patch/1219350/ -- You are receiving this mail because: You are watching the assignee of the bug.

[PATCH v12 00/22] mm/gup: prereqs to track dma-pinned pages: FOLL_PIN

2020-01-07 Thread John Hubbard
Hi, The "track FOLL_PIN pages" would have been the very next patch, but it is not included here because I'm still debugging a bug report from Leon. Let's get all of the prerequisite work (it's been reviewed) into the tree so that future reviews are easier. It's clear that any fixes that are

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

2020-01-07 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

[PATCH v12 03/22] mm: Cleanup __put_devmap_managed_page() vs ->page_free()

2020-01-07 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

[PATCH v12 01/22] mm/gup: factor out duplicate code from four routines

2020-01-07 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 v12 14/22] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2020-01-07 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 v12 19/22] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2020-01-07 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

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

2020-01-07 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 ---

[PATCH v12 08/22] mm/gup: allow FOLL_FORCE for get_user_pages_fast()

2020-01-07 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

[Bug 206049] alg: skcipher: p8_aes_xts encryption unexpectedly succeeded on test vector "random: len=0 klen=64"; expected_error=-22, cfg="random: inplace may_sleep use_finup src_divs=[66.99%@+1

2020-01-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206049 --- Comment #5 from Erhard F. (erhar...@mailbox.org) --- (In reply to Michael Ellerman from comment #3) > Looks like other implementations check the size, can you try this: > > diff --git a/drivers/crypto/vmx/aes_xts.c

[PATCH] crypto: vmx/xts - reject inputs that are too short

2020-01-07 Thread Daniel Axtens
When the kernel XTS implementation was extended to deal with ciphertext stealing in commit 8083b1bf8163 ("crypto: xts - add support for ciphertext stealing"), a check was added to reject inputs that were too short. However, in the vmx enablement - commit 239668419349 ("crypto: vmx/xts - use

[PATCH v12 10/22] media/v4l2-core: set pages dirty upon releasing DMA buffers

2020-01-07 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 v12 12/22] goldish_pipe: convert to pin_user_pages() and put_user_page()

2020-01-07 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 v12 16/22] fs/io_uring: set FOLL_PIN via pin_user_pages()

2020-01-07 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] powerpc/mm/hash: Fix the min context value used by userspace.

2020-01-07 Thread Aneesh Kumar K.V
Without this kernel can endup with SLB entries as below 04 c00c0800 00066bde000a7510 256M ESID=c00c0 VSID= 66bde000a7 LLP:110 12 0800 00066bde000a7d90 256M ESID=0 VSID= 66bde000a7 LLP:110 Such SLB entries can result in machine check. We noticed this with