Re: [PATCH v2 2/2] kbuild: handle excessively long argument lists

2021-01-14 Thread Nick Desaulniers
ove use an `@` before the invocation of `rm`. I don't know what that's about, but that or even this patch doesn't affect my ability to build negatively. LGTM Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers > > $(multi-used-m): FORCE > $(call if_changed,l

Re: [PATCH 1/2] kbuild: simplify cmd_mod

2021-01-14 Thread Nick Desaulniers
$($*-objs) $($*-y) $($*-m)), \ > + $(@:.mod=.o))) \ > + $(undefined_syms) echo >> $@ I find the indendation to be a readability improvement. Thanks for the patch. Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers > > $(obj)/%.mod: $(obj)/%.o

Re: [tip:efi/core 3/7] /tmp/slab-258052.s:9870: Error: unrecognized opcode `zext.b a2,a2'

2020-12-23 Thread Nick Desaulniers
https://people.kernel.org/tglx/notes-about-netiquette > > -- > You received this message because you are subscribed to the Google Groups > "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/20201223183606.GB29011%40zn.tnic. -- Thanks, ~Nick Desaulniers

[PATCH] x86/entry: use STB_GLOBAL for register restoring thunk

2020-12-23 Thread Nick Desaulniers
nux/issues/1209 Link: https://reviews.llvm.org/D93783 Signed-off-by: Nick Desaulniers --- arch/x86/entry/thunk_64.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S index ccd32877a3c4..878816034a73 100644 --- a/arch

Re: drivers/gpu/drm/i915/gvt/gtt.c:267:19: error: unused function 'get_pt_type'

2021-03-24 Thread Nick Desaulniers
On Wed, Mar 24, 2021 at 2:12 AM Zhenyu Wang wrote: > > On 2021.03.23 15:15:29 -0700, Nick Desaulniers wrote: > > On Fri, Mar 19, 2021 at 11:45 PM kernel test robot wrote: > > > > > > Hi Nick, > > > > > > FYI, the error/warning still remains. >

Re: s390: kernel/entry.o: in function `sys_call_table_emu': (.rodata+0x1bc0): undefined reference to `__s390_'

2021-03-18 Thread Nick Desaulniers
(Replying to https://lore.kernel.org/linux-s390/ca+g9fytbw0hav5ooayck2rz_m2sj73krxpj0idzt+o8qtc1...@mail.gmail.com/) Yeah, our CI is failing today, too with the same error on linux-next: https://github.com/ClangBuiltLinux/continuous-integration2/runs/2138006304?check_suite_focus=true

Re: [PATCH v2 02/17] cfi: add __cficanonical

2021-03-18 Thread Nick Desaulniers
hat's the minimum supported version of clang for the kernel, and this series depends on LTO which depends on clang-12, so no additional guards are necessary). Reviewed-by: Nick Desaulniers > --- > include/linux/compiler-clang.h | 1 + > include/linux/compiler_types.h | 4 >

Re: [PATCH v2 09/17] lib/list_sort: fix function type mismatches

2021-03-18 Thread Nick Desaulniers
> } > /* The final merge, rebuilding prev links */ > - merge_final(priv, (cmp_func)cmp, head, pending, list); > + merge_final(priv, cmp, head, pending, list); > } > EXPORT_SYMBOL(list_sort); > -- > 2.31.0.291.g576ba9dcdaf-goog > -- Thanks, ~Nick Desaulniers

Re: [PATCH v2 10/17] lkdtm: use __va_function

2021-03-18 Thread Nick Desaulniers
unconst + PAGE_SIZE)) { > pr_warn("copy_to_user failed, but lacked Oops\n"); > goto free_user; > -- > 2.31.0.291.g576ba9dcdaf-goog > -- Thanks, ~Nick Desaulniers

Re: [PATCH v2 10/17] lkdtm: use __va_function

2021-03-18 Thread Nick Desaulniers
On Thu, Mar 18, 2021 at 11:43 AM Nick Desaulniers wrote: > > On Thu, Mar 18, 2021 at 10:11 AM Sami Tolvanen > wrote: > > > > To ensure we take the actual address of a function in kernel text, use > > __va_function. Otherwise, with CONFIG_CFI_CLANG, the compiler repl

Re: [PATCH v2 05/17] workqueue: use WARN_ON_FUNCTION_MISMATCH

2021-03-18 Thread Nick Desaulniers
N_ON_ONCE(timer->function != delayed_work_timer_fn); > + WARN_ON_FUNCTION_MISMATCH(timer->function, delayed_work_timer_fn); > WARN_ON_ONCE(timer_pending(timer)); > WARN_ON_ONCE(!list_empty(&work->entry)); > > -- > 2.31.0.291.g576ba9dcdaf-goog > -- Thanks, ~Nick Desaulniers

Re: [PATCH v2 07/17] kallsyms: strip ThinLTO hashes from static functions

2021-03-18 Thread Nick Desaulniers
syms_expand_symbol(get_symbol_offset(pos), >name, KSYM_NAME_LEN); > modname[0] = '\0'; > - return 0; > + goto found; > } > /* See if it's in a module. */ > - return lookup_module_symbol_attrs(addr, size, offset, modname, name); > + res = lookup_module_symbol_attrs(addr, size, offset, modname, name); > + if (res) > + return res; > + > +found: > + cleanup_symbol_name(name); > + return 0; > } > > /* Look up a kernel symbol and return it in a text buffer. */ > -- > 2.31.0.291.g576ba9dcdaf-goog > -- Thanks, ~Nick Desaulniers

Re: [PATCH v2 04/17] module: ensure __cfi_check alignment

2021-03-18 Thread Nick Desaulniers
t; +* With CONFIG_CFI_CLANG, we assume __cfi_check is at the beginning > +* of the .text section, and is aligned to PAGE_SIZE. > +*/ > + .text : ALIGN_CFI { > + *(.text.__cfi_check) > + *(.text .text.[0-9a-zA-Z_]* .text..L.cfi*) > + } > } > > /* bring in arch-specific sections */ > -- > 2.31.0.291.g576ba9dcdaf-goog > -- Thanks, ~Nick Desaulniers

[PATCH] Makefile: fix GDB warning with CONFIG_RELR

2021-03-18 Thread Nick Desaulniers
github.com/ClangBuiltLinux/linux/issues/1057 Suggested-by: Peter Collingbourne Signed-off-by: Nick Desaulniers --- Makefile | 2 +- scripts/tools-support-relr.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5160ff8903c1..47

Re: sparc: clang: error: unknown argument: '-mno-fpu'

2021-03-19 Thread Nick Desaulniers
imit clang regression testing to x86, arm, powerpc, s390, mips, > riscv > and arc. We definitely cannot yet build arc. $ cmake ... -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="ARC" $ ARCH=arc CROSS_COMPILE=arc-linux-gnu- make LLVM=1 -j72 defconfig vmlinux ... clang-13: error: unknown argument: '-mmedium-calls' clang-13: error: unknown argument: '-fsection-anchors' clang-13: error: unknown argument: '-mlock' clang-13: error: unknown argument: '-mswape' clang-13: error: unknown argument: '-mno-sdata' clang-13: error: unknown argument: '-fcall-used-gp' -- Thanks, ~Nick Desaulniers

Re: [PATCH] scripts: stable: add script to validate backports

2021-03-23 Thread Nick Desaulniers
On Tue, Mar 23, 2021 at 6:56 AM Greg Kroah-Hartman wrote: > > On Tue, Mar 16, 2021 at 02:31:33PM -0700, Nick Desaulniers wrote: > > A common recurring mistake made when backporting patches to stable is > > forgetting to check for additional commits tagged with `Fixes:`. This &g

Re: [PATCH] scripts: stable: add script to validate backports

2021-03-23 Thread Nick Desaulniers
it grep -l --threads=3 ae46578b963f $ Should it have found a7889c6320b9 and 773e0c402534? Perhaps `git log --grep=` should be used instead? I thought `git grep` only greps files in the archive, not commit history? -- Thanks, ~Nick Desaulniers

Re: [PATCH v3 09/17] treewide: Change list_sort to use const pointers

2021-03-23 Thread Nick Desaulniers
Integrity (CFI) checking. > > Instead of removing the consts, this change defines the > list_cmp_func_t type and changes the comparison function types of > all list_sort() callers to use const pointers, thus avoiding type > mismatches. > > Suggested-by: Nick Desaulniers > Signed-off

Re: [PATCH] irqchip/gic-v3: fix OF_BAD_ADDR error handling

2021-03-23 Thread Nick Desaulniers
if (mbi_phys_base == (phys_addr_t)OF_BAD_ADDR) { > ret = -ENXIO; > goto err_free_mbi; > } > -- > 2.29.2 > -- Thanks, ~Nick Desaulniers

Re: drivers/gpu/drm/i915/gvt/gtt.c:267:19: error: unused function 'get_pt_type'

2021-03-23 Thread Nick Desaulniers
b9 drm/i915/gvt: Introduce page > table type of current level in GTT type enumerations > > :: TO: Zhi Wang > :: CC: Zhenyu Wang > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org -- Thanks, ~Nick Desaulniers

Re: [PATCH v2] sched: Optimize __calc_delta.

2021-03-04 Thread Nick Desaulniers
983 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -36,6 +36,7 @@ > #include > > #include > +#include This hunk of the patch is curious. I assume that bitops.h is needed for fls(); if so, why not #include it in kernel/sched/fair.c? Otherwise this potentially hurts compile time for all TUs that include kernel/sched/sched.h. > #include > #include > #include > -- > 2.30.1.766.gb4fecdf3b7-goog > -- Thanks, ~Nick Desaulniers

Re: [PATCH v3] MIPS: Make MIPS32_O32 depends on !CC_IS_CLANG

2021-03-04 Thread Nick Desaulniers
O32 for MIPS64 due to lack of > resources". It's my hope we will fix the resourcing issue. I'm working on that; it's a non-technical challenge though. Acked-by: Nick Desaulniers > > It is not a good idea to remove CONFIG_MIPS32_O32=y directly > in defconfig because

Re: [PATCH v1] powerpc: Include running function as first entry in save_stack_trace() and friends

2021-03-04 Thread Nick Desaulniers
ux/compiler.h:246: prevent_tail_call_optimization commit a9a3ed1eff36 ("x86: Fix early boot crash on gcc-10, third try") > > Perhaps we can ask the toolchain folks to help add such an attribute. Or > maybe the feature already exists somewhere, but hidden. > > +Cc linux-toolcha...@vger.kernel.org > > > > But I'm also not sure if with all that we'd be guaranteed the code we > > > want, even though in practice it might. > > > > True! I'd just like to be on the least dodgy ground we can be. > > It's been dodgy for a while, and I'd welcome any low-cost fixes to make > it less dodgy in the short-term at least. :-) > > Thanks, > -- Marco -- Thanks, ~Nick Desaulniers

Re: [PATCH 3/4] kbuild: check the minimum assembler version in Kconfig

2021-03-04 Thread Nick Desaulniers
+ # by scripts/cc-version.sh. > + echo LLVM 0 > + exit 0 > +fi > + > +# Split the line on spaces. > +IFS=' ' > +set -- $line > + > +tool_version=$(dirname $0)/tool-version.sh > + > +if [ "$1" = GNU -a "$2" = assembler ]; then > + shift $(($# - 1)) > + version=$1 > + min_version=$($tool_version binutils) > + name=GNU > +else > + echo "$orig_args: unknown assembler invoked" >&2 > + exit 1 > +fi > + > +# Some distributions append a package release number, as in 2.34-4.fc32 > +# Trim the hyphen and any characters that follow. > +version=${version%-*} > + > +cversion=$(get_canonical_version $version) > +min_cversion=$(get_canonical_version $min_version) > + > +if [ "$cversion" -lt "$min_cversion" ]; then > + echo >&2 "***" > + echo >&2 "*** Assembler is too old." > + echo >&2 "*** Your $name assembler version:$version" > + echo >&2 "*** Minimum $name assembler version: $min_version" > + echo >&2 "***" > + exit 1 > +fi > + > +echo $name $cversion > -- > 2.27.0 > -- Thanks, ~Nick Desaulniers

Re: [RFC PATCH v2 00/13] objtool: add base support for arm64

2021-03-05 Thread Nick Desaulniers
config with LLVM=1 with this series applied. Tested-by: Nick Desaulniers One thing I noticed was a spew of warnings for allmodconfig, like: init/main.o: warning: objtool: asan.module_ctor()+0xc: call without frame pointer save/setup init/main.o: warning: objtool: asan.module_dtor()+0xc: call w

Re: [RFC PATCH v2 00/13] objtool: add base support for arm64

2021-03-05 Thread Nick Desaulniers
On Fri, Mar 5, 2021 at 3:51 PM Nick Desaulniers wrote: > > (in response to > https://lore.kernel.org/linux-arm-kernel/20210303170932.1838634-1-jthie...@redhat.com/ > from the command line) > > > Changes since v1[2]: > > - Drop gcc plugin in favor of -fno-jump-tables

Re: [PATCH] x86/kernel: remove unneeded dead-store initialization

2021-03-31 Thread Nick Desaulniers
bject code is identical before and after this change. > > No functional change. No change to object code. Reviewed-by: Nick Desaulniers Looks like this is from when this code was introduced in commit 0d55ba46bfbe ("x86/cacheinfo: Move cacheinfo sysfs code to generic infrastructure") thou

Re: [PATCH 5/9] kbuild: rename extmod-prefix to extmod_prefix

2021-03-31 Thread Nick Desaulniers
On Wed, Mar 31, 2021 at 6:38 AM Masahiro Yamada wrote: > > This seems to be useful in sub-make as well. As a preparation of > exporting it, rename extmod-prefix to extmod_prefix because exported > variables cannot contain hyphens. > > Signed-off-by: Masahiro Yamada Reviewed-by

Re: [PATCH 9/9] kbuild: remove CONFIG_MODULE_COMPRESS

2021-03-31 Thread Nick Desaulniers
DULE_SIG_SHA512 > > -config MODULE_COMPRESS The top level Makefile has comments and code that refer to this choice which is now removed. I think you'll want to fix that up in this change as well? Ah, patch 7 in the series does that: https://lore.kernel.org/linux-kbuild/20210331133811.322154

Re: [PATCH 11/13] kconfig: do not use allnoconfig_y option

2021-03-31 Thread Nick Desaulniers
/Makefile > > index 7df3c0e4c52e..46f2465177f0 100644 > > --- a/scripts/kconfig/Makefile > > +++ b/scripts/kconfig/Makefile > > @@ -102,7 +102,8 @@ configfiles=$(wildcard $(srctree)/kernel/configs/$@ > > $(srctree)/arch/$(SRCARCH)/c > > > > PHONY += tinyconfig > > tinyconfig: > > - $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config > > + $(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.config $(MAKE) -f > > $(srctree)/Makefile allnoconfig > > + $(Q)$(MAKE) -f $(srctree)/Makefile tiny.config > > > > # CHECK: -o cache_dir= working? > > PHONY += testconfig > > -- > > 2.27.0 > > -- Thanks, ~Nick Desaulniers

Re: [PATCH 2/2] Makefile: Only specify '--prefix=' when building with clang + GNU as

2021-03-02 Thread Nick Desaulniers
use the integrated assembler (ie. with this change, don't set --prefix), with either of the two above configs, which objcopy get's exec'd? > > With LLVM_IAS=1, these cases are ruled out. -- Thanks, ~Nick Desaulniers

Re: [PATCH 1/2] Makefile: Remove '--gcc-toolchain' flag

2021-03-02 Thread Nick Desaulniers
; distribution version of LLVM 11.1.0 without binutils in the LLVM > toolchain locations. > > Signed-off-by: Nathan Chancellor Thanks for the patch! Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers I see this pattern still being used in arch/arm64/kernel/vdso32/Makefile,

Re: [PATCH 2/2] Makefile: Only specify '--prefix=' when building with clang + GNU as

2021-03-02 Thread Nick Desaulniers
On Tue, Mar 2, 2021 at 2:09 PM Nick Desaulniers wrote: > > On Tue, Mar 2, 2021 at 2:02 PM Fangrui Song wrote: > > > > On 2021-03-02, Nathan Chancellor wrote: > > >When building with LLVM_IAS=1, there is no point to specifying > > >'--prefix=' be

Re: [PATCH 4/4] kbuild: dwarf: use AS_VERSION instead of test_dwarf5_support.sh

2021-03-03 Thread Nick Desaulniers
` and `md5 0x00`. Should be fixed in GNU binutils > -# 2.35.2. https://sourceware.org/bugzilla/show_bug.cgi?id=25611 > -echo '.file 0 "filename" md5 0x7a0b65214090b6693bd1dc24dd248245' | \ > - $* -gdwarf-5 -Wno-unused-command-line-argument -c -x assembler -o > /dev/null - > -- > 2.27.0 > -- Thanks, ~Nick Desaulniers

Re: [PATCH 1/4] kbuild: remove LLVM=1 test from HAS_LTO_CLANG

2021-03-03 Thread Nick Desaulniers
ends on $(success,test $(LLVM) -eq 1) IIRC, we needed some other LLVM utilities like llvm-nm and llvm-ar, which are checked below. So I guess we can still support CC=clang AR=llvm-ar NM=llvm-nm, and this check is redundant. > depends on $(success,test $(LLVM_IAS) -eq 1) > depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) > depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) > -- > 2.27.0 > -- Thanks, ~Nick Desaulniers

Re: [PATCH v2 3/3] kbuild: dwarf: use AS_VERSION instead of test_dwarf5_support.sh

2021-03-15 Thread Nick Desaulniers
C code is as follows: > > - gcc + gnu as -> requires gcc 5.0+ (but 7.0+ for full support) > - clang + gnu as-> requires binutils 2.35.2+ > - clang + integrated as -> OK > > Signed-off-by: Masahiro Yamada > Reviewed-by: Nathan Chancellor Revi

Re: WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()

2021-03-16 Thread Nick Desaulniers
direction. > */ > -static inline __init bool memblock_bottom_up(void) > +static inline __init_memblock bool memblock_bottom_up(void) > { > return memblock.bottom_up; > } > > > -- > Sincerely yours, > Mike. > > -- > You received this message because you are subscribed to the Google Groups > "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/YFBYWjtWJrnGyiVp%40linux.ibm.com. -- Thanks, ~Nick Desaulniers

Re: [PATCH] memblock: fix section mismatch warning again

2021-03-16 Thread Nick Desaulniers
rnel.org/lkml/202103160133.uzhgy0wt-...@intel.com > Fixes: 34dc2efb39a2 ("memblock: fix section mismatch warning") > Signed-off-by: Mike Rapoport > Reported-by: kernel test robot > Reviewed-by: Arnd Bergmann Thank you Mike. Acked-by: Nick Desaulniers > --- > > @A

[PATCH] scripts: stable: add script to validate backports

2021-03-16 Thread Nick Desaulniers
e Oops, let me fixup the commit message and retry. $ git commit --amend $ ./scripts/stable/check_backports.py Checking 2 local commits for additional Fixes: in master $ echo $? 0 This allows for client side validation by the backports author, and server side validation by the stable kernel maintain

Re: [PATCH] lockdep: address clang -Wformat warning printing for %hd

2021-03-29 Thread Nick Desaulniers
'int'. > > However, there is really no point in printing the number as a 16-bit > 'short' rather than either an 8-bit or 32-bit number, so just change > it to a normal %d. Thanks for the patch! Reviewed-by: Nick Desaulniers > > Fixes: de8f5e4f2dc1 ("lo

Re: [PATCH 2/3] riscv: Workaround mcount name prior to clang-13

2021-03-29 Thread Nick Desaulniers
of the mcount symbol for > older versions of clang in mount.S and recordmcount.pl. > > Cc: sta...@vger.kernel.org > Link: https://github.com/ClangBuiltLinux/linux/issues/1331 > Signed-off-by: Nathan Chancellor Thanks for keeping this alive on clang-10, and resolving it for future

Re: [PATCH v2] ARM: kprobes: rewrite test-[arm|thumb].c in UAL

2021-03-29 Thread Nick Desaulniers
On Fri, Jan 29, 2021 at 1:40 AM Ard Biesheuvel wrote: > > On Fri, 29 Jan 2021 at 01:22, Nick Desaulniers > wrote: > > > > > On Thu, 28 Jan 2021 at 20:34, Nick Desaulniers > > > wrote: > > > > + TEST_RX("tbh[pc, r",7, (9f-(1f+4)

[PATCH v2] ARM: kprobes: test-thumb: fix for LLVM_IAS=1

2021-03-29 Thread Nick Desaulniers
1309 Signed-off-by: Nick Desaulniers --- See: https://lore.kernel.org/linux-arm-kernel/CAMj1kXE5uw4+zV3JVpfA2drOD5TZVMs5a_E5wrrnzjEYc=e...@mail.gmail.com/ for what I'd consider V1. The previous issues with .w suffixes have been fixed or have fixes pending in LLVM: * BL+DBG: https://reviews.l

Re: [PATCH v2] arm64: vdso32: drop -no-integrated-as flag

2021-04-15 Thread Nick Desaulniers
On Thu, Apr 15, 2021 at 6:31 AM Vincenzo Frascino wrote: > > > > On 4/14/21 10:45 PM, Nick Desaulniers wrote: > > Clang can assemble these files just fine; this is a relic from the top > > level Makefile conditionally adding this. We no longer need --prefix, > >

Re: [PATCH] X86: Makefile: Replace -pg with CC_FLAGS_FTRACE

2021-04-15 Thread Nick Desaulniers
NITIZE_cmdline.o := n > KCSAN_SANITIZE_cmdline.o := n > > ifdef CONFIG_FUNCTION_TRACER > -CFLAGS_REMOVE_cmdline.o = -pg > +CFLAGS_REMOVE_cmdline.o = $(CC_FLAGS_FTRACE) > endif > > CFLAGS_cmdline.o := -fno-stack-protector -fno-jump-tables > -- > 2.20.1 > > > -- Thanks, ~Nick Desaulniers

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-15 Thread Nick Desaulniers
On Wed, Apr 14, 2021 at 5:43 PM Miguel Ojeda wrote: > > On Thu, Apr 15, 2021 at 1:19 AM Nick Desaulniers > wrote: > > > > -Oz in clang typically generates larger kernel code than -Os; LLVM > > seems to aggressively emit libcalls even when the setup for a call > >

Re: [PATCH 00/13] [RFC] Rust support

2021-04-15 Thread Nick Desaulniers
ntly there is no code requiring > synchronization between C side and Rust side, so we are currently fine. > But in the longer term, we need to teach Rust memory model about the > "design patterns" used in Linux kernel for parallel programming. > > What I have been doing so far is reviewing patches which have memory > orderings in Rust-for-Linux project, try to make sure we don't include > memory ordering bugs for the beginning. > > Regards, > Boqun -- Thanks, ~Nick Desaulniers

Re: [PATCH] gcov: clang: fix clang-11+ build

2021-04-12 Thread Nick Desaulniers
en't had time to check this particular build! Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers > and my kvmalloc() conversion patch is in akpm/linux-next. > I guess this should be folded into > > gcov: use kvmalloc() > > If desired, I can send a combined patch inst

[PATCH v3] gcov: clang: drop support for clang-10 and older

2021-04-13 Thread Nick Desaulniers
m.org/rGcdd683b516d147925212724b09ec6fb792a40041 Link: https://reviews.llvm.org/rG13a633b438b6500ecad9e4f936ebadf3411d0f44 Link: https://lkml.kernel.org/r/20210312224132.3413602-3-ndesaulni...@google.com Signed-off-by: Nick Desaulniers Suggested-by: Nathan Chancellor Acked-by: Peter Oberparleiter Reviewed-by: N

[PATCH] arm64: vdso32: drop -no-integrated-as flag

2021-04-13 Thread Nick Desaulniers
-by: Nick Desaulniers --- arch/arm64/kernel/vdso32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index 789ad420f16b..7812717f8b79 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64

Re: [PATCH] arm64: alternatives: Move length validation in alternative_{insn,endif}

2021-04-14 Thread Nick Desaulniers
) to the alternative_endif > macro, shuffling the .org directives so that the length validation > happen will always happen in the same subsections. alternative_insn has > not shown any issue yet but it appears that it could have the same issue > in the future so just preemptively change it. T

[PATCH v2] arm64: vdso32: drop -no-integrated-as flag

2021-04-14 Thread Nick Desaulniers
- \ CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make LLVM=1 LLVM_IAS=1 \ defconfig arch/arm64/kernel/vdso32/ Suggested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Changes V1 -> V2: * Remove --prefix, --gcc-toolchain, COMPAT_GCC_TOOLCHAIN, and COMPAT_GCC_TOOLCHAIN_DIR as per Nat

Re: [PATCH 11/13] MAINTAINERS: Rust

2021-04-14 Thread Nick Desaulniers
least be part of Wedson's core responsibilities, shouldn't this be "Supported." Per Maintainers: 87 S: *Status*, one of the following: 88 Supported: Someone is actually paid to look after this. 89 Maintained: Someone actually looks after it. Either way, Acked-by: Ni

Re: [PATCH 10/13] Documentation: Rust general information

2021-04-14 Thread Nick Desaulniers
> + > + > +Building > + > + > +Building a kernel with Clang or a complete LLVM toolchain is the best > supported > +setup at the moment. That is:: > + > +make ARCH=... CROSS_COMPILE=... CC=clang -j... > + > +or:: > + > +make ARCH=... CROSS_COMPILE=... LLVM=1 -j... Please reorder; prefer LLVM=1 to CC=clang. Probably worth another cross reference to :ref:`kbuild_llvm`. > + > +Using GCC also works for some configurations, but it is *very* experimental > at > +the moment. > + > + > +Hacking > +--- > + > +If you want to dive deeper, take a look at the source code of the samples > +at ``samples/rust/``, the Rust support code under ``rust/`` and > +the ``Rust hacking`` menu under ``Kernel hacking``. > + > +If you use GDB/Binutils and Rust symbols aren't getting demangled, the reason > +is your toolchain doesn't support Rust's new v0 mangling scheme yet. There > are "new" as in changed, or "new" as in Rust previously did not mangle symbols? > +a few ways out: > + > + - If you don't mind building your own tools, we provide the following fork > +with the support cherry-picked from GCC on top of very recent releases: > + > + > https://github.com/Rust-for-Linux/binutils-gdb/releases/tag/gdb-10.1-release-rust > + > https://github.com/Rust-for-Linux/binutils-gdb/releases/tag/binutils-2_35_1-rust > + > + - If you only need GDB and can enable ``CONFIG_DEBUG_INFO``, do so: > +some versions of GDB (e.g. vanilla GDB 10.1) are able to use > +the pre-demangled names embedded in the debug info. > + > + - If you don't need loadable module support, you may compile without > +the ``-Zsymbol-mangling-version=v0`` flag. However, we don't maintain > +support for that, so avoid it unless you are in a hurry. > -- > 2.17.1 > -- Thanks, ~Nick Desaulniers

Re: [PATCH 11/13] MAINTAINERS: Rust

2021-04-14 Thread Nick Desaulniers
: linux-r...@vger.kernel.org ... > +F: rust/ > +F: samples/rust/ > +F: Documentation/rust/ Probably some other files, too? Like the target.json files under arch/{arch}/rust/ ? -- Thanks, ~Nick Desaulniers

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-14 Thread Nick Desaulniers
-MMD,$(depfile) $(NOSTDINC_FLAGS) > $(LINUXINCLUDE) \ > $(_c_flags) $(modkern_cflags) \ > $(basename_flags) $(modname_flags) > > +rustc_flags = $(_rustc_flags) $(modkern_rustcflags) > @$(objtree)/include/generated/rustc_cfg > + > a_flags= -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ > $(_a_flags) $(modkern_aflags) > > diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c > index 2568dbe16ed6..a83d646ecef5 100644 > --- a/scripts/kconfig/confdata.c > +++ b/scripts/kconfig/confdata.c > @@ -637,6 +637,56 @@ static struct conf_printer kconfig_printer_cb = > .print_comment = kconfig_print_comment, > }; > > +/* > + * rustc cfg printer > + * > + * This printer is used when generating the resulting rustc configuration > + * after kconfig invocation and `defconfig` files. > + */ > +static void rustc_cfg_print_symbol(FILE *fp, struct symbol *sym, const char > *value, void *arg) > +{ > + const char *str; > + > + switch (sym->type) { > + case S_INT: > + case S_HEX: > + case S_BOOLEAN: > + case S_TRISTATE: > + str = sym_escape_string_value(value); > + > + /* > +* We don't care about disabled ones, i.e. no need for > +* what otherwise are "comments" in other printers. > +*/ > + if (*value == 'n') > + return; > + > + /* > +* To have similar functionality to the C macro `IS_ENABLED()` > +* we provide an empty `--cfg CONFIG_X` here in both `y` > +* and `m` cases. > +* > +* Then, the common `fprintf()` below will also give us > +* a `--cfg CONFIG_X="y"` or `--cfg CONFIG_X="m"`, which can > +* be used as the equivalent of `IS_BUILTIN()`/`IS_MODULE()`. > +*/ > + if (*value == 'y' || *value == 'm') > + fprintf(fp, "--cfg=%s%s\n", CONFIG_, sym->name); > + > + break; > + default: > + str = value; > + break; > + } > + > + fprintf(fp, "--cfg=%s%s=%s\n", CONFIG_, sym->name, str); > +} > + > +static struct conf_printer rustc_cfg_printer_cb = > +{ > + .print_symbol = rustc_cfg_print_symbol, > +}; > + > /* > * Header printer > * > @@ -1044,7 +1094,7 @@ int conf_write_autoconf(int overwrite) > struct symbol *sym; > const char *name; > const char *autoconf_name = conf_get_autoconfig_name(); > - FILE *out, *out_h; > + FILE *out, *out_h, *out_rustc_cfg; > int i; > > if (!overwrite && is_present(autoconf_name)) > @@ -1065,6 +1115,13 @@ int conf_write_autoconf(int overwrite) > return 1; > } > > + out_rustc_cfg = fopen(".tmp_rustc_cfg", "w"); > + if (!out_rustc_cfg) { > + fclose(out); > + fclose(out_h); > + return 1; > + } > + > conf_write_heading(out, &kconfig_printer_cb, NULL); > conf_write_heading(out_h, &header_printer_cb, NULL); > > @@ -1076,9 +1133,11 @@ int conf_write_autoconf(int overwrite) > /* write symbols to auto.conf and autoconf.h */ > conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1); > conf_write_symbol(out_h, sym, &header_printer_cb, NULL); > + conf_write_symbol(out_rustc_cfg, sym, &rustc_cfg_printer_cb, > NULL); > } > fclose(out); > fclose(out_h); > + fclose(out_rustc_cfg); > > name = getenv("KCONFIG_AUTOHEADER"); > if (!name) > @@ -1097,6 +1156,12 @@ int conf_write_autoconf(int overwrite) > if (rename(".tmpconfig", autoconf_name)) > return 1; > > + name = "include/generated/rustc_cfg"; > + if (make_parent_dir(name)) > + return 1; > + if (rename(".tmp_rustc_cfg", name)) > + return 1; > + > return 0; > } > > diff --git a/scripts/rust-version.sh b/scripts/rust-version.sh > new file mode 100755 > index ..67b6d31688e2 > --- /dev/null > +++ b/scripts/rust-version.sh > @@ -0,0 +1,31 @@ > +#!/bin/sh > +# SPDX-License-Identifier: GPL-2.0 > +# > +# rust-version rust-command > +# > +# Print the compiler version of `rust-command' in a 5 or 6-digit form > +# such as `14502' for rustc-1.45.2 etc. > +# > +# Returns 0 if not found (so that Kconfig does not complain) > +compiler="$*" > + > +if [ ${#compiler} -eq 0 ]; then > + echo "Error: No compiler specified." >&2 > + printf "Usage:\n\t$0 \n" >&2 > + exit 1 > +fi > + > +if ! command -v $compiler >/dev/null 2>&1; then > + echo 0 > + exit 0 > +fi > + > +VERSION=$($compiler --version | cut -f2 -d' ') > + > +# Cut suffix if any (e.g. `-dev`) > +VERSION=$(echo $VERSION | cut -f1 -d'-') > + > +MAJOR=$(echo $VERSION | cut -f1 -d'.') > +MINOR=$(echo $VERSION | cut -f2 -d'.') > +PATCHLEVEL=$(echo $VERSION | cut -f3 -d'.') > +printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL > -- > 2.17.1 > -- Thanks, ~Nick Desaulniers

Re: [PATCH 09/13] Samples: Rust examples

2021-04-14 Thread Nick Desaulniers
people could > use as a example of a real piece of code that actually does something > meaningful? Are you suggesting that they "rewrite it in Rust?" :^P *ducks* (sorry, I couldn't help myself) Perhaps it would be a good exercise to demonstrate some of the benefits of using Rust for driver work? -- Thanks, ~Nick Desaulniers

Re: [PATCH 03/13] Makefile: Generate CLANG_FLAGS even in GCC builds

2021-04-14 Thread Nick Desaulniers
# CC_VERSION_TEXT is referenced from Kconfig (so it needs export), > +# and from include/config/auto.conf.cmd to detect the compiler upgrade. > +CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1 | sed > 's/\#//g') > + > +ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) > +CLANG_FLAGS+= $(TENTATIVE_CLANG_FLAGS) > KBUILD_CFLAGS += $(CLANG_FLAGS) > KBUILD_AFLAGS += $(CLANG_FLAGS) > export CLANG_FLAGS > -- > 2.17.1 > -- Thanks, ~Nick Desaulniers

Re: [PATCH 02/13] kallsyms: Increase maximum kernel symbol length to 512

2021-04-14 Thread Nick Desaulniers
#ifndef KSYM_NAME_LEN > -#define KSYM_NAME_LEN 256 > +#define KSYM_NAME_LEN 512 > #endif > > struct perf_record_ksymbol { > diff --git a/tools/lib/symbol/kallsyms.h b/tools/lib/symbol/kallsyms.h > index 72ab9870454b..542f9b059c3b 100644 > --- a/tools/lib/symbol/kallsyms.h > +++ b/tools/lib/symbol/kallsyms.h > @@ -7,7 +7,7 @@ > #include > > #ifndef KSYM_NAME_LEN > -#define KSYM_NAME_LEN 256 > +#define KSYM_NAME_LEN 512 > #endif > > static inline u8 kallsyms2elf_binding(char type) > -- > 2.17.1 > -- Thanks, ~Nick Desaulniers

Re: [PATCH 00/13] [RFC] Rust support

2021-04-14 Thread Nick Desaulniers
at: > > rust-for-li...@vger.kernel.org > > and take a look at the project itself at: > > https://github.com/Rust-for-Linux Looks like Wedson's writeup is now live. Nice job Wedson! https://security.googleblog.com/2021/04/rust-in-linux-kernel.html -- Thanks, ~Nick Desaulniers

Re: [PATCH 09/13] Samples: Rust examples

2021-04-15 Thread Nick Desaulniers
On Thu, Apr 15, 2021 at 12:10 AM Greg Kroah-Hartman wrote: > > On Wed, Apr 14, 2021 at 04:24:45PM -0700, Nick Desaulniers wrote: > > On Wed, Apr 14, 2021 at 12:35 PM Linus Torvalds > > wrote: > > > > > > On Wed, Apr 14, 2021 at 11:47 AM wrote

Re: Usage of CXX in tools directory

2021-04-06 Thread Nick Desaulniers
> If we have HOSTCXX why not have a CXX in toplevel Makefile? > > In "tools: Factor Clang, LLC and LLVM utils definitions" (see [3]) I > did some factor-ing. > > For the records: Here Linus Git is my base. > > Ideas? > > Thanks. > > Regards, > - Sedat - >

Re: [PATCH] blk-mq: fix alignment mismatch.

2021-03-31 Thread Nick Desaulniers
s a fair but small amount of churn IMO; but if Jens is not opposed it seems fine? -- Thanks, ~Nick Desaulniers

Re: [PATCH v2 2/3] kbuild: check the minimum assembler version in Kconfig

2021-03-31 Thread Nick Desaulniers
ed assembler, we do not check the > > + # version here. It is the same as the clang > > version, and > > + # it has been already checked by > > scripts/cc-version.sh. > > + echo LLVM 0 > > + exit 0 > > + fi > > + shift > > + done > > +} > > + > > +check_integrated_as "$@" > > + > > +orig_args="$@" > > + > > +# Get the first line of the --version output. > > +IFS=' > > +' > > +set -- $(LC_ALL=C "$@" -Wa,--version -c -x assembler /dev/null -o > > /dev/null 2>&1) > > + > > +# Split the line on spaces. > > +IFS=' ' > > +set -- $1 > > + > > +min_tool_version=$(dirname $0)/min-tool-version.sh > > + > > +if [ "$1" = GNU -a "$2" = assembler ]; then > > + shift $(($# - 1)) > > + version=$1 > > + min_version=$($min_tool_version binutils) > > + name=GNU > > +else > > + echo "$orig_args: unknown assembler invoked" >&2 > > + exit 1 > > +fi > > + > > +# Some distributions append a package release number, as in 2.34-4.fc32 > > +# Trim the hyphen and any characters that follow. > > +version=${version%-*} > > + > > +cversion=$(get_canonical_version $version) > > +min_cversion=$(get_canonical_version $min_version) > > + > > +if [ "$cversion" -lt "$min_cversion" ]; then > > + echo >&2 "***" > > + echo >&2 "*** Assembler is too old." > > + echo >&2 "*** Your $name assembler version:$version" > > + echo >&2 "*** Minimum $name assembler version: $min_version" > > + echo >&2 "***" > > + exit 1 > > +fi > > + > > +echo $name $cversion > > -- > > 2.27.0 > > > > -- -- Thanks, ~Nick Desaulniers

Re: [PATCH] ARM: OMAP1: ams-delta: remove unused function ams_delta_camera_power

2021-04-01 Thread Nick Desaulniers
receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/20210401160434.7655-1-maciej.falkowski9%40gmail.com. -- Thanks, ~Nick Desaulniers

Re: [PATCH] ARM: OMAP: Fix use of possibly uninitialized irq variable

2021-04-01 Thread Nick Desaulniers
nce this warning > int irq; >^ > = 0 > 1 warning generated. Ooh, yeah if cpu_is_omap15xx() then irq is unused uninitialized; I don't see any INT_1610_WAKE_UP_REQ-equlivalent for INT_15XX_WAKE_UP_REQ. Ok, LGTM. Reviewed-by: Nick Desaulniers

Re: [PATCH] usb: isp1301-omap: Add missing gpiod_add_lookup_table function

2021-04-01 Thread Nick Desaulniers
3ef38160e3d ("usb: isp1301-omap: Convert to use GPIO descriptors") > Link: https://github.com/ClangBuiltLinux/linux/issues/1325 Looks consistent to me with other callers of gpiod_add_lookup_table from .init_machine callbacks. Reviewed-by: Nick Desaulniers > --- > arch/arm/mach-o

Re: [PATCH 00/13] [RFC] Rust support

2021-04-19 Thread Nick Desaulniers
On Fri, Apr 16, 2021 at 11:47 AM Paul E. McKenney wrote: > > On Thu, Apr 15, 2021 at 11:04:37PM -0700, Nick Desaulniers wrote: > > On Thu, Apr 15, 2021 at 9:27 PM Boqun Feng wrote: > > > > > > But I think the Rust Community still wants to have a good memory model,

Re: [PATCH 00/13] [RFC] Rust support

2021-04-19 Thread Nick Desaulniers
me machine and could have written this component in Rust from the start, 51 (73.9%) of these bugs would not have been possible." -- Thanks, ~Nick Desaulniers

Re: static_branch/jump_label vs branch merging

2021-04-09 Thread Nick Desaulniers
er from asm goto might help? Then if there were side effects but you forgot to inform the compiler that there were via an explicit volatile qualifier, and it performed the suggested merge, oh well. -- Thanks, ~Nick Desaulniers

Re: [PATCH] crypto: arm/curve25519 - Move '.fpu' after '.arch'

2021-04-09 Thread Nick Desaulniers
ux/continuous-integration2/issues/118 > Reported-by: Arnd Bergmann > Suggested-by: Arnd Bergmann > Suggested-by: Jessica Clarke > Signed-off-by: Nathan Chancellor Great work tracking down that Debian was carrying patches! Thank you! I've run this through the same 3 assemblers. R

Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-02 Thread Nick Desaulniers
> + if (!*s1 && *s2 == '\n' && !s2[1]) > + return true; > + if (*s1 == '\n' && !s1[1] && !*s2) > + return true; > + return false; > +} > +EXPORT_SYMBOL(sysfs_streqcase); This should be declared in include/linux/string.h in order for others to use this (as 0day bot notes). > + > /** > * match_string - matches given string in an array > * @array: array of strings > -- > 2.25.1 > -- Thanks, ~Nick Desaulniers

Re: gfp.h:20:32: error: redefinition of typedef 'gfp_t' is a C11 feature

2021-02-22 Thread Nick Desaulniers
quires > # that you install podman or docker on your system. > # > # To install tuxmake on your system globally: > # sudo pip3 install -U tuxmake > # > # See https://docs.tuxmake.org/ for complete documentation. > > tuxmake --runtime podman --target-arch arm --toolchain clang-10 > --kconfig davinci_all_defconfig > > build log, > https://builds.tuxbuild.com/1opbM56yvX4uyeXV8JBwFNz9WEQ/ > > -- > Linaro LKFT > https://lkft.linaro.org -- Thanks, ~Nick Desaulniers

Re: [PATCH] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute

2021-02-22 Thread Nick Desaulniers
roups > "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/20210211194258.4137998-1-nathan%40kernel.org. -- Thanks, ~Nick Desaulniers

Re: [PATCH] lib: compile memcat_p only when needed

2020-11-17 Thread Nick Desaulniers
oups > "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/20201117173828.27292-1-info%40metux.net. -- Thanks, ~Nick Desaulniers

Re: [PATCH v3 1/7] compiler-clang: add build check for clang 10.0.1

2020-11-17 Thread Nick Desaulniers
s picked up by AKPM and is in the -mm tree: https://ozlabs.org/~akpm/mmots/broken-out/compiler-clang-remove-version-check-for-bpf-tracing.patch -- Thanks, ~Nick Desaulniers

Re: [PATCH] RISC-V: fix barrier() use in

2020-11-17 Thread Nick Desaulniers
, so that I don't break anything backporting 3347acc6fcd4 because I forgot or missed any follow ups that also needed to be backported. > Reported-by: Andreas Schwab > Signed-off-by: Randy Dunlap > Cc: Andrew Morton > Cc: Stephen Rothwell > Cc: Arvind Sankar > Cc: linux-r

Re: [PATCH 2/3] Revert "lib: Revert use of fallthrough pseudo-keyword in lib/"

2020-11-17 Thread Nick Desaulniers
On Mon, Nov 16, 2020 at 7:02 PM Nathan Chancellor wrote: > > On Sun, Nov 15, 2020 at 08:35:31PM -0800, Nick Desaulniers wrote: > > This reverts commit 6a9dc5fd6170 ("lib: Revert use of fallthrough > > pseudo-keyword in lib/") Gustavo, whose tree did 6a9dc5fd61

Re: [PATCH 1/2] kbuild: Hoist '--orphan-handling' into Kconfig

2020-11-17 Thread Nick Desaulniers
On Mon, Nov 16, 2020 at 5:54 PM Nathan Chancellor wrote: > > On Mon, Nov 16, 2020 at 05:41:58PM -0800, Nick Desaulniers wrote: > > On Fri, Nov 13, 2020 at 11:56 AM Nathan Chancellor > > wrote: > > > > > > Currently, '--orphan-handling=warn' is spread

Re: [PATCH 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1

2020-11-17 Thread Nick Desaulniers
; + > +linker="$*" > + > +if ! ( $linker --version | grep -q LLD ); then > + echo 0 > + exit 1 > +fi > + > +VERSION=$($linker --version | cut -d ' ' -f 2) This is going to invoke the linker potentially twice if it's LLD. Would it be nicer

Re: [PATCH v2] RISC-V: fix barrier() use in

2020-11-17 Thread Nick Desaulniers
lap > Cc: Andrew Morton > Cc: Stephen Rothwell > Cc: Arvind Sankar > Cc: linux-ri...@lists.infradead.org > Cc: clang-built-li...@googlegroups.com > Cc: Nick Desaulniers > Cc: Nathan Chancellor > Cc: Paul Walmsley > Cc: Palmer Dabbelt > Cc: Albert Ou Reviewed-

Re: [PATCH 2/3] Revert "lib: Revert use of fallthrough pseudo-keyword in lib/"

2020-11-17 Thread Nick Desaulniers
esting tree, so it can be > build-tested by the 0-day folks. :) SGTM, and thank you. I'm sure you saw the existing warning about indentation. Do we want to modify the revert patch, or put another patch on top? -- Thanks, ~Nick Desaulniers

[PATCH v2 0/3] PPC: Fix -Wimplicit-fallthrough for clang

2020-11-17 Thread Nick Desaulniers
h 2/3). * reword commit message of patch 1/3 as per Arvind. * reformat patch 2/3 as per kernel test robot and Gustavo. Nick Desaulniers (3): powerpc: boot: include compiler_attributes.h Revert "lib: Revert use of fallthrough pseudo-keyword in lib/" powerpc: fix -Wimplicit-fallthr

[PATCH v2 3/3] powerpc: fix -Wimplicit-fallthrough

2020-11-17 Thread Nick Desaulniers
The "fallthrough" pseudo-keyword was added as a portable way to denote intentional fallthrough. Clang will still warn on cases where there is a fallthrough to an immediate break. Add explicit breaks for those cases. Signed-off-by: Nick Desaulniers Tested-by: Nathan Chancellor R

[PATCH v2 2/3] Revert "lib: Revert use of fallthrough pseudo-keyword in lib/"

2020-11-17 Thread Nick Desaulniers
warning on "inconsistent indenting" reported by kernel test robot. Reported-by: kernel test robot Signed-off-by: Nick Desaulniers Tested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Reviewed-by: Gustavo A. R. Silva Reviewed-by: Miguel Ojeda Link: https://github.com/ClangBuiltLi

[PATCH v2 1/3] powerpc: boot: include compiler_attributes.h

2020-11-17 Thread Nick Desaulniers
ces a whole sea of warnings to cleanup. This approach is minimally invasive. Signed-off-by: Nick Desaulniers Tested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Acked-by: Gustavo A. R. Silva Acked-by: Miguel Ojeda Acked-by: Michael Ellerman Link: https://github.com/ClangBuiltLinux/

Re: violating function pointer signature

2020-11-18 Thread Nick Desaulniers
nused in the body. If you do plan to use them, maybe a pointer to a tagged union would be safer? > > can be used as an argument to any function pointer that has a void > return. In fact, I already do that, grep for __static_call_nop(). > > I'm not sure what the LLVM-CFI crud makes of it, but that's their > problem. If you have instructions on how to exercise the code in question, we can help test it with CFI. Better to find any potential issues before they get committed. -- Thanks, ~Nick Desaulniers

Re: [PATCH] kbuild: Always link with '-z norelro'

2020-11-18 Thread Nick Desaulniers
On Fri, Nov 13, 2020 at 11:34 AM Nick Desaulniers wrote: > > On Thu, Nov 12, 2020 at 10:06 PM Ard Biesheuvel wrote: > > > > On Fri, 13 Nov 2020 at 01:53, Nathan Chancellor > > wrote: > > > > > > On Thu, Nov 12, 2020 at 04:44:46PM -0800, Nick Desaulniers

Re: [PATCH] kbuild: Always link with '-z norelro'

2020-11-18 Thread Nick Desaulniers
On Wed, Nov 18, 2020 at 3:07 PM Ard Biesheuvel wrote: > > On Thu, 19 Nov 2020 at 00:05, Nick Desaulniers > wrote: > > > > > > > > > To avoid playing whack-a-mole with different architectures over > > > > > > > time, > > > >

Re: [PATCH v7 00/17] Add support for Clang LTO

2020-11-18 Thread Nick Desaulniers
it.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=for-next/lto > [2] https://lore.kernel.org/lkml/20201114004911.aip52eimk6c2uxd4@treble/ > > You can also pull this series from > > https://github.com/samitolvanen/linux.git lto-v7 Thanks for continuing to drive this se

Re: [PATCH v7 02/17] kbuild: add support for Clang LTO

2020-11-18 Thread Nick Desaulniers
--start-group \ > - ${KBUILD_VMLINUX_LIBS} \ > - --end-group \ > - ${@}" > + if [ -n "${CONFIG_LTO_CLANG}" ]; then > + # Use vmlinux.o instead of performing the slow LTO > + # link again. > + objects="--whole-archive\ > + vmlinux.o \ > + --no-whole-archive \ > + ${@}" > + else > + objects="--whole-archive\ > + ${KBUILD_VMLINUX_OBJS} \ > + --no-whole-archive \ > + --start-group \ > + ${KBUILD_VMLINUX_LIBS} \ > + --end-group \ > + ${@}" > + fi > > ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} \ > ${strip_debug#-Wl,} \ > @@ -274,7 +291,6 @@ fi; > ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init need-builtin=1 > > #link vmlinux.o > -info LD vmlinux.o > modpost_link vmlinux.o > objtool_link vmlinux.o > > -- > 2.29.2.299.gdc1121823c-goog > -- Thanks, ~Nick Desaulniers

Re: [PATCH v2 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1

2020-11-19 Thread Nick Desaulniers
d-by: Kees Cook > Signed-off-by: Nathan Chancellor Thanks for the additions in v2. Reviewed-by: Nick Desaulniers > --- > > v1 -> v2: > > * Add condition as a depends on line (Kees Cook) > > * Capture output of "$* --version" to avoid invoking linker twice (N

Re: violating function pointer signature

2020-11-19 Thread Nick Desaulniers
el to be built with > both gcc and llvm. Our fleet of machines in the data centers is currently mid-ramp, at around or slightly just over 50% of kernels built with Clang. Soon to be 100%. So "a good chunk of Google services," too, FWIW. OpenMandriva is on track for their 4.2 release to use LLVM for their kernels. -- Thanks, ~Nick Desaulniers

[PATCH] lib/string: remove unnecessary #undefs

2020-11-19 Thread Nick Desaulniers
/ClangBuiltLinux/linux/issues/428 Fixes: 5f074f3e192f ("lib/string.c: implement a basic bcmp") Signed-off-by: Nick Desaulniers --- lib/string.c | 4 1 file changed, 4 deletions(-) diff --git a/lib/string.c b/lib/string.c index 4288e0158d47..7548eb715ddb 100644 --- a/lib/string.c

Re: [PATCH v7 17/17] mm: add mmu_notifier argument to follow_pfn

2020-11-30 Thread Nick Desaulniers
(writable) > > 1916*writable = true; > > 1917 > > 1918 /* > > 1919 * Get a reference here because callers of > > *hva_to_pfn* and > > 1920 * *gfn_to_pfn* ultimately call kvm_release_pfn_clean > > on the > > 1921 * returned pfn. This is only needed if the VMA has > > VM_MIXEDMAP > > 1922 * set, but the kvm_get_pfn/kvm_release_pfn_clean > > pair will > > 1923 * simply do nothing for reserved pfns. > > 1924 * > > 1925 * Whoever called remap_pfn_range is also going to > > call e.g. > > 1926 * unmap_mapping_range before the underlying pages > > are freed, > > 1927 * causing a call to our MMU notifier. > > 1928 */ > > 1929kvm_get_pfn(pfn); > > 1930 > > 1931*p_pfn = pfn; > > 1932return 0; > > 1933} > > 1934 > > > > --- > > 0-DAY CI Kernel Test Service, Intel Corporation > > https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch > > -- > You received this message because you are subscribed to the Google Groups > "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/20201130142820.GN401619%40phenom.ffwll.local. -- Thanks, ~Nick Desaulniers

Re: [PATCH v3] Compiler Attributes: remove CONFIG_ENABLE_MUST_CHECK

2020-11-30 Thread Nick Desaulniers
g churn. If arch > maintainers want to clean them up, please go ahead. > > While I was here, I also moved __must_check to compiler_attributes.h > from compiler_types.h > > Signed-off-by: Masahiro Yamada > Acked-by: Jason A. Donenfeld Reviewed-by: Nick Desaulniers > --- &g

RE: [PATCH v15 01/26] Documentation/x86: Add CET description

2020-11-30 Thread Nick Desaulniers
(In response to https://lore.kernel.org/lkml/20201110162211.9207-2-yu-cheng...@intel.com/) > These need to be enabled to build a CET-enabled kernel, and Binutils v2.31 > and GCC v8.1 or later are required to build a CET kernel. What about LLVM? Surely CrOS might be of interest to ship this on (w

Re: [PATCH] __div64_32(): straighten up inline asm constraints

2020-11-30 Thread Nick Desaulniers
"%1", "r2") > - __asmeq("%2", "r0") > - __asmeq("%3", "r4") > + __asmeq("%2", "r4") > "bl __do_div64" > - : "=r" (__rem), "=r" (__res) > - : "r" (__n), "r" (__base) > + : "+r" (__n), "=r" (__res) > + : "r" (__base) > : "ip", "lr", "cc"); > + __rem = __n >> 32; > *n = __res; > return __rem; The above 3 statement could be: ``` *n = __res; return __n >> 32; ``` > } -- Thanks, ~Nick Desaulniers

Re: [PATCH v15 05/26] x86/cet/shstk: Add Kconfig option for user-mode Shadow Stack

2020-11-30 Thread Nick Desaulniers
In response to https://lore.kernel.org/lkml/20201110162211.9207-6-yu-cheng...@intel.com/. Hi Yu-cheng, This feature reminds me very much of ARCH_SUPPORTS_SHADOW_CALL_STACK/CC_HAVE_SHADOW_CALL_STACK implemented in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=528756

Re: [stable 4.9] PANIC: double fault, error_code: 0x0 - clang boot failed on x86_64

2020-11-30 Thread Nick Desaulniers
o 4.14, 4.9, and 4.4 for x86_64 and aarch64. We still have CI coverage of those branches+arches with Clang today. Pixel 2 shipped with 4.4+clang, Pixel 3 and 3a with 4.9+clang, Pixel 4 and 4a with 4.14+clang. CrOS has also shipped clang built kernels since 4.4+. -- Thanks, ~Nick Desaulniers

<    2   3   4   5   6   7   8   9   10   11   >