Commit graph

597112 commits

Author SHA1 Message Date
Linux Build Service Account
fe3ef6b4ac Merge "arm64: Add BTAC/LinkStack sanitizations for Kryo cores" 2018-02-08 19:03:42 -08:00
Linux Build Service Account
741767ad2c Merge "arm64: Implement branch predictor hardening for Falkor" 2018-02-08 19:03:41 -08:00
Linux Build Service Account
e89a71fb8b Merge "arch: arm64: Add midr values for kryo2xx big cores" 2018-02-08 19:03:41 -08:00
Linux Build Service Account
049d9307d2 Merge "arm64: Implement branch predictor hardening for affected Cortex-A CPUs" 2018-02-08 19:03:40 -08:00
Linux Build Service Account
e887df737e Merge "arm64: Define Cortex-A73 MIDR" 2018-02-08 19:03:39 -08:00
Linux Build Service Account
731d1e7b7f Merge "arm64: cputype: Add missing MIDR values for Cortex-A72 and Cortex-A75" 2018-02-08 19:03:38 -08:00
Linux Build Service Account
bb4e15efef Merge "arm64: cpu_errata: Allow an erratum to be match for all revisions of a core" 2018-02-08 19:03:37 -08:00
Linux Build Service Account
6564e041a6 Merge "arm64: Add skeleton to harden the branch predictor against aliasing attacks" 2018-02-08 19:03:37 -08:00
Linux Build Service Account
5d7bc6e4bb Merge "drivers/firmware: Expose psci_get_version through psci_ops structure" 2018-02-08 19:03:36 -08:00
Linux Build Service Account
18f6c1a5fb Merge "arm64: cpufeature: Pass capability structure to ->enable callback" 2018-02-08 19:03:35 -08:00
Linux Build Service Account
8543ad0652 Merge "arm64: errata: Calling enable functions for CPU errata too" 2018-02-08 19:03:34 -08:00
Linux Build Service Account
cf1de4e04b Merge "Merge android-4.4.115 (aa856bd) into msm-4.4" 2018-02-08 19:03:33 -08:00
Linux Build Service Account
71de2d96a7 Merge "cnss: Add support to program MAC address thru debugfs" 2018-02-08 19:03:31 -08:00
Linux Build Service Account
978d3b08ae Merge "msm: ADSPRPC: Use ID in response to get context pointer" 2018-02-08 19:03:29 -08:00
Linux Build Service Account
2503a1d5d8 Merge "msm: camera: change csiphy CDR regulator voltage on sdm660" 2018-02-08 19:03:28 -08:00
Linux Build Service Account
6ca24c92b8 Merge "mm-camera2:isp2: Handle use after free buffer" 2018-02-08 08:43:54 -08:00
Tharun Kumar Merugu
e569b915a2 msm: ADSPRPC: Use ID in response to get context pointer
Send context ID in rpc header instead of context pointer.
Validate context ID received in response and get context pointer.

Change-Id: I9cfd10d0c1b25c3085b8e15c7ca1c8ff214bf10d
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2018-02-08 15:30:54 +05:30
Srinivas Ramana
21393ff3ea arm64: Add BTAC/LinkStack sanitizations for Kryo cores
Kryo cores are exposed to two vulnerabilities due to subroutine return
(called LINK-STACK) and branch target predictors.
These two issues can be mitigated through software workarounds.

Kernel:
 - Apply LINK-STACK mitigation which is to issue 16 nested BL instructions
   on process context switch 'cpu_do_switch_mm()' where ASID changes.
 - Apply psci based branch predictor invalidation.

use the kryo core detection routine (based on MIDR) from the
commit bb48711800e6d ("arm64: cpu_errata: Add Kryo to Falkor 1003 errata")
by Stephen Boyd <sboyd@codeaurora.org>.

Change-Id: I81e8e72e7fa219f12dfe8ec39836eb8eb3c4c7b0
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-08 01:50:16 -08:00
Shanker Donthineni
f62d97e9b4 arm64: Implement branch predictor hardening for Falkor
Falkor is susceptible to branch predictor aliasing and can
theoretically be attacked by malicious code. This patch
implements a mitigation for these attacks, preventing any
malicious entries from affecting other victim contexts.

Change-Id: I535d423c2cefaf93627267b867bf0846e502d4c1
Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
[will: fix label name when !CONFIG_KVM and remove references to MIDR_FALKOR]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: ec82b567a74fbdffdf418d4bb381d55f6a9096af
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sramana@codeaurora.org: Use only the link stack sanitization routines,
and leave Falkor related BP hardening code]
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-08 15:13:20 +05:30
Mohammed Javid
36737be7c6 msm: ipa: Fix to add string NULL terminator
Missing null terminator to userspcae provided
string leads to strlen buffer overflow in strlcpy function.
Added code changes to fix string NULL terminator issue.

Change-Id: I3f9d5f22fbb26f68de12370bc5e07a4e6bc2ced9
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-02-07 22:49:47 -08:00
Vijay kumar Tumati
ca6497929a msm: camera: change csiphy CDR regulator voltage on sdm660
Set the appropriate regulator voltage to run csiphy in
cphy mode.

Change-Id: I1d6d65115e294dbf72560c8066b45bed0b03b92a
Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org>
2018-02-08 11:15:41 +05:30
Sameer Thalappil
db441e2f4c cnss: Add support to program MAC address thru debugfs
MAC addresses provisioning thru CNSS is usually done by OEM drivers.
Debugfs interfaces can be used for internal testing.

Change-Id: I1a2693835ac09619baf03ee7d2e1b69dbe48559f
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
2018-02-07 21:14:51 -08:00
Linux Build Service Account
f0020b57b5 Merge "i2c-msm-v2: Use "subsys" instead of "arch" initcall" 2018-02-07 17:11:15 -08:00
Linux Build Service Account
324ecc4547 Merge "ath10k: Enable wlan firmware based on the driver mode" 2018-02-07 17:11:14 -08:00
Linux Build Service Account
645d6ad33c Merge "power: smb1351-charger: Fix check in shutdown path for parallel disable" 2018-02-07 08:41:44 -08:00
Linux Build Service Account
f5c9996a31 Merge "cnss_utils: Add support for derived MAC address" 2018-02-07 08:41:42 -08:00
Linux Build Service Account
b7c0ad4f6b Merge "drm/msm: Corrected CCU load bit configuration" 2018-02-07 08:41:41 -08:00
Srinivas Ramana
254d671c83 arch: arm64: Add midr values for kryo2xx big cores
Add midr value for kryo2xx big cores to apply errata workarounds for
branch prediction hardening.

Change-Id: I7ca9cfa3e6b48d5af78a5297cb76ebe6f52e519e
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-07 04:16:55 -08:00
Will Deacon
ac2491ab10 arm64: Implement branch predictor hardening for affected Cortex-A CPUs
Cortex-A57, A72, A73 and A75 are susceptible to branch predictor aliasing
and can theoretically be attacked by malicious code.

This patch implements a PSCI-based mitigation for these CPUs when available.
The call into firmware will invalidate the branch predictor state, preventing
any malicious entries from affecting other victim contexts.

Change-Id: I554536e8e5cb3839e102299da8f5b944415b1880
Co-developed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: aa6acde65e03186b5add8151e1ffe36c3c62639b
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-07 04:16:43 -08:00
Marc Zyngier
a2c10034c9 arm64: Define Cortex-A73 MIDR
As we're about to introduce a new workaround that is specific to
Cortex-A73, let's define the coresponding MIDR.

Change-Id: Iabb0e83a0eadddbde458fdafd1224e442b6f3e63
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Git-commit: 199fd2bff4040985fbd7853cc39b7245fcf54bb9
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sramana@codeaurora.org: Resolve trivial merge conflicts]
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-07 04:16:32 -08:00
Will Deacon
424c93be33 arm64: cputype: Add missing MIDR values for Cortex-A72 and Cortex-A75
Hook up MIDR values for the Cortex-A72 and Cortex-A75 CPUs, since they
will soon need MIDR matches for hardening the branch predictor.

Change-Id: I59af5ea4af17198aa70d2ba4b25f729a562727ee
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: a65d219fe5dc7887fd5ca04c2ac3e9a34feb8dfc
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sramana@codeaurora.org: Resolve trivial merge conflicts]
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-07 04:16:21 -08:00
Marc Zyngier
cdf382ed61 arm64: cpu_errata: Allow an erratum to be match for all revisions of a core
Some minor erratum may not be fixed in further revisions of a core,
leading to a situation where the workaround needs to be updated each
time an updated core is released.

Introduce a MIDR_ALL_VERSIONS match helper that will work for all
versions of that MIDR, once and for all.

Change-Id: Icbb685f79205ba45f9c990d83cf961616b0d96b7
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Git-commit: 06f1494f837da8997d670a1ba87add7963b08922
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sramana@codeaurora.org: Fix merge conflicts]
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-07 04:16:08 -08:00
Will Deacon
4e56397ea6 arm64: Add skeleton to harden the branch predictor against aliasing attacks
Aliasing attacks against CPU branch predictors can allow the attacks to
redirect speculative control flow on some CPUs and potentially divulge
information from one context to another.

This patch adds initial skeleton code behind a new Kconfig option to
enable implementation-specific mitigations against these attacks for
CPUs that are affected.

Change-Id: I07fba1943dd63df8951bf68fac947666100e5559
Co-developed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: 0f15adbb2861ce6f75ccfc5a92b19eae0ef327d0
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sramana@codeaurora.org: Fix merge conflicts and make it
compilable on msm-4.4]
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-07 17:33:15 +05:30
Atanas Filipov
1b0c0d8c44 i2c-msm-v2: Use "subsys" instead of "arch" initcall
The i2c-msm-v2 driver trying to get the clocks too early, but
the clock framework is not initialized yet. The change of the
initcall type reducing deferred calls and improving boot time.

Info:
[0.212999] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
[0.213172] i2c-msm-v2 78b6000.i2c: error on clk_get(core_clk):-517
-- snipped --
[0.275922] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
[0.276086] i2c-msm-v2 78b6000.i2c: error on clk_get(core_clk):-517
-- snipped --
[0.302980] msm_mpm_dev_probe(): Cannot get clk resource for XO: -517
[0.303394] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
-- snipped --

Change-Id: Ia8c110b5f67eeec07586adb30ec3a7aff7ce265a
Signed-off-by: Atanas Filipov <afilipov@codeaurora.org>
2018-02-07 14:55:25 +05:30
Linux Build Service Account
e0c650273e Merge "reg: qcom: call reg notifier during wiphy registration" 2018-02-06 23:46:59 -08:00
Linux Build Service Account
2be3fbd7ed Merge "drm/msm: restore perfcounter after turning on GPMU" 2018-02-06 23:46:57 -08:00
Linux Build Service Account
84d2490998 Merge "ath10k: Handle mgmt tx completion event" 2018-02-06 23:46:56 -08:00
Sameer Thalappil
e2b2768357 cnss_utils: Add support for derived MAC address
MAC address programmed thru CNSS could be provisioned or
derived MAC address. So add support for programming the derived
MAC address.

Change-Id: I2fae232e32a8600949c286346acd05afefd94ef8
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
2018-02-06 20:36:18 -08:00
Linux Build Service Account
1766dce24a Merge "lpm-stats: cleanup lpm stats processing sanity wrapping" 2018-02-06 15:07:47 -08:00
Linux Build Service Account
53c56ac0a5 Merge "Merge android-4.4.114 (fe09418) into msm-4.4" 2018-02-06 15:07:46 -08:00
Kiran Kumar Lokere
2aa0bb3ac0 reg: qcom: call reg notifier during wiphy registration
Call reg notifier for self managed hints during wiphy
registration. Call the notifier with last reg-domain
request.

CRs-Fixed: 2183721
Change-Id: I4fdc0a8fae94f774c4b923fba26a8eec1c96730d
Signed-off-by: Kiran Kumar Lokere <klokere@codeaurora.org>
2018-02-06 11:44:16 -08:00
Will Deacon
24c543be85 drivers/firmware: Expose psci_get_version through psci_ops structure
Entry into recent versions of ARM Trusted Firmware will invalidate the CPU
branch predictor state in order to protect against aliasing attacks.

This patch exposes the PSCI "VERSION" function via psci_ops, so that it
can be invoked outside of the PSCI driver where necessary.

Change-Id: Id6edce067d098ed7aca19ad9321c858c89097966
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: d68e3ba5303f7e1099f51fdcd155f5263da8569b
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-06 20:03:53 +05:30
Will Deacon
715fcb10be arm64: cpufeature: Pass capability structure to ->enable callback
In order to invoke the CPU capability ->matches callback from the ->enable
callback for applying local-CPU workarounds, we need a handle on the
capability structure.

This patch passes a pointer to the capability structure to the ->enable
callback.

Change-Id: Ie9a18c7a5d721dcb3d3d6c6001c74366525cf87e
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: 0a0d111d40fd1dc588cc590fab6b55d86ddc71d3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-06 20:03:49 +05:30
Andre Przywara
ce870f33b6 arm64: errata: Calling enable functions for CPU errata too
Currently we call the (optional) enable function for CPU _features_
only. As CPU _errata_ descriptions share the same data structure and
having an enable function is useful for errata as well (for instance
to set bits in SCTLR), lets call it when enumerating erratas too.

Change-Id: Ie5d4d14dc1c0006423196e9fc1b102655f0c13b2
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Git-commit: 8e2318521bf5837dae093413f81292b59d49d030
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sramana@codeaurora.org: Resolve trivial merge conflicts]
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2018-02-06 20:03:44 +05:30
John Zhao
819b1faf12 lpm-stats: cleanup lpm stats processing sanity wrapping
during list_for_each_entry_reverse iteration, cleanup_stats
recursively on current operated stats node could result it
will be freed at the end of that cleanup_stats progress.
De-referencing it again should not happen.

CRs-Fixed: 2182622
Change-Id: Icf837b0aa796fed5fe1721f9fe66fd0dd36ccfd7
Signed-off-by: John Zhao <yuankuiz@codeaurora.org>
2018-02-06 06:25:17 -08:00
Mohammed Javid
6cb84eed2d msm: ipa: dynamic memory leak fix
This is a fix for dynamic memory leak seen with incorrectly
allocating memory of a different size than with intended
size.

Change-Id: I350719dadad9fd5c7f35a334e81c8d9f2298f888
Acked-by: Jyothi Jayanthi <jyothij@qti.qualcomm.com>
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-02-06 02:47:19 -08:00
Rakesh Pillai
ad91e76196 ath10k: Enable wlan firmware based on the driver mode
The firmware is always enabled in the mission mode,
even if the driver is in the utf mode. This causes
unexpected behaviour when driver is in utf mode.

Enable the firmware in FTM mode if the driver is
started in UTF mode, else enable the firmware in
the normal mission mode.

Change-Id: I4da204b6d19d41e208465a8314bfb8cacc346f4b
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
2018-02-06 12:36:15 +05:30
Linux Build Service Account
a7e3f3f2de Merge "diag: Fix possible use-after-free issue for mdlog session info" 2018-02-05 16:30:01 -08:00
Linux Build Service Account
68a2f1c190 Merge "ARM: dts: qcom: add an empty hab into the baseline vplatform" 2018-02-05 16:29:59 -08:00
Linux Build Service Account
9c85fe89c6 Merge "reg: qcom: call regulatory callback for self managed hints" 2018-02-05 16:29:58 -08:00