mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
Merge Linus's 5.4-rc1-prerelease branch into android-mainline
This merges Linus's tree as of commit b41dae061b ("Merge tag
'xfs-5.4-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux")
into android-mainline.
This "early" merge makes it easier to test and handle merge conflicts
instead of having to wait until the "end" of the merge window and handle
all 10000+ commits at once.
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6bebf55e5e2353f814e3c87f5033607b1ae5d812
This commit is contained in:
commit
bfa0399bc8
7251 changed files with 334804 additions and 222478 deletions
|
|
@ -1,4 +1,9 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
ifdef CONFIG_KASAN
|
||||
CFLAGS_KASAN_NOSANITIZE := -fno-builtin
|
||||
KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)
|
||||
endif
|
||||
|
||||
ifdef CONFIG_KASAN_GENERIC
|
||||
|
||||
ifdef CONFIG_KASAN_INLINE
|
||||
|
|
@ -7,8 +12,6 @@ else
|
|||
call_threshold := 0
|
||||
endif
|
||||
|
||||
KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)
|
||||
|
||||
CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address
|
||||
|
||||
cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1)))
|
||||
|
|
@ -45,7 +48,3 @@ CFLAGS_KASAN := -fsanitize=kernel-hwaddress \
|
|||
$(instrumentation_flags)
|
||||
|
||||
endif # CONFIG_KASAN_SW_TAGS
|
||||
|
||||
ifdef CONFIG_KASAN
|
||||
CFLAGS_KASAN_NOSANITIZE := -fno-builtin
|
||||
endif
|
||||
|
|
|
|||
102
scripts/coccinelle/api/platform_get_irq.cocci
Normal file
102
scripts/coccinelle/api/platform_get_irq.cocci
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/// Remove dev_err() messages after platform_get_irq*() failures
|
||||
//
|
||||
// Confidence: Medium
|
||||
// Options: --include-headers
|
||||
|
||||
virtual patch
|
||||
virtual context
|
||||
virtual org
|
||||
virtual report
|
||||
|
||||
@depends on context@
|
||||
expression ret;
|
||||
struct platform_device *E;
|
||||
@@
|
||||
|
||||
ret =
|
||||
(
|
||||
platform_get_irq
|
||||
|
|
||||
platform_get_irq_byname
|
||||
)(E, ...);
|
||||
|
||||
if ( \( ret < 0 \| ret <= 0 \) )
|
||||
{
|
||||
(
|
||||
if (ret != -EPROBE_DEFER)
|
||||
{ ...
|
||||
*dev_err(...);
|
||||
... }
|
||||
|
|
||||
...
|
||||
*dev_err(...);
|
||||
)
|
||||
...
|
||||
}
|
||||
|
||||
@depends on patch@
|
||||
expression ret;
|
||||
struct platform_device *E;
|
||||
@@
|
||||
|
||||
ret =
|
||||
(
|
||||
platform_get_irq
|
||||
|
|
||||
platform_get_irq_byname
|
||||
)(E, ...);
|
||||
|
||||
if ( \( ret < 0 \| ret <= 0 \) )
|
||||
{
|
||||
(
|
||||
-if (ret != -EPROBE_DEFER)
|
||||
-{ ...
|
||||
-dev_err(...);
|
||||
-... }
|
||||
|
|
||||
...
|
||||
-dev_err(...);
|
||||
)
|
||||
...
|
||||
}
|
||||
|
||||
@r depends on org || report@
|
||||
position p1;
|
||||
expression ret;
|
||||
struct platform_device *E;
|
||||
@@
|
||||
|
||||
ret =
|
||||
(
|
||||
platform_get_irq
|
||||
|
|
||||
platform_get_irq_byname
|
||||
)(E, ...);
|
||||
|
||||
if ( \( ret < 0 \| ret <= 0 \) )
|
||||
{
|
||||
(
|
||||
if (ret != -EPROBE_DEFER)
|
||||
{ ...
|
||||
dev_err@p1(...);
|
||||
... }
|
||||
|
|
||||
...
|
||||
dev_err@p1(...);
|
||||
)
|
||||
...
|
||||
}
|
||||
|
||||
@script:python depends on org@
|
||||
p1 << r.p1;
|
||||
@@
|
||||
|
||||
cocci.print_main(p1)
|
||||
|
||||
@script:python depends on report@
|
||||
p1 << r.p1;
|
||||
@@
|
||||
|
||||
msg = "line %s is redundant because platform_get_irq() already prints an error" % (p1[0].line)
|
||||
coccilib.report.print_report(p1[0],msg)
|
||||
|
|
@ -1245,7 +1245,7 @@ sub dump_enum($$) {
|
|||
# strip #define macros inside enums
|
||||
$x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
|
||||
|
||||
if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) {
|
||||
if ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) {
|
||||
$declaration_name = $1;
|
||||
my $members = $2;
|
||||
my %_members;
|
||||
|
|
@ -1580,6 +1580,7 @@ sub dump_function($$) {
|
|||
$prototype =~ s/__must_check +//;
|
||||
$prototype =~ s/__weak +//;
|
||||
$prototype =~ s/__sched +//;
|
||||
$prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
|
||||
my $define = $prototype =~ s/^#\s*define\s+//; #ak added
|
||||
$prototype =~ s/__attribute__\s*\(\(
|
||||
(?:
|
||||
|
|
|
|||
|
|
@ -56,13 +56,17 @@ modpost_link()
|
|||
}
|
||||
|
||||
# Link of vmlinux
|
||||
# ${1} - optional extra .o files
|
||||
# ${2} - output file
|
||||
# ${1} - output file
|
||||
# ${2}, ${3}, ... - optional extra .o files
|
||||
vmlinux_link()
|
||||
{
|
||||
local lds="${objtree}/${KBUILD_LDS}"
|
||||
local output=${1}
|
||||
local objects
|
||||
|
||||
# skip output file argument
|
||||
shift
|
||||
|
||||
if [ "${SRCARCH}" != "um" ]; then
|
||||
objects="--whole-archive \
|
||||
${KBUILD_VMLINUX_OBJS} \
|
||||
|
|
@ -70,9 +74,10 @@ vmlinux_link()
|
|||
--start-group \
|
||||
${KBUILD_VMLINUX_LIBS} \
|
||||
--end-group \
|
||||
${1}"
|
||||
${@}"
|
||||
|
||||
${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \
|
||||
${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} \
|
||||
-o ${output} \
|
||||
-T ${lds} ${objects}
|
||||
else
|
||||
objects="-Wl,--whole-archive \
|
||||
|
|
@ -81,9 +86,10 @@ vmlinux_link()
|
|||
-Wl,--start-group \
|
||||
${KBUILD_VMLINUX_LIBS} \
|
||||
-Wl,--end-group \
|
||||
${1}"
|
||||
${@}"
|
||||
|
||||
${CC} ${CFLAGS_vmlinux} -o ${2} \
|
||||
${CC} ${CFLAGS_vmlinux} \
|
||||
-o ${output} \
|
||||
-Wl,-T,${lds} \
|
||||
${objects} \
|
||||
-lutil -lrt -lpthread
|
||||
|
|
@ -92,23 +98,36 @@ vmlinux_link()
|
|||
}
|
||||
|
||||
# generate .BTF typeinfo from DWARF debuginfo
|
||||
# ${1} - vmlinux image
|
||||
# ${2} - file to dump raw BTF data into
|
||||
gen_btf()
|
||||
{
|
||||
local pahole_ver;
|
||||
local pahole_ver
|
||||
local bin_arch
|
||||
|
||||
if ! [ -x "$(command -v ${PAHOLE})" ]; then
|
||||
info "BTF" "${1}: pahole (${PAHOLE}) is not available"
|
||||
return 0
|
||||
return 1
|
||||
fi
|
||||
|
||||
pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
|
||||
if [ "${pahole_ver}" -lt "113" ]; then
|
||||
info "BTF" "${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.13"
|
||||
return 0
|
||||
return 1
|
||||
fi
|
||||
|
||||
info "BTF" ${1}
|
||||
info "BTF" ${2}
|
||||
vmlinux_link ${1}
|
||||
LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
|
||||
|
||||
# dump .BTF section into raw binary file to link with final vmlinux
|
||||
bin_arch=$(LANG=C ${OBJDUMP} -f ${1} | grep architecture | \
|
||||
cut -d, -f1 | cut -d' ' -f2)
|
||||
bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \
|
||||
awk '{print $4}')
|
||||
${OBJCOPY} --dump-section .BTF=.btf.vmlinux.bin ${1} 2>/dev/null
|
||||
${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \
|
||||
--rename-section .data=.BTF .btf.vmlinux.bin ${2}
|
||||
}
|
||||
|
||||
# Create ${2} .o file with all symbols from the ${1} object file
|
||||
|
|
@ -153,6 +172,7 @@ sortextable()
|
|||
# Delete output files in case of error
|
||||
cleanup()
|
||||
{
|
||||
rm -f .btf.*
|
||||
rm -f .tmp_System.map
|
||||
rm -f .tmp_kallsyms*
|
||||
rm -f .tmp_vmlinux*
|
||||
|
|
@ -215,6 +235,13 @@ ${MAKE} -f "${srctree}/scripts/Makefile.modpost" MODPOST_VMLINUX=1
|
|||
info MODINFO modules.builtin.modinfo
|
||||
${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo
|
||||
|
||||
btf_vmlinux_bin_o=""
|
||||
if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
|
||||
if gen_btf .tmp_vmlinux.btf .btf.vmlinux.bin.o ; then
|
||||
btf_vmlinux_bin_o=.btf.vmlinux.bin.o
|
||||
fi
|
||||
fi
|
||||
|
||||
kallsymso=""
|
||||
kallsyms_vmlinux=""
|
||||
if [ -n "${CONFIG_KALLSYMS}" ]; then
|
||||
|
|
@ -246,11 +273,11 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
|
|||
kallsyms_vmlinux=.tmp_vmlinux2
|
||||
|
||||
# step 1
|
||||
vmlinux_link "" .tmp_vmlinux1
|
||||
vmlinux_link .tmp_vmlinux1 ${btf_vmlinux_bin_o}
|
||||
kallsyms .tmp_vmlinux1 .tmp_kallsyms1.o
|
||||
|
||||
# step 2
|
||||
vmlinux_link .tmp_kallsyms1.o .tmp_vmlinux2
|
||||
vmlinux_link .tmp_vmlinux2 .tmp_kallsyms1.o ${btf_vmlinux_bin_o}
|
||||
kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o
|
||||
|
||||
# step 3
|
||||
|
|
@ -261,18 +288,13 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
|
|||
kallsymso=.tmp_kallsyms3.o
|
||||
kallsyms_vmlinux=.tmp_vmlinux3
|
||||
|
||||
vmlinux_link .tmp_kallsyms2.o .tmp_vmlinux3
|
||||
|
||||
vmlinux_link .tmp_vmlinux3 .tmp_kallsyms2.o ${btf_vmlinux_bin_o}
|
||||
kallsyms .tmp_vmlinux3 .tmp_kallsyms3.o
|
||||
fi
|
||||
fi
|
||||
|
||||
info LD vmlinux
|
||||
vmlinux_link "${kallsymso}" vmlinux
|
||||
|
||||
if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
|
||||
gen_btf vmlinux
|
||||
fi
|
||||
vmlinux_link vmlinux "${kallsymso}" "${btf_vmlinux_bin_o}"
|
||||
|
||||
if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then
|
||||
info SORTEX vmlinux
|
||||
|
|
|
|||
16
scripts/tools-support-relr.sh
Executable file
16
scripts/tools-support-relr.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh -eu
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
tmp_file=$(mktemp)
|
||||
trap "rm -f $tmp_file.o $tmp_file $tmp_file.bin" EXIT
|
||||
|
||||
cat << "END" | "$CC" -c -x c - -o $tmp_file.o >/dev/null 2>&1
|
||||
void *p = &p;
|
||||
END
|
||||
"$LD" $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr -o $tmp_file
|
||||
|
||||
# Despite printing an error message, GNU nm still exits with exit code 0 if it
|
||||
# sees a relr section. So we need to check that nothing is printed to stderr.
|
||||
test -z "$("$NM" $tmp_file 2>&1 >/dev/null)"
|
||||
|
||||
"$OBJCOPY" -O binary $tmp_file $tmp_file.bin
|
||||
Loading…
Reference in a new issue