OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
4 years agocamera_v2: import xiaomi changes
Demon Singur [Wed, 28 Feb 2018 19:40:09 +0000 (19:40 +0000)]
camera_v2: import xiaomi changes

Change-Id: I1c63e5f13cfea310256e173c1164cc68198304d6

4 years agoASoC: msm8998: kill logspam if max wsa devices property is set to 0
Volodymyr Zhdanov [Sun, 17 Mar 2019 21:31:18 +0000 (21:31 +0000)]
ASoC: msm8998: kill logspam if max wsa devices property is set to 0

* I'm not sure it's a good idea to print this messages dozens of times
* Also remove useless xiaomi's hack (it acts the same as property anyway)

Change-Id: Ib12e7c793aa53e757356edefec950906641d8f1a

4 years agotfa98xx: fix self assigment errors
Demon Singur [Sat, 10 Mar 2018 20:47:56 +0000 (20:47 +0000)]
tfa98xx: fix self assigment errors

Change-Id: Ie87226c26ea07a5284fdb61fee6802817c00006b

4 years agosound: Import polaris changes for USB audio
Bruno Martins [Mon, 18 Jun 2018 20:05:03 +0000 (21:05 +0100)]
sound: Import polaris changes for USB audio

Change-Id: I4dbf44995e2bc05dd632fc33f543f56415f9b33f
Signed-off-by: Volodymyr Zhdanov <wight554@gmail.com>
4 years agosound: elliptic: update from sagit-p-oss
Volodymyr Zhdanov [Fri, 12 Jul 2019 12:24:04 +0000 (15:24 +0300)]
sound: elliptic: update from sagit-p-oss

Change-Id: I77d8c6756d8c4e853b23593c5aabfccd9a34c36d

4 years agosound: properly include elliptic drivers headers
Demon Singur [Mon, 12 Mar 2018 08:32:46 +0000 (08:32 +0000)]
sound: properly include elliptic drivers headers

Change-Id: I6d6b14e9bf1fc50ff74ca167ff36b42f4e5a253b

4 years agosound: import xiaomi changes
Demon000 [Fri, 10 Nov 2017 20:18:06 +0000 (22:18 +0200)]
sound: import xiaomi changes

Change-Id: I1305495c4d591d27d380ba61a553bb924d2ce6a8

4 years agopower: smb2: remove xiaomi's typeC try.snk implementation
dianlujitao [Fri, 19 Oct 2018 08:57:41 +0000 (16:57 +0800)]
power: smb2: remove xiaomi's typeC try.snk implementation

 * Qualcomm introduced a SW implementation of try.SNK and enabled by default.

Change-Id: Ib3faf2f283e90974399b2d26302f5eac3a37509c

4 years agopower: ignore IRQs while system is suspended
Demon Singur [Wed, 16 May 2018 15:49:37 +0000 (15:49 +0000)]
power: ignore IRQs while system is suspended

There's no reason to handle IRQs for SoC changes while system is
suspended.

Change-Id: I0dee8baa49addb808b3d6d5a2d467b48a405df9e

4 years agopower: add charging current limitting
Demon Singur [Sat, 24 Mar 2018 17:27:51 +0000 (17:27 +0000)]
power: add charging current limitting

Charging at 3200mA while using the phone makes it quite hot.
Decrease the charging current to ~1600mA to prevent bad user
experience and complaints.

After 90 seconds with screen on, vote USB ICL to lower current
to 1600mA.
After 5 seconds with screen off, unvote USB ICL so the current
goes back to 3200mA.

Also, add compatibility with stock hvdcp service that writes to
the system_temp_level property to trigger thermal throttling.

Values taken from MIUI kernel, rewritten to look better and avoid
locking in framebuffer notifiers.

Change-Id: Iedf2789304356221283472ba242211d3ea6256d8

4 years agopower: import xiaomi changes
Demon Singur [Wed, 7 Feb 2018 15:34:41 +0000 (15:34 +0000)]
power: import xiaomi changes

* import voltage limits
* enable try sink mode
* wait more for typec detection
* do device wakeup before smb probe logic

Change-Id: I3dfd28cd005c03e7001fa51fe1df332e4d330236

4 years agoof_batterydata: add fallback to generic node
dianlujitao [Sat, 22 Sep 2018 12:02:56 +0000 (20:02 +0800)]
of_batterydata: add fallback to generic node

Change-Id: Ic8b1c163a20a787e3d485a8ec27eebb6b0c25d32

4 years agonfc: import xiaomi sagit-p-oss changes
wloot [Fri, 12 Jul 2019 17:08:43 +0000 (01:08 +0800)]
nfc: import xiaomi sagit-p-oss changes

Change-Id: Ib320f9d088e7be28ef0986d88071256dd80fd2e4

4 years agogoodix_ta: respect capacitive keys state
dianlujitao [Fri, 2 Feb 2018 09:31:04 +0000 (17:31 +0800)]
goodix_ta: respect capacitive keys state

 * Only report key event when capacitive keys enabled

Change-Id: Id30ba1fd7a589b2fce7bd3d2f433a6b1d756b37d

4 years agogoodix_ta: boost fingerprint hal priority when screen is off
Demon Singur [Fri, 4 May 2018 15:29:57 +0000 (15:29 +0000)]
goodix_ta: boost fingerprint hal priority when screen is off

Give fingerprint hal the priority -1 when the screen is off to
speed up fingerprint processing, and then reset its priority back to
normal when the screen is on.

Change-Id: I0e144fdfcef8c96478593a4396a51a431af83989

4 years agogoodix_ta: clean up everything
Demon Singur [Thu, 22 Mar 2018 20:22:47 +0000 (20:22 +0000)]
goodix_ta: clean up everything

 * get rid of spi bus support, we only need platform bus
 * move fingerprint detection wakelock time to a define
 * do not dynamically allocate minors, there's only one
   minor needed, 0
 * move wakelock declaration to gf_dev
 * merge enable/disable irq methods
 * remove spi clk control
 * remove nav event support
 * remove unused input events
 * remove unused ioctls
 * remove ioctl type checking, copy_from/to_user already
   handles this
 * remove fasync support
 * move netlink message sending out of notifier, inside
   dedicated worker
 * register platform_driver directly
 * move event handling to a high priority worker
 * do not use conflicting names for struct and instance of it

Change-Id: Iac4951f65d533befe1362a718ce4ce8773d7973c

4 years agofpc1268: respect capacitive keys state
dianlujitao [Fri, 2 Feb 2018 10:59:59 +0000 (18:59 +0800)]
fpc1268: respect capacitive keys state

 * Implement a key handler with the simple purpose of filtering
   the key events sent by the fingerprint HAL.
 * Only report key event when capacitive keys enabled.
 * Input handler taken from bgcngm's implementation for Xiaomi msm8996.

Change-Id: I091eb514fee291b7625193496c217c0b966fa518

4 years agofingerprint: add fpc1020_tee and goodix_ta drivers
Demon000 [Fri, 10 Nov 2017 17:19:29 +0000 (19:19 +0200)]
fingerprint: add fpc1020_tee and goodix_ta drivers

Change-Id: Iebb57cea163fdd93824d884bfe8e5f95894fcc18
Signed-off-by: Volodymyr Zhdanov <wight554@gmail.com>
4 years agosynaptics_dsx_force: export capacitive keys state
dianlujitao [Fri, 2 Feb 2018 09:21:25 +0000 (17:21 +0800)]
synaptics_dsx_force: export capacitive keys state

Change-Id: I9d92311d52dc170dd5b2a9770072a57eff038f2c

4 years agosynaptics_dsx_force: do not reinit the device upon suspend/resume
Xiaonian Wang [Fri, 15 Apr 2016 11:34:12 +0000 (19:34 +0800)]
synaptics_dsx_force: do not reinit the device upon suspend/resume

There is no need to reinit the device when suspend, resume or even an
spontaneous reset is detected, touch will recover by itself.

CRs-Fixed: 1003951
Change-Id: Ifb5b134d0fbeb2f55f16af8806abb9c8e51c35e0

4 years agosynaptics_dsx_force: do not spam dmesg for button presses
Demon Singur [Mon, 9 Apr 2018 04:26:02 +0000 (04:26 +0000)]
synaptics_dsx_force: do not spam dmesg for button presses

Change-Id: Ia10ab0db050cf1d1fd4fc73e99a1c46b923281fa

4 years agosynaptics_dsx_force: guard test reporting
Demon Singur [Sat, 31 Mar 2018 10:56:42 +0000 (10:56 +0000)]
synaptics_dsx_force: guard test reporting

Change-Id: I4cae16efcae5d1fa7aa1b1a6f7851e4fe9200edd

4 years agosynaptics_dsx_force: symlink input device to /proc/touchpanel
Demon000 [Sun, 12 Feb 2017 21:23:11 +0000 (23:23 +0200)]
synaptics_dsx_force: symlink input device to /proc/touchpanel

Change-Id: I5bf1291aa22b889522585a3faeab5f96ff6612e2

4 years agosynaptics_dsx_force: allow reversing back and menu keys
Louis Popi [Wed, 29 Nov 2017 21:16:12 +0000 (23:16 +0200)]
synaptics_dsx_force: allow reversing back and menu keys

Change-Id: I8b6c6afd85e82dd1e05d95702e7071d3eedbbb9a

4 years agosynaptics_dsx_force: check if buttons are enabled before reporting touch event
Demon000 [Sun, 9 Apr 2017 15:14:25 +0000 (18:14 +0300)]
synaptics_dsx_force: check if buttons are enabled before reporting touch event

Change-Id: I5483fc47dc76bb8f00b921261fcc48fa923e860d

4 years agosynpatics_dsx_force: alias sysfs nodes
Demon000 [Thu, 16 Nov 2017 19:37:33 +0000 (21:37 +0200)]
synpatics_dsx_force: alias sysfs nodes

Change-Id: I79cd5267da895e2f8535e73fd13bf7691897eb74

4 years agotouchscreen: import synaptics_dsx_force driver
Demon000 [Fri, 10 Nov 2017 17:26:10 +0000 (19:26 +0200)]
touchscreen: import synaptics_dsx_force driver

Change-Id: Ib7bc0dd2cda6e68ce6739153406afe6081ca0476

4 years agoclk: mdss: silence slave PLL unavailable message
Demon000 [Sun, 12 Nov 2017 17:02:23 +0000 (19:02 +0200)]
clk: mdss: silence slave PLL unavailable message

Change-Id: Ife6dc30ef6e498915af38661c4c8450363cf7a04

4 years agomdss: add hooks for touchscreen
Demon000 [Sun, 12 Nov 2017 09:22:07 +0000 (11:22 +0200)]
mdss: add hooks for touchscreen

Change-Id: I9b840a18e2443975bf90c0332cfc2fec5e022fbc

4 years agoqpnp-wled: disable ovp irq after handling
Demon Singur [Sat, 28 Apr 2018 07:15:53 +0000 (07:15 +0000)]
qpnp-wled: disable ovp irq after handling

From Xiaomi kernel.

Change-Id: I82a972b39e13a10f32159f592ce7e9872da6c269

4 years agoqpnp-wled: add 600kHz freq
Demon000 [Fri, 10 Nov 2017 18:18:07 +0000 (20:18 +0200)]
qpnp-wled: add 600kHz freq

Change-Id: I35be564e7e2b84dd01bafe74355672ebb47024a6

4 years agorc: import peelir driver
Demon000 [Sat, 11 Nov 2017 20:26:46 +0000 (22:26 +0200)]
rc: import peelir driver

Change-Id: I658e2787245d8588502a4464b6cb2ee44170c83e

4 years agoarm64: add functions to get the hw version
Demon000 [Sun, 12 Nov 2017 09:54:42 +0000 (11:54 +0200)]
arm64: add functions to get the hw version

Change-Id: I71142017007b10c3e0c67832a4d4736f4caf3b2f

4 years agodts: xiaomi: msm8998: mount cust partition as /vendor
Demon Singur [Fri, 22 Jun 2018 16:52:49 +0000 (16:52 +0000)]
dts: xiaomi: msm8998: mount cust partition as /vendor

Change-Id: Ib18364354e7d6ac58c4d89e81cdf6859a31e68b5

4 years agodts: xiaomi: msm8998: enable soc linearization
Demon Singur [Fri, 1 Jun 2018 07:41:29 +0000 (07:41 +0000)]
dts: xiaomi: msm8998: enable soc linearization

Change-Id: I11e338d903af802e7dc14979d24c896a9afd90a5

4 years agodts: xiaomi: msm8998: disable wled auto calibration
Demon Singur [Sat, 28 Apr 2018 07:04:57 +0000 (07:04 +0000)]
dts: xiaomi: msm8998: disable wled auto calibration

Xiaomi reverted the auto calibration support in their kernel, but we can
disable it in a more elegant way.

Change-Id: I6addcb637ff44e4841dffa1520d0a7202ddd3b14

4 years agodts: xiaomi: msm8998: limit led current
Demon Singur [Mon, 18 Jun 2018 18:06:40 +0000 (18:06 +0000)]
dts: xiaomi: msm8998: limit led current

Xiaomi limits this current in userspace by setting the max_brightness
to 64 out of 256. This means that the default current is reduced 4
times.
Do this kernel-side because we're smarter.

Change-Id: I2facc5da9e2e6aad4c00e8732ce07e1fc550ed88

4 years agodts: xiaomi: msm8998: rewrite notification led configuration
Demon000 [Thu, 16 Nov 2017 19:21:20 +0000 (21:21 +0200)]
dts: xiaomi: msm8998: rewrite notification led configuration

Taken from sambar.

* smooth out duty percents
* increase low and high duration
* lower ramp step duration
* allow reverse, high, and low configuration

Change-Id: I9727a923351a3e3403ecfbafb993121bb74112ad

4 years agodts: xiaomi: msm8998: add ramoops memory regions
Demon000 [Sun, 19 Nov 2017 20:43:36 +0000 (22:43 +0200)]
dts: xiaomi: msm8998: add ramoops memory regions

Change-Id: I6c7f2e1545251857d83ccd7783f647dee2412c97

4 years agodts: xiaomi: msm8998: cleanup panel properties
Demon [Tue, 28 Nov 2017 06:46:47 +0000 (06:46 +0000)]
dts: xiaomi: msm8998: cleanup panel properties

Change-Id: I3b11f67e7ff195a70984ffb160b9b3305f36ef72

4 years agodts: xiaomi: msm8998: update chiron batterydata
Vol Zhdanov [Wed, 26 Sep 2018 16:48:46 +0000 (16:48 +0000)]
dts: xiaomi: msm8998: update chiron batterydata

* extracted from MIMIX2Global_V10.0.2.0 DTS
* fixes bug with battery drops on firmware > 8.4.19

Change-Id: If2526d8a43dd19a90efe88bf94f4e0c70b40de6b

4 years agodts: qcom: add xiaomi msm8998 support
Demon000 [Sat, 11 Nov 2017 19:52:30 +0000 (21:52 +0200)]
dts: qcom: add xiaomi msm8998 support

Change-Id: I6466699830f0ff060c65ad4c9fa7683bcaa20cae

4 years agoplatform: add xiaomi board selection
Demon000 [Sat, 11 Nov 2017 16:43:15 +0000 (18:43 +0200)]
platform: add xiaomi board selection

Change-Id: Ied4baa79fe62cb1ee5c671de8ca69402050e884c

4 years agoRevert "Android.bp: Initial header export bp for Android (qseecom only)"
Ethan Chen [Thu, 29 Nov 2018 07:04:39 +0000 (23:04 -0800)]
Revert "Android.bp: Initial header export bp for Android (qseecom only)"

This reverts commit 1a0aae2861c1836573eeb937a6450d0a8e065058.

Change-Id: I7788582bdc3576d25c64e5c9ab3d7a51340a1eba

4 years agomsm: ipa3: Return if RT table size is 0
Mohammed Javid [Fri, 7 Sep 2018 11:56:21 +0000 (17:26 +0530)]
msm: ipa3: Return if RT table size is 0

If RT table size is zero, retrun to prevent
further process.

Change-Id: Ic671b1760969e6a5f5e896f5334289061b02d256
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
4 years 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>
4 years agosched: hmp: Reduce number of load reports in a window
Vikram Mulukutla [Fri, 31 Mar 2017 23:29:59 +0000 (16:29 -0700)]
sched: hmp: Reduce number of load reports in a window

There's no use reporting load more than once in a window
via the cpufreq_update_util path (unless there's a migration).
Set the load_reported_window flag in sched_get_cpus_busy
to remove these redundant updates.

Change-Id: If43dd5abc7e0e52a8e0f0df3a20ca99ed92f5361
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
4 years agosched: cpufreq: HMP load reporting changes
Vikram Mulukutla [Mon, 20 Mar 2017 20:41:37 +0000 (13:41 -0700)]
sched: cpufreq: HMP load reporting changes

Since HMP uses WALT, ensure that load is reported just once per window,
with the exception of intercluster migrations. Further, try to report load
whenever WALT stats are updated.

Change-Id: I6539f8c916f6f271cf26f03249de7f953d5b12c2
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
4 years agocore_ctl: Consider high irq loaded CPU as busy
Pavankumar Kondeti [Mon, 16 Oct 2017 08:39:29 +0000 (14:09 +0530)]
core_ctl: Consider high irq loaded CPU as busy

Currently a CPU is considered as busy if it's utilization in
the last window exceeds busy threshold. A CPU loaded with
hardirqs/softirqs does not necessarily have high utilization.
Isolating such CPUs may hurt performance as it involves waking
up the CPU frequently from deep c-state. Prevent isolating
high irq loaded CPUs by considering them as busy.

Change-Id: I169b69f6003eb59a126c8a16b67b65be2aa7af40
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
4 years agoFROMLIST: arm64: Build vDSO with -ffixed-x18
Peter Collingbourne [Wed, 7 Nov 2018 00:39:13 +0000 (16:39 -0800)]
FROMLIST: arm64: Build vDSO with -ffixed-x18

The vDSO needs to be build with x18 reserved in order to accommodate
userspace platform ABIs built on top of Linux that use the register
to carry inter-procedural state, as provided for by the AAPCS.
An example of such a platform ABI is the one that will be used by an
upcoming version of Android.

Although this change is currently a no-op due to the fact that the vDSO
is currently implemented in pure assembly on arm64, it is necessary
in order to prepare for another change [1] that will add C code to
the vDSO.

[1] https://patchwork.kernel.org/patch/10044501/

Change-Id: Icaac4b1c9127d81d754d3b8688274e9afc781760
Signed-off-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Mark Salyzyn <salyzyn@google.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
4 years agoANDROID: clock_gettime(CLOCK_BOOTTIME,) slows down >20x
Mark Salyzyn [Wed, 24 Jan 2018 22:00:19 +0000 (14:00 -0800)]
ANDROID: clock_gettime(CLOCK_BOOTTIME,) slows down >20x

clock_gettime(CLOCK_BOOTTIME,) slows down after significant
accumulation of suspend time creating a large offset between it and
CLOCK_MONOTONIC time.  The __iter_div_u64_rem() is only for the usage
of adding a few second+nanosecond times and saving cycles on more
expensive remainder and division operations, but iterates one second
at a time which quickly goes out of scale in CLOCK_BOOTTIME's case
since it was specified as nanoseconds only.

The fix is to split off seconds from the boot time and cap the
nanoseconds so that __iter_div_u64_rem does not iterate.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 72406285
Change-Id: Ia647ef1e76b7ba3b0c003028d4b3b955635adabb

4 years agoFROMLIST: arm64: vdso32: Use full path to Clang instead of relying on PATH
Nathan Chancellor [Tue, 22 May 2018 21:59:35 +0000 (14:59 -0700)]
FROMLIST: arm64: vdso32: Use full path to Clang instead of relying on PATH

Currently, in order to build the compat VDSO with Clang, this format
has to be used:

  PATH=${BIN_FOLDER}:${PATH} make CC=clang

Prior to the addition of this file, this format would also be
acceptable:

  make CC=${BIN_FOLDER}/clang

This is because the vdso32 Makefile uses cc-name instead of CC. After
this path, CC will still evaluate to clang for the first case as
expected but now the second case will use the specified Clang, rather
than the host's copy, which may not be compatible as shown below.

/usr/bin/as: unrecognized option '-mfloat-abi=soft'
clang-6.0: error: assembler command failed with exit code 1

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
(cherry picked from https://patchwork.kernel.org/patch/10419665)
Bug: 80184372
Change-Id: If90a5a4edbc2b5883b4c78161081ebeafbebdcde

4 years agoANDROID: arm64: vdso32: fix CC=clang build
Mark Salyzyn [Wed, 10 Jan 2018 00:55:17 +0000 (16:55 -0800)]
ANDROID: arm64: vdso32: fix CC=clang build

clang build had wrong --gcc-toolchain for cross compiler.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 63737556
Change-Id: Ib0c3bbb250943a0309da021ba5335a8320b584f4

4 years agoANDROID: CROSS_COMPILE_ARM32 must work if CONFIG_COMPAT_VDSO
Mark Salyzyn [Tue, 28 Mar 2017 21:11:02 +0000 (14:11 -0700)]
ANDROID: CROSS_COMPILE_ARM32 must work if CONFIG_COMPAT_VDSO

Prevent surprise loss of vdso32 support.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 63737556
Bug: 20045882
Bug: 19198045
Change-Id: I8b381f7649b95b298ea9e1a99aa3794c7bc08d09

4 years agoFROMLIST: BACKPORT: [PATCH 6/6] arm64: Wire up and expose the new compat vDSO
Kevin Brodsky [Fri, 13 May 2016 08:59:28 +0000 (09:59 +0100)]
FROMLIST: BACKPORT: [PATCH 6/6] arm64: Wire up and expose the new compat vDSO

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

Expose the new compat vDSO via the COMPAT_VDSO config option.

The option is not enabled in defconfig because we really need a 32-bit
compiler this time, and we rely on the user to provide it themselves
by setting CROSS_COMPILE_ARM32. Therefore enabling the option by
default would make little sense, since the user must explicitly set a
non-standard environment variable anyway.

CONFIG_COMPAT_VDSO is not directly used in the code, because we want
to ignore it (build as if it were not set) if the user didn't set
CROSS_COMPILE_ARM32. If the variable has been set to a valid prefix,
CONFIG_VDSO32 will be set; this is the option that the code and
Makefiles test.

For more flexibility, like CROSS_COMPILE, CROSS_COMPILE_ARM32 can also
be set via CONFIG_CROSS_COMPILE_ARM32 (the environment variable
overrides the config option, as expected).

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Also needs to set CONFIG_ARM_ARCH_TIMER_VCT_ACCESS when CONFIG_VDSO32
is selected.

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: Ie8a7d6c2b5ba3edca591a9a953ce99ec792da882

4 years agoFROMLIST: BACKPORT: [PATCH 5/6] arm64: compat: 32-bit vDSO setup
Kevin Brodsky [Thu, 8 Sep 2016 13:25:04 +0000 (14:25 +0100)]
FROMLIST: BACKPORT: [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

4 years 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

4 years agoFROMLIST: [PATCH 3/6] arm64: Refactor vDSO init/setup
Kevin Brodsky [Tue, 10 May 2016 12:51:54 +0000 (13:51 +0100)]
FROMLIST: [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

4 years 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

4 years 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>
Bug: 63737556
Bug: 20045882
Change-Id: Ic0933741e321e1bf66409b7e190a776f12948024

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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: 20057882
Change-Id: Iadf94bed6166d2ee43bb46bdf54636618e4b8854

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years agoFROMLIST: [PATCH v2 3/3] arm64: compat: Add CONFIG_KUSER_HELPERS
Kevin Brodsky [Wed, 23 Nov 2016 15:41:15 +0000 (15:41 +0000)]
FROMLIST: [PATCH v2 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

4 years agoFROMLIST: [PATCH v2 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 v2 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

4 years agoFROMLIST: [PATCH v2 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 v2 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

4 years agoposix_cpu_timer: check return on cpu_timer_sample_group
Chris Fries [Tue, 7 Mar 2017 21:37:47 +0000 (15:37 -0600)]
posix_cpu_timer: check return on cpu_timer_sample_group

If error, don't trust "now" time that it should be setting

kernel/time/posix-cpu-timers.c:1269:13: warning: 'now' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: I679d99c335494bae50fd926663fad37aedb1487a
Signed-off-by: Chris Fries <cfries@google.com>
4 years agopower: reset: Move in_panic handling out of dload mode
Michael Bestas [Sun, 22 Jul 2018 19:05:13 +0000 (22:05 +0300)]
power: reset: Move in_panic handling out of dload mode

* Some devices might want to use that logic
  without enabling download mode

Change-Id: Idd4a2cc8a47041740f8d4e9f43bffd84fae5830d

4 years agomsm_thermal: initialize later than arch drivers
Park Ju Hyung [Sun, 23 Dec 2018 21:55:20 +0000 (06:55 +0900)]
msm_thermal: initialize later than arch drivers

If OSM driver is initialized later than msm_thermal, it will fail:

[    0.226183] cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
[    0.227931] msm_thermal:get_cpu_freq_plan_len Error reading CPU0 freq table len. error:-19
[    0.227955] cpu cpu4: dev_pm_opp_get_opp_count: OPP table not found (-19)
[    0.229631] msm_thermal:get_cpu_freq_plan_len Error reading CPU4 freq table len. error:-19
[    0.229652] cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
[    0.231380] msm_thermal:get_cpu_freq_plan_len Error reading CPU0 freq table len. error:-19
[    0.231404] cpu cpu4: dev_pm_opp_get_opp_count: OPP table not found (-19)
[    0.233095] msm_thermal:get_cpu_freq_plan_len Error reading CPU4 freq table len. error:-19

Change-Id: I98be9d37701f1f9366cef1427cfdd9082b8fb24c
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
4 years agodts: msm8998: disable hotplug in BCL mitigation
Wei Wang [Mon, 2 Apr 2018 02:18:25 +0000 (02:18 +0000)]
dts: msm8998: disable hotplug in BCL mitigation

Bug: 63165849
Test: boot
Change-Id: Icc1131578be0a02542376d34e4f5cc7c53156bd9
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: joshuous <joshuous@gmail.com>
4 years agosoc: qcom: haptic: Correct return value of show() methods
Zhao Wei Liew [Thu, 1 Nov 2018 10:05:30 +0000 (10:05 +0000)]
soc: qcom: haptic: Correct return value of show() methods

By convention, these methods should return the number of bytes
actually written into the buffer, not the number of bytes that
would have been written.

Change-Id: Iab8b292397bf3cbbf4a59a72812d3831ac7722c4
Signed-off-by: Zhao Wei Liew <zhaoweiliew@gmail.com>
4 years agomsm: qpnp-haptic: set up sysfs interface for common cmhw implementation
dianlujitao [Fri, 1 Jul 2016 14:17:42 +0000 (22:17 +0800)]
msm: qpnp-haptic: set up sysfs interface for common cmhw implementation

 * Export vmax_mv as vtg_level
 * Add min/max/default voltage sysfs entries
 * Make min/max voltage adjustable via DT

Change-Id: Iefa3accdb75fcef9bcb2d4c730ca0a72763994f3

4 years agomsm: qpnp-haptic: Process haptics asynchronously
Sultanxda [Wed, 3 Aug 2016 06:59:42 +0000 (23:59 -0700)]
msm: qpnp-haptic: Process haptics asynchronously

Blocking the timed_output sysfs node due to mutex contention causes severe
device wake-up latency, as a process crucial to system resume writes to the
timed_output vibrator node every time the device is resumed via the
fingerprint reader (fingerprint reader triggers a haptic response on
success).

By processing haptics asynchronously via a worker, the timed_output sysfs
won't get stalled for long periods of time (>30ms), and thus the device
will consistently wake from sleep faster.

Change-Id: I248ff11b79482cea804252c199b4a8935ad45fc1
Signed-off-by: Sultanxda <sultanxda@gmail.com>
4 years agonet/sch_generic: Shut up noise
Daniel Vetter [Tue, 18 Jul 2017 08:21:10 +0000 (10:21 +0200)]
net/sch_generic: Shut up noise

We can't allow spam in CI.

Upate 26th June 2018: This is still an issue:

[  224.739686] ------------[ cut here ]------------
[  224.739712] WARNING: CPU: 3 PID: 2982 at net/sched/sch_generic.c:461 dev_watchdog+0x1fd/0x210
[  224.739714] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_pcm i915 asix usbnet mii mei_me mei prime_numbers i2c_hid pinctrl_sunrisepoint pinctrl_intel btusb btrtl btbcm btintel bluetooth ecdh_generic
[  224.739775] CPU: 3 PID: 2982 Comm: gem_exec_suspen Tainted: G     U  W         4.18.0-rc2-CI-Patchwork_9414+ #1
[  224.739777] Hardware name: Dell Inc. XPS 13 9350/, BIOS 1.4.12 11/30/2016
[  224.739780] RIP: 0010:dev_watchdog+0x1fd/0x210
[  224.739781] Code: 49 63 4c 24 f0 eb 92 4c 89 ef c6 05 21 46 ad 00 01 e8 77 ee fc ff 89 d9 48 89 c2 4c 89 ee 48 c7 c7 88 4c 14 82 e8 a3 fe 84 ff <0f> 0b eb be 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 c7 47
[  224.739866] RSP: 0018:ffff88027dd83e40 EFLAGS: 00010286
[  224.739869] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000102
[  224.739871] RDX: 0000000080000102 RSI: ffffffff820c8c6c RDI: 00000000ffffffff
[  224.739873] RBP: ffff8802644c1540 R08: 0000000071be9b33 R09: 0000000000000000
[  224.739874] R10: ffff88027dd83dc0 R11: 0000000000000000 R12: ffff8802644c1588
[  224.739876] R13: ffff8802644c1160 R14: 0000000000000001 R15: ffff88026a5dc728
[  224.739878] FS:  00007f18f4887980(0000) GS:ffff88027dd80000(0000) knlGS:0000000000000000
[  224.739880] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  224.739881] CR2: 00007f4c627ae548 CR3: 000000022ca1a002 CR4: 00000000003606e0
[  224.739883] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  224.739885] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  224.739886] Call Trace:
[  224.739888]  <IRQ>
[  224.739892]  ? qdisc_reset+0xe0/0xe0
[  224.739894]  ? qdisc_reset+0xe0/0xe0
[  224.739897]  call_timer_fn+0x93/0x360
[  224.739903]  expire_timers+0xc1/0x1d0
[  224.739908]  run_timer_softirq+0xc7/0x170
[  224.739916]  __do_softirq+0xd9/0x505
[  224.739923]  irq_exit+0xa9/0xc0
[  224.739926]  smp_apic_timer_interrupt+0x9c/0x2d0
[  224.739929]  apic_timer_interrupt+0xf/0x20
[  224.739931]  </IRQ>
[  224.739934] RIP: 0010:delay_tsc+0x2e/0xb0
[  224.739936] Code: 49 89 fc 55 53 bf 01 00 00 00 e8 6d 2c 78 ff e8 88 9d b6 ff 41 89 c5 0f ae e8 0f 31 48 c1 e2 20 48 09 c2 48 89 d5 eb 16 f3 90 <bf> 01 00 00 00 e8 48 2c 78 ff e8 63 9d b6 ff 44 39 e8 75 36 0f ae
[  224.740021] RSP: 0018:ffffc900002f7d48 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
[  224.740024] RAX: 0000000080000000 RBX: 0000000649565ca9 RCX: 0000000000000001
[  224.740026] RDX: 0000000080000001 RSI: ffffffff820c8c6c RDI: 00000000ffffffff
[  224.740027] RBP: 00000006493ea9ce R08: 000000005e81e2ee R09: 0000000000000000
[  224.740029] R10: 0000000000000120 R11: 0000000000000000 R12: 00000000002ad8d6
[  224.740030] R13: 0000000000000003 R14: 0000000000000004 R15: ffff88025caf5408
[  224.740040]  ? delay_tsc+0x66/0xb0
[  224.740045]  hibernation_debug_sleep+0x1c/0x30
[  224.740048]  hibernation_snapshot+0x2c1/0x690
[  224.740053]  hibernate+0x142/0x2a4
[  224.740057]  state_store+0xd0/0xe0
[  224.740063]  kernfs_fop_write+0x104/0x190
[  224.740068]  __vfs_write+0x31/0x180
[  224.740072]  ? rcu_read_lock_sched_held+0x6f/0x80
[  224.740075]  ? rcu_sync_lockdep_assert+0x29/0x50
[  224.740078]  ? __sb_start_write+0x152/0x1f0
[  224.740080]  ? __sb_start_write+0x168/0x1f0
[  224.740084]  vfs_write+0xbd/0x1a0
[  224.740088]  ksys_write+0x50/0xc0
[  224.740094]  do_syscall_64+0x55/0x190
[  224.740097]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  224.740099] RIP: 0033:0x7f18f400a281
[  224.740100] Code: c3 0f 1f 84 00 00 00 00 00 48 8b 05 59 8d 20 00 c3 0f 1f 84 00 00 00 00 00 8b 05 8a d1 20 00 85 c0 75 16 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 57 f3 c3 0f 1f 44 00 00 41 54 55 49 89 d4 53
[  224.740186] RSP: 002b:00007fffd1f4fec8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[  224.740189] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f18f400a281
[  224.740190] RDX: 0000000000000004 RSI: 00007f18f448069a RDI: 0000000000000006
[  224.740192] RBP: 00007fffd1f4fef0 R08: 0000000000000000 R09: 0000000000000000
[  224.740194] R10: 0000000000000000 R11: 0000000000000246 R12: 000055e795d03400
[  224.740195] R13: 00007fffd1f50500 R14: 0000000000000000 R15: 0000000000000000
[  224.740205] irq event stamp: 1582591
[  224.740207] hardirqs last  enabled at (1582590): [<ffffffff810f9f9c>] vprintk_emit+0x4bc/0x4d0
[  224.740210] hardirqs last disabled at (1582591): [<ffffffff81a0111c>] error_entry+0x7c/0x100
[  224.740212] softirqs last  enabled at (1582568): [<ffffffff81c0034f>] __do_softirq+0x34f/0x505
[  224.740215] softirqs last disabled at (1582571): [<ffffffff8108c959>] irq_exit+0xa9/0xc0
[  224.740218] WARNING: CPU: 3 PID: 2982 at net/sched/sch_generic.c:461 dev_watchdog+0x1fd/0x210
[  224.740219] ---[ end trace 6e41d690e611c338 ]---

Change-Id: Ie3cc947a719d91ae7c9b7d93513b1728aa603211
References: https://bugzilla.kernel.org/show_bug.cgi?id=196399
Acked-by: Martin Peres <martin.peres@linux.intel.com>
Cc: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170718082110.12524-1-daniel.vetter@ffwll.ch
4 years agodo not call trace_printk on non-debug build
Wei Wang [Sun, 10 Sep 2017 21:27:05 +0000 (14:27 -0700)]
do not call trace_printk on non-debug build

trace_printk will cause trace_printk_init_buffers executed in kernel
start. Remove them from non-debug build.

Test: see nasty message gone in dmesg
Bug: 64215528
Change-Id: I82b8435a3cf36123608aae572c843db8ad86ac8a
Signed-off-by: Wei Wang <wvw@google.com>
4 years agoremove calls to trace_printk
Thierry Strudel [Tue, 14 Mar 2017 20:00:33 +0000 (13:00 -0700)]
remove calls to trace_printk

Removes boot warning:
trace_printk() being used. Allocating extra memory.

Change-Id: I3347379da302fc273e9b1d2787863cb244837ce8
Signed-off-by: Thierry Strudel <tstrudel@google.com>
4 years agodevfreq: Don't force compilation of userspace governor
Sultanxda [Mon, 1 Jan 2018 05:34:03 +0000 (21:34 -0800)]
devfreq: Don't force compilation of userspace governor

Change-Id: I540ed4fe4bef8f059e577c59a839b27ddee78345
Signed-off-by: Sultanxda <sultanxda@gmail.com>
4 years agocpuidle: Don't enable all governors by default
Jean Delvare [Mon, 11 Jan 2016 16:43:02 +0000 (17:43 +0100)]
cpuidle: Don't enable all governors by default

Since commit d6f346f2d2 (cpuidle: improve governor Kconfig options)
the best cpuidle governor is selected automatically. There is little
point in additionally selecting the other one as it will not be used,
so don't select both governors by default.

Being able to select more than one governor is still good for
developers booting with cpuidle_sysfs_switch, though.

This fixes the second half of kernel BZ #65531.

Change-Id: I8757624f6bdc2d418b12ffcad294d273b9aca26d
Link: https://bugzilla.kernel.org/show_bug.cgi?id=65531
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
4 years agoANDROID: mm: add config for default readahead size
Wei Wang [Wed, 28 Feb 2018 21:34:22 +0000 (13:34 -0800)]
ANDROID: mm: add config for default readahead size

Change the VM_MAX_READAHED value from the default 128KB to a
configurable value. This will allow the readahead window to grow to a
maximum size bigger than 128KB, which greatly benefits to sequential
read throughput and thus boot performance.

Bug: 62413151
Test: boot walleye 100ms faster
Change-Id: Iad448cf1198056de46654dcb409466802b3b908d
Signed-off-by: Wei Wang <wvw@google.com>
4 years agosecurity: pfk: fix build when ecryptfs is disabled
Eric Biggers [Wed, 25 Jan 2017 23:17:01 +0000 (15:17 -0800)]
security: pfk: fix build when ecryptfs is disabled

To avoid compile errors and warnings when the pfk module is enabled
without ecryptfs, the ecryptfs stubs need to be static inline.

Bug: 34712722
Change-Id: I39d715fcac1ff2f7781230cc2d1da2a8d803e974
Signed-off-by: Eric Biggers <ebiggers@google.com>
4 years agoscsi: ufs: Increase crypto thread priority
Neeraj Soni [Tue, 6 Feb 2018 16:25:50 +0000 (08:25 -0800)]
scsi: ufs: Increase crypto thread priority

Crypto work is used to program file keys into
the Crypto HW. Some times the thread is scheduled
but is not executed and is preempted oftenly by
block i/o kworker. This causes same requests to be
requeued  leading to timeout and cpu overload issues.

Change-Id: Icd9b5108018b85d60d72858c92673e1f2feddbd4
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
4 years agoipv6: add option to drop unsolicited neighbor advertisements
Johannes Berg [Thu, 4 Feb 2016 12:31:20 +0000 (13:31 +0100)]
ipv6: add option to drop unsolicited neighbor advertisements

In certain 802.11 wireless deployments, there will be NA proxies
that use knowledge of the network to correctly answer requests.
To prevent unsolicitd advertisements on the shared medium from
being a problem, on such deployments wireless needs to drop them.

Enable this by providing an option called "drop_unsolicited_na".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit aec215e7aa380fe5f85eb6948766b58bf78cb6c3)

Change-Id: Iad429a767a786087b0985632be44932b2e3fd1a8

4 years agoipv4: add option to drop gratuitous ARP packets
Johannes Berg [Thu, 4 Feb 2016 12:31:18 +0000 (13:31 +0100)]
ipv4: add option to drop gratuitous ARP packets

In certain 802.11 wireless deployments, there will be ARP proxies
that use knowledge of the network to correctly answer requests.
To prevent gratuitous ARP frames on the shared medium from being
a problem, on such deployments wireless needs to drop them.

Enable this by providing an option called "drop_gratuitous_arp".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4078228159c9f54cca7347a8bdace29f2abdef65)

Change-Id: I8772dbd7471085878f8b4161eb2a056d79b8b232

4 years agoipv6: add option to drop unicast encapsulated in L2 multicast
Johannes Berg [Thu, 4 Feb 2016 12:31:19 +0000 (13:31 +0100)]
ipv6: add option to drop unicast encapsulated in L2 multicast

In order to solve a problem with 802.11, the so-called hole-196 attack,
add an option (sysctl) called "drop_unicast_in_l2_multicast" which, if
enabled, causes the stack to drop IPv6 unicast packets encapsulated in
link-layer multi- or broadcast frames. Such frames can (as an attack)
be created by any member of the same wireless network and transmitted
as valid encrypted frames since the symmetric key for broadcast frames
is shared between all stations.

Reviewed-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit dede82143bf1bbf92ea73a519bb0298b19c56cb9)

Change-Id: I76c8f84b53e95c40ad3c2b5adac0ec4964cc920c

4 years agoipv4: add option to drop unicast encapsulated in L2 multicast
Johannes Berg [Thu, 4 Feb 2016 12:31:17 +0000 (13:31 +0100)]
ipv4: add option to drop unicast encapsulated in L2 multicast

In order to solve a problem with 802.11, the so-called hole-196 attack,
add an option (sysctl) called "drop_unicast_in_l2_multicast" which, if
enabled, causes the stack to drop IPv4 unicast packets encapsulated in
link-layer multi- or broadcast frames. Such frames can (as an attack)
be created by any member of the same wireless network and transmitted
as valid encrypted frames since the symmetric key for broadcast frames
is shared between all stations.

Additionally, enabling this option provides compliance with a SHOULD
clause of RFC 1122.

Change-Id: I8de9fa5bdbea0556802f2ee553d0e73c1349213e
Reviewed-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agofs/exec: fix use after free in execve
Andrea Arcangeli [Tue, 25 Jul 2017 20:22:45 +0000 (22:22 +0200)]
fs/exec: fix use after free in execve

"file" can be already freed if bprm->file is NULL after
exec_binprm() return. binfmt_script will do exactly that for
example. If the VM reuses the file after fput run(), this will result in
a use ater free.

So obtain d_is_su before exec_binprm() runs.

This should explain this crash:

[25333.009554] Unable to handle kernel NULL pointer dereference at virtual address 00000185
[..]
[25333.009918] [2:             am:21861] PC is at do_execve+0x354/0x474

Change-Id: I2a8a814d1c0aa75625be83cb30432cf13f1a0681
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
4 years agokernel: Fix potential refcount leak in su check
Tom Marshall [Thu, 18 May 2017 23:50:22 +0000 (23:50 +0000)]
kernel: Fix potential refcount leak in su check

Change-Id: I8d2c8bed65a01eb0928308df638a04449a5bd881

4 years agokernel: Only expose su when daemon is running
Tom Marshall [Wed, 25 Jan 2017 17:01:03 +0000 (18:01 +0100)]
kernel: Only expose su when daemon is running

It has been claimed that the PG implementation of 'su' has security
vulnerabilities even when disabled.  Unfortunately, the people that
find these vulnerabilities often like to keep them private so they
can profit from exploits while leaving users exposed to malicious
hackers.

In order to reduce the attack surface for vulnerabilites, it is
therefore necessary to make 'su' completely inaccessible when it
is not in use (except by the root and system users).

Change-Id: I79716c72f74d0b7af34ec3a8054896c6559a181d

4 years agoRevert "f_fs: set maxburst to one before enabling endpoints"
Jerry Zhang [Fri, 23 Mar 2018 23:23:34 +0000 (16:23 -0700)]
Revert "f_fs: set maxburst to one before enabling endpoints"

This reverts commit e3c2d0c27e3bd3df4b66bba9e9b47c7e0a442eb8.

This was severely slowing down usb transfer speeds.

Bug: 76154677
Test: mtp and adb speeds return to normal
Change-Id: I70e7a45b3d71a66a4191637891d145a86495aab6
Signed-off-by: Jerry Zhang <zhangjerry@google.com>