Commit graph

873,956 commits

Author SHA1 Message Date
Sami Tolvanen
96dc079c19 ANDROID: kbuild: suppress llvm-ar errors
These errors are harmless, suppress the output.

Fixes: 310afefe71 ("ANDROID: kbuild: add support for Clang LTO")
Change-Id: Ia78f2edb6aa3a93ffbca37d193f065a51f748679
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-27 13:12:36 -08:00
Sami Tolvanen
2d939f16c3 ANDROID: kbuild: fix modfinal with LTO
Makefile.modpost was split to Makefile.modfinal in 5.4. This file
doesn't include include/config/auto.conf, which breaks checking
for kernel configuration. This change adds the missing include and
cleans up the LTO build rule.

Bug: 145296861
Fixes: 310afefe71 ("ANDROID: kbuild: add support for Clang LTO")
Change-Id: I3e6f676e841eed730ce8cccdfbd312f63660c293
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-27 13:04:31 -08:00
Steve Muckle
93306180b8 ANDROID: gki_defconfig: enable CONFIG_REGULATOR_FIXED_VOLTAGE
Bug: 145297013
Change-Id: I220b9e8339f670f22922e5e5ecba8b47f782d0ca
Signed-off-by: Steve Muckle <smuckle@google.com>
2019-11-27 11:14:25 -08:00
Sami Tolvanen
59ec77600f ANDROID: gki_defconfig: enable LTO, CFI, and SCS
Bug: 145210207
Change-Id: I10a67f8607bfbd20b699a33cad3f441cd49aad26
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:49 -08:00
Sami Tolvanen
0ccde911cc FROMLIST: crypto: arm64/sha: fix function types
Instead of casting pointers to callback functions, add C wrappers
to avoid type mismatch failures with Control-Flow Integrity (CFI)
checking.

Bug: 145210207
Change-Id: I78751148dc1d2cf5666dfdeeb8f6ffa602aefa5c
(am from https://lore.kernel.org/patchwork/patch/1156078/)
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:49 -08:00
Sami Tolvanen
e7b2999eae ANDROID: arm64: kvm: disable CFI
Disable CFI for code that runs at EL2 because __cfi_check only
understands EL1 addresses.

Bug: 145210207
Change-Id: I0053c4e42a0f40423ac94ab73077034e97e0ff31
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:48 -08:00
Sami Tolvanen
2e34bc14ef ANDROID: arm64: add __nocfi to __apply_alternatives
__apply_alternatives makes indirect calls to functions whose address is
taken in assembly code using the alternative_cb macro. With CFI enabled
using non-canonical jump tables, the compiler isn't able to replace the
function reference with the jump table reference, which trips CFI.

Bug: 145210207
Change-Id: I6cdd164f9315c0aa16a1427ab1a67cfa8aad3ffd
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:48 -08:00
Sami Tolvanen
7d6a5a0eab ANDROID: arm64: add __pa_function
We use non-canonical CFI jump tables with CONFIG_CFI_CLANG, which
means the compiler replaces function address references with the
address of the function's CFI jump table entry. This results in
__pa_symbol(function) returning the physical address of the jump
table entry, which can lead to address space confusion since the
jump table points to a virtual address.

This change adds a __pa_function macro, which uses inline assembly
to take the actual function address instead.

Bug: 145210207
Change-Id: I674e5ed386b282a7ed32eeb1f070fb39b5c4b19c
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:48 -08:00
Sami Tolvanen
a5ba549dff ANDROID: arm64: add __nocfi to functions that jump to a physical address
Disable CFI checking for functions that switch to linear mapping and
make an indirect call to a physical address, since the compiler only
understands virtual addresses.

Bug: 145210207
Change-Id: Icce1a5b8ca521227b2fd6a3309189e738fe022b8
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:47 -08:00
Sami Tolvanen
d9756ba082 ANDROID: arm64: bpf: implement arch_bpf_jit_check_func
Implement arch_bpf_jit_check_func to check that pointers to jited BPF
functions are correctly aligned and point to the BPF JIT region. This
narrows down the attack surface on the stored pointer.

Bug: 145210207
Change-Id: I1c2c9365662437f9a4178b873859576028468ea6
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:47 -08:00
Sami Tolvanen
788bbf4f26 ANDROID: bpf: validate bpf_func when BPF_JIT is enabled with CFI
With CONFIG_BPF_JIT, the kernel makes indirect calls to dynamically
generated code, which the compile-time Control-Flow Integrity (CFI)
checking cannot validate. This change adds basic sanity checking to
ensure we are jumping to a valid location, which narrows down the
attack surface on the stored pointer.

In addition, this change adds a weak arch_bpf_jit_check_func function,
which architectures that implement BPF JIT can override to perform
additional validation, such as verifying that the pointer points to
the correct memory region.

Bug: 145210207
Change-Id: I1a90c70cdcef25673a870d3c4f2586a829c0d32e
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:46 -08:00
Sami Tolvanen
fa91466f31 ANDROID: add support for Clang's Control Flow Integrity (CFI)
This change adds the CONFIG_CFI_CLANG option, CFI error handling,
and a faster look-up table for cross module CFI checks.

Bug: 145210207
Change-Id: I118303de50114ca6f85d89a7d69c5cbc47e2f5c0
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:46 -08:00
Sami Tolvanen
f08b8ec58c ANDROID: arm64: allow LTO_CLANG and THINLTO to be selected
Allow CONFIG_LTO_CLANG and CONFIG_THINLTO to be enabled.

Bug: 145210207
Change-Id: If0d2cf24eabd3720576489cc74410681ef722784
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:46 -08:00
Sami Tolvanen
6530acbe7c FROMLIST: arm64: fix alternatives with LLVM's integrated assembler
LLVM's integrated assembler fails with the following error when
building KVM:

  <inline asm>:12:6: error: expected absolute expression
   .if kvm_update_va_mask == 0
       ^
  <inline asm>:21:6: error: expected absolute expression
   .if kvm_update_va_mask == 0
       ^
  <inline asm>:24:2: error: unrecognized instruction mnemonic
          NOT_AN_INSTRUCTION
          ^
  LLVM ERROR: Error parsing inline asm

These errors come from ALTERNATIVE_CB and __ALTERNATIVE_CFG,
which test for the existence of the callback parameter in inline
assembly using the following expression:

  " .if " __stringify(cb) " == 0\n"

This works with GNU as, but isn't supported by LLVM. This change
splits __ALTERNATIVE_CFG and ALTINSTR_ENTRY into separate macros
to fix the LLVM build.

Bug: 145210207
Change-Id: I3f80fca8aafdac4e185f79ce5a4eee9ba367bb33
(am from https://lore.kernel.org/patchwork/patch/1146950/)
Link: https://github.com/ClangBuiltLinux/linux/issues/472
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:45 -08:00
Sami Tolvanen
4307fb9134 FROMLIST: arm64: lse: fix LSE atomics with LLVM's integrated assembler
Unlike gcc, clang considers each inline assembly block to be independent
and therefore, when using the integrated assembler for inline assembly,
any preambles that enable features must be repeated in each block.

This change defines __LSE_PREAMBLE and adds it to each inline assembly
block that has LSE instructions, which allows them to be compiled also
with clang's assembler.

Bug: 145210207
Change-Id: Ifdcb160ddb074bea62a52239fffb0590f409df46
(am from https://lore.kernel.org/patchwork/patch/1146951/)
Link: https://github.com/ClangBuiltLinux/linux/issues/671
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:45 -08:00
Sami Tolvanen
a516ca1ee7 ANDROID: arm64: disable HAVE_ARCH_PREL32_RELOCATIONS with LTO_CLANG
Disable HAVE_ARCH_PREL32_RELOCATIONS to stop LLVM from reordering
initcalls.

Bug: 145210207
Change-Id: Ia5ba389ff204fdc51cf6d6c554e9345bd89398d7
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:44 -08:00
Sami Tolvanen
f0f28e9c01 ANDROID: arm64: vdso: disable LTO
Bug: 145210207
Change-Id: I51f87b1b975ba22e67555a6bb4f31a8f47364eba
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:44 -08:00
Sami Tolvanen
23141e2689 ANDROID: irqchip/gic-v3: rename gic_of_init to work around a ThinLTO+CFI bug
Bug: 145210207
Link: https://github.com/ClangBuiltLinux/linux/issues/537
Change-Id: Ibe51a1f531625fde4a44cf92f89b1f9ac41b4c68
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:44 -08:00
Sami Tolvanen
79ff0889f8 ANDROID: soc/tegra: disable ARCH_TEGRA_210_SOC with LTO
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue
with ThinLTO.

Bug: 145210207
Change-Id: Ic37929da7337317ff2720f1f939227b99f0cdadd
Link: https://github.com/ClangBuiltLinux/linux/issues/510
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:43 -08:00
Sami Tolvanen
6c5ad8b10e ANDROID: init: ensure initcall ordering with LTO
With LTO, the compiler doesn't necessarily obey link order for
initcalls, and the initcall variables need to be globally unique
to avoid naming collisions.

In order to preserve the intended order, this change moves each
initcall variable into its own section and generates a linker
script (in scripts/link-vmlinux.sh) to define the correct order
for these sections. We also add a __COUNTER__ prefix to the name,
so we can retain the order of initcalls within each compilation
unit, and __LINE__ to help ensure uniqueness.

Bug: 145210207
Change-Id: I602038783853497790c5a2941343c546e380c525
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:43 -08:00
Sami Tolvanen
95788bcf46 ANDROID: drivers/misc/lkdtm: disable LTO for rodata.o
Disable LTO for rodata.o to allow objcopy to be used to
manipulate sections.

Bug: 145210207
Change-Id: I387a37fd2dd13a877e9e66e9f99c9c4b10b0e963
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:43 -08:00
Sami Tolvanen
a4fa5799c0 ANDROID: efi/libstub: disable LTO
With CONFIG_LTO_CLANG, we produce LLVM IR instead of object files. Since LTO
is not really needed here and the Makefile assumes we produce an object file,
disable LTO for libstub.

Bug: 145210207
Change-Id: I7f1f9af7430164ebbcb0e85f66abae5cb9feee6a
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:42 -08:00
Sami Tolvanen
c7aaf58a4d ANDROID: scripts/mod: disable LTO for empty.c
With CONFIG_LTO_CLANG, clang generates LLVM IR instead of ELF object
files. As empty.o is used for probing target properties, disable LTO
for it to produce an object file instead.

Bug: 145210207
Change-Id: I618d8b86ed88ad048abdee3c541ced19d12982c0
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:42 -08:00
Sami Tolvanen
c4fa71e251 ANDROID: kbuild: fix dynamic ftrace with clang LTO
With CONFIG_LTO_CLANG enabled, LLVM IR won't be compiled into object
files until modpost_link. This change postpones calls to recordmcount
until after this step.

In order to exclude ftrace_process_locs from inspection, we add a new
code section .text..ftrace, which we tell recordmcount to ignore, and
a __norecordmcount attribute for moving functions to this section.

Bug: 145210207
Change-Id: Ib77f7c431fce54243c46d584b55761ed2342965c
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:41 -08:00
Sami Tolvanen
310afefe71 ANDROID: kbuild: add support for Clang LTO
This change adds the configuration option CONFIG_LTO_CLANG, and
build system support for Clang's Link Time Optimization (LTO). In
preparation for LTO support with other compilers, potentially common
parts of the changes are gated behind CONFIG_LTO instead.

With -flto, instead of object files, Clang produces LLVM bitcode,
which is compiled into a native object at link time, allowing the
final binary to be optimized globally. For more details, see:

  https://llvm.org/docs/LinkTimeOptimization.html

While the kernel normally uses GNU ld for linking, LLVM supports LTO
only with LLD or GNU gold linkers. This change assumes LLD is used.

Bug: 145210207
Change-Id: If1164ff33d073358ee7d4bba84cbb06c349c4a88
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:41 -08:00
Sami Tolvanen
79ae4ab8e6 ANDROID: kbuild: add CONFIG_LD_IS_LLD
Similarly to the CC_IS_CLANG config, add LD_IS_LLD to simplify feature
selection based on the linker.

Bug: 145210207
Change-Id: I097c52899dcf9829eb0e1ea89211b17972301c1a
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:40 -08:00
Sami Tolvanen
e75fce5307 FROMGIT: driver core: platform: use the correct callback type for bus_find_device
platform_find_device_by_driver calls bus_find_device and passes
platform_match as the callback function. Casting the function to a
mismatching type trips indirect call Control-Flow Integrity (CFI) checking.

This change adds a callback function with the correct type and instead
of casting the function, explicitly casts the second parameter to struct
device_driver* as expected by platform_match.

Bug: 145210207
Change-Id: Idef667974d3c54ebd79f0813531cf2523d651dfe
(cherry picked from commit 492c88720d
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
 driver-core-next)
Fixes: 36f3313d6b ("platform: Add platform_find_device_by_driver() helper")
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191112214156.3430-1-samitolvanen@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-26 13:27:40 -08:00
Sami Tolvanen
084cffa679 FROMLIST: arm64: implement Shadow Call Stack
This change implements shadow stack switching, initial SCS set-up,
and interrupt shadow stacks for arm64.

Bug: 145210207
Change-Id: I6fd8770bef9d24c85470d17e6a8e867c7cfe43f4
(am from https://lore.kernel.org/patchwork/patch/1149062/)
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:40 -08:00
Sami Tolvanen
4756bebcd2 FROMLIST: arm64: disable SCS for hypervisor code
Filter out CC_FLAGS_SCS for code that runs at a different exception
level.

Bug: 145210207
Change-Id: I834424fba7aa18598b618891814327ecc2841c6e
(am from https://lore.kernel.org/patchwork/patch/1149062/)
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:39 -08:00
Sami Tolvanen
8662f567f7 FROMLIST: arm64: vdso: disable Shadow Call Stack
Shadow stacks are only available in the kernel, so disable SCS
instrumentation for the vDSO.

Bug: 145210207
Change-Id: Id894b77112801c00a44bcc539cc3882b5f72b251
(am from https://lore.kernel.org/patchwork/patch/1149061/)
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:39 -08:00
Sami Tolvanen
0db85aae47 FROMLIST: arm64: efi: restore x18 if it was corrupted
If we detect a corrupted x18 and SCS is enabled, restore the register
before jumping back to instrumented code. This is safe, because the
wrapper is called with preemption disabled and a separate shadow stack
is used for interrupt handling.

Bug: 145210207
Change-Id: Idb75117e38c895231a14f5573261861e722c1264
(am from https://lore.kernel.org/patchwork/patch/1149060/)
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:38 -08:00
Sami Tolvanen
ee3f10f584 FROMLIST: arm64: preserve x18 when CPU is suspended
Don't lose the current task's shadow stack when the CPU is suspended.

Bug: 145210207
Change-Id: I8db58daadcc15a00a6f585580a3c97905c678eb3
(am from https://lore.kernel.org/patchwork/patch/1149059/)
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:38 -08:00
Sami Tolvanen
cb28bf9230 FROMLIST: arm64: reserve x18 from general allocation with SCS
Reserve the x18 register from general allocation when SCS is enabled,
because the compiler uses the register to store the current task's
shadow stack pointer. Note that all external kernel modules must also be
compiled with -ffixed-x18 if the kernel has SCS enabled.

Bug: 145210207
Change-Id: I0407d38a0a5ecb6852b3f281d52f6601c565157e
(am from https://lore.kernel.org/patchwork/patch/1149058/)
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:38 -08:00
Sami Tolvanen
acd44754dd FROMLIST: arm64: disable function graph tracing with SCS
The graph tracer hooks returns by modifying frame records on the
(regular) stack, but with SCS the return address is taken from the
shadow stack, and the value in the frame record has no effect. As we
don't currently have a mechanism to determine the corresponding slot
on the shadow stack (and to pass this through the ftrace
infrastructure), for now let's disable the graph tracer when SCS is
enabled.

Bug: 145210207
Change-Id: I65dd098be827121ecf0c08538b11e3b98f5eacde
(am from https://lore.kernel.org/patchwork/patch/1149057/)
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:37 -08:00
Sami Tolvanen
e5438c0fea FROMLIST: scs: add support for stack usage debugging
Implements CONFIG_DEBUG_STACK_USAGE for shadow stacks. When enabled,
also prints out the highest shadow stack usage per process.

Bug: 145210207
Change-Id: I2b2fea68760ca8d94d6f887cfe5828883d233b88
(am from https://lore.kernel.org/patchwork/patch/1149056/)
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:37 -08:00
Sami Tolvanen
d78efa28eb FROMLIST: scs: add accounting
This change adds accounting for the memory allocated for shadow stacks.

Bug: 145210207
Change-Id: Iee94c22abefcabb63a3bcd4db8ba952130f30a82
(am from https://lore.kernel.org/patchwork/patch/1149055/)
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:37 -08:00
Sami Tolvanen
44a2290faf FROMLIST: add support for Clang's Shadow Call Stack (SCS)
This change adds generic support for Clang's Shadow Call Stack,
which uses a shadow stack to protect return addresses from being
overwritten by an attacker. Details are available here:

  https://clang.llvm.org/docs/ShadowCallStack.html

Note that security guarantees in the kernel differ from the
ones documented for user space. The kernel must store addresses
of shadow stacks used by other tasks and interrupt handlers in
memory, which means an attacker capable reading and writing
arbitrary memory may be able to locate them and hijack control
flow by modifying shadow stacks that are not currently in use.

Bug: 145210207
Change-Id: I2a8ba6a3decac50c169731c3121c9dcab96621d2
(am from https://lore.kernel.org/patchwork/patch/1149054/)
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:36 -08:00
Ard Biesheuvel
1e55c6fbd3 FROMLIST: arm64: kernel: avoid x18 in __cpu_soft_restart
The code in __cpu_soft_restart() uses x18 as an arbitrary temp register,
which will shortly be disallowed. So use x8 instead.

Bug: 145210207
Change-Id: Iad10392005b66e6bf3a0f00c40024448e9798b89
(am from https://lore.kernel.org/patchwork/patch/1149053/)
Link: https://patchwork.kernel.org/patch/9836877/
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
[Sami: updated commit message]
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:36 -08:00
Ard Biesheuvel
947573898b FROMLIST: arm64: kvm: stop treating register x18 as caller save
In preparation of reserving x18, stop treating it as caller save in
the KVM guest entry/exit code. Currently, the code assumes there is
no need to preserve it for the host, given that it would have been
assumed clobbered anyway by the function call to __guest_enter().
Instead, preserve its value and restore it upon return.

Bug: 145210207
Change-Id: I341bcb10b615999a59a8413a6b98cb2ce1c62e02
(am from https://lore.kernel.org/patchwork/patch/1149065/)
Link: https://patchwork.kernel.org/patch/9836891/
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
[Sami: updated commit message, switched from x18 to x29 for the guest context]
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:36 -08:00
Ard Biesheuvel
45c8ed6483 FROMLIST: arm64/lib: copy_page: avoid x18 register in assembler code
Register x18 will no longer be used as a caller save register in the
future, so stop using it in the copy_page() code.

Bug: 145210207
Change-Id: Iffd77db101d6e83ec8c5e12b11d9f0fef09a630b
(am from https://lore.kernel.org/patchwork/patch/1149064/)
Link: https://patchwork.kernel.org/patch/9836869/
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
[Sami: changed the offset and bias to be explicit]
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:36 -08:00
Sami Tolvanen
ae38465e97 FROMLIST: arm64: mm: avoid x18 in idmap_kpti_install_ng_mappings
idmap_kpti_install_ng_mappings uses x18 as a temporary register, which
will result in a conflict when x18 is reserved. Use x16 and x17 instead
where needed.

Bug: 145210207
Change-Id: I9fbf40769c5c241422fff8558c7a9bade8ebadb6
(am from https://lore.kernel.org/patchwork/patch/1149052/)
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-11-26 13:27:35 -08:00
Guru Das Srinagesh
79650f61a7 FROMLIST: pwm: Convert period and duty cycle to u64
Because period and duty cycle are defined as ints with units of
nanoseconds, the maximum time duration that can be set is limited to
~2.147 seconds. Change their definitions to u64 in the structs of the
PWM framework so that higher durations may be set.

Also make the relevant fixes to those drivers that use the period and
duty_cycle struct members in division operations, viz. replacing the
division operations with 64-bit division macros as appropriate.

Bug: 140290586
Change-Id: Ibb8c7f007f4c11ebf8cf01e7a468cc9c29aa8b23
Link: https://www.spinics.net/lists/linux-pwm/msg11133.html
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
2019-11-26 21:25:04 +00:00
Alistair Delva
dbc9ea9521 ANDROID: clang: update to 10.0.1
Bug: 144776928
Change-Id: Ic1c76a05a54b0001eac6f9c6f248222989aa79bd
Signed-off-by: Alistair Delva <adelva@google.com>
2019-11-26 12:58:21 -08:00
Ram Muthiah
2e1635f514 ANDROID: gki_defconfig: =m's applied for virtio configs in arm64
aligned =m virtual dev configs for arm64 and 86_64

Test: Treehugger
Bug: 143710295
Change-Id: I77c8b838bec94cf5ad3f0dc124f8269c2b6d6636
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
2019-11-26 19:37:18 +00:00
Ram Muthiah
2ca5fe7ddf ANDROID: gki_defconfig: removed CONFIG_PM_WAKELOCKS
Change-Id: I9ff74aea38ee20815d9e0cb2b81ebbb2dae6dd7b
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Bug: 143710295
Bug: 115946999
Test: Treehugger
2019-11-26 19:31:59 +00:00
Mark Salyzyn
8331ce0007 ANDROID: gki_defconfig: FW_CACHE to no
Set the default for FW_CACHE to n to match Android expectations.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 32180327
Bug: 137566496
Change-Id: I86a28040be07fb2f30125d28f7f379798727785c
2019-11-26 15:50:42 +00:00
Mark Salyzyn
cd403ef6a7 FROMGIT: firmware_class: make firmware caching configurable
Because firmware caching generates uevent messages that are sent over
a netlink socket, it can prevent suspend on many platforms.  It's
also not always useful, so make it a configurable option.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Tim Murray <timmurray@google.com>
Cc: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: kernel-team@android.com
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20191113225429.118495-1-salyzyn@android.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit c74f805662 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-testing)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 32180327
Bug: 137566496
Change-Id: I1250512b27edb56caa78d536e5ccf1fb669476ad
2019-11-26 15:50:27 +00:00
Ram Muthiah
bc997f7549 ANDROID: gki_defconfig: enable CONFIG_IKHEADERS as m
Change-Id: I584b09e1565a1453567e692fdff9e92790b4a29e
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Bug: 143710295
Test: Treehugger
(cherry picked from commit 991e1d9b7b)
2019-11-25 23:17:52 +00:00
Matthias Maennich
9fc4b4c81e ANDROID: update abi representation
Change-Id: I84f9a2a9cfb6e389a710bda2f7bf9a69e4e0af33
Cc: Sami Tolvanen <samitolvanen@google.com>
Fixes: 00c013f4a6 ("ANDROID: gki_defconfig: disable FUNCTION_TRACER")
Signed-off-by: Matthias Maennich <maennich@google.com>
2019-11-25 22:28:50 +00:00
Elliot Berman
14e014655b FROMLIST: reboot: Export reboot_mode
Export reboot_mode to support kernel modules wishing to modify reboot_mode.

Change-Id: I8d25aec75331a57fab85c12b8527a329e2a4f19d
Bug: 143964928
Link: https://lore.kernel.org/patchwork/patch/1151092/
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-25 19:40:58 +00:00