[PATCH 1/8] powerpc/spufs: simplify spufs core dumping

2020-04-14 Thread Christoph Hellwig
Replace the coredump ->read method with a ->dump method that must call dump_emit itself. That way we avoid a buffer allocation an messing with set_fs() to call into code that is intended to deal with user buffers. For the ->get case we can now use a small on-stack buffer and avoid memory allocatio

remove set_fs calls from the exec and coredump code v2

2020-04-14 Thread Christoph Hellwig
Hi all, this series gets rid of playing with the address limit in the exec and coredump code. Most of this was fairly trivial, the biggest changes are those to the spufs coredump code. Changes since v1: - properly spell NUL - properly handle the compat siginfo case in ELF coredumps

[PATCH 2/8] signal: clean up __copy_siginfo_to_user32

2020-04-14 Thread Christoph Hellwig
Instead of an architecture specific calling convention in common code just pass a flags argument with architecture specific values. Signed-off-by: Christoph Hellwig --- arch/x86/ia32/ia32_signal.c | 2 +- arch/x86/include/asm/compat.h | 4 arch/x86/include/asm/signal.h | 3 +++ arch/x8

[PATCH 3/8] signal: replace __copy_siginfo_to_user32 with to_compat_siginfo

2020-04-14 Thread Christoph Hellwig
Move copying the siginfo to userspace into the callers, so that the compat_siginfo conversion can be reused by the ELF coredump code without set_fs magic. Signed-off-by: Christoph Hellwig --- arch/x86/ia32/ia32_signal.c | 4 +- arch/x86/kernel/signal.c| 5 ++- include/linux/compat.h |

[PATCH 4/8] binfmt_elf: open code copy_siginfo_to_user to kernelspace buffer

2020-04-14 Thread Christoph Hellwig
Instead of messing with the address limit just open code the trivial memcpy + memset logic for the native version, and a call to to_compat_siginfo for the compat version. Signed-off-by: Christoph Hellwig --- fs/binfmt_elf.c| 9 + fs/compat_binfmt_elf.c | 6 +- 2 files changed

[PATCH 5/8] binfmt_elf: remove the set_fs(KERNEL_DS) in elf_core_dump

2020-04-14 Thread Christoph Hellwig
There is no logic in elf_core_dump itself, or in the various arch helpers called from it which use uaccess routines on kernel pointers, except for the actual file writes that nicely encapsulated in __kernel_write used by dump_emit. Signed-off-by: Christoph Hellwig --- fs/binfmt_elf.c | 40 ++

[PATCH 6/8] binfmt_elf_fdpic: remove the set_fs(KERNEL_DS) in elf_fdpic_core_dump

2020-04-14 Thread Christoph Hellwig
There is no logic in elf_fdpic_core_dump itself that uses uaccess routines on kernel pointers, the file writes are nicely encapsulated in dump_emit which does its own set_fs. Signed-off-by: Christoph Hellwig --- fs/binfmt_elf_fdpic.c | 31 --- 1 file changed, 12 inser

[PATCH 7/8] exec: simplify the copy_strings_kernel calling convention

2020-04-14 Thread Christoph Hellwig
copy_strings_kernel is always used with a single argument, adjust the calling convention to that. Signed-off-by: Christoph Hellwig --- fs/binfmt_em86.c| 6 +++--- fs/binfmt_misc.c| 4 ++-- fs/binfmt_script.c | 6 +++--- fs/exec.c | 13 ++--- include/

[PATCH 8/8] exec: open code copy_string_kernel

2020-04-14 Thread Christoph Hellwig
Currently copy_string_kernel is just a wrapper around copy_strings that simplifies the calling conventions and uses set_fs to allow passing a kernel pointer. But due to the fact the we only need to handle a single kernel argument pointer, the logic can be sigificantly simplified while getting rid

[PATCH v8 0/7] ASoC: Add new module driver for new ASRC

2020-04-14 Thread Shengjiu Wang
Add new module driver for new ASRC in i.MX8MN, several commits are added for new property fsl,asrc-format Shengjiu Wang (7): ASoC: fsl_asrc: rename asrc_priv to asrc ASoC: dt-bindings: fsl_asrc: Add new property fsl,asrc-format ASoC: fsl-asoc-card: Support new property fsl,asrc-format ASoC

[PATCH v8 2/7] ASoC: dt-bindings: fsl_asrc: Add new property fsl, asrc-format

2020-04-14 Thread Shengjiu Wang
In order to support new EASRC and simplify the code structure, We decide to share the common structure between them. This bring a problem that EASRC accept format directly from devicetree, but ASRC accept width from devicetree. In order to align with new ESARC, we add new property fsl,asrc-format.

[PATCH v8 1/7] ASoC: fsl_asrc: rename asrc_priv to asrc

2020-04-14 Thread Shengjiu Wang
In order to move common structure to fsl_asrc_common.h we change the name of asrc_priv to asrc, the asrc_priv will be used by new struct fsl_asrc_priv. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen --- sound/soc/fsl/fsl_asrc.c | 298 +-- sound/soc/fsl/f

[PATCH v8 3/7] ASoC: fsl-asoc-card: Support new property fsl, asrc-format

2020-04-14 Thread Shengjiu Wang
In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen --- sound/soc/fsl/fsl-asoc-c

[PATCH v8 4/7] ASoC: fsl_asrc: Support new property fsl,asrc-format

2020-04-14 Thread Shengjiu Wang
In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen --- sound/soc/fsl/fsl_asrc.c

[PATCH v8 6/7] ASoC: dt-bindings: fsl_easrc: Add document for EASRC

2020-04-14 Thread Shengjiu Wang
EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. Signed-off-by: Shengjiu Wang --- .../devicetree/bindings/sound/fsl,easrc.yaml | 101 ++ 1 file changed, 101 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/fsl,easr

[PATCH v8 5/7] ASoC: fsl_asrc: Move common definition to fsl_asrc_common

2020-04-14 Thread Shengjiu Wang
There is a new ASRC included in i.MX serial platform, there are some common definition can be shared with each other. So move the common definition to a separate header file. And add fsl_asrc_pair_priv and fsl_asrc_priv for the variable specific for the module, which can be used internally. Signe

[PATCH v8 7/7] ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers

2020-04-14 Thread Shengjiu Wang
EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. It is different with old ASRC module. The primary features for the EASRC are as follows: - 4 Contexts - groups of channels with an independent time base - Fully independent and concurrent context control - Sim

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-04-14 Thread Christoph Hellwig
On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: > For platforms that define HAVE_ARCH_HUGE_VMAP and support PMD vmap mappings, > have vmalloc attempt to allocate PMD-sized pages first, before falling back > to small pages. Allocations which use something other than PAGE_KERNEL > pr

Re: [PATCH] vhost: do not enable VHOST_MENU by default

2020-04-14 Thread Christian Borntraeger
On 14.04.20 04:44, Jason Wang wrote: > We try to keep the defconfig untouched after decoupling CONFIG_VHOST > out of CONFIG_VIRTUALIZATION in commit 20c384f1ea1a > ("vhost: refine vhost and vringh kconfig") by enabling VHOST_MENU by > default. Then the defconfigs can keep enabling CONFIG_VHOST_N

Re: [PATCH v2] qtpm2: Export tpm2_get_cc_attrs_tbl for ibmvtpm driver as module

2020-04-14 Thread Jarkko Sakkinen
On Tue, Apr 14, 2020 at 10:51:37AM +1000, Michael Ellerman wrote: > Jarkko Sakkinen writes: > > On Wed, Apr 01, 2020 at 02:40:30PM +0530, Sachin Sant wrote: > >> > On 20-Mar-2020, at 1:27 AM, Jarkko Sakkinen > >> > wrote: > >> > > >> > On Wed, Mar 18, 2020 at 09:00:17PM -0400, Stefan Berger wro

Re: -Wincompatible-pointer-types in arch/powerpc/platforms/embedded6xx/mvme5100.c

2020-04-14 Thread Michael Ellerman
Hi Nathan, Thanks for the report. Nathan Chancellor writes: > Hi all, > > 0day reported a build error in arch/powerpc/platforms/embedded6xx/mvme5100.c > when building with clang [1]. This is not a clang specific issue since > it also happens with gcc: > > $ curl -LSs > https://lore.kernel.org/l

Re: [PATCH] lib/mpi: Fix building for powerpc with clang

2020-04-14 Thread Michael Ellerman
Nathan Chancellor writes: > 0day reports over and over on an powerpc randconfig with clang: > > lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a > inline asm context requiring an l-value: remove the cast or build with > -fheinous-gnu-extensions > > Remove the superfluous casts,

Re: -Wincompatible-pointer-types in arch/powerpc/platforms/embedded6xx/mvme5100.c

2020-04-14 Thread Nathan Chancellor
Hi Michael, On Tue, Apr 14, 2020 at 05:33:45PM +1000, Michael Ellerman wrote: > Hi Nathan, > > Thanks for the report. > > Nathan Chancellor writes: > > Hi all, > > > > 0day reported a build error in arch/powerpc/platforms/embedded6xx/mvme5100.c > > when building with clang [1]. This is not a cl

[PATCH v10 14/14] powerpc: Use mm_context vas_windows counter to issue CP_ABORT

2020-04-14 Thread Haren Myneni
(Thanks Michael for your review. Here is the updated patch with your comments and from Nick - Moved mm_context_add/remove_coproc() to add/remove_vas_window()) >From 521f86710f3605dc575f13634fd7520087993ffb Mon Sep 17 00:00:00 2001 From: Haren Myneni Date: Wed, 1 Apr 2020 23:12:12 -0500 Subject:

Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place

2020-04-14 Thread Paolo Bonzini
On 13/04/20 23:34, Philippe Mathieu-Daudé wrote: >> +#define VM_STAT(x, ...) offsetof(struct kvm, stat.x), KVM_STAT_VM, ## >> __VA_ARGS__ >> +#define VCPU_STAT(x, ...) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU, >> ## __VA_ARGS__ > I find this macro expanding into multiple fields odd... May

[PATCH v3 04/13] powerpc/40x: Remove support for IBM 403GCX

2020-04-14 Thread Christophe Leroy
CONFIG_403GCX is not user selectable and is not selected by any platform. Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cache.h | 2 +- arch/powerpc/include/asm/reg_booke.h | 54 arch/powerpc/include/asm/time.h | 12 --- arch/

[PATCH v3 02/13] powerpc/40x: Rework 40x PTE access and TLB miss

2020-04-14 Thread Christophe Leroy
Commit 1bc54c03117b ("powerpc: rework 4xx PTE access and TLB miss") reworked 44x PTE access to avoid atomic pte updates, and left 8xx, 40x and fsl booke with atomic pte updates. Commit 6cfd8990e27d ("powerpc: rework FSL Book-E PTE access and TLB miss") removed atomic pte updates on fsl booke. It we

[PATCH v3 03/13] powerpc/pgtable: Drop PTE_ATOMIC_UPDATES

2020-04-14 Thread Christophe Leroy
40x was the last user of PTE_ATOMIC_UPDATES. Drop everything related to PTE_ATOMIC_UPDATES. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 32 arch/powerpc/include/asm/nohash/64/pgtable.h | 27 - 2 files changed, 59 deleti

[PATCH v3 00/13] Modernise powerpc 40x

2020-04-14 Thread Christophe Leroy
v1 and v2 of this series were aiming at removing 40x entirely, but it led to protests. v3 is trying to start modernising powerpc 40x: - Rework TLB miss handlers to not use PTE_ATOMIC_UPDATES and _PAGE_HWWRITE - Remove old versions of 40x processors, namely 403 and 405GP and associated errata. - La

[PATCH v3 01/13] powerpc: Remove Xilinx PPC405/PPC440 support

2020-04-14 Thread Christophe Leroy
From: Michal Simek The latest Xilinx design tools called ISE and EDK has been released in October 2013. New tool doesn't support any PPC405/PPC440 new designs. These platforms are no longer supported and tested. PowerPC 405/440 port is orphan from 2013 by commit cdeb89943bfc ("MAINTAINERS: Fix i

[PATCH v3 09/13] powerpc/40x: Remove support for IBM 405GP

2020-04-14 Thread Christophe Leroy
All platforms selecting the obsolete processor are gone now. Remove support for it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/cputable.c | 13 - arch/powerpc/platforms/40x/Kconfig | 6 -- 2 files changed, 19 deletions(-) diff --git a/arch/powerpc/kernel/cputa

[PATCH v3 08/13] powerpc/40x: Remove support for ISS Simulator

2020-04-14 Thread Christophe Leroy
ISS4xx has support for 405GP which is obsolete. Remote it. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/44x/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig index 39e93d23fb38..78

[PATCH v3 06/13] powerpc/40x: Remove WALNUT

2020-04-14 Thread Christophe Leroy
CONFIG_WALNUT is not selected by any config and is based on 405GP which is obsolete. Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/boot/Makefile | 5 +- arch/powerpc/boot/dts/walnut.dts| 246 arch/powerpc/boot/treeboot-walnut.c

[PATCH v3 05/13] powerpc/40x: Remove STB03xxx

2020-04-14 Thread Christophe Leroy
CONFIG_STB03xxx is not user selectable and is not selected by any config. Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/cputable.c | 13 - arch/powerpc/platforms/40x/Kconfig | 5 - 2 files changed, 18 deletions(-) diff --git a/arch/powerpc/kernel/cputa

[PATCH v3 07/13] powerpc/40x: Remove EP405

2020-04-14 Thread Christophe Leroy
EP405 is an old type of board based on a 405GP which is obsolete. Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/boot/Makefile | 2 +- arch/powerpc/boot/dts/ep405.dts | 230 --- arch/powerpc/boot/ep405.c| 71 --- arc

[PATCH v3 10/13] powerpc/40x: Remove IBM405 Erratum #51

2020-04-14 Thread Christophe Leroy
This erratum was for IBM 403GCX, 405EP and STB03xxx which are now gone. Remove this erratum. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_40x.S | 6 -- arch/powerpc/platforms/40x/Kconfig | 4 2 files changed, 10 deletions(-) diff --git a/arch/powerpc/kernel/head_40

[PATCH v3 11/13] powerpc: Remove IBM405 Erratum #77

2020-04-14 Thread Christophe Leroy
This erratum is dedicated to IBM 405GP and STB03xxx which are now gone. Remove this erratum. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/asm-405.h | 19 --- arch/powerpc/include/asm/atomic.h| 11 --- arch/powerpc/include/asm/bitops.

[PATCH v3 12/13] powerpc/40x: Avoid using r12 in TLB miss handlers

2020-04-14 Thread Christophe Leroy
Let's reduce the number of registers used in TLB miss handlers. We have both r9 and r12 available for any temporary use. r9 is enough, avoid using r12. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_40x.S | 70 -- 1 file changed, 33 insertions(+),

[PATCH v3 13/13] powerpc/40x: Don't save CR in SPRN_SPRG_SCRATCH6

2020-04-14 Thread Christophe Leroy
We have r12 available, use it to keep CR around and don't save it in SPRN_SPRG_SCRATCH6. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_40x.S | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/he

Re: [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()

2020-04-14 Thread Dan Carpenter
On Fri, Apr 10, 2020 at 04:05:06PM +0800, Tang Bin wrote: > > > > > > > Thus it must be fixed. > > Wording alternative: > >Thus adjust the error detection and corresponding exception handling. > > Got it. Wow... No, don't listen to Markus when it comes to writing commit messages. You couldn

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-04-14 Thread Jason A. Donenfeld
On 4/13/20 3:15 PM, Waiman Long wrote: As said by Linus: A symmetric naming is only helpful if it implies symmetries in use. Otherwise it's actively misleading. In "kzalloc()", the z is meaningful and an important part of what the caller wants. In "kzfree()", the z is actively d

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-04-14 Thread Michal Hocko
On Mon 13-04-20 17:15:49, Waiman Long wrote: > As said by Linus: > > A symmetric naming is only helpful if it implies symmetries in use. > Otherwise it's actively misleading. > > In "kzalloc()", the z is meaningful and an important part of what the > caller wants. > > In "kzfree()", th

Re: [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()

2020-04-14 Thread Tang Bin
Hi On 2020/4/14 16:30, Dan Carpenter wrote: On Fri, Apr 10, 2020 at 04:05:06PM +0800, Tang Bin wrote: Thus it must be fixed. Wording alternative: Thus adjust the error detection and corresponding exception handling. Got it. Wow... No, don't listen to Markus when it comes to writing co

Re: [PATCH 1/3] kexec: Prevent removal of memory in use by a loaded kexec image

2020-04-14 Thread Baoquan He
On 04/14/20 at 10:00am, David Hildenbrand wrote: > On 14.04.20 08:40, Baoquan He wrote: > > On 04/13/20 at 08:15am, Eric W. Biederman wrote: > >> Baoquan He writes: > >> > >>> On 04/12/20 at 02:52pm, Eric W. Biederman wrote: > > The only benefit of kexec_file_load is that it is simple en

Re: [PATCH 1/3] kexec: Prevent removal of memory in use by a loaded kexec image

2020-04-14 Thread David Hildenbrand
On 14.04.20 11:22, Baoquan He wrote: > On 04/14/20 at 10:00am, David Hildenbrand wrote: >> On 14.04.20 08:40, Baoquan He wrote: >>> On 04/13/20 at 08:15am, Eric W. Biederman wrote: Baoquan He writes: > On 04/12/20 at 02:52pm, Eric W. Biederman wrote: >> >> The only benefit of

Re: [PATCH] vhost: do not enable VHOST_MENU by default

2020-04-14 Thread Jason Wang
On 2020/4/14 下午3:26, Christian Borntraeger wrote: On 14.04.20 04:44, Jason Wang wrote: We try to keep the defconfig untouched after decoupling CONFIG_VHOST out of CONFIG_VIRTUALIZATION in commit 20c384f1ea1a ("vhost: refine vhost and vringh kconfig") by enabling VHOST_MENU by default. Then the

Re: [PATCH v6 0/3] powerpc/powernv: Introduce interface for self-restore support

2020-04-14 Thread Gautham R Shenoy
Hello Pratik, On Thu, Mar 26, 2020 at 12:40:31PM +0530, Pratik Rajesh Sampat wrote: > v5: https://lkml.org/lkml/2020/3/17/944 > Changelog > v5-->v6 > 1. Updated background, motivation and illuminated potential design > choices > 2. Re-organization of patch-set > a. Split introducing preference f

Re: Build regressions/improvements in v5.7-rc1

2020-04-14 Thread Michael Ellerman
Geert Uytterhoeven writes: > On Mon, 13 Apr 2020, Geert Uytterhoeven wrote: >> Below is the list of build error/warning regressions/improvements in >> v5.7-rc1[1] compared to v5.6[2]. >> >> Summarized: >> - build errors: +132/-3 >> - build warnings: +257/-79 >> >> Happy fixing! ;-) >> >> Thanks

Re: [PATCH v6 1/3] powerpc/powernv: Introduce interface for self-restore support

2020-04-14 Thread Gautham R Shenoy
On Thu, Mar 26, 2020 at 12:40:32PM +0530, Pratik Rajesh Sampat wrote: > Introduces an interface that helps determine support for the > self-restore API. The commit is isomorphic to the original interface of > declaring SPRs to self-restore. > > Signed-off-by: Pratik Rajesh Sampat This patch look

Re: [PATCH v6 2/3] powerpc/powernv: Introduce support and parsing for self-save API

2020-04-14 Thread Gautham R Shenoy
On Thu, Mar 26, 2020 at 12:40:33PM +0530, Pratik Rajesh Sampat wrote: > This commit introduces and leverages the Self save API. The difference > between self-save and self-restore is that the value to be saved for the > SPR does not need to be passed to the call. > > Add the new Self Save OPAL API

Re: Build regressions/improvements in v5.7-rc1

2020-04-14 Thread Krzysztof Kozlowski
On Tue, Apr 14, 2020 at 08:23:32PM +1000, Michael Ellerman wrote: > Geert Uytterhoeven writes: > > On Mon, 13 Apr 2020, Geert Uytterhoeven wrote: > >> Below is the list of build error/warning regressions/improvements in > >> v5.7-rc1[1] compared to v5.6[2]. > >> > >> Summarized: > >> - build erro

[PATCH] target/ppc: Fix mtmsr(d) L=1 variant that loses interrupts

2020-04-14 Thread Nicholas Piggin
If mtmsr L=1 sets MSR[EE] while there is a maskable exception pending, it does not cause an interrupt. This causes the test case to hang: https://lists.gnu.org/archive/html/qemu-ppc/2019-10/msg00826.html More recently, Linux reduced the occurance of operations (e.g., rfi) which stop translation a

Re: Build regressions/improvements in v5.7-rc1

2020-04-14 Thread Krzysztof Kozlowski
On Tue, Apr 14, 2020 at 01:06:27PM +0200, Krzysztof Kozlowski wrote: > On Tue, Apr 14, 2020 at 08:23:32PM +1000, Michael Ellerman wrote: > >> + /kisskb/src/arch/powerpc/include/asm/nohash/64/pgtable-4k.h: error: > >> expected ')' before '!=' token: => 58:40 > > >> + /kisskb/src/arch/powerpc/i

Re: [PATCH v6 4/4] Advertise the self-save and self-restore attributes in the device tree

2020-04-14 Thread Gautham R Shenoy
Hello Pratik, On Thu, Mar 26, 2020 at 12:39:17PM +0530, Pratik Rajesh Sampat wrote: > Support for self save and self restore interface is advertised in the > device tree, along with the list of SPRs it supports for each. > > The Special Purpose Register identification is encoded in a 2048 bitmask

Re: [PATCH v2 1/4] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2020-04-14 Thread Nicholas Piggin
Excerpts from Matthew Wilcox's message of April 13, 2020 11:34 pm: > On Mon, Apr 13, 2020 at 10:53:00PM +1000, Nicholas Piggin wrote: >> vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. >> Whether or not a vmap is huge depends on the architecture details, >> alignments, boot op

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-04-14 Thread Nicholas Piggin
Excerpts from Matthew Wilcox's message of April 13, 2020 11:41 pm: > On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: >> +static int vmap_pages_range_noflush(unsigned long start, unsigned long end, >> +pgprot_t prot, struct page **pages, >> +

[PATCH 0/3] mm/hugetlb: Add some new arch enabling macros

2020-04-14 Thread Anshuman Khandual
This series adds two macros which platforms can enable to override generic fallback definitions. Before that it drops __HAVE_ARCH_HUGE_PTEP_GET from arm64 platform. 1. HAVE_ARCH_IS_HUGEPAGE_ONLY_RANGE - is_hugepage_only_range() 2. HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS - arch_clear_hugepage_flags() Thi

[PATCH 2/3] mm/hugetlb: Introduce HAVE_ARCH_IS_HUGEPAGE_ONLY_RANGE

2020-04-14 Thread Anshuman Khandual
There are multiple similar definitions for is_hugepage_only_range() across platforms. This introduces HAVE_ARCH_IS_HUGEPAGE_ONLY_RANGE for platforms that need to define their own is_hugepage_only_range() but otherwise there is a generic fallback definition for others to use. This help reduce code d

[PATCH 3/3] mm/hugetlb: Introduce HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS

2020-04-14 Thread Anshuman Khandual
There are multiple similar definitions for arch_clear_hugepage_flags() on various platforms. This introduces HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS for those platforms that need to define their own arch_clear_hugepage_flags() while also providing a generic fallback definition for others to use. This help r

Re: [PATCH v6 0/3] powerpc/powernv: Introduce interface for self-restore support

2020-04-14 Thread Pratik Sampat
Hello Gautham On 14/04/20 12:41 pm, Gautham R Shenoy wrote: Hello Pratik, On Thu, Mar 26, 2020 at 12:40:31PM +0530, Pratik Rajesh Sampat wrote: v5: https://lkml.org/lkml/2020/3/17/944 Changelog v5-->v6 1. Updated background, motivation and illuminated potential design choices 2. Re-organizatio

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-04-14 Thread Nicholas Piggin
Excerpts from Christoph Hellwig's message of April 14, 2020 5:23 pm: > On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: >> For platforms that define HAVE_ARCH_HUGE_VMAP and support PMD vmap mappings, >> have vmalloc attempt to allocate PMD-sized pages first, before falling back >> t

Re: [PATCH v6 2/3] powerpc/powernv: Introduce support and parsing for self-save API

2020-04-14 Thread Pratik Sampat
Hello Gautham, [..snip..] + + if (curr_spr.supported_mode & FIRMWARE_SELF_SAVE) { + rc = opal_slw_self_save_reg(pir, + curr_spr.spr); + if (rc != 0) +

Re: [PATCH v2 0/4] huge vmalloc mappings

2020-04-14 Thread Nicholas Piggin
Excerpts from David Rientjes's message of April 14, 2020 10:27 am: > On Mon, 13 Apr 2020, Nicholas Piggin wrote: > >> We can get a significant win with larger mappings for some of the big >> global hashes. >> >> Since RFC, relevant architectures have added p?d_leaf accessors so no >> real arch ch

generic DMA bypass flag v3

2020-04-14 Thread Christoph Hellwig
Hi all, I've recently beeing chatting with Lu about using dma-iommu and per-device DMA ops in the intel IOMMU driver, and one missing feature in dma-iommu is a bypass mode where the direct mapping is used even when an iommu is attached to improve performance. The powerpc code already has a simila

[PATCH 1/4] dma-mapping: move the remaining DMA API calls out of line

2020-04-14 Thread Christoph Hellwig
For a long time the DMA API has been implemented inline in dma-mapping.h, but the function bodies can be quite large. Move them all out of line. Signed-off-by: Christoph Hellwig --- include/linux/dma-direct.h | 58 + include/linux/dma-mapping.h | 247 --

[PATCH 2/4] dma-mapping: inline the fast path dma-direct calls

2020-04-14 Thread Christoph Hellwig
Inline the single page map/unmap/sync dma-direct calls into the now out of line generic wrappers. This restores the behavior of a single function call that we had before moving the generic calls out of line. Besides the dma-mapping callers there are just a few callers in IOMMU drivers that have a

[PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-14 Thread Christoph Hellwig
Several IOMMU drivers have a bypass mode where they can use a direct mapping if the devices DMA mask is large enough. Add generic support to the core dma-mapping code to do that to switch those drivers to a common solution. Signed-off-by: Christoph Hellwig --- include/linux/device.h | 6

[PATCH 4/4] powerpc: use the generic dma_ops_bypass mode

2020-04-14 Thread Christoph Hellwig
Use the DMA API bypass mechanism for direct window mappings. This uses common code and speed up the direct mapping case by avoiding indirect calls just when not using dma ops at all. It also fixes a problem where the sync_* methods were using the bypass check for DMA allocations, but those are pa

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-04-14 Thread Christophe Leroy
Le 13/04/2020 à 15:41, Matthew Wilcox a écrit : On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: +static int vmap_pages_range_noflush(unsigned long start, unsigned long end, + pgprot_t prot, struct page **pages, +

Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-14 Thread Greg Kroah-Hartman
On Tue, Apr 14, 2020 at 02:25:05PM +0200, Christoph Hellwig wrote: > Several IOMMU drivers have a bypass mode where they can use a direct > mapping if the devices DMA mask is large enough. Add generic support > to the core dma-mapping code to do that to switch those drivers to > a common solution.

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-04-14 Thread David Sterba
On Mon, Apr 13, 2020 at 05:15:49PM -0400, Waiman Long wrote: > fs/btrfs/ioctl.c | 2 +- > diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c > index 40b729dce91c..eab3f8510426 100644 > --- a/fs/btrfs/ioctl.c > +++ b/fs/btrfs/ioctl.c > @@ -2691,7 +2691,7 @@ static int b

Re: [PATCH] vhost: do not enable VHOST_MENU by default

2020-04-14 Thread Thomas Bogendoerfer
On Tue, Apr 14, 2020 at 10:44:38AM +0800, Jason Wang wrote: > We try to keep the defconfig untouched after decoupling CONFIG_VHOST > out of CONFIG_VIRTUALIZATION in commit 20c384f1ea1a > ("vhost: refine vhost and vringh kconfig") by enabling VHOST_MENU by > default. Then the defconfigs can keep ena

[PATCH 0/8] Simplefs: group and simplify linux fs code

2020-04-14 Thread Emanuele Giuseppe Esposito
This series of patches introduce wrappers for functions, arguments simplification in functions calls and most importantly groups duplicated code in a single header, simplefs, to avoid redundancy in the linux fs, especially debugfs and tracefs. Signed-off-by: Emanuele Giuseppe Esposito Emanuele G

[PATCH 1/8] apparmor: just use vfs_kern_mount to make .null

2020-04-14 Thread Emanuele Giuseppe Esposito
aa_mk_null_file is using simple_pin_fs/simple_release_fs with local variables as arguments, for what would amount to a simple vfs_kern_mount/mntput pair if everything was inlined. Just use the normal filesystem API since the reference counting is not needed here. Signed-off-by: Emanuele Giuseppe

[PATCH 2/8] fs: extract simple_pin/release_fs to separate files

2020-04-14 Thread Emanuele Giuseppe Esposito
We will augment this family of functions with inode management. To avoid littering include/linux/fs.h and fs/libfs.c, move them to a separate header, with a Kconfig symbol to enable them. Signed-off-by: Emanuele Giuseppe Esposito --- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/drm_d

[PATCH 3/8] fs: wrap simple_pin_fs/simple_release_fs arguments in a struct

2020-04-14 Thread Emanuele Giuseppe Esposito
Simplify passing the count and mount to simple_pin_fs and simple_release_fs, in preparation for adding more high level operations to the simplefs API. Signed-off-by: Emanuele Giuseppe Esposito --- drivers/gpu/drm/drm_drv.c | 11 +-- drivers/misc/cxl/api.c | 13 ++--

[PATCH 4/8] fs: introduce simple_new_inode

2020-04-14 Thread Emanuele Giuseppe Esposito
It is a common special case for new_inode to initialize the time to the current time and the inode to get_next_ino(). Introduce a core function that does it and use it throughout Linux. Signed-off-by: Emanuele Giuseppe Esposito --- arch/powerpc/platforms/cell/spufs/inode.c | 4 +--- arch/s390/h

[PATCH 5/8] simplefs: add alloc_anon_inode wrapper

2020-04-14 Thread Emanuele Giuseppe Esposito
Start adding file creation wrappers, the simplest returns an anonymous inode. Signed-off-by: Emanuele Giuseppe Esposito --- drivers/gpu/drm/drm_drv.c | 2 +- drivers/misc/cxl/api.c | 2 +- drivers/scsi/cxlflash/ocxl_hw.c | 2 +- fs/simplefs.c | 6 ++ include/

[PATCH 6/8] simplefs: add file creation functions

2020-04-14 Thread Emanuele Giuseppe Esposito
A bunch of code is duplicated between debugfs and tracefs, unify it to the simplefs library. The code is very similar, except that dentry and inode creation are unified into a single function (unlike start_creating in debugfs and tracefs, which only takes care of dentries). This adds an output pa

[PATCH 7/8] debugfs: switch to simplefs inode creation API

2020-04-14 Thread Emanuele Giuseppe Esposito
The only difference, compared to the pre-existing code, is that symlink creation now triggers fsnotify_create. This was a bug in the debugfs code, since for example vfs_symlink does call fsnotify_create. Signed-off-by: Emanuele Giuseppe Esposito --- fs/debugfs/inode.c | 144 +---

[PATCH 8/8] tracefs: switch to simplefs inode creation API

2020-04-14 Thread Emanuele Giuseppe Esposito
There is no semantic change intended; the code in the simplefs.c functions in fact was derived from debugfs and tracefs code. Signed-off-by: Emanuele Giuseppe Esposito --- fs/tracefs/inode.c | 86 -- 1 file changed, 7 insertions(+), 79 deletions(-) di

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-04-14 Thread Christoph Hellwig
On Tue, Apr 14, 2020 at 10:13:44PM +1000, Nicholas Piggin wrote: > Which case? Usually the answer would be because you don't want to use > contiguous physical memory and/or you don't want to use the linear > mapping. But with huge pages you do by definition already use large contiguous areas. So

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-04-14 Thread David Howells
Waiman Long wrote: > As said by Linus: > > A symmetric naming is only helpful if it implies symmetries in use. > Otherwise it's actively misleading. > > In "kzalloc()", the z is meaningful and an important part of what the > caller wants. > > In "kzfree()", the z is actively detrimen

decruft the vmalloc API v2

2020-04-14 Thread Christoph Hellwig
Hi all, Peter noticed that with some dumb luck you can toast the kernel address space with exported vmalloc symbols. I used this as an opportunity to decruft the vmalloc.c API and make it much more systematic. This also removes any chance to create vmalloc mappings outside the designated areas o

[PATCH 01/29] x86/hyperv: use vmalloc_exec for the hypercall page

2020-04-14 Thread Christoph Hellwig
Use the designated helper for allocating executable kernel memory, and remove the now unused PAGE_KERNEL_RX define. Signed-off-by: Christoph Hellwig Reviewed-by: Michael Kelley Acked-by: Wei Liu Acked-by: Peter Zijlstra (Intel) --- arch/x86/hyperv/hv_init.c| 2 +- arch/x86/include

[PATCH 02/29] x86: fix vmap arguments in map_irq_stack

2020-04-14 Thread Christoph Hellwig
vmap does not take a gfp_t, the flags argument is for VM_* flags. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/irq_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index 12df3a4abfdd..6b32ab009c19 100644 --- a/ar

[PATCH 03/29] staging: android: ion: use vmap instead of vm_map_ram

2020-04-14 Thread Christoph Hellwig
vm_map_ram can keep mappings around after the vm_unmap_ram. Using that with non-PAGE_KERNEL mappings can lead to all kinds of aliasing issues. Signed-off-by: Christoph Hellwig Acked-by: Greg Kroah-Hartman Acked-by: Peter Zijlstra (Intel) --- drivers/staging/android/ion/ion_heap.c | 4 ++-- 1

[PATCH 04/29] staging: media: ipu3: use vmap instead of reimplementing it

2020-04-14 Thread Christoph Hellwig
Just use vmap instead of messing with vmalloc internals. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- drivers/staging/media/ipu3/ipu3-css-pool.h | 4 +-- drivers/staging/media/ipu3/ipu3-dmamap.c | 30 ++ 2 files changed, 9 insertions(+), 25 deleti

[PATCH 05/29] dma-mapping: use vmap insted of reimplementing it

2020-04-14 Thread Christoph Hellwig
Replace the open coded instance of vmap with the actual function. In the non-contiguous (IOMMU) case this requires an extra find_vm_area, but given that this isn't a fast path function that is a small price to pay. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- kernel/dm

[PATCH 06/29] powerpc: add an ioremap_phb helper

2020-04-14 Thread Christoph Hellwig
Factor code shared between pci_64 and electra_cf into a ioremap_pbh helper that follows the normal ioremap semantics, and returns a useful __iomem pointer. Note that it opencodes __ioremap_at as we know from the callers the slab is available. Switch pci_64 to also store the result as __iomem poin

[PATCH 07/29] powerpc: remove __ioremap_at and __iounmap_at

2020-04-14 Thread Christoph Hellwig
These helpers are only used for remapping the ISA I/O base. Replace the mapping side with a remap_isa_range helper in isa-bridge.c that hard codes all the known arguments, and just remove __iounmap_at in favour of open coding it in the only caller. Signed-off-by: Christoph Hellwig Acked-by: Pete

[PATCH 08/29] mm: remove __get_vm_area

2020-04-14 Thread Christoph Hellwig
Switch the two remaining callers to use __get_vm_area_caller instead. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- arch/powerpc/kernel/pci_64.c | 3 ++- arch/sh/kernel/cpu/sh4/sq.c | 3 ++- include/linux/vmalloc.h | 2 -- mm/vmalloc.c | 8

[PATCH 10/29] mm: rename CONFIG_PGTABLE_MAPPING to CONFIG_ZSMALLOC_PGTABLE_MAPPING

2020-04-14 Thread Christoph Hellwig
Rename the Kconfig variable to clarify the scope. Signed-off-by: Christoph Hellwig Acked-by: Minchan Kim Acked-by: Peter Zijlstra (Intel) --- arch/arm/configs/omap2plus_defconfig | 2 +- include/linux/zsmalloc.h | 2 +- mm/Kconfig | 2 +- mm/zsmalloc.c

[PATCH 09/29] mm: unexport unmap_kernel_range_noflush

2020-04-14 Thread Christoph Hellwig
There are no modular users of this function. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- mm/vmalloc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index d1534d610b48..3375f9508ef6 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2029,7

[PATCH 11/29] mm: only allow page table mappings for built-in zsmalloc

2020-04-14 Thread Christoph Hellwig
This allows to unexport map_vm_area and unmap_kernel_range, which are rather deep internal and should not be available to modules, as they for example allow fine grained control of mapping permissions, and also allow splitting the setup of a vmalloc area and the actual mapping and thus expose vmall

[PATCH 12/29] mm: pass addr as unsigned long to vb_free

2020-04-14 Thread Christoph Hellwig
Ever use of addr in vb_free casts to unsigned long first, and the caller has an unsigned long version of the address available anyway. Just pass that and avoid all the casts. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- mm/vmalloc.c | 16 +++- 1 file change

[PATCH 14/29] mm: rename vmap_page_range to map_kernel_range

2020-04-14 Thread Christoph Hellwig
This matches the map_kernel_range_noflush API. Also change to pass a size instead of the end, similar to the noflush version. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- mm/vmalloc.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/vm

[PATCH 13/29] mm: remove vmap_page_range_noflush and vunmap_page_range

2020-04-14 Thread Christoph Hellwig
These have non-static aliases called map_kernel_range_noflush and unmap_kernel_range_noflush that just differ slightly in the calling conventions that pass addr + size instead of an end. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- mm/vmalloc.c | 98

[PATCH 15/29] mm: don't return the number of pages from map_kernel_range{, _noflush}

2020-04-14 Thread Christoph Hellwig
None of the callers needs the number of pages, and a 0 / -errno return value is a lot more intuitive. Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- mm/vmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index a3d8

[PATCH 16/29] mm: remove map_vm_range

2020-04-14 Thread Christoph Hellwig
Switch all callers to map_kernel_range, which symmetric to the unmap side (as well as the _noflush versions). Signed-off-by: Christoph Hellwig Acked-by: Peter Zijlstra (Intel) --- Documentation/core-api/cachetlb.rst | 2 +- include/linux/vmalloc.h | 10 -- mm/vmalloc.c

  1   2   >