[PATCH] libfs: make all users of simple_attr_open have the format checked

2018-11-09 Thread Rasmus Villemoes
Almost all uses of simple_attr_open() happen via macros that do a __simple_attr_check_format(__fmt, 0ull). One of the few exceptions actually does not pass a fmt matching an unsigned long long. So move the check into the call of simple_attr_open() by wrapping it in a macro of the same name, and fi

Re: [GIT PULL] of: overlay: validation checks, subsequent fixes for v20

2018-11-09 Thread Rob Herring
On Fri, Nov 9, 2018 at 12:56 AM Frank Rowand wrote: > > Hi Rob, > > Please pull the changes to add the overlay validation checks. > > This is the v7 version of the patch series. Pulled for 4.21. Thanks. Rob

Re: UBSAN: Undefined behaviour in kernel/rcu/tree_plugin.h in 4.20-rc1

2018-11-09 Thread Paul E. McKenney
On Fri, Nov 09, 2018 at 06:11:20PM +0100, Christophe LEROY wrote: > (Resending due to error in Paul's address) > > Paul > > I get the following UBSAN reports in 4.20-rc1 on an MPC8321E > (powerpc/book3s/32) > > I bisected it to 3e31009898699dfc ("rcu: Defer reporting RCU-preempt > quiescent stat

[PATCH 16/17] Kconfig: Update the prose for selection of compression algorithm

2018-11-09 Thread Adam Borowski
It was really obsolete, and some entries contradicted each other. Let's not recommend ZSTD for kernel compression yet as it's available only on x86, and some distros might not have the tool installed. Proposing ZSTD for initrd is safer but let's test it first. Signed-off-by: Adam Borowski --- i

[PATCH 17/17] [NOT FOR MERGING] lib: Be noisy about used decompression method.

2018-11-09 Thread Adam Borowski
It's too easy to build the initrd with wrong options during testing, after which it may silently work anyway. Signed-off-by: Adam Borowski --- lib/decompress.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/decompress.c b/lib/decompress.c index 95f39a14eb7b..345679312

[PATCH 07/17] s390: Remove support for BZIP2 and LZMA compressed kernel

2018-11-09 Thread Adam Borowski
Made redundant by newer choices. Signed-off-by: Adam Borowski --- arch/s390/Kconfig| 2 -- arch/s390/boot/compressed/Makefile | 8 +--- arch/s390/boot/compressed/decompressor.c | 8 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/arch/s39

[PATCH 04/17] x86: Remove support for BZIP2 and LZMA compressed kernel

2018-11-09 Thread Adam Borowski
While bzip2 used to be good in its heyday, it's been drastically eclipsed by newer algorithms. In no case it's a rational choice anymore -- at any point of the size-to-compression curve, there's something much better. As we control the build process, any .configs that still select it will harmless

[PATCH 15/17] lib: Completely purge now-unused lzma code from the kernel

2018-11-09 Thread Adam Borowski
The XZ library already can decompress lzma, this other copy was redundant. We just removed rather than converted all old users. Signed-off-by: Adam Borowski --- include/linux/decompress/unlzma.h | 13 - lib/Makefile | 1 - lib/decompress.c | 5 - lib/de

[PATCH 10/17] arm: Remove support for LZMA compressed kernel

2018-11-09 Thread Adam Borowski
You want XZ instead: newer version of same algorithm, has an optimized filter for arm32 executables, uses a library shared with other uses of XZ in the kernel. Signed-off-by: Adam Borowski --- arch/arm/Kconfig | 1 - arch/arm/boot/compressed/Makefile | 1 - arch/arm/boot

[PATCH 06/17] parisc: Remove support for BZIP2 and LZMA compressed kernel

2018-11-09 Thread Adam Borowski
Made redundant by newer choices. Signed-off-by: Adam Borowski --- arch/parisc/Kconfig | 2 -- arch/parisc/boot/compressed/Makefile | 10 ++ arch/parisc/boot/compressed/misc.c | 8 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/arch/parisc/Kc

[PATCH 01/17] lib: Add support for ZSTD-compressed kernel

2018-11-09 Thread Adam Borowski
From: Nick Terrell Add support for extracting ZSTD-compressed kernel images, as well as ZSTD-compressed ramdisk images in the kernel boot process. When neither `fill' nor `flush' are used, the decompression function requires a constant amount of memory (192 KB is sufficient). When either is used

[PATCH 05/17] mips: Remove support for BZIP2 and LZMA compressed kernel

2018-11-09 Thread Adam Borowski
Made redundant by newer choices. Signed-off-by: Adam Borowski --- arch/mips/Kconfig | 2 -- arch/mips/boot/Makefile| 27 -- arch/mips/boot/compressed/Makefile | 2 -- arch/mips/boot/compressed/decompress.c | 8 4 files

[PATCH 03/17] .gitignore: add ZSTD-compressed files

2018-11-09 Thread Adam Borowski
For now, that's arch/x86/boot/compressed/vmlinux.bin.zst but probably more will come, thus let's be consistent with all other compressors. Signed-off-by: Adam Borowski --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 97ba6b79834c..0d09cf1c053c 1006

[PATCH 0/17] Kernel compression: add ZSTD, remove LZMA1 and BZIP2

2018-11-09 Thread Adam Borowski
Hi! As new compressors get invented, they tend to find their way into the kernel, yet we never prune superseded ones. It's time to do so. In particular, BZIP2 is drastically slower than other compressors we have, even when they achieve smaller sizes. It takes more memory, too. And, BZIP2 is not

[PATCH 02/17] x86: Add support for ZSTD-compressed kernel

2018-11-09 Thread Adam Borowski
From: Nick Terrell Integrates the ZSTD decompression code to the x86 pre-boot code. Zstandard requires slightly more memory during the kernel decompression on x86 (192 KB vs 64 KB), and the memory usage is independent of the window size. Zstandard requires memory proportional to the window size

[PATCH 08/17] sh: Remove support for BZIP2 and LZMA compressed kernel

2018-11-09 Thread Adam Borowski
Made redundant by newer choices. Signed-off-by: Adam Borowski --- arch/sh/Kconfig | 2 -- arch/sh/Makefile | 4 +--- arch/sh/boot/Makefile| 19 ++- arch/sh/boot/compressed/Makefile | 5 - arch/sh/boot/compressed/misc.c | 12 --

[PATCH 11/17] Kconfig: Remove support for BZIP2-compressed initrd and kernel

2018-11-09 Thread Adam Borowski
In no case it's a rational choice anymore: it's much slower than newer algorithms at similar compression strength, and takes lots of memory as well. Removal of compression algorithms for vmlinuz is completely safe (the kernel gets compressed by this very Makefile), less so for initrd as someone mi

[PATCH 12/17] Kconfig: Remove support for LZMA-compressed initrd

2018-11-09 Thread Adam Borowski
Obsoleted by XZ. The config option for compressing the kernel stays, as some archs have a bootloader outside the kernel that wants LZMA. Signed-off-by: Adam Borowski --- Makefile| 1 - usr/Kconfig | 28 ++-- 2 files changed, 2 insertions(+), 27 deletions(-) diff --

[PATCH 09/17] unicore32: Remove support for BZIP2 and LZMA compressed kernel

2018-11-09 Thread Adam Borowski
Made redundant by newer choices -- sort of, as no one enabled support for XZ nor ZSTD for unicore yet... Signed-off-by: Adam Borowski --- arch/unicore32/Kconfig | 2 -- arch/unicore32/boot/compressed/Makefile | 4 +--- arch/unicore32/boot/compressed/misc.c | 8 3 file

[PATCH 13/17] arch/*: Purge references to CONFIG_RD_BZIP2/LZMA from various defconfigs

2018-11-09 Thread Adam Borowski
They don't exist anymore. Signed-off-by: Adam Borowski --- arch/arm/configs/aspeed_g4_defconfig | 1 - arch/arm/configs/aspeed_g5_defconfig | 1 - arch/arm/configs/clps711x_defconfig| 1 - arch/arm/configs/ezx_defconfig | 2 -- arch/arm/configs/hisi_defconfig

[PATCH 14/17] lib: Completely purge now-unused bzip2 code from the kernel

2018-11-09 Thread Adam Borowski
All remaining references are userspace code to build tarballs, packages or such. Signed-off-by: Adam Borowski --- lib/Kconfig | 3 - lib/Makefile | 1 - lib/decompress.c | 4 - lib/decompress_bunzip2.c | 756 --- scripts/

Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags

2018-11-09 Thread Nick Desaulniers
On Mon, Nov 5, 2018 at 7:05 PM Masahiro Yamada wrote: > > Collect basic Clang options such as --target, --prefix, --gcc-toolchain, > -no-integrated-as into a single variable CLANG_FLAGS so that it can be > easily reused in other parts of Makefile. > > Signed-off-by: Masahiro Yamada > --- > > Chan

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-09 Thread Ram Pai
On Thu, Nov 08, 2018 at 09:23:35PM +0100, Florian Weimer wrote: > * Ram Pai: > > > Florian, > > > > I can. But I am struggling to understand the requirement. Why is > > this needed? Are we proposing a enhancement to the sys_pkey_alloc(), > > to be able to allocate keys that are initia

Re: [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally

2018-11-09 Thread Nick Desaulniers
On Mon, Nov 5, 2018 at 7:05 PM Masahiro Yamada wrote: > > We are still a way off the Clang's integrated assembler support for > the kernel. Hence, -no-integrated-as is mandatory to build the kernel > with Clang. If you had an ancient version of Clang that does not > recognize this option, you woul

[PATCH 2/3] powerpc: convert to generic builtin command line

2018-11-09 Thread Daniel Walker
This updates the powerpc code to use the CONFIG_GENERIC_CMDLINE option. [maksym.kok...@globallogic.com: add strlcat to prom_init_check.sh whitelist] Cc: Daniel Walker Cc: Daniel Walker Cc: xe-linux-exter...@cisco.com Signed-off-by: Daniel Walker Signed-off-by: Maksym Kokhan --- arch/powerpc/K

[PATCH 3/3] powerpc: convert config files to generic cmdline

2018-11-09 Thread Daniel Walker
This is a scripted mass convert of the config files to use the new generic cmdline. There is a bit of a trim effect here. It would seems that some of the config haven't been trimmed in a while. The script used to convert is as follows, if [[ -z "$1" || -z "$2" ]]; then echo "Two arguments

[PATCH 9/9] powerpc/smp: Use code patching to restore reset vector

2018-11-09 Thread Christophe Leroy
Instead of hardcoding reset vector restore, use patch_instruction() Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/86xx/mpc86xx_smp.c | 3 +-- arch/powerpc/platforms/powermac/smp.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/86xx

[PATCH 8/9] powerpc/44x: use patch_sites for TLB handlers patching

2018-11-09 Thread Christophe Leroy
Use patch sites and associated helpers to manage TLB handlers patching instead of hardcoding. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu-44x.h | 3 +++ arch/powerpc/kernel/head_44x.S | 11 +-- arch/powerpc/mm/44x_mmu.c | 14 +++--- 3 files chan

[PATCH 7/9] powerpc/signal: Use code patching instead of hardcoding

2018-11-09 Thread Christophe Leroy
Instead of hardcoding code modifications, use code patching functions. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 1 + arch/powerpc/kernel/signal_32.c | 12 ++-- arch/powerpc/kernel/signal_64.c | 7 --- 3 files changed, 11 insertions(+),

[PATCH 6/9] powerpc/8xx: use modify_instruction_site()

2018-11-09 Thread Christophe Leroy
Instead of hardcoding the TLB handlers patching, use the newly created modify_instruction_site() helper. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/8xx_mmu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/mm/8xx_mmu.c b/arch/powerpc/mm/8xx_mmu.c in

[PATCH 5/9] powerpc/book3s/32: Use patch_site to patch hash functions

2018-11-09 Thread Christophe Leroy
Use patch_sites and the new modify_instruction_site() function instead of hardcoding hash functions patching. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/mmu-hash.h | 6 + arch/powerpc/mm/hash_low_32.S | 33 ++--- arch/powerpc/m

[PATCH 4/9] powerpc/book3s/32: Use MMU_FTR_HPTE_TABLE in head_32.S

2018-11-09 Thread Christophe Leroy
Instead of manually patching a blr at hash_page() entry in MMU_init_hw(), this patch adds a features section in head_32.S Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 4 arch/powerpc/mm/ppc_mmu_32.c | 12 +--- 2 files changed, 5 insertions(+), 11 deletions(-

[PATCH 3/9] powerpc/32: use patch_site_addr() in machine_init()

2018-11-09 Thread Christophe Leroy
Use patch_site_addr() instead of hardcoding the address calculation in machine_init() Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup_32.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 819

[PATCH 2/9] powerpc: add modify_instruction() and modify_instruction_site()

2018-11-09 Thread Christophe Leroy
Add two helpers to avoid hardcoding of instructions modifications. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h in

[PATCH 1/9] powerpc: simplify patch_instruction_site() and patch_branch_site()

2018-11-09 Thread Christophe Leroy
Using patch_site_addr() helper, patch_instruction_site() and patch_branch_site() can be simplified and inlined. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 12 ++-- arch/powerpc/lib/code-patching.c | 16 2 files changed, 10 inse

UBSAN: Undefined behaviour in kernel/rcu/tree_plugin.h in 4.20-rc1

2018-11-09 Thread Christophe LEROY
(Resending due to error in Paul's address) Paul I get the following UBSAN reports in 4.20-rc1 on an MPC8321E (powerpc/book3s/32) I bisected it to 3e31009898699dfc ("rcu: Defer reporting RCU-preempt quiescent states when disabled") Thanks Christophe [4.919995]

UBSAN: Undefined behaviour in kernel/rcu/tree_plugin.h in 4.20-rc1

2018-11-09 Thread Christophe LEROY
Paul, I get the following UBSAN reports in 4.20-rc1 on an MPC8321E (powerpc/book3s/32) I bisected it to 3e31009898699dfc ("rcu: Defer reporting RCU-preempt quiescent states when disabled") Thanks Christophe [4.919995] ===

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-09 Thread Keith Busch
On Fri, Nov 09, 2018 at 03:32:57AM -0800, Greg Kroah-Hartman wrote: > On Fri, Nov 09, 2018 at 08:29:53AM +0100, Lukas Wunner wrote: > > On Thu, Nov 08, 2018 at 02:01:17PM -0800, Greg Kroah-Hartman wrote: > > > On Thu, Nov 08, 2018 at 02:09:17PM -0600, Bjorn Helgaas wrote: > > > > I'm having second

Re: [PATCH] powerpc/xmon: Fix invocation inside lock region

2018-11-09 Thread Thiago Jung Bauermann
Breno Leitao writes: > Currently xmon needs to get devtree_lock (through rtas_token()) during its > invocation (at crash time). If there is a crash while devtree_lock is being > held, then xmon tries to get the lock but spins forever and never get into > the interactive debugger, as in the foll

Re: [PATCH] powerpc: Add KVM guest defconfig

2018-11-09 Thread Breno Leitao
hi Satheesh, On 11/09/2018 07:59 AM, Satheesh Rajendran wrote: > On Thu, Nov 08, 2018 at 04:23:07PM -0200, Breno Leitao wrote: >> hi Satheesh, >> >> On 11/08/2018 03:08 AM, sathn...@linux.vnet.ibm.com wrote: >>> --- /dev/null >>> +++ b/arch/powerpc/configs/guest.config >>> @@ -0,0 +1,14 @@ >>> +CO

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-09 Thread Greg Kroah-Hartman
On Fri, Nov 09, 2018 at 08:29:53AM +0100, Lukas Wunner wrote: > On Thu, Nov 08, 2018 at 02:01:17PM -0800, Greg Kroah-Hartman wrote: > > On Thu, Nov 08, 2018 at 02:09:17PM -0600, Bjorn Helgaas wrote: > > > I'm having second thoughts about this. One thing I'm uncomfortable > > > with is that sprinkl

Re: [PATCH] powerpc: Add KVM guest defconfig

2018-11-09 Thread Satheesh Rajendran
On Thu, Nov 08, 2018 at 04:23:07PM -0200, Breno Leitao wrote: > hi Satheesh, > > On 11/08/2018 03:08 AM, sathn...@linux.vnet.ibm.com wrote: > > --- /dev/null > > +++ b/arch/powerpc/configs/guest.config > > @@ -0,0 +1,14 @@ > > +CONFIG_VIRTIO_BLK=y > > +CONFIG_VIRTIO_BLK_SCSI=y > > +CONFIG_SCSI_VIR