GitHub/LineageOS/G12/android_kernel_amlogic_linux-4.9.git
13 months agoFROMLIST: [PATCH 5/6] arm64: compat: 32-bit vDSO setup
Kevin Brodsky [Thu, 8 Sep 2016 13:25:04 +0000 (14:25 +0100)]
FROMLIST: [PATCH 5/6] arm64: compat: 32-bit vDSO setup

(cherry pick from url https://patchwork.kernel.org/patch/10060459/)

If the compat vDSO is enabled, install it in compat processes. In this
case, the compat vDSO replaces the sigreturn page (it provides its own
sigreturn trampolines).

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug: 63737556
Bug: 20045882
Change-Id: Ia6acf4c3ffea636bc750ac00853ea762c182e5b5

13 months agoFROMLIST: [PATCH 4/6] arm64: compat: Add a 32-bit vDSO
Kevin Brodsky [Wed, 11 May 2016 10:42:22 +0000 (11:42 +0100)]
FROMLIST: [PATCH 4/6] arm64: compat: Add a 32-bit vDSO

(cherry pick from url https://patchwork.kernel.org/patch/10060445/)

Provide the files necessary for building a compat (AArch32) vDSO in
kernel/vdso32.

This is mostly an adaptation of the arm vDSO. The most significant
change in vgettimeofday.c is the use of the arm64 vdso_data struct,
allowing the vDSO data page to be shared between the 32 and 64-bit
vDSOs. Additionally, a different set of barrier macros is used (see
aarch32-barrier.h), as we want to support old 32-bit compilers that
may not support ARMv8 and its new barrier arguments (*ld).

In addition to the time functions, sigreturn trampolines are also
provided, aiming at replacing those in the sigreturn page as the
latter don't provide any unwinding information (and it's easier to
have just one "user code" page). arm-specific unwinding directives are
used, based on glibc's implementation. Symbol offsets are made
available to the kernel using the same method as the 64-bit vDSO.

There is unfortunately an important caveat: we cannot get away with
hand-coding 32-bit instructions like in kernel/kuser32.S, this time we
really need a 32-bit compiler. The compat vDSO Makefile relies on
CROSS_COMPILE_ARM32 to provide a 32-bit compiler, appropriate logic
will be added to the arm64 Makefile later on to ensure that an attempt
to build the compat vDSO is made only if this variable has been set
properly.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug: 63737556
Bug: 20045882
Change-Id: I3fb9d21b29bd9fec1408f2274d090e6def546b0d

13 months agoFROMLIST: BACKPORT: [PATCH 3/6] arm64: Refactor vDSO init/setup
Kevin Brodsky [Tue, 10 May 2016 12:51:54 +0000 (13:51 +0100)]
FROMLIST: BACKPORT: [PATCH 3/6] arm64: Refactor vDSO init/setup

(cherry pick from url https://patchwork.kernel.org/patch/10060439/)

Move the logic for setting up mappings and pages for the vDSO into
static functions. This makes the vDSO setup code more consistent with
the compat side and will allow to reuse it for the future compat vDSO.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug: 63737556
Bug: 20045882
Change-Id: I13e84479591091669190360f2a7f4d04462e6344

13 months agoFROMLIST: [PATCH 2/6] arm64: elf: Set AT_SYSINFO_EHDR in compat processes
Kevin Brodsky [Thu, 12 May 2016 08:53:26 +0000 (09:53 +0100)]
FROMLIST: [PATCH 2/6] arm64: elf: Set AT_SYSINFO_EHDR in compat processes

(cherry pick from url https://patchwork.kernel.org/patch/10060431/)

If the compat vDSO is enabled, we need to set AT_SYSINFO_EHDR in the
auxiliary vector of compat processes to the address of the vDSO code
page, so that the dynamic linker can find it (just like the regular vDSO).

Note that we cast context.vdso to Elf64_Off, instead of elf_addr_t,
because elf_addr_t is Elf32_Off in compat_binfmt_elf.c, and casting
context.vdso to u32 would trigger a pointer narrowing warning.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug: 63737556
Bug: 20045882
Change-Id: I5d0b191d3b2f4c0b2ec31fe9faef0246253635ce

13 months agoFROMLIST: [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available
Kevin Brodsky [Thu, 12 May 2016 09:55:47 +0000 (10:55 +0100)]
FROMLIST: [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available

(cherry pick from url https://patchwork.kernel.org/patch/10060449/)

If the compat vDSO is enabled, it replaces the sigreturn page.
Therefore, we use the sigreturn trampolines the vDSO provides instead.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug: 63737556
Bug: 20045882
Change-Id: Ic0933741e321e1bf66409b7e190a776f12948024

13 months agoFROMLIST: lib: vdso: add support for time
Mark Salyzyn [Fri, 27 Oct 2017 15:58:18 +0000 (08:58 -0700)]
FROMLIST: lib: vdso: add support for time

(cherry pick from url https://patchwork.kernel.org/patch/10053549/)

Add time() vdso support to match up with existing support in the x86's
vdso.  Currently benefitting arm and arm64 which uses the common
vgettimeofday.c implementation.  On arm provides about a ~14 fold
improvement in speed over the straight syscall, and about a ~5 fold
improvement in speed over an alternate library implementation that
relies on the vdso call to gettimeofday to fulfill the request.

We can provide __vdso_time even if we can not provide a speed
enhanced __vdso_gettimeofday.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug: 63737556
Bug: 20045882
Change-Id: I0bb3c6bafe57f9ed69350e2dd54edaae58316e8f

13 months agoFROMLIST: [PATCH] arm64: compat: Expose offset to registers in sigframes
Kevin Brodsky [Tue, 10 May 2016 12:32:58 +0000 (13:32 +0100)]
FROMLIST: [PATCH] arm64: compat: Expose offset to registers in sigframes

(cherry picked from url https://patchwork.kernel.org/patch/10006025/)

This will be needed to provide unwinding information in compat
sigreturn trampolines, part of the future compat vDSO. There is no
obvious header the compat_sig* struct's should be moved to, so let's
put them in signal32.h.

Also fix minor style issues reported by checkpatch.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug: 63737556
Bug: 20045882
Change-Id: I9c23dd6b56ca48c0953cbf78ccb7b49ded906052

13 months agoFROMLIST: [PATCH v5 12/12] lib: vdso: do not expose gettimeofday, if no arch supporte...
Mark Salyzyn [Fri, 27 Oct 2017 15:58:18 +0000 (08:58 -0700)]
FROMLIST: [PATCH v5 12/12] lib: vdso: do not expose gettimeofday, if no arch supported timer

(cherry pick from url https://patchwork.kernel.org/patch/10044539/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

If ARCH_PROVIDES_TIMER is not defined, do not expose gettimeofday.
libc will default directly to syscall.  Also ifdef clock_gettime
switch cases and stubs if not supported and other unused components.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I362a7114db0aac800e16eb90d14a8739e18f42e4

13 months agoFROMLIST: [PATCH v5 11/12] lib: vdso: Add support for CLOCK_BOOTTIME
Mark Salyzyn [Thu, 24 Aug 2017 20:35:24 +0000 (13:35 -0700)]
FROMLIST: [PATCH v5 11/12] lib: vdso: Add support for CLOCK_BOOTTIME

(cherry pick from url https://patchwork.kernel.org/patch/10044503/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Add a case for CLOCK_BOOTTIME as it is popular for measuring
relative time on systems expected to suspend() or hibernate().

Android uses CLOCK_BOOTTIME for all relative time measurements
and timeouts. Switching to vdso reduced CPU utilization and improves
accuracy. There is also a desire by some partners to switch all
logging over to CLOCK_BOOTTIME, and thus this operation alone would
contribute to a near percentile CPU load.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I76c26b054baf7f1100e03c65d6b16fe649b883b1

13 months agoFROMLIST: [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with global vgettimeof...
Mark Salyzyn [Fri, 4 Aug 2017 16:58:40 +0000 (09:58 -0700)]
FROMLIST: [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with global vgettimeofday.C

(cherry picked from url https://patchwork.kernel.org/patch/10044501/)

Take an effort from the previous 9 patches to recode the arm64 vdso
code from assembler to C previously submitted by
Andrew Pinski <apinski@cavium.com>, rework it for use in both arm and
arm64, overlapping any optimizations for each architecture. But
instead of landing it in arm64, land the result into lib/vdso and
unify both implementations to simplify future maintenance.

apinski@cavium.com makes the following claims in the original patch:

This allows the compiler to optimize the divide by 1000 and remove
the other divides.

On ThunderX, gettimeofday improves by 32%.  On ThunderX 2,
gettimeofday improves by 18%.

Note I noticed a bug in the old (arm64) implementation of
__kernel_clock_getres; it was checking only the lower 32bits of the
pointer; this would work for most cases but could fail in a few.

<end of claim>

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I71ff27ff5bfa323354fda6867b01ec908d8d6cbd

13 months agoFROMLIST: [PATCH v5 09/12] arm: vdso: move vgettimeofday.c to lib/vdso/
Mark Salyzyn [Thu, 12 Oct 2017 22:13:07 +0000 (15:13 -0700)]
FROMLIST: [PATCH v5 09/12] arm: vdso: move vgettimeofday.c to lib/vdso/

(cherry pick from url https://patchwork.kernel.org/patch/10044497/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Declare arch/arm/vdso/vgettimeofday.c to be a candidate for a global
implementation of the vdso timer calls.  The hope is that new
architectures can take advantage of the current unification of
arm and arm64 implementations.

We urge future efforts to merge their implementations into the
global vgettimeofday.c file and thus provide functional parity.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: If7da1d8144684d52ed9520a581e6023c623df931

13 months agoFROMLIST: [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK

(cherry picked from url https://patchwork.kernel.org/patch/10044543/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Add ARCH_CLOCK_FIXED_MASK as an efficiency since arm64 has no
purpose for cs_mask vdso_data variable.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: Iadf94bed6166d2ee43bb46bdf54636618e4b8854

13 months agoFROMLIST: [PATCH v5 07/12] arm: vdso: disable profiling
Mark Salyzyn [Thu, 12 Oct 2017 22:13:07 +0000 (15:13 -0700)]
FROMLIST: [PATCH v5 07/12] arm: vdso: disable profiling

(cherry pick from url https://patchwork.kernel.org/patch/10044491/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Make sure kasan and ubsan profiling, and kcov instrumentation,
is turned off for VDSO code.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I2b44c1edd81665b8bb235a65ba642767c35f1e61

13 months agoFROMLIST: [PATCH v5 06/12] arm: vdso: add support for clock_getres
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 06/12] arm: vdso: add support for clock_getres

(cherry picked from url https://patchwork.kernel.org/patch/10044545/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Add clock_getres vdso support to match up with existing support in
the arm64's vdso.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: Ie37bf76d2992027f06a2cdd001d8654a860d2aac

13 months agoFROMLIST: [PATCH v6 05/12] arm: vdso: Add support for CLOCK_MONOTONIC_RAW
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v6 05/12] arm: vdso: Add support for CLOCK_MONOTONIC_RAW

(cherry pick from url https://patchwork.kernel.org/patch/10052099/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Add a case for CLOCK_MONOTONIC_RAW to match up with support that
is available in arm64's vdso.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: If9c09d131e236ba4a483dbc122e6b876f471df72

13 months agoFROMLIST: [PATCH v5 04/12] arm: vdso: do calculations outside reader loops
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 04/12] arm: vdso: do calculations outside reader loops

(cherry picked from url https://patchwork.kernel.org/patch/10044477/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

In variable timer reading loops, pick up just the values until all
are synchronized, then outside of loop pick up cntvct and perform
calculations to determine final offset, shifted and multiplied
output value.

This replaces get_ns with get_clock_shifted_nsec as cntvct reader.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I8008197f08485ef89b267128e41624ff69c33f6b

13 months agoFROMLIST: [PATCH v5 03/12] arm: vdso: inline assembler operations to compiler.h
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 03/12] arm: vdso: inline assembler operations to compiler.h

(cherry picked from commit https://patchwork.kernel.org/patch/10044507/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Move compiler-specific code to a local compiler.h file:

- CONFIG_AEABI dependency check.
- System call fallback functions standardized into a
  DEFINE_FALLBACK macro.
- Replace arch_counter_get_cntvct() with arch_vdso_read_counter.
- Deal with architecture specific unresolved references emitted
  by GCC.
- Optimize handling of fallback calls in callers.
- For time functions that always return success, do not waste time
  checking return value for switch to fallback.
- Optimize unlikely nullptr checking in __vdso_gettimeofday,
  if tv null no need to proceed to fallback, as vdso is still
  capable of filling in the tv values.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I468e4c32b5136d199982bf25df8967321e384d90

13 months agoFROMLIST: [PATCH v5 02/12] arm: vdso: add include file defining __get_datapage()
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 02/12] arm: vdso: add include file defining __get_datapage()

(cherry picked from url https://patchwork.kernel.org/patch/10044481/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Define the prototype for __get_datapage() in local datapage.h header.
Rename all vdata variable that point to the datapage shortened to vd
to relect a consistent and concise style. Make sure that all
references to the datapage in vdso operations are readonly (const).
Make sure datapage is first parameter to all subroutines to also
be consistent.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I9512b49d36d53ca1b71d3ff82219a7c64e0fc613

13 months agoFROMLIST: [PATCH v5 01/12] arm: vdso: rename vdso_datapage variables
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 01/12] arm: vdso: rename vdso_datapage variables

(cherry picked from url https://patchwork.kernel.org/patch/10044505/)

Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.

Rename seq_count to tb_seq_count. Rename tk_is_cntvct to use_syscall.
Rename cs_mult to cs_mono_mult. All to align with the variables in the
arm64 vdso datapage. Rework vdso_read_begin() and vdso_read_retry()
functions to reflect modern access patterns for tb_seq_count field.

Update copyright message to reflect the start of the contributions in
this series.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug: 63737556
Bug: 20045882
Change-Id: I13f16e71b1ecba3d72b999caafef72e3c7f48dfe

13 months agoFROMLIST: [PATCH v3 3/3] arm64: compat: Add CONFIG_KUSER_HELPERS
Kevin Brodsky [Wed, 23 Nov 2016 15:41:15 +0000 (15:41 +0000)]
FROMLIST: [PATCH v3 3/3] arm64: compat: Add CONFIG_KUSER_HELPERS

(cherry picked from url http://lkml.iu.edu/hypermail/linux/kernel/1709.1/01903.html)

Make it possible to disable the kuser helpers by adding a KUSER_HELPERS
config option (enabled by default). When disabled, all kuser
helpers-related code is removed from the kernel and no mapping is done
at the fixed high address (0xffff0000); any attempt to use a kuser
helper from a 32-bit process will result in a segfault.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug: 9674955
Bug: 63737556
Bug: 20045882
Change-Id: Ie8c543301d39bfe88ef71fb6a669e571914b117b

13 months agoFROMLIST: [PATCH v3 2/3] arm64: compat: Split the sigreturn trampolines and kuser...
Kevin Brodsky [Wed, 23 Nov 2016 15:41:15 +0000 (15:41 +0000)]
FROMLIST: [PATCH v3 2/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (assembler sources)

(cherry picked from url http://lkml.iu.edu/hypermail/linux/kernel/1709.1/01902.html)

AArch32 processes are currently installed a special [vectors] page that
contains the sigreturn trampolines and the kuser helpers, at the fixed
address mandated by the kuser helpers ABI.

Having both functionalities in the same page has become problematic,
because:

* It makes it impossible to disable the kuser helpers (the sigreturn
  trampolines cannot be removed), which is possible on arm.

* A future 32-bit vDSO would provide the sigreturn trampolines itself,
  making those in [vectors] redundant.

This patch addresses the problem by moving the sigreturn trampolines
sources to its own file.  Wrapped the comments to reduce the wrath of
checkpatch.pl.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug: 9674955
Bug: 63737556
Bug: 20045882
Change-Id: I1d7b96e7cfbe979ecf4cb4996befd1f3ae0e64fd

13 months agoFROMLIST: [PATCH v3 1/3] arm64: compat: Split the sigreturn trampolines and kuser...
Kevin Brodsky [Wed, 23 Nov 2016 14:01:10 +0000 (14:01 +0000)]
FROMLIST: [PATCH v3 1/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (C sources)

(cherry picked from url http://lkml.iu.edu/hypermail/linux/kernel/1709.1/01901.html)

AArch32 processes are currently installed a special [vectors] page that
contains the sigreturn trampolines and the kuser helpers, at the fixed
address mandated by the kuser helpers ABI.

Having both functionalities in the same page has become problematic,
because:

* It makes it impossible to disable the kuser helpers (the sigreturn
  trampolines cannot be removed), which is possible on arm.

* A future 32-bit vDSO would provide the sigreturn trampolines itself,
  making those in [vectors] redundant.

This patch addresses the problem by moving the sigreturn trampolines to
a separate [sigpage] page, mirroring [sigpage] on arm.

Even though [vectors] has always been a misnomer on arm64/compat, as
there is no AArch32 vector there (and now only the kuser helpers),
its name has been left unchanged, for compatibility with arm (there
are reports of software relying on [vectors] being there as the last
mapping in /proc/maps).

mm->context.vdso used to point to the [vectors] page, which is
unnecessary (as its address is fixed). It now points to the [sigpage]
page (whose address is randomized like a vDSO).

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug: 9674955
Bug: 63737556
Bug: 20045882
Change-Id: I52a56ea71d7326df8c784f90eb73b5c324fe9d20

13 months agoRevert "arm64: vdso: Fix clock_getres() for CLOCK_REALTIME"
Khusika Dhamar Gusti [Mon, 16 Sep 2019 12:39:56 +0000 (19:39 +0700)]
Revert "arm64: vdso: Fix clock_getres() for CLOCK_REALTIME"

This reverts commit 9f641ee2b749d57b4672e4c28f4dba9523923ac4.

Signed-off-by: Khusika Dhamar Gusti <khusikadhamar@gmail.com>
Change-Id: Ib983c72f8d0868c4c2d50e31d0e5a48fb4f4354e

13 months agoRevert "ARM: vdso: Remove dependency with the arch_timer driver internals"
Khusika Dhamar Gusti [Mon, 16 Sep 2019 07:32:55 +0000 (14:32 +0700)]
Revert "ARM: vdso: Remove dependency with the arch_timer driver internals"

This reverts commit 79940ddbd08866e556e8c8da59e25754e1d89462.

Signed-off-by: Khusika Dhamar Gusti <khusikadhamar@gmail.com>
Change-Id: Ic7d585615698ee688b5a3999da07d3118563bb78

13 months agoARM64: configs: g12a_tab_variant: Enable USB ACM support
Bruno Martins [Mon, 25 Sep 2023 10:52:27 +0000 (11:52 +0100)]
ARM64: configs: g12a_tab_variant: Enable USB ACM support

Pretty usefull, if one wants to connect for example an external GPS.

Change-Id: Ic62b123e54724d5c552246c23ba3109e53b97ea4

13 months agoARM64: configs: Create g12a variant defconfig for non-ATV targets
Bruno Martins [Sun, 9 Jul 2023 11:08:16 +0000 (12:08 +0100)]
ARM64: configs: Create g12a variant defconfig for non-ATV targets

Straight copy from g12a_variant_defconfig, which only enables
touchscreen support on top for now.

Change-Id: Ie89e6d79389d461bfad6088ee15a25c7a7c6d0db

13 months agoARM64: dts: radxa0_4g: Use safe value for usable memory end region
Bruno Martins [Tue, 10 Oct 2023 17:25:19 +0000 (18:25 +0100)]
ARM64: dts: radxa0_4g: Use safe value for usable memory end region

Although the previous value (the maximum within the 32-bit range)
booted fine when dtb.img was normally flashed in bootloader mode,
it proved to cause issues when fully packed image was flashed
via AML flash tool.

This value has been taken from S922X datasheet. Stick to it as
the user facing total memory is 4.0 GB, as desired.

Change-Id: I17d20003cf52aede3720065564666809ba63f711

13 months agoARM64: dts: Include all dtbs
Bruno Martins [Tue, 10 Oct 2023 09:47:48 +0000 (10:47 +0100)]
ARM64: dts: Include all dtbs

Change-Id: Ia2d66f52cf5d83d376af35322abc2f9cd08f8d49

13 months agoARM64: dts: Add dt for radxa0 boards with 4GB of RAM
Bruno Martins [Mon, 9 Oct 2023 15:51:40 +0000 (16:51 +0100)]
ARM64: dts: Add dt for radxa0 boards with 4GB of RAM

Copied from regular g12a_s905y2_radxa0.dts, which has usable-memory
set to 2GB, this changes it to 4GB.

Change-Id: Ibf1a7d36b097560b349342e64ec0427dd413b688

16 months agoRevert "[DNM] [TMP] HACK: Disable log level from being set"
Nolen Johnson [Mon, 10 Jul 2023 00:44:39 +0000 (20:44 -0400)]
Revert "[DNM] [TMP] HACK: Disable log level from being set"

This reverts commit 698e5846f704891f3e704989a268ed3ab3d9f463.

Reason: Pushed with the merge - whoops.
Change-Id: I8b786467483492e7b5a416b44d929ad21b5e1163

16 months agoMerge branch 'deprecated/android-4.9-q' of https://android.googlesource.com/kernel...
Nolen Johnson [Sun, 9 Jul 2023 23:21:36 +0000 (19:21 -0400)]
Merge branch 'deprecated/android-4.9-q' of https://android.googlesource.com/kernel/common into `lineage-20`

Change-Id: Ia96684a6c37a38a6e87d290ebfde978436e58c35

16 months ago[DNM] [TMP] HACK: Disable log level from being set
deadman96385 [Thu, 1 Jul 2021 20:46:58 +0000 (13:46 -0700)]
[DNM] [TMP] HACK: Disable log level from being set

* This allows the kernel log to be piped to uart by default.

Change-Id: I7c19a152daea7b920b247a2cce608abf13183f93

17 months agoarch: arm64: boot: dts: devkits*: Switch to no-AVB DTS
Nolen Johnson [Sun, 11 Jun 2023 21:30:52 +0000 (17:30 -0400)]
arch: arm64: boot: dts: devkits*: Switch to no-AVB DTS

* Not a damn clue why, but completely broken without this.

Change-Id: I04123a7cdec2bd8efe69ee08f66e10533ab0e73d

17 months agoarch: dts: amlogic; Add deadpool noavb dynamic partition
Vitaliy Tomin [Sun, 25 Dec 2022 14:44:13 +0000 (22:44 +0800)]
arch: dts: amlogic; Add deadpool noavb dynamic partition

Change-Id: I17c52df142cde9682fc613a7152042b09442c8e4
(cherry picked from commit db804dde0bf8c2b23313edb33bedb508f12296da)

20 months agoinclude: linux: Allow older GCC versions
Nolen Johnson [Sun, 26 Mar 2023 23:17:31 +0000 (19:17 -0400)]
include: linux: Allow older GCC versions

* Some of our kmods aren't ready for clang.
* We can revert this once they are.
* Stock Deadpool S kernel source does this.

Change-Id: I432cb54efc15ee7e242437077670ba7925fc91ed

21 months agoamlogic: Opt-out of spectre mitigation
Christian Hoffmann [Tue, 7 Feb 2023 21:13:22 +0000 (22:13 +0100)]
amlogic: Opt-out of spectre mitigation

Change-Id: Ia20177ae4807ba935a0da89825e27961eae71004

21 months agoRevert "arm64: entry: Free up another register on kpti's tramp_exit path"
Christian Hoffmann [Tue, 7 Feb 2023 21:12:53 +0000 (22:12 +0100)]
Revert "arm64: entry: Free up another register on kpti's tramp_exit path"

This reverts commit a212d166a9d7c35e56ba11f15d6706eee3dd499b.

Change-Id: If3cc91ff73fce3af22768516835a7050958571ed

21 months agoMerge android.googlesource.com/kernel/common
Christian Hoffmann [Sun, 12 Feb 2023 08:26:28 +0000 (09:26 +0100)]
Merge android.googlesource.com/kernel/common

* Branch: android-4.9-q
* SHA1: b6d8afc10b82f168c3a97896d8ecd623da4a59bc
* Version: 4.9.336

21 months agoarch: arm64: dts: partition_mbox_dynamic_deadpool: Revert userdata -> data rename
Nolen Johnson [Fri, 30 Dec 2022 18:56:17 +0000 (13:56 -0500)]
arch: arm64: dts: partition_mbox_dynamic_deadpool: Revert userdata -> data rename

* Unecessary, and breaks things for no reason.

Change-Id: Ib72c227ea9d9074db0b0149aeb8fb031e8470e7a

21 months agoarm64: dts: g12a_s905y2_radxa0: Apply changes for radxa0
Stricted [Fri, 30 Jul 2021 23:30:47 +0000 (23:30 +0000)]
arm64: dts: g12a_s905y2_radxa0: Apply changes for radxa0

Change-Id: I804f728e360356cc35f31a37b28dc9a07e1f1b46

21 months agoarm64: dts: Rebrand G12A deadpool variant for radxa0
Stricted [Fri, 30 Jul 2021 23:29:56 +0000 (23:29 +0000)]
arm64: dts: Rebrand G12A deadpool variant for radxa0

Change-Id: I48c8aac327bbb10057086a895148cda7866b06ca

21 months agoarm64: dts: Add wifi overlay for m5
Stricted [Sat, 17 Jul 2021 12:00:22 +0000 (12:00 +0000)]
arm64: dts: Add wifi overlay for m5

Change-Id: I338d01d750a701c64f2af488e6f95cf8adf978d1

21 months agoarm64: dts: sm1_s905y3_bananapim5: Apply changes for bananapim5
Stricted [Tue, 6 Jul 2021 17:42:39 +0000 (17:42 +0000)]
arm64: dts: sm1_s905y3_bananapim5: Apply changes for bananapim5

Change-Id: If09571483ae6f68f52c86041669f1054cd216b20

21 months agoarm64: dts: Rebrand odroidc4 for bananapim5
Stricted [Tue, 6 Jul 2021 17:41:17 +0000 (17:41 +0000)]
arm64: dts: Rebrand odroidc4 for bananapim5

Change-Id: I682a92fefeef88d1965fd09e15cc25342f51e331

21 months agoarm64: dts: sm1_s905y3_odroidc4: Apply changes for odroidc4
Stricted [Fri, 2 Jul 2021 04:59:07 +0000 (04:59 +0000)]
arm64: dts: sm1_s905y3_odroidc4: Apply changes for odroidc4

Change-Id: I2ee6b8645002d98631496587055dcaece9d9ca8d

21 months agoarm64: dts: Rebrand SM1 deadpool variant for odroidc4
Stricted [Fri, 2 Jul 2021 04:58:23 +0000 (04:58 +0000)]
arm64: dts: Rebrand SM1 deadpool variant for odroidc4

Change-Id: I1a64dd7831fe776999ac1c21e4c5b8ce57dc0694

21 months agokbuild: use HOSTLDFLAGS for single .c executables
Robin Jarry [Mon, 26 Feb 2018 18:41:47 +0000 (19:41 +0100)]
kbuild: use HOSTLDFLAGS for single .c executables

When compiling executables from a single .c file, the linker is also
invoked. Pass the HOSTLDFLAGS like for other linker commands.

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Change-Id: I8332132775e7cc220eb7d1e20911223bca65e1e2

21 months agoarm64: dts: sabrina: Add reserved ion-fb-mem space to ion_dev
me2151 [Sun, 8 May 2022 04:43:29 +0000 (04:43 +0000)]
arm64: dts: sabrina: Add reserved ion-fb-mem space to ion_dev

* We already reserve the space in dts but its
  not being called upon from dtsi.

* This fixes screen blanking during Toasts and
  other pop up messages.

* [npjohnson]: Pull the original definition from SM1 deadpool
  DTS.

Change-Id: I51f7aa6d0953b42c358a4ab963cc4cd72e1f35c3

21 months agoarm64: dts: partition_mbox_dynamic_sabrina: Inherit the firmware_avb_deadpool
Nolen Johnson [Thu, 4 Aug 2022 22:30:05 +0000 (18:30 -0400)]
arm64: dts: partition_mbox_dynamic_sabrina: Inherit the firmware_avb_deadpool

* firmware_avb_Q.dtsi isn't correct on Android 12 based kernel.

Change-Id: Ia2adfe4eb9b85af9871d1a9d0e50b10f688d508f

21 months agoarm64: configs: g12a: Move CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR
Nolen Johnson [Mon, 20 Dec 2021 23:10:05 +0000 (18:10 -0500)]
arm64: configs: g12a: Move CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR

Change-Id: Iecf9ef8b09a4edef3e7236353e739db3b9353b92

21 months agoarm64: configs: Create sabrina variant defconfig
Stricted [Mon, 26 Jul 2021 16:57:37 +0000 (16:57 +0000)]
arm64: configs: Create sabrina variant defconfig

* Generated by comparing deadpool Android 10 defconfig to
  sabrina Android 10 defconfig (both ran through savedconfig
  first), with extraneous changes dropped.

Change-Id: I26c6ba841e840a7b0500ec3158a82e599c7776c8

21 months agoarm64: dts: Import sabrina
deadman96385 [Sun, 25 Jul 2021 20:18:55 +0000 (15:18 -0500)]
arm64: dts: Import sabrina

* From QTS2.200918.032-sabrina TAR release.

Co-authored-by: Stricted <info@stricted.net>
Change-Id: Ibd5200f2af59cdf70316d4b0dee89983da5dce3e

21 months agoarm64: dts: sti6130d3x0: Add reserved ion-fb-mem space to ion_dev
me2151 [Sun, 8 May 2022 04:43:29 +0000 (04:43 +0000)]
arm64: dts: sti6130d3x0: Add reserved ion-fb-mem space to ion_dev

* We already reserve the space in dts but its
  not being called upon from dtsi.

* This fixes screen blanking during Toasts and
  other pop up messages.

Change-Id: Ib9cf180f93473e0839ddbac806d9c086416d4ffa

21 months agoarm64: dts: sti6140d350: Enable IR
deadman96385 [Thu, 1 Jul 2021 23:34:15 +0000 (16:34 -0700)]
arm64: dts: sti6140d350: Enable IR

* wade has an IR module, and it's stock remote works with it,
  even in recovery, which is awesome.
* `arch/arm64/boot/dts/amlogic/Makefile` apparently had no
  UNIX file-end newline, so now it does.

Change-Id: I19fbd84981f11af75b5e4ae10533d164cbcf18a3

21 months agoarm64: dts: sti6130d3x0: Apply dopinder/wade's stock DTS changes
deadman96385 [Thu, 1 Jul 2021 22:48:53 +0000 (15:48 -0700)]
arm64: dts: sti6130d3x0: Apply dopinder/wade's stock DTS changes

* Dummy-Charger/Battery added to main DTB instead of DTBO.
* IR Remote disabled in main DTS, enabled in Wade DTBO.

Co-authored-by: Stricted <info@stricted.net>
Co-authored-by: Sean McCreary <mccreary@mcwest.org>
Change-Id: I9ae1d2a56596e5f3c3ed4d3d08fda6b8b45efe8b

21 months agoarm64: dts: sti6130d3x0: Rebrand to track device-specific changes
deadman96385 [Thu, 1 Jul 2021 22:47:37 +0000 (15:47 -0700)]
arm64: dts: sti6130d3x0: Rebrand to track device-specific changes

Change-Id: I738ae3065b9a932619c7774d543031e829432892

21 months agoarm64: dts: amlogic: Build all DTBs
Stricted [Sat, 19 Jun 2021 23:28:55 +0000 (23:28 +0000)]
arm64: dts: amlogic: Build all DTBs

Change-Id: I424c2f57b537371d980f4f1ead3d4c4516d67161

21 months agoarm64: configs: g12a_defconfig: Update from TTT1.220909.001.B7-9305992
Nolen Johnson [Mon, 5 Dec 2022 20:07:06 +0000 (15:07 -0500)]
arm64: configs: g12a_defconfig: Update from TTT1.220909.001.B7-9305992

Change-Id: I5aeefbe586dadadd257259db9f314f1babda5d2a

21 months agoarm64: configs: Add g12a defconfig from STT1.211025.001.Z4-7928920
Stricted [Sat, 19 Jun 2021 23:30:26 +0000 (23:30 +0000)]
arm64: configs: Add g12a defconfig from STT1.211025.001.Z4-7928920

* Extracted from stock package: adt3-user-12-STT1.211025.001.Z4-7928920-release-keys.
* Ran through `make savedconfig` to sanitize/minimalize.

Change-Id: I55fc74de8ab3c6eeef072c95dc6b7f589ed8922c

21 months agoAdd toggle for disabling newly added USB devices
Daniel Micay [Tue, 16 May 2017 21:51:48 +0000 (17:51 -0400)]
Add toggle for disabling newly added USB devices

Based on the public grsecurity patches.

Change-Id: I2cbea91b351cda7d098f4e1aa73dff1acbd23cce
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
21 months agoUPSTREAM: seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro
Andy Shevchenko [Mon, 22 Jan 2018 16:05:43 +0000 (18:05 +0200)]
UPSTREAM: seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro

The DEFINE_SHOW_ATTRIBUTE() helper macro would be useful for current
users, which are many of them, and for new comers to decrease code
duplication.

Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Darren Hart (VMware) <dvhart@infradead.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Bug: 136497735
(cherry picked from commit a08f06bb7a0743a7fc8d571899c93d882468096e)
Change-Id: Ib60cf57dc5e979915a83848919644150d82e7058
Signed-off-by: Hridya Valsaraju <hridya@google.com>
21 months agolib/string: add sysfs_match_string helper
Heikki Krogerus [Tue, 21 Mar 2017 11:56:46 +0000 (13:56 +0200)]
lib/string: add sysfs_match_string helper

Make a simple helper for matching strings with sysfs
attribute files. In most parts the same as match_string(),
except sysfs_match_string() uses sysfs_streq() instead of
strcmp() for matching. This is more convenient when used
with sysfs attributes.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Icf173608d9814e1aaf6bc05ed4223f893763960b

21 months agodrivers: base: Unified device connection lookup
Heikki Krogerus [Tue, 20 Mar 2018 12:57:02 +0000 (15:57 +0300)]
drivers: base: Unified device connection lookup

Several frameworks - clk, gpio, phy, pmw, etc. - maintain
lookup tables for describing connections and provide custom
API for handling them. This introduces a single generic
lookup table and API for the connections.

The motivation for this commit is centralizing the
connection lookup, but the goal is to ultimately extract the
connection descriptions also from firmware by using the
fwnode_graph_* functions and other mechanisms that are
available.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I5dd10228fc5a1e2c96a116b0de547dae35a3cddb

21 months agoDon't require a VARIANT_DEFCONFIG
Christopher R. Palmer [Tue, 12 Aug 2014 09:43:23 +0000 (05:43 -0400)]
Don't require a VARIANT_DEFCONFIG

Change-Id: I4a652c22ad4e29cd2a7eb31ae533d1e09a015ced

21 months agoscripts: Add support for variant and selinux defconfig
dhacker29 [Fri, 23 Aug 2013 22:29:35 +0000 (17:29 -0500)]
scripts: Add support for variant and selinux defconfig

Change-Id: I853d82d970d14839906e4242f147cdd122f18c4c

21 months agoAndroid: Add empty Android.mk file
LuK1337 [Tue, 11 Dec 2018 08:50:01 +0000 (09:50 +0100)]
Android: Add empty Android.mk file

* This prevents inclusion of drivers/staging/greybus/toolsAndroid.mk
  which will conflict in case we have more than 1 kernel tree in AOSP
  source dir.

Change-Id: I335bca7b6d6463b1ffc673ab5367603347516e13

21 months agousb: typec: tcpm: Unconditionally return port->current_limit
Nolen Johnson [Tue, 21 Dec 2021 19:47:24 +0000 (14:47 -0500)]
usb: typec: tcpm: Unconditionally return port->current_limit

* For the function `tcpm_psy_get_current_max`, normally we compare max
  of `port->current_limit` and `tcpm_get_max_fixed_current(port)`, but
  `tcpm_get_max_fixed_current` is guarded by a messy DEBUGFS config
  check. So, lets play it safe and assume that the port's limit is the
  limit.

Change-Id: I9df703cd47f3a94b723b861fbfae0aabf13fb92c

21 months agousb: typec: Fix enum conversion warning
Timi Rautamäki [Mon, 6 Dec 2021 18:00:27 +0000 (18:00 +0000)]
usb: typec: Fix enum conversion warning

Change-Id: Id61b8673915551bfa6ce81058bea066312b16345

21 months agoamlogic: media: di_multi: Fix enum conversion warnings
Timi Rautamäki [Mon, 6 Dec 2021 18:00:27 +0000 (18:00 +0000)]
amlogic: media: di_multi: Fix enum conversion warnings

Change-Id: Idc9f800662e543b036fb44c3056980dc9163c18d

21 months agoubifs: Remove unnecessary assignment
Stefan Agner [Sun, 11 Feb 2018 22:17:36 +0000 (23:17 +0100)]
ubifs: Remove unnecessary assignment

Assigning a value of a variable to itself is not useful. This
fixes a warning shown when using clang:
  warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Richard Weinberger <richard@nod.at>
Change-Id: I282cad6e2d0c820e7dbece2f61ce046646aac3c9

21 months agoubifs: Remove unnecessary assignment
Stefan Agner [Mon, 17 Apr 2017 02:22:43 +0000 (19:22 -0700)]
ubifs: Remove unnecessary assignment

Assigning a value of a variable to itself is not useful.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Richard Weinberger <richard@nod.at>
Change-Id: I0ac4db5bb670dde5e86af187a209fbbade6a3ba5

21 months agonet: wireless: ath10k: Fix null check warnings
Stricted [Sat, 19 Jun 2021 23:14:08 +0000 (23:14 +0000)]
net: wireless: ath10k: Fix null check warnings

Change-Id: If6625cd0ddb96f6c056a8068efe033c69dc80bc3

21 months agomedia: dvb-frontends: Remove extra parentheses
Stricted [Wed, 23 Jun 2021 22:14:25 +0000 (22:14 +0000)]
media: dvb-frontends: Remove extra parentheses

Change-Id: I43119a75f3cb9d14e052c26e249d3215e60add99

21 months agomedia: dvb-frontends: Fix self assign warning
Stricted [Sat, 19 Jun 2021 23:13:05 +0000 (23:13 +0000)]
media: dvb-frontends: Fix self assign warning

Change-Id: Ie343bf04cdc1843395663d1ac5a09cd3a49a43ca

21 months agoamlogic: usb: Remove extra parentheses
Stricted [Sat, 19 Jun 2021 23:12:06 +0000 (23:12 +0000)]
amlogic: usb: Remove extra parentheses

Change-Id: Ide547d68899ef8150344b1f9d43e8db843317f63

21 months agoamlogic: mtd: Remove extra parentheses
Stricted [Sat, 19 Jun 2021 23:11:27 +0000 (23:11 +0000)]
amlogic: mtd: Remove extra parentheses

Change-Id: If0265d086d1f0453c0080b372878390f0050856f

21 months agoamlogic: mmc: Fix null check
Stricted [Sat, 19 Jun 2021 23:10:46 +0000 (23:10 +0000)]
amlogic: mmc: Fix null check

Change-Id: I08b33f1971b753cd443ac2006c08642414cee5fb

21 months agoamlogic: memory_ext: Fix sizeof-array-div warning
Stricted [Sat, 19 Jun 2021 23:09:39 +0000 (23:09 +0000)]
amlogic: memory_ext: Fix sizeof-array-div warning

Change-Id: Ief3bec13d2096c4d94bbbcb0e2654feec2c5dce9

21 months agoamlogic: tvout: Remove extra parentheses
Stricted [Sat, 19 Jun 2021 23:07:43 +0000 (23:07 +0000)]
amlogic: tvout: Remove extra parentheses

Change-Id: I4ec4b04576d043c5898263905a5db3ffa81a6c11

21 months agoamlogic: tvin: Fix enum conversion warnings
Stricted [Sat, 19 Jun 2021 23:06:58 +0000 (23:06 +0000)]
amlogic: tvin: Fix enum conversion warnings

Change-Id: Ib93abbeb272370b9e520a6eabdae8d9f1ca061cc

21 months agoamlogic: osd: Fix self assign warnings
Stricted [Sat, 19 Jun 2021 23:05:13 +0000 (23:05 +0000)]
amlogic: osd: Fix self assign warnings

Change-Id: Ib7cbf268dcaf9115c423f5fea3eb88c5819aea24

21 months agoamlogic: osd: Fix comparsion checks
Stricted [Sat, 19 Jun 2021 23:04:31 +0000 (23:04 +0000)]
amlogic: osd: Fix comparsion checks

Change-Id: Ide1f24ad8b6e6348df9ea5b1902116a2dc6ecae3

21 months agoamlogic: amvecm: Fix if check warnings
Stricted [Sat, 19 Jun 2021 23:03:23 +0000 (23:03 +0000)]
amlogic: amvecm: Fix if check warnings

Change-Id: If3696b4a33677f1a3d4db2fade1524a363d90fc7

21 months agoamlogic: di_multi: Fix enum conversion warnings
Stricted [Sat, 19 Jun 2021 22:56:03 +0000 (22:56 +0000)]
amlogic: di_multi: Fix enum conversion warnings

Change-Id: Ie4c96994a79d1e824ef375d2bb4868da1d41750a

21 months agoamlogic: deinterlace: Fix indentation
Stricted [Sat, 19 Jun 2021 22:53:25 +0000 (22:53 +0000)]
amlogic: deinterlace: Fix indentation

Change-Id: Ia49e62bcab7d4a0d49088e77b15234e8e783b096

21 months agoamlogic: hifi4dsp: Fix null check
Stricted [Sat, 19 Jun 2021 22:52:22 +0000 (22:52 +0000)]
amlogic: hifi4dsp: Fix null check

Change-Id: I3b8bc51863bb69662193d8e5e3f99f4319b81e65

21 months agoamlogic: esm: Fix indentation
Stricted [Sat, 19 Jun 2021 22:51:24 +0000 (22:51 +0000)]
amlogic: esm: Fix indentation

Change-Id: I48cb46f9b6bc1222a5a83273ed6e7f8329a5f2b9

21 months agoamlogic: clk: Remove unused variables
Stricted [Sat, 19 Jun 2021 22:50:37 +0000 (22:50 +0000)]
amlogic: clk: Remove unused variables

Change-Id: I252bdd6b66bc87db7a4242ef5ffdf880bc931a3a

21 months agovmscan: Fix enum conversion warning
Stricted [Sat, 19 Jun 2021 22:48:54 +0000 (22:48 +0000)]
vmscan: Fix enum conversion warning

Change-Id: Ib06e0e5ec2660eb63c14c5e4ad2b5d8bb2261467

21 months agotreewide: Remove unknown warning build flags
Stricted [Sat, 19 Jun 2021 22:46:42 +0000 (22:46 +0000)]
treewide: Remove unknown warning build flags

Change-Id: Ia6ebfc9a9438a0aff23a58fbb660b4e10f144db4

21 months agodrivers: net: usb: Import Google's Realtek RTL8152/RTL8153 changes
deadman96385 [Thu, 22 Jul 2021 00:31:04 +0000 (19:31 -0500)]
drivers: net: usb: Import Google's Realtek RTL8152/RTL8153 changes

Change-Id: I310354ab560e53b1d93bb9414423f51eabfb6b52

21 months agodrivers: amlogic: Import Google's OTG changes
deadman96385 [Thu, 22 Jul 2021 00:22:32 +0000 (19:22 -0500)]
drivers: amlogic: Import Google's OTG changes

Change-Id: I79dfd43e7fae1f79cac2e45e5bf081b2d16240db

21 months agodrivers: usb: Import Google's Type-C driver
deadman96385 [Thu, 22 Jul 2021 00:19:50 +0000 (19:19 -0500)]
drivers: usb: Import Google's Type-C driver

Change-Id: Ib224baf7f88334a07f1f1d106f4d0af36b59c72d

21 months agodrivers: usb: Import Google's role switch driver
deadman96385 [Thu, 22 Jul 2021 00:21:31 +0000 (19:21 -0500)]
drivers: usb: Import Google's role switch driver

Change-Id: Ie8e5b6759feea920d6fe903be43e94a8762842c1

21 months agodrivers: google: Import USB power monitor driver
deadman96385 [Wed, 21 Jul 2021 23:54:28 +0000 (18:54 -0500)]
drivers: google: Import USB power monitor driver

Change-Id: I5f56663798cbd790f4ec9f164e83d07404c157a3

21 months agohdmitx: adjust edid parsing [1/2]
xiang.wu1 [Tue, 25 Oct 2022 14:21:52 +0000 (22:21 +0800)]
hdmitx: adjust edid parsing [1/2]

PD#SWPL-97387
BUG=244782420

Problem:
TVTS/2.4_R2 failed

Solution:
remove useless parsing code, and adjust
edid parsing and fallback policy
1.if edid checksum invalid in any block,
or header of cta extension block is 0,
then use fallback mode list
2.if base block header invalid, or
checksum invalid, then don't parse
base block except dtd / standard timing
3.for cta extension block, if block
byte0 != 0x2, it means not valid
extension block, skip parsing whole
block. if block byte1 <= 2, it means
that it's DVI block, skip parsing data
block, just parse DTD.
4.fallback mode list:
480p/720p/1080p60hz, RGB,8bit, and uplayer
should use 720p60hz RGB,8bit by default

Verify:
ah212

Signed-off-by: xiang.wu1 <xiang.wu1@amlogic.com>
Change-Id: I6e4b04888ce097846d18acaf3ba0df3e92313440

21 months agoamvecm: merge stb eye protect for 4.9 [1/3]
MingLiang Dong [Tue, 28 Jun 2022 11:57:04 +0000 (19:57 +0800)]
amvecm: merge stb eye protect for 4.9 [1/3]

PD#SWPL-61674
PD#SWPL-88705
BUG=239526007
BUG=235156795

Problem:
merge stb eye protect for 4.9

Solution:
merge stb eye protect for 4.9

Verify:
verify on adt3

Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
Change-Id: I0f7979a588a98ffee5a4c20ef96a9dd941eae8ed

21 months agodts: add sg12a_s905y2_deadpool_1g.dts for 1G RAM [1/1]
yidong zhang [Mon, 27 Jun 2022 05:41:25 +0000 (13:41 +0800)]
dts: add sg12a_s905y2_deadpool_1g.dts for 1G RAM [1/1]

PD#SWPL-86236
BUG=236953393

Problem:
add sg12a_s905y2_deadpool_1g.dts for 1G RAM.

Solution:
add sg12a_s905y2_deadpool_1g.dts for 1G RAM.
increase codec_mm

Verify:
adt3

Change-Id: I7fafff5ba3f535e6d95e585b85e365e06cd1428e
Signed-off-by: yidong zhang <yidong.zhang@amlogic.com>
21 months agonet: fix nla_strcmp to handle more then one trailing null character
Maciej Żenczykowski [Wed, 5 May 2021 16:58:31 +0000 (09:58 -0700)]
net: fix nla_strcmp to handle more then one trailing null character

Android userspace has been using TCA_KIND with a char[IFNAMESIZ]
many-null-terminated buffer containing the string 'bpf'.

This works on 4.19 and ceases to work on 5.10.

I'm not entirely sure what fixes tag to use, but I think the issue
was likely introduced in the below mentioned 5.4 commit.

Reported-by: Nucca Chen <nuccachen@google.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Fixes: 62794fc4fbf5 ("net_sched: add max len check for TCA_KIND")
Change-Id: I66dc281f165a2858fc29a44869a270a2d698a82b
Signed-off-by: David S. Miller <davem@davemloft.net>
21 months agoAndroid T: green screen issue [1/1]
lele.liu [Thu, 9 Jun 2022 07:30:44 +0000 (15:30 +0800)]
Android T: green screen issue [1/1]

PD#SWPL-84229
BUG=234891437
BUG=235170159

Problem:
Connecting HDMI after 15+ seconds of device boot gives only green screen

Solution:
create new branch

Verify:
local

Signed-off-by: lele.liu <lele.liu@amlogic.com>
Change-Id: I3addbf52a0ffe2f4b101bc06a71e9c2ee9afcc9c