* [PATCH 1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild @ 2018-10-10 5:13 Michael Ellerman 2018-10-10 5:13 ` [PATCH 2/4] powerpc: Add -Werror at arch/powerpc level Michael Ellerman ` (3 more replies) 0 siblings, 4 replies; 19+ messages in thread From: Michael Ellerman @ 2018-10-10 5:13 UTC (permalink / raw) To: linuxppc-dev; +Cc: maddy, keescook This is a nice cleanup, arch/powerpc/Makefile is long and messy so moving this out helps a little. It also allows us to do: $ make arch/powerpc Which can be helpful if you just want to compile test some changes to arch code and not link everything. Finally it also gives us a single place to do subdir-cc-flags assignments which affect the whole of arch/powerpc, which we will do in a future patch. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> --- arch/powerpc/Kbuild | 14 ++++++++++++++ arch/powerpc/Makefile | 14 ++------------ 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 arch/powerpc/Kbuild diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild new file mode 100644 index 000000000000..690a498da050 --- /dev/null +++ b/arch/powerpc/Kbuild @@ -0,0 +1,14 @@ +obj-y += kernel/ +obj-y += mm/ +obj-y += lib/ +obj-y += sysdev/ +obj-y += platforms/ +obj-y += math-emu/ +obj-y += crypto/ +obj-y += net/ + +obj-$(CONFIG_XMON) += xmon/ +obj-$(CONFIG_KVM) += kvm/ + +obj-$(CONFIG_PERF_EVENTS) += perf/ +obj-$(CONFIG_KEXEC_FILE) += purgatory/ diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 974103254aed..e623abaa573e 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -269,18 +269,8 @@ head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o head-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += arch/powerpc/kernel/prom_init.o -core-y += arch/powerpc/kernel/ \ - arch/powerpc/mm/ \ - arch/powerpc/lib/ \ - arch/powerpc/sysdev/ \ - arch/powerpc/platforms/ \ - arch/powerpc/math-emu/ \ - arch/powerpc/crypto/ \ - arch/powerpc/net/ -core-$(CONFIG_XMON) += arch/powerpc/xmon/ -core-$(CONFIG_KVM) += arch/powerpc/kvm/ -core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/ -core-$(CONFIG_KEXEC_FILE) += arch/powerpc/purgatory/ +# See arch/powerpc/Kbuild for content of core part of the kernel +core-y += arch/powerpc/ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ -- 2.17.1 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/4] powerpc: Add -Werror at arch/powerpc level 2018-10-10 5:13 [PATCH 1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman @ 2018-10-10 5:13 ` Michael Ellerman 2018-10-19 2:51 ` [2/4] " Michael Ellerman 2018-10-10 5:13 ` [PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS Michael Ellerman ` (2 subsequent siblings) 3 siblings, 1 reply; 19+ messages in thread From: Michael Ellerman @ 2018-10-10 5:13 UTC (permalink / raw) To: linuxppc-dev; +Cc: maddy, keescook Back when I added -Werror in commit ba55bd74360e ("powerpc: Add configurable -Werror for arch/powerpc") I did it by adding it to most of the arch Makefiles. At the time we excluded math-emu, because apparently it didn't build cleanly. But that seems to have been fixed somewhere in the interim. So move the -Werror addition to the top-level of the arch, this saves us from repeating it in every Makefile and means we won't forget to add it to any new sub-dirs. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> --- arch/powerpc/Kbuild | 2 ++ arch/powerpc/kernel/Makefile | 2 -- arch/powerpc/kernel/trace/Makefile | 2 -- arch/powerpc/kvm/Makefile | 2 -- arch/powerpc/lib/Makefile | 2 -- arch/powerpc/mm/Makefile | 2 -- arch/powerpc/oprofile/Makefile | 1 - arch/powerpc/perf/Makefile | 1 - arch/powerpc/platforms/Makefile | 2 -- arch/powerpc/sysdev/Makefile | 3 --- arch/powerpc/sysdev/xics/Makefile | 1 - arch/powerpc/sysdev/xive/Makefile | 1 - arch/powerpc/xmon/Makefile | 2 -- 13 files changed, 2 insertions(+), 21 deletions(-) diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild index 690a498da050..1625a06802ca 100644 --- a/arch/powerpc/Kbuild +++ b/arch/powerpc/Kbuild @@ -1,3 +1,5 @@ +subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror + obj-y += kernel/ obj-y += mm/ obj-y += lib/ diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 85ffa488dfb5..006e391814ed 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -5,8 +5,6 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - ifdef CONFIG_PPC64 CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) endif diff --git a/arch/powerpc/kernel/trace/Makefile b/arch/powerpc/kernel/trace/Makefile index d868ba42032f..b1725ad3e13d 100644 --- a/arch/powerpc/kernel/trace/Makefile +++ b/arch/powerpc/kernel/trace/Makefile @@ -3,8 +3,6 @@ # Makefile for the powerpc trace subsystem # -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - ifdef CONFIG_FUNCTION_TRACER # do not trace tracer code CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile index f872c04bb5b1..e9d579921a96 100644 --- a/arch/powerpc/kvm/Makefile +++ b/arch/powerpc/kvm/Makefile @@ -3,8 +3,6 @@ # Makefile for Kernel-based Virtual Machine module # -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm KVM := ../../../virt/kvm diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 670286808928..703afa1808ed 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -3,8 +3,6 @@ # Makefile for ppc-specific library files.. # -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE) diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile index cdf6a9960046..90e103ab44fb 100644 --- a/arch/powerpc/mm/Makefile +++ b/arch/powerpc/mm/Makefile @@ -3,8 +3,6 @@ # Makefile for the linux ppc-specific parts of the memory manager. # -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) obj-y := fault.o mem.o pgtable.o mmap.o \ diff --git a/arch/powerpc/oprofile/Makefile b/arch/powerpc/oprofile/Makefile index 7a7834c39f64..8d26d7416481 100644 --- a/arch/powerpc/oprofile/Makefile +++ b/arch/powerpc/oprofile/Makefile @@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) diff --git a/arch/powerpc/perf/Makefile b/arch/powerpc/perf/Makefile index 82986d2acd9b..ab26df5bacb9 100644 --- a/arch/powerpc/perf/Makefile +++ b/arch/powerpc/perf/Makefile @@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror obj-$(CONFIG_PERF_EVENTS) += callchain.o perf_regs.o diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile index e46bb7ea710f..143d4417f6cc 100644 --- a/arch/powerpc/platforms/Makefile +++ b/arch/powerpc/platforms/Makefile @@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - obj-$(CONFIG_FSL_ULI1575) += fsl_uli1575.o obj-$(CONFIG_PPC_PMAC) += powermac/ diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index f730539074c4..2caa4defdfb6 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) @@ -56,8 +55,6 @@ obj-$(CONFIG_PPC_SCOM) += scom.o obj-$(CONFIG_PPC_EARLY_DEBUG_MEMCONS) += udbg_memcons.o -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - obj-$(CONFIG_PPC_XICS) += xics/ obj-$(CONFIG_PPC_XIVE) += xive/ diff --git a/arch/powerpc/sysdev/xics/Makefile b/arch/powerpc/sysdev/xics/Makefile index 5d438d92472b..ba1e3117b1c0 100644 --- a/arch/powerpc/sysdev/xics/Makefile +++ b/arch/powerpc/sysdev/xics/Makefile @@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror obj-y += xics-common.o obj-$(CONFIG_PPC_ICP_NATIVE) += icp-native.o diff --git a/arch/powerpc/sysdev/xive/Makefile b/arch/powerpc/sysdev/xive/Makefile index 536d6e5706e3..dea2abc23f4d 100644 --- a/arch/powerpc/sysdev/xive/Makefile +++ b/arch/powerpc/sysdev/xive/Makefile @@ -1,4 +1,3 @@ -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror obj-y += common.o obj-$(CONFIG_PPC_XIVE_NATIVE) += native.o diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile index 93cc1f1b8b61..ab5f66affb06 100644 --- a/arch/powerpc/xmon/Makefile +++ b/arch/powerpc/xmon/Makefile @@ -1,8 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for xmon -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror - GCOV_PROFILE := n UBSAN_SANITIZE := n -- 2.17.1 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [2/4] powerpc: Add -Werror at arch/powerpc level 2018-10-10 5:13 ` [PATCH 2/4] powerpc: Add -Werror at arch/powerpc level Michael Ellerman @ 2018-10-19 2:51 ` Michael Ellerman 0 siblings, 0 replies; 19+ messages in thread From: Michael Ellerman @ 2018-10-19 2:51 UTC (permalink / raw) To: Michael Ellerman, linuxppc-dev; +Cc: maddy, keescook On Wed, 2018-10-10 at 05:13:06 UTC, Michael Ellerman wrote: > Back when I added -Werror in commit ba55bd74360e ("powerpc: Add > configurable -Werror for arch/powerpc") I did it by adding it to most > of the arch Makefiles. > > At the time we excluded math-emu, because apparently it didn't build > cleanly. But that seems to have been fixed somewhere in the interim. > > So move the -Werror addition to the top-level of the arch, this saves > us from repeating it in every Makefile and means we won't forget to > add it to any new sub-dirs. > > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Applied to powerpc next. https://git.kernel.org/powerpc/c/23ad1a2700725d46ee7760920974c6 cheers ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS 2018-10-10 5:13 [PATCH 1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman 2018-10-10 5:13 ` [PATCH 2/4] powerpc: Add -Werror at arch/powerpc level Michael Ellerman @ 2018-10-10 5:13 ` Michael Ellerman 2018-10-10 14:45 ` Kees Cook 2018-10-10 5:13 ` [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough " Michael Ellerman 2018-10-19 2:51 ` [1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman 3 siblings, 1 reply; 19+ messages in thread From: Michael Ellerman @ 2018-10-10 5:13 UTC (permalink / raw) To: linuxppc-dev; +Cc: maddy, keescook Upstream has declared that Variable Length Array's (VLAs) are a bad idea, and eventually -Wvla will be added to the top-level Makefile. We can go one better and make sure we don't introduce any more by adding it to the arch Makefile. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> --- arch/powerpc/Kbuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild index 1625a06802ca..86b261d6bde5 100644 --- a/arch/powerpc/Kbuild +++ b/arch/powerpc/Kbuild @@ -1,4 +1,5 @@ -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror +subdir-ccflags-y := $(call cc-option, -Wvla) +subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror obj-y += kernel/ obj-y += mm/ -- 2.17.1 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS 2018-10-10 5:13 ` [PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS Michael Ellerman @ 2018-10-10 14:45 ` Kees Cook 2018-10-11 0:30 ` Michael Ellerman 0 siblings, 1 reply; 19+ messages in thread From: Kees Cook @ 2018-10-10 14:45 UTC (permalink / raw) To: Michael Ellerman; +Cc: linuxppc-dev, maddy On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: > Upstream has declared that Variable Length Array's (VLAs) are a bad > idea, and eventually -Wvla will be added to the top-level Makefile. We > can go one better and make sure we don't introduce any more by adding > it to the arch Makefile. > > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> > --- > arch/powerpc/Kbuild | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild > index 1625a06802ca..86b261d6bde5 100644 > --- a/arch/powerpc/Kbuild > +++ b/arch/powerpc/Kbuild > @@ -1,4 +1,5 @@ > -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror > +subdir-ccflags-y := $(call cc-option, -Wvla) > +subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror > > obj-y += kernel/ > obj-y += mm/ -Wvla will be going into the top-level Makefile in the merge window (see linux-next), so this will be redundant. -Kees -- Kees Cook Pixel Security ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS 2018-10-10 14:45 ` Kees Cook @ 2018-10-11 0:30 ` Michael Ellerman 0 siblings, 0 replies; 19+ messages in thread From: Michael Ellerman @ 2018-10-11 0:30 UTC (permalink / raw) To: Kees Cook; +Cc: linuxppc-dev, maddy Kees Cook <keescook@chromium.org> writes: > On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: >> Upstream has declared that Variable Length Array's (VLAs) are a bad >> idea, and eventually -Wvla will be added to the top-level Makefile. We >> can go one better and make sure we don't introduce any more by adding >> it to the arch Makefile. >> >> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> >> --- >> arch/powerpc/Kbuild | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild >> index 1625a06802ca..86b261d6bde5 100644 >> --- a/arch/powerpc/Kbuild >> +++ b/arch/powerpc/Kbuild >> @@ -1,4 +1,5 @@ >> -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror >> +subdir-ccflags-y := $(call cc-option, -Wvla) >> +subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror >> >> obj-y += kernel/ >> obj-y += mm/ > > -Wvla will be going into the top-level Makefile in the merge window > (see linux-next), so this will be redundant. Thanks, yeah I saw that after I posted. Will drop this one. cheers ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-10 5:13 [PATCH 1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman 2018-10-10 5:13 ` [PATCH 2/4] powerpc: Add -Werror at arch/powerpc level Michael Ellerman 2018-10-10 5:13 ` [PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS Michael Ellerman @ 2018-10-10 5:13 ` Michael Ellerman 2018-10-10 14:47 ` Kees Cook ` (2 more replies) 2018-10-19 2:51 ` [1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman 3 siblings, 3 replies; 19+ messages in thread From: Michael Ellerman @ 2018-10-10 5:13 UTC (permalink / raw) To: linuxppc-dev; +Cc: maddy, keescook Warn whenever a switch statement has a fallthrough without a comment annotating it. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> --- arch/powerpc/Kbuild | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild index 86b261d6bde5..ef625f1db576 100644 --- a/arch/powerpc/Kbuild +++ b/arch/powerpc/Kbuild @@ -1,4 +1,5 @@ subdir-ccflags-y := $(call cc-option, -Wvla) +subdir-ccflags-y += $(call cc-option, -Wimplicit-fallthrough) subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror obj-y += kernel/ -- 2.17.1 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-10 5:13 ` [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough " Michael Ellerman @ 2018-10-10 14:47 ` Kees Cook 2018-10-11 0:32 ` Michael Ellerman 2018-10-10 16:55 ` kbuild test robot 2018-10-10 17:00 ` kbuild test robot 2 siblings, 1 reply; 19+ messages in thread From: Kees Cook @ 2018-10-10 14:47 UTC (permalink / raw) To: Michael Ellerman; +Cc: linuxppc-dev, maddy, Gustavo A. R. Silva On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: > Warn whenever a switch statement has a fallthrough without a comment > annotating it. > > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Yes please. :) Reviewed-by: Kees Cook <keescook@chromium.org> -Kees > --- > arch/powerpc/Kbuild | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild > index 86b261d6bde5..ef625f1db576 100644 > --- a/arch/powerpc/Kbuild > +++ b/arch/powerpc/Kbuild > @@ -1,4 +1,5 @@ > subdir-ccflags-y := $(call cc-option, -Wvla) > +subdir-ccflags-y += $(call cc-option, -Wimplicit-fallthrough) > subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror > > obj-y += kernel/ > -- > 2.17.1 > -- Kees Cook Pixel Security ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-10 14:47 ` Kees Cook @ 2018-10-11 0:32 ` Michael Ellerman 2018-10-11 1:35 ` Kees Cook 2018-10-11 15:23 ` Gustavo A. R. Silva 0 siblings, 2 replies; 19+ messages in thread From: Michael Ellerman @ 2018-10-11 0:32 UTC (permalink / raw) To: Kees Cook; +Cc: linuxppc-dev, maddy, Gustavo A. R. Silva Kees Cook <keescook@chromium.org> writes: > On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: >> Warn whenever a switch statement has a fallthrough without a comment >> annotating it. >> >> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> > > Yes please. :) > > Reviewed-by: Kees Cook <keescook@chromium.org> Haha, thanks. It still pops a few errors, including in linux/signal.h & compat.h, so it's somewhat aspirational until we can get those fixed up :) cheers ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-11 0:32 ` Michael Ellerman @ 2018-10-11 1:35 ` Kees Cook 2018-10-11 13:11 ` Gustavo A. R. Silva 2018-10-11 15:23 ` Gustavo A. R. Silva 1 sibling, 1 reply; 19+ messages in thread From: Kees Cook @ 2018-10-11 1:35 UTC (permalink / raw) To: Michael Ellerman; +Cc: linuxppc-dev, maddy, Gustavo A. R. Silva On Wed, Oct 10, 2018 at 5:32 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: > Kees Cook <keescook@chromium.org> writes: >> On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: >>> Warn whenever a switch statement has a fallthrough without a comment >>> annotating it. >>> >>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> >> >> Yes please. :) >> >> Reviewed-by: Kees Cook <keescook@chromium.org> > > Haha, thanks. > > It still pops a few errors, including in linux/signal.h & compat.h, so > it's somewhat aspirational until we can get those fixed up :) Gustavo, any chance you can target those two files? It could get us a whole architecture using the flag. :) -Kees -- Kees Cook Pixel Security ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-11 1:35 ` Kees Cook @ 2018-10-11 13:11 ` Gustavo A. R. Silva 0 siblings, 0 replies; 19+ messages in thread From: Gustavo A. R. Silva @ 2018-10-11 13:11 UTC (permalink / raw) To: Kees Cook, Michael Ellerman; +Cc: linuxppc-dev, maddy On 10/11/18 3:35 AM, Kees Cook wrote: > On Wed, Oct 10, 2018 at 5:32 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: >> Kees Cook <keescook@chromium.org> writes: >>> On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@ellerman.id.au> wrote: >>>> Warn whenever a switch statement has a fallthrough without a comment >>>> annotating it. >>>> >>>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> >>> >>> Yes please. :) >>> >>> Reviewed-by: Kees Cook <keescook@chromium.org> >> >> Haha, thanks. >> >> It still pops a few errors, including in linux/signal.h & compat.h, so >> it's somewhat aspirational until we can get those fixed up :) > > Gustavo, any chance you can target those two files? It could get us a > whole architecture using the flag. :) > Yep. Sure thing. I'm already taking a look. Thanks -- Gustavo ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-11 0:32 ` Michael Ellerman 2018-10-11 1:35 ` Kees Cook @ 2018-10-11 15:23 ` Gustavo A. R. Silva 2018-10-12 9:32 ` Michael Ellerman 1 sibling, 1 reply; 19+ messages in thread From: Gustavo A. R. Silva @ 2018-10-11 15:23 UTC (permalink / raw) To: Michael Ellerman, Kees Cook; +Cc: linuxppc-dev, maddy Hi Michael, On 10/11/18 2:32 AM, Michael Ellerman wrote: > It still pops a few errors, including in linux/signal.h & compat.h, so > it's somewhat aspirational until we can get those fixed up :) > I wonder if you have a log containing those warnings that you can share with me. I'd like to fix them up. Thanks -- Gustavo ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-11 15:23 ` Gustavo A. R. Silva @ 2018-10-12 9:32 ` Michael Ellerman 2018-10-12 9:59 ` Gustavo A. R. Silva 0 siblings, 1 reply; 19+ messages in thread From: Michael Ellerman @ 2018-10-12 9:32 UTC (permalink / raw) To: Gustavo A. R. Silva, Kees Cook; +Cc: linuxppc-dev, maddy "Gustavo A. R. Silva" <gustavo@embeddedor.com> writes: > Hi Michael, > > On 10/11/18 2:32 AM, Michael Ellerman wrote: > >> It still pops a few errors, including in linux/signal.h & compat.h, so >> it's somewhat aspirational until we can get those fixed up :) >> > > I wonder if you have a log containing those warnings that you can > share with me. Sure. The kbuild report up thread has some or most of them. But here's a full list: Failed 279/290 http://kisskb.ellerman.id.au/kisskb/head/1d59e2c78793d8aea9949ca71323c4583c78f488/ Failed: powerpc-next/ppc64_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542791/log/) /kisskb/src/arch/powerpc/platforms/powermac/feature.c:1477:6: error: this statement may fall through [-Werror=implicit-fallthrough=] /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] /kisskb/src/include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=] /kisskb/src/include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=] /kisskb/src/include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=] Failed: powerpc-next/corenet64_smp_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542786/log/) /kisskb/src/include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=] /kisskb/src/include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=] /kisskb/src/include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=] Failed: powerpc-next/ppc64le_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542777/log/) /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] Failed: powerpc-next/powernv_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542776/log/) /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] cheers ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-12 9:32 ` Michael Ellerman @ 2018-10-12 9:59 ` Gustavo A. R. Silva 2018-10-13 1:23 ` Kees Cook 0 siblings, 1 reply; 19+ messages in thread From: Gustavo A. R. Silva @ 2018-10-12 9:59 UTC (permalink / raw) To: Michael Ellerman, Kees Cook; +Cc: linuxppc-dev, maddy On 10/12/18 11:32 AM, Michael Ellerman wrote: > > Sure. The kbuild report up thread has some or most of them. > > But here's a full list: > > Failed 279/290 > http://kisskb.ellerman.id.au/kisskb/head/1d59e2c78793d8aea9949ca71323c4583c78f488/ > Failed: powerpc-next/ppc64_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542791/log/) > /kisskb/src/arch/powerpc/platforms/powermac/feature.c:1477:6: error: this statement may fall through [-Werror=implicit-fallthrough=] > /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] > /kisskb/src/include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=] > /kisskb/src/include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=] > /kisskb/src/include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=] > Failed: powerpc-next/corenet64_smp_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542786/log/) > /kisskb/src/include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=] > /kisskb/src/include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=] > /kisskb/src/include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=] > Failed: powerpc-next/ppc64le_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542777/log/) > /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] > Failed: powerpc-next/powernv_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542776/log/) > /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] > Thanks, Michael. Kees, can you take the patches? Apparently, neither signal.h nor compat.h have a dedicated maintainer: $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback include/linux/signal.h linux-kernel@vger.kernel.org (open list) $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback include/linux/compat.h linux-kernel@vger.kernel.org (open list) Thanks -- Gustavo ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-12 9:59 ` Gustavo A. R. Silva @ 2018-10-13 1:23 ` Kees Cook 2018-10-13 7:39 ` Gustavo A. R. Silva 0 siblings, 1 reply; 19+ messages in thread From: Kees Cook @ 2018-10-13 1:23 UTC (permalink / raw) To: Gustavo A. R. Silva; +Cc: maddy, linuxppc-dev On Fri, Oct 12, 2018 at 2:59 AM, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote: > > > On 10/12/18 11:32 AM, Michael Ellerman wrote: >> >> Sure. The kbuild report up thread has some or most of them. >> >> But here's a full list: >> >> Failed 279/290 >> http://kisskb.ellerman.id.au/kisskb/head/1d59e2c78793d8aea9949ca71323c4583c78f488/ >> Failed: powerpc-next/ppc64_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542791/log/) >> /kisskb/src/arch/powerpc/platforms/powermac/feature.c:1477:6: error: this statement may fall through [-Werror=implicit-fallthrough=] >> /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] >> /kisskb/src/include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=] >> /kisskb/src/include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=] >> /kisskb/src/include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=] >> Failed: powerpc-next/corenet64_smp_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542786/log/) >> /kisskb/src/include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=] >> /kisskb/src/include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=] >> /kisskb/src/include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=] >> Failed: powerpc-next/ppc64le_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542777/log/) >> /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] >> Failed: powerpc-next/powernv_defconfig/powerpc-gcc8 (http://kisskb.ellerman.id.au/kisskb/buildresult/13542776/log/) >> /kisskb/src/include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] >> > > Thanks, Michael. > > > Kees, can you take the patches? > > Apparently, neither signal.h nor compat.h have a dedicated maintainer: > > $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback include/linux/signal.h > linux-kernel@vger.kernel.org (open list) > > $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback include/linux/compat.h > linux-kernel@vger.kernel.org (open list) Normally things like that go through akpm, but I'm happy to carry them if needed. -Kees -- Kees Cook Pixel Security ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-13 1:23 ` Kees Cook @ 2018-10-13 7:39 ` Gustavo A. R. Silva 0 siblings, 0 replies; 19+ messages in thread From: Gustavo A. R. Silva @ 2018-10-13 7:39 UTC (permalink / raw) To: Kees Cook; +Cc: maddy, linuxppc-dev On 10/13/18 3:23 AM, Kees Cook wrote: >> >> $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback include/linux/compat.h >> linux-kernel@vger.kernel.org (open list) > > Normally things like that go through akpm, but I'm happy to carry them > if needed. > Oh okay. Let me try through apkm first. :) Thanks -- Gustavo ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-10 5:13 ` [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough " Michael Ellerman 2018-10-10 14:47 ` Kees Cook @ 2018-10-10 16:55 ` kbuild test robot 2018-10-10 17:00 ` kbuild test robot 2 siblings, 0 replies; 19+ messages in thread From: kbuild test robot @ 2018-10-10 16:55 UTC (permalink / raw) To: Michael Ellerman; +Cc: linuxppc-dev, maddy, kbuild-all, keescook [-- Attachment #1: Type: text/plain, Size: 15143 bytes --] Hi Michael, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v4.19-rc7 next-20181010] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Michael-Ellerman/powerpc-Move-core-kernel-logic-into-arch-powerpc-Kbuild/20181010-205834 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-socrates_defconfig (attached as .config) compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=7.2.0 make.cross ARCH=powerpc All errors (new ones prefixed by >>): arch/powerpc/kernel/align.c: In function 'emulate_spe': >> arch/powerpc/kernel/align.c:183:8: error: this statement may fall through [-Werror=implicit-fallthrough=] ret |= __get_user_inatomic(temp.v[3], p++); ^~ arch/powerpc/kernel/align.c:184:3: note: here case 4: ^~~~ arch/powerpc/kernel/align.c:186:8: error: this statement may fall through [-Werror=implicit-fallthrough=] ret |= __get_user_inatomic(temp.v[5], p++); ^~ arch/powerpc/kernel/align.c:187:3: note: here case 2: ^~~~ arch/powerpc/kernel/align.c:266:8: error: this statement may fall through [-Werror=implicit-fallthrough=] ret |= __put_user_inatomic(data.v[3], p++); ^~ arch/powerpc/kernel/align.c:267:3: note: here case 4: ^~~~ arch/powerpc/kernel/align.c:269:8: error: this statement may fall through [-Werror=implicit-fallthrough=] ret |= __put_user_inatomic(data.v[5], p++); ^~ arch/powerpc/kernel/align.c:270:3: note: here case 2: ^~~~ cc1: all warnings being treated as errors vim +183 arch/powerpc/kernel/align.c 26caeb2e Kumar Gala 2007-08-24 104 26caeb2e Kumar Gala 2007-08-24 105 /* 26caeb2e Kumar Gala 2007-08-24 106 * Emulate SPE loads and stores. 26caeb2e Kumar Gala 2007-08-24 107 * Only Book-E has these instructions, and it does true little-endian, 26caeb2e Kumar Gala 2007-08-24 108 * so we don't need the address swizzling. 26caeb2e Kumar Gala 2007-08-24 109 */ 26caeb2e Kumar Gala 2007-08-24 110 static int emulate_spe(struct pt_regs *regs, unsigned int reg, 26caeb2e Kumar Gala 2007-08-24 111 unsigned int instr) 26caeb2e Kumar Gala 2007-08-24 112 { f626190d Anton Blanchard 2013-09-23 113 int ret; 26caeb2e Kumar Gala 2007-08-24 114 union { 26caeb2e Kumar Gala 2007-08-24 115 u64 ll; 26caeb2e Kumar Gala 2007-08-24 116 u32 w[2]; 26caeb2e Kumar Gala 2007-08-24 117 u16 h[4]; 26caeb2e Kumar Gala 2007-08-24 118 u8 v[8]; 26caeb2e Kumar Gala 2007-08-24 119 } data, temp; 26caeb2e Kumar Gala 2007-08-24 120 unsigned char __user *p, *addr; 26caeb2e Kumar Gala 2007-08-24 121 unsigned long *evr = ¤t->thread.evr[reg]; 26caeb2e Kumar Gala 2007-08-24 122 unsigned int nb, flags; 26caeb2e Kumar Gala 2007-08-24 123 26caeb2e Kumar Gala 2007-08-24 124 instr = (instr >> 1) & 0x1f; 26caeb2e Kumar Gala 2007-08-24 125 26caeb2e Kumar Gala 2007-08-24 126 /* DAR has the operand effective address */ 26caeb2e Kumar Gala 2007-08-24 127 addr = (unsigned char __user *)regs->dar; 26caeb2e Kumar Gala 2007-08-24 128 26caeb2e Kumar Gala 2007-08-24 129 nb = spe_aligninfo[instr].len; 26caeb2e Kumar Gala 2007-08-24 130 flags = spe_aligninfo[instr].flags; 26caeb2e Kumar Gala 2007-08-24 131 26caeb2e Kumar Gala 2007-08-24 132 /* Verify the address of the operand */ 26caeb2e Kumar Gala 2007-08-24 133 if (unlikely(user_mode(regs) && 26caeb2e Kumar Gala 2007-08-24 134 !access_ok((flags & ST ? VERIFY_WRITE : VERIFY_READ), 26caeb2e Kumar Gala 2007-08-24 135 addr, nb))) 26caeb2e Kumar Gala 2007-08-24 136 return -EFAULT; 26caeb2e Kumar Gala 2007-08-24 137 26caeb2e Kumar Gala 2007-08-24 138 /* userland only */ 26caeb2e Kumar Gala 2007-08-24 139 if (unlikely(!user_mode(regs))) 26caeb2e Kumar Gala 2007-08-24 140 return 0; 26caeb2e Kumar Gala 2007-08-24 141 26caeb2e Kumar Gala 2007-08-24 142 flush_spe_to_thread(current); 26caeb2e Kumar Gala 2007-08-24 143 26caeb2e Kumar Gala 2007-08-24 144 /* If we are loading, get the data from user space, else 26caeb2e Kumar Gala 2007-08-24 145 * get it from register values 26caeb2e Kumar Gala 2007-08-24 146 */ 26caeb2e Kumar Gala 2007-08-24 147 if (flags & ST) { 26caeb2e Kumar Gala 2007-08-24 148 data.ll = 0; 26caeb2e Kumar Gala 2007-08-24 149 switch (instr) { 26caeb2e Kumar Gala 2007-08-24 150 case EVSTDD: 26caeb2e Kumar Gala 2007-08-24 151 case EVSTDW: 26caeb2e Kumar Gala 2007-08-24 152 case EVSTDH: 26caeb2e Kumar Gala 2007-08-24 153 data.w[0] = *evr; 26caeb2e Kumar Gala 2007-08-24 154 data.w[1] = regs->gpr[reg]; 26caeb2e Kumar Gala 2007-08-24 155 break; 26caeb2e Kumar Gala 2007-08-24 156 case EVSTWHE: 26caeb2e Kumar Gala 2007-08-24 157 data.h[2] = *evr >> 16; 26caeb2e Kumar Gala 2007-08-24 158 data.h[3] = regs->gpr[reg] >> 16; 26caeb2e Kumar Gala 2007-08-24 159 break; 26caeb2e Kumar Gala 2007-08-24 160 case EVSTWHO: 26caeb2e Kumar Gala 2007-08-24 161 data.h[2] = *evr & 0xffff; 26caeb2e Kumar Gala 2007-08-24 162 data.h[3] = regs->gpr[reg] & 0xffff; 26caeb2e Kumar Gala 2007-08-24 163 break; 26caeb2e Kumar Gala 2007-08-24 164 case EVSTWWE: 26caeb2e Kumar Gala 2007-08-24 165 data.w[1] = *evr; 26caeb2e Kumar Gala 2007-08-24 166 break; 26caeb2e Kumar Gala 2007-08-24 167 case EVSTWWO: 26caeb2e Kumar Gala 2007-08-24 168 data.w[1] = regs->gpr[reg]; 26caeb2e Kumar Gala 2007-08-24 169 break; 26caeb2e Kumar Gala 2007-08-24 170 default: 26caeb2e Kumar Gala 2007-08-24 171 return -EINVAL; 26caeb2e Kumar Gala 2007-08-24 172 } 26caeb2e Kumar Gala 2007-08-24 173 } else { 26caeb2e Kumar Gala 2007-08-24 174 temp.ll = data.ll = 0; 26caeb2e Kumar Gala 2007-08-24 175 ret = 0; 26caeb2e Kumar Gala 2007-08-24 176 p = addr; 26caeb2e Kumar Gala 2007-08-24 177 26caeb2e Kumar Gala 2007-08-24 178 switch (nb) { 26caeb2e Kumar Gala 2007-08-24 179 case 8: 26caeb2e Kumar Gala 2007-08-24 180 ret |= __get_user_inatomic(temp.v[0], p++); 26caeb2e Kumar Gala 2007-08-24 181 ret |= __get_user_inatomic(temp.v[1], p++); 26caeb2e Kumar Gala 2007-08-24 182 ret |= __get_user_inatomic(temp.v[2], p++); 26caeb2e Kumar Gala 2007-08-24 @183 ret |= __get_user_inatomic(temp.v[3], p++); 26caeb2e Kumar Gala 2007-08-24 184 case 4: 26caeb2e Kumar Gala 2007-08-24 185 ret |= __get_user_inatomic(temp.v[4], p++); 26caeb2e Kumar Gala 2007-08-24 186 ret |= __get_user_inatomic(temp.v[5], p++); 26caeb2e Kumar Gala 2007-08-24 187 case 2: 26caeb2e Kumar Gala 2007-08-24 188 ret |= __get_user_inatomic(temp.v[6], p++); 26caeb2e Kumar Gala 2007-08-24 189 ret |= __get_user_inatomic(temp.v[7], p++); 26caeb2e Kumar Gala 2007-08-24 190 if (unlikely(ret)) 26caeb2e Kumar Gala 2007-08-24 191 return -EFAULT; 26caeb2e Kumar Gala 2007-08-24 192 } 26caeb2e Kumar Gala 2007-08-24 193 26caeb2e Kumar Gala 2007-08-24 194 switch (instr) { 26caeb2e Kumar Gala 2007-08-24 195 case EVLDD: 26caeb2e Kumar Gala 2007-08-24 196 case EVLDW: 26caeb2e Kumar Gala 2007-08-24 197 case EVLDH: 26caeb2e Kumar Gala 2007-08-24 198 data.ll = temp.ll; 26caeb2e Kumar Gala 2007-08-24 199 break; 26caeb2e Kumar Gala 2007-08-24 200 case EVLHHESPLAT: 26caeb2e Kumar Gala 2007-08-24 201 data.h[0] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 202 data.h[2] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 203 break; 26caeb2e Kumar Gala 2007-08-24 204 case EVLHHOUSPLAT: 26caeb2e Kumar Gala 2007-08-24 205 case EVLHHOSSPLAT: 26caeb2e Kumar Gala 2007-08-24 206 data.h[1] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 207 data.h[3] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 208 break; 26caeb2e Kumar Gala 2007-08-24 209 case EVLWHE: 26caeb2e Kumar Gala 2007-08-24 210 data.h[0] = temp.h[2]; 26caeb2e Kumar Gala 2007-08-24 211 data.h[2] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 212 break; 26caeb2e Kumar Gala 2007-08-24 213 case EVLWHOU: 26caeb2e Kumar Gala 2007-08-24 214 case EVLWHOS: 26caeb2e Kumar Gala 2007-08-24 215 data.h[1] = temp.h[2]; 26caeb2e Kumar Gala 2007-08-24 216 data.h[3] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 217 break; 26caeb2e Kumar Gala 2007-08-24 218 case EVLWWSPLAT: 26caeb2e Kumar Gala 2007-08-24 219 data.w[0] = temp.w[1]; 26caeb2e Kumar Gala 2007-08-24 220 data.w[1] = temp.w[1]; 26caeb2e Kumar Gala 2007-08-24 221 break; 26caeb2e Kumar Gala 2007-08-24 222 case EVLWHSPLAT: 26caeb2e Kumar Gala 2007-08-24 223 data.h[0] = temp.h[2]; 26caeb2e Kumar Gala 2007-08-24 224 data.h[1] = temp.h[2]; 26caeb2e Kumar Gala 2007-08-24 225 data.h[2] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 226 data.h[3] = temp.h[3]; 26caeb2e Kumar Gala 2007-08-24 227 break; 26caeb2e Kumar Gala 2007-08-24 228 default: 26caeb2e Kumar Gala 2007-08-24 229 return -EINVAL; 26caeb2e Kumar Gala 2007-08-24 230 } 26caeb2e Kumar Gala 2007-08-24 231 } 26caeb2e Kumar Gala 2007-08-24 232 26caeb2e Kumar Gala 2007-08-24 233 if (flags & SW) { 26caeb2e Kumar Gala 2007-08-24 234 switch (flags & 0xf0) { 26caeb2e Kumar Gala 2007-08-24 235 case E8: f626190d Anton Blanchard 2013-09-23 236 data.ll = swab64(data.ll); 26caeb2e Kumar Gala 2007-08-24 237 break; 26caeb2e Kumar Gala 2007-08-24 238 case E4: f626190d Anton Blanchard 2013-09-23 239 data.w[0] = swab32(data.w[0]); f626190d Anton Blanchard 2013-09-23 240 data.w[1] = swab32(data.w[1]); 26caeb2e Kumar Gala 2007-08-24 241 break; 26caeb2e Kumar Gala 2007-08-24 242 /* Its half word endian */ 26caeb2e Kumar Gala 2007-08-24 243 default: f626190d Anton Blanchard 2013-09-23 244 data.h[0] = swab16(data.h[0]); f626190d Anton Blanchard 2013-09-23 245 data.h[1] = swab16(data.h[1]); f626190d Anton Blanchard 2013-09-23 246 data.h[2] = swab16(data.h[2]); f626190d Anton Blanchard 2013-09-23 247 data.h[3] = swab16(data.h[3]); 26caeb2e Kumar Gala 2007-08-24 248 break; 26caeb2e Kumar Gala 2007-08-24 249 } 26caeb2e Kumar Gala 2007-08-24 250 } 26caeb2e Kumar Gala 2007-08-24 251 26caeb2e Kumar Gala 2007-08-24 252 if (flags & SE) { 26caeb2e Kumar Gala 2007-08-24 253 data.w[0] = (s16)data.h[1]; 26caeb2e Kumar Gala 2007-08-24 254 data.w[1] = (s16)data.h[3]; 26caeb2e Kumar Gala 2007-08-24 255 } 26caeb2e Kumar Gala 2007-08-24 256 26caeb2e Kumar Gala 2007-08-24 257 /* Store result to memory or update registers */ 26caeb2e Kumar Gala 2007-08-24 258 if (flags & ST) { 26caeb2e Kumar Gala 2007-08-24 259 ret = 0; 26caeb2e Kumar Gala 2007-08-24 260 p = addr; 26caeb2e Kumar Gala 2007-08-24 261 switch (nb) { 26caeb2e Kumar Gala 2007-08-24 262 case 8: 26caeb2e Kumar Gala 2007-08-24 263 ret |= __put_user_inatomic(data.v[0], p++); 26caeb2e Kumar Gala 2007-08-24 264 ret |= __put_user_inatomic(data.v[1], p++); 26caeb2e Kumar Gala 2007-08-24 265 ret |= __put_user_inatomic(data.v[2], p++); 26caeb2e Kumar Gala 2007-08-24 266 ret |= __put_user_inatomic(data.v[3], p++); 26caeb2e Kumar Gala 2007-08-24 267 case 4: 26caeb2e Kumar Gala 2007-08-24 268 ret |= __put_user_inatomic(data.v[4], p++); 26caeb2e Kumar Gala 2007-08-24 269 ret |= __put_user_inatomic(data.v[5], p++); 26caeb2e Kumar Gala 2007-08-24 270 case 2: 26caeb2e Kumar Gala 2007-08-24 271 ret |= __put_user_inatomic(data.v[6], p++); 26caeb2e Kumar Gala 2007-08-24 272 ret |= __put_user_inatomic(data.v[7], p++); 26caeb2e Kumar Gala 2007-08-24 273 } 26caeb2e Kumar Gala 2007-08-24 274 if (unlikely(ret)) 26caeb2e Kumar Gala 2007-08-24 275 return -EFAULT; 26caeb2e Kumar Gala 2007-08-24 276 } else { 26caeb2e Kumar Gala 2007-08-24 277 *evr = data.w[0]; 26caeb2e Kumar Gala 2007-08-24 278 regs->gpr[reg] = data.w[1]; 26caeb2e Kumar Gala 2007-08-24 279 } 26caeb2e Kumar Gala 2007-08-24 280 26caeb2e Kumar Gala 2007-08-24 281 return 1; 26caeb2e Kumar Gala 2007-08-24 282 } 26caeb2e Kumar Gala 2007-08-24 283 #endif /* CONFIG_SPE */ 5daf9071 Benjamin Herrenschmidt 2005-11-18 284 :::::: The code at line 183 was first introduced by commit :::::: 26caeb2ee1924d564e8d8190aa783a569532f81a [POWERPC] Handle alignment faults on SPE load/store instructions :::::: TO: Kumar Gala <galak@kernel.crashing.org> :::::: CC: Kumar Gala <galak@kernel.crashing.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 17535 bytes --] ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS 2018-10-10 5:13 ` [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough " Michael Ellerman 2018-10-10 14:47 ` Kees Cook 2018-10-10 16:55 ` kbuild test robot @ 2018-10-10 17:00 ` kbuild test robot 2 siblings, 0 replies; 19+ messages in thread From: kbuild test robot @ 2018-10-10 17:00 UTC (permalink / raw) To: Michael Ellerman; +Cc: linuxppc-dev, maddy, kbuild-all, keescook [-- Attachment #1: Type: text/plain, Size: 6026 bytes --] Hi Michael, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v4.19-rc7 next-20181010] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Michael-Ellerman/powerpc-Move-core-kernel-logic-into-arch-powerpc-Kbuild/20181010-205834 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-defconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=7.2.0 make.cross ARCH=powerpc All errors (new ones prefixed by >>): In file included from arch/powerpc/kernel/signal_32.c:32:0: include/linux/compat.h: In function 'put_compat_sigset': >> include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=] case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; ~~~~~~~~~^~~~~~~~~~~~~ include/linux/compat.h:495:2: note: here case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; ^~~~ include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=] case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; ~~~~~~~~~^~~~~~~~~~~~~ include/linux/compat.h:496:2: note: here case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1]; ^~~~ include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=] case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1]; ~~~~~~~~~^~~~~~~~~~~~~ include/linux/compat.h:497:2: note: here case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0]; ^~~~ cc1: all warnings being treated as errors -- arch/powerpc/kernel/nvram_64.c: In function 'dev_nvram_ioctl': >> arch/powerpc/kernel/nvram_64.c:811:3: error: this statement may fall through [-Werror=implicit-fallthrough=] printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/kernel/nvram_64.c:812:2: note: here case IOC_NVRAM_GET_OFFSET: { ^~~~ cc1: all warnings being treated as errors -- In file included from include/linux/kvm_host.h:14:0, from arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:21: include/linux/signal.h: In function 'sigemptyset': >> include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=] case 2: set->sig[1] = 0; ~~~~~~~~~~~~^~~ include/linux/signal.h:181:2: note: here case 1: set->sig[0] = 0; ^~~~ cc1: all warnings being treated as errors -- arch/powerpc/platforms/powermac/feature.c: In function 'g5_i2s_enable': >> arch/powerpc/platforms/powermac/feature.c:1477:6: error: this statement may fall through [-Werror=implicit-fallthrough=] if (macio->type == macio_shasta) ^ arch/powerpc/platforms/powermac/feature.c:1479:2: note: here default: ^~~~~~~ cc1: all warnings being treated as errors -- arch/powerpc/xmon/xmon.c: In function 'do_spu_cmd': >> arch/powerpc/xmon/xmon.c:4023:24: error: this statement may fall through [-Werror=implicit-fallthrough=] if (isxdigit(subcmd) || subcmd == '\n') arch/powerpc/xmon/xmon.c:4025:2: note: here case 'f': ^~~~ cc1: all warnings being treated as errors vim +494 include/linux/compat.h fde9fc76 Matt Redfearn 2018-02-19 481 fde9fc76 Matt Redfearn 2018-02-19 482 /* fde9fc76 Matt Redfearn 2018-02-19 483 * Defined inline such that size can be compile time constant, which avoids fde9fc76 Matt Redfearn 2018-02-19 484 * CONFIG_HARDENED_USERCOPY complaining about copies from task_struct fde9fc76 Matt Redfearn 2018-02-19 485 */ fde9fc76 Matt Redfearn 2018-02-19 486 static inline int fde9fc76 Matt Redfearn 2018-02-19 487 put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set, fde9fc76 Matt Redfearn 2018-02-19 488 unsigned int size) fde9fc76 Matt Redfearn 2018-02-19 489 { fde9fc76 Matt Redfearn 2018-02-19 490 /* size <= sizeof(compat_sigset_t) <= sizeof(sigset_t) */ fde9fc76 Matt Redfearn 2018-02-19 491 #ifdef __BIG_ENDIAN fde9fc76 Matt Redfearn 2018-02-19 492 compat_sigset_t v; fde9fc76 Matt Redfearn 2018-02-19 493 switch (_NSIG_WORDS) { fde9fc76 Matt Redfearn 2018-02-19 @494 case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; fde9fc76 Matt Redfearn 2018-02-19 495 case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; fde9fc76 Matt Redfearn 2018-02-19 496 case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1]; fde9fc76 Matt Redfearn 2018-02-19 497 case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0]; fde9fc76 Matt Redfearn 2018-02-19 498 } fde9fc76 Matt Redfearn 2018-02-19 499 return copy_to_user(compat, &v, size) ? -EFAULT : 0; fde9fc76 Matt Redfearn 2018-02-19 500 #else fde9fc76 Matt Redfearn 2018-02-19 501 return copy_to_user(compat, set, size) ? -EFAULT : 0; fde9fc76 Matt Redfearn 2018-02-19 502 #endif fde9fc76 Matt Redfearn 2018-02-19 503 } bebfa101 Andi Kleen 2006-06-26 504 :::::: The code at line 494 was first introduced by commit :::::: fde9fc766e96c494b82931b1d270a9a751be07c0 signals: Move put_compat_sigset to compat.h to silence hardened usercopy :::::: TO: Matt Redfearn <matt.redfearn@mips.com> :::::: CC: James Hogan <jhogan@kernel.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 23972 bytes --] ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild 2018-10-10 5:13 [PATCH 1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman ` (2 preceding siblings ...) 2018-10-10 5:13 ` [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough " Michael Ellerman @ 2018-10-19 2:51 ` Michael Ellerman 3 siblings, 0 replies; 19+ messages in thread From: Michael Ellerman @ 2018-10-19 2:51 UTC (permalink / raw) To: Michael Ellerman, linuxppc-dev; +Cc: maddy, keescook On Wed, 2018-10-10 at 05:13:05 UTC, Michael Ellerman wrote: > This is a nice cleanup, arch/powerpc/Makefile is long and messy so > moving this out helps a little. > > It also allows us to do: > > $ make arch/powerpc > > Which can be helpful if you just want to compile test some changes to > arch code and not link everything. > > Finally it also gives us a single place to do subdir-cc-flags > assignments which affect the whole of arch/powerpc, which we will do > in a future patch. > > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Applied to powerpc next. https://git.kernel.org/powerpc/c/c47ca98d32a22a412ddbc69916cf62 cheers ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2018-10-19 2:55 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-10-10 5:13 [PATCH 1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman 2018-10-10 5:13 ` [PATCH 2/4] powerpc: Add -Werror at arch/powerpc level Michael Ellerman 2018-10-19 2:51 ` [2/4] " Michael Ellerman 2018-10-10 5:13 ` [PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS Michael Ellerman 2018-10-10 14:45 ` Kees Cook 2018-10-11 0:30 ` Michael Ellerman 2018-10-10 5:13 ` [PATCH 4/4] powerpc: Add -Wimplicit-fallthrough " Michael Ellerman 2018-10-10 14:47 ` Kees Cook 2018-10-11 0:32 ` Michael Ellerman 2018-10-11 1:35 ` Kees Cook 2018-10-11 13:11 ` Gustavo A. R. Silva 2018-10-11 15:23 ` Gustavo A. R. Silva 2018-10-12 9:32 ` Michael Ellerman 2018-10-12 9:59 ` Gustavo A. R. Silva 2018-10-13 1:23 ` Kees Cook 2018-10-13 7:39 ` Gustavo A. R. Silva 2018-10-10 16:55 ` kbuild test robot 2018-10-10 17:00 ` kbuild test robot 2018-10-19 2:51 ` [1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild Michael Ellerman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).