* [PATCH] dt-bindings: arm: Remove obsolete insignal-boards.txt
From: Rob Herring @ 2018-05-31 16:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180528185310.21971-1-krzk@kernel.org>
On Mon, May 28, 2018 at 08:53:10PM +0200, Krzysztof Kozlowski wrote:
> The compatibles mentioned in insignal-boards.txt are already documented
> under devicetree/bindings/arm/samsung/samsung-boards.txt. Also the
> contents of insignal-boards.txt is not accurate, e.g. does not mention
> Arndale boards.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> Documentation/devicetree/bindings/arm/insignal-boards.txt | 8 --------
> 1 file changed, 8 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/arm/insignal-boards.txt
Reviewd-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* [PATCH v2] arm64: allwinner: a64-amarula-relic: Enable AP6330 WiFi support
From: Jagan Teki @ 2018-05-31 16:51 UTC (permalink / raw)
To: linux-arm-kernel
Enable AP6330 WiFi/BT combo chip on Amarula A64-Relic board:
- WiFi SDIO interface is connected to MMC1
- WiFi WL-PMU-EN pin connected to gpio PL2: attach to mmc-pwrseq
- WiFi WL-WAKE-AP pin connected to gpio PL3
- 32kHz external oscillator gate clock from RTC
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v2:
- Move external rtc clock nodes into main rtc node definition
of sun50i-a64.dtsi
.../dts/allwinner/sun50i-a64-amarula-relic.dts | 31 ++++++++++++++++++++++
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 3 +++
2 files changed, 34 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
index ce4a256ff086..eac4793c8502 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
@@ -21,12 +21,43 @@
chosen {
stdout-path = "serial0:115200n8";
};
+
+ wifi_pwrseq: wifi-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ clocks = <&rtc 1>;
+ clock-names = "ext_clock";
+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* WL-PMU-EN: PL2 */
+ };
};
&ehci0 {
status = "okay";
};
+&mmc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins>;
+ vmmc-supply = <®_dcdc1>;
+ /*
+ * Schematic shows both dldo4 and eldo1 connected for vcc-io-wifi, but
+ * dldo4 connection shows DNP(Do Not Populate) and eldo1 connected with
+ * 0Ohm register to vcc-io-wifi so eldo1 is used.
+ */
+ vqmmc-supply = <®_eldo1>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+
+ brcmf: wifi at 1 {
+ reg = <1>;
+ compatible = "brcm,bcm4329-fmac";
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* WL-WAKE-AP: PL3 */
+ interrupt-names = "host-wake";
+ };
+};
+
&mmc2 {
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 1b2ef28c42bd..82516aec4153 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -634,6 +634,9 @@
reg = <0x01f00000 0x54>;
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
+ clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
+ clocks = <&osc32k>;
+ #clock-cells = <1>;
};
r_intc: interrupt-controller at 1f00c00 {
--
2.14.3
^ permalink raw reply related
* [PATCH v1 2/2] arm64: handle NOTIFY_SEI notification by the APEI driver
From: James Morse @ 2018-05-31 16:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531110115.uglmicy3nzwfoyx3@lakrids.cambridge.arm.com>
Hi Mark, Dongjiu Geng,
On 31/05/18 12:01, Mark Rutland wrote:
> In do_serror() we already handle nmi_{enter,exit}(), so there's no need
> for that here.
Even better: nmi_enter() has a BUG_ON(in_nmi()).
> TBH, I don't understand why do_sea() does that conditionally today.
> Unless there's some constraint I'm missing,
APEI uses a different fixmap entry and locks when in_nmi(). This was because we
may interrupt the irq-masked region in APEI that was using the regular memory.
(e.g. the 'polled' notification, or something backed by an interrupt.) But,
Borislav has spotted other things in here that are broken[0]. I'm working on
rolling all that into 'v5' of the in_nmi() rework stuff.
We currently get away with this on arm because 'SEA' is the only NMI-like thing,
and it occurs synchronously. The problem cases are all also cases where the
kernel text is corrupt, which we can't possibly hope to handle.
For NOTIFY_SDEI and NOTIFY_SEI this is the wrong pattern as these are
asynchronous. do_serror() has already done most of the work for NOTIFY_SEI, but
we need to use the estatus queue in APEI, which is currently x86 only.
> I think it would make more
> sense to do that regardless of whether the interrupted context had
> interrupts enabled. James -- does that make sense to you?
>
> If you update the prior patch with a stub for !CONFIG_ACPI_APEI_SEI, you
> can simplify all of the above additions down to:
>
> if (!ghes_notify_sei())
> return;
>
> ... which would look a lot nicer.
The code that calls ghes_notify_sei() may need calling by KVM too, but its
default action to an 'unclaimed' SError will be different.
Because of the race between memory_failure() and return-to-userspace, we may
need to kick the irq work queue (if we can), as we return from do_serror(). [1]
and [2] provide an example for NOTIFY_SEA. SDEI does this by returning to the
kernel through the IRQ handler, (which handles the KVM case too).
I think this series is unsafe until we can use the estatus queue in APEI. Its
also missing the handling for an SError interrupting a KVM guest.
Thanks,
James
[0] https://www.spinics.net/lists/arm-kernel/msg653332.html
[1] https://www.spinics.net/lists/arm-kernel/msg649237.html
[2] https://www.spinics.net/lists/arm-kernel/msg649239.html
^ permalink raw reply
* [PATCH v2 00/17] arm64 SSBD (aka Spectre-v4) mitigation
From: Marc Zyngier @ 2018-05-31 16:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531164133.6z6py7nl55ty473e@armageddon.cambridge.arm.com>
Hi Catalin,
On 31/05/18 17:41, Catalin Marinas wrote:
> On Tue, May 29, 2018 at 01:11:04PM +0100, Marc Zyngier wrote:
>> Marc Zyngier (17):
>> arm/arm64: smccc: Add SMCCC-specific return codes
>> arm64: Call ARCH_WORKAROUND_2 on transitions between EL0 and EL1
>> arm64: Add per-cpu infrastructure to call ARCH_WORKAROUND_2
>> arm64: Add ARCH_WORKAROUND_2 probing
>> arm64: Add 'ssbd' command-line option
>> arm64: ssbd: Add global mitigation state accessor
>> arm64: ssbd: Skip apply_ssbd if not using dynamic mitigation
>> arm64: ssbd: Restore mitigation status on CPU resume
>> arm64: ssbd: Introduce thread flag to control userspace mitigation
>> arm64: ssbd: Add prctl interface for per-thread mitigation
>> arm64: KVM: Add HYP per-cpu accessors
>> arm64: KVM: Add ARCH_WORKAROUND_2 support for guests
>> arm64: KVM: Handle guest's ARCH_WORKAROUND_2 requests
>> arm64: KVM: Add ARCH_WORKAROUND_2 discovery through
>> ARCH_FEATURES_FUNC_ID
>
> I queued the 14 patches above for 4.18.
I just realized that your for-next/core branch is based on
4.17-rc4, which means arch/arm64/kernel/ssbd.c won't compile
(it relies on some of the symbols introduced with the x86
stuff in 4.17-rc7.
You can work around it by adding the following hack:
>From 8a0dbe9fb468c03b3913d17af9dce7358f899ee3 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Thu, 31 May 2018 17:54:11 +0100
Subject: [PATCH] fixup! arm64: ssbd: Add prctl interface for per-thread
mitigation
---
arch/arm64/kernel/ssbd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/ssbd.c b/arch/arm64/kernel/ssbd.c
index 07b12c034ec2..3432e5ef9f41 100644
--- a/arch/arm64/kernel/ssbd.c
+++ b/arch/arm64/kernel/ssbd.c
@@ -11,7 +11,9 @@
/*
* prctl interface for SSBD
+ * FIXME: Drop the below ifdefery once merged in 4.18.
*/
+#ifdef PR_SPEC_STORE_BYPASS
static int ssbd_prctl_set(struct task_struct *task, unsigned long ctrl)
{
int state = arm64_get_ssbd_state();
@@ -105,3 +107,4 @@ int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which)
return -ENODEV;
}
}
+#endif /* PR_SPEC_STORE_BYPASS */
--
2.17.1
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply related
* [linux-sunxi] [PATCH v2] arm64: allwinner: a64-amarula-relic: Enable AP6330 WiFi support
From: Christopher Obbard @ 2018-05-31 16:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531165109.8476-1-jagan@amarulasolutions.com>
Hi Jagan,
I cannot find any information on this board online, so I am guessing
it has not been released yet and you are developing software support
now.
Do you have any datasheet/overview document of the board?
Rather than making a lot of noise on the various MLs, why not wait
until all hardware has a driver written for it & bugs have been been
smashed, then patch in one series?
Christopher Obbard
64 Studio Ltd.
On 31 May 2018 at 17:51, Jagan Teki <jagan@amarulasolutions.com> wrote:
> Enable AP6330 WiFi/BT combo chip on Amarula A64-Relic board:
> - WiFi SDIO interface is connected to MMC1
> - WiFi WL-PMU-EN pin connected to gpio PL2: attach to mmc-pwrseq
> - WiFi WL-WAKE-AP pin connected to gpio PL3
> - 32kHz external oscillator gate clock from RTC
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
> Changes for v2:
> - Move external rtc clock nodes into main rtc node definition
> of sun50i-a64.dtsi
>
> .../dts/allwinner/sun50i-a64-amarula-relic.dts | 31 ++++++++++++++++++++++
> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 3 +++
> 2 files changed, 34 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> index ce4a256ff086..eac4793c8502 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
> @@ -21,12 +21,43 @@
> chosen {
> stdout-path = "serial0:115200n8";
> };
> +
> + wifi_pwrseq: wifi-pwrseq {
> + compatible = "mmc-pwrseq-simple";
> + clocks = <&rtc 1>;
> + clock-names = "ext_clock";
> + reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* WL-PMU-EN: PL2 */
> + };
> };
>
> &ehci0 {
> status = "okay";
> };
>
> +&mmc1 {
> + pinctrl-names = "default";
> + pinctrl-0 = <&mmc1_pins>;
> + vmmc-supply = <®_dcdc1>;
> + /*
> + * Schematic shows both dldo4 and eldo1 connected for vcc-io-wifi, but
> + * dldo4 connection shows DNP(Do Not Populate) and eldo1 connected with
> + * 0Ohm register to vcc-io-wifi so eldo1 is used.
> + */
> + vqmmc-supply = <®_eldo1>;
> + mmc-pwrseq = <&wifi_pwrseq>;
> + bus-width = <4>;
> + non-removable;
> + status = "okay";
> +
> + brcmf: wifi at 1 {
> + reg = <1>;
> + compatible = "brcm,bcm4329-fmac";
> + interrupt-parent = <&r_pio>;
> + interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* WL-WAKE-AP: PL3 */
> + interrupt-names = "host-wake";
> + };
> +};
> +
> &mmc2 {
> pinctrl-names = "default";
> pinctrl-0 = <&mmc2_pins>;
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 1b2ef28c42bd..82516aec4153 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -634,6 +634,9 @@
> reg = <0x01f00000 0x54>;
> interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
> <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
> + clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> + clocks = <&osc32k>;
> + #clock-cells = <1>;
> };
>
> r_intc: interrupt-controller at 1f00c00 {
> --
> 2.14.3
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply
* [PATCH v2 0/2] arm64: align KPTI interface with x86
From: Mark Langsdorf @ 2018-05-31 17:08 UTC (permalink / raw)
To: linux-arm-kernel
ARM64 supports KPTI, but support isn't documented and KPTI can be enabled
or disabled silently. Also, x86_64 supports the nopti kernel parameter,
but ARM64 doesn't.
Add the nopti argument, update the documentation so that ARM64 as well
as x86 supports nopti, add documentation for the existing kpti parameter,
and revise how kpti is logged.
--Mark Langsdorf
Changes from v1:
- Two patches dealing with debugfs dropped as x86 doesn't have this capability
- Documentation changed so that the existing kpti argument is documented,
instead of a pti argument similar to what x86 uses but arm64 does not.
- when logging kpti status, made it clear when status is set by default
^ permalink raw reply
* [PATCH v2 1/2] arm64: capabilities: add nopti command line argument
From: Mark Langsdorf @ 2018-05-31 17:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531170832.14263-1-mlangsdo@redhat.com>
The x86 kernel and the documentation use 'nopti' as the kernel command
line argument to disable kernel page table isolation, so add nopti to
the arm64 kernel for compatibility.
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
---
Documentation/admin-guide/kernel-parameters.txt | 19 +++++++++++++++----
arch/arm64/kernel/cpufeature.c | 11 ++++++++++-
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index f2040d4..cf0c728 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3342,8 +3342,8 @@
pt. [PARIDE]
See Documentation/blockdev/paride.txt.
- pti= [X86_64] Control Page Table Isolation of user and
- kernel address spaces. Disabling this feature
+ pti= [X86_64] Control Page Table Isolation of user
+ and kernel address spaces. Disabling this feature
removes hardening, but improves performance of
system calls and interrupts.
@@ -3354,8 +3354,19 @@
Not specifying this option is equivalent to pti=auto.
- nopti [X86_64]
- Equivalent to pti=off
+ kpti= [ARM64] Control Page Table Isolation of user
+ and kernel address spaces. Disabling this feature
+ removes hardening, but improves performance of
+ system calls and interrupts.
+
+ on - unconditionally enable
+ off - unconditionally disable
+
+ Not specifying this option will enable kpti on all
+ systems that support it.
+
+ nopti [X86_64, ARM64]
+ Equivalent to pti=off on X86_64 or kpti=off on ARM64
pty.legacy_count=
[KNL] Number of legacy pty's. Overwrites compiled-in
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 9d1b06d..7c5d8712 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -934,10 +934,19 @@ static int __init parse_kpti(char *str)
if (ret)
return ret;
- __kpti_forced = enabled ? 1 : -1;
+ if (!__kpti_forced)
+ __kpti_forced = enabled ? 1 : -1;
return 0;
}
__setup("kpti=", parse_kpti);
+
+/* for compatibility with documentation and x86 nopti command line arg */
+static int __init force_nokpti(char *arg)
+{
+ __kpti_forced = -1;
+ return 0;
+}
+early_param("nopti", force_nokpti);
#endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
#ifdef CONFIG_ARM64_HW_AFDBM
--
2.9.5
^ permalink raw reply related
* [PATCH v2 2/2] arm64: cpufeature: always log KPTI setting on boot
From: Mark Langsdorf @ 2018-05-31 17:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531170832.14263-1-mlangsdo@redhat.com>
Always log KPTI setting at boot time, whether or not KPTI was forced
by a kernel parameter.
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
---
arch/arm64/kernel/cpufeature.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 7c5d8712..2bfbbe4 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -860,6 +860,7 @@ static bool has_cache_dic(const struct arm64_cpu_capabilities *entry,
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
static int __kpti_forced; /* 0: not forced, >0: forced on, <0: forced off */
+static bool __pti_enabled;
static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
int scope)
@@ -884,21 +885,26 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
/* Forced? */
if (__kpti_forced) {
+ __pti_enabled = __kpti_forced > 0;
pr_info_once("kernel page table isolation forced %s by %s\n",
- __kpti_forced > 0 ? "ON" : "OFF", str);
- return __kpti_forced > 0;
- }
-
- /* Useful for KASLR robustness */
- if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
- return true;
+ __pti_enabled ? "ON" : "OFF", str);
+ } else {
+ str = "default";
+ /* Useful for KASLR robustness */
+ if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
+ __pti_enabled = true;
+ /* Don't force KPTI for CPUs that are not vulnerable */
+ else if (is_midr_in_range_list(read_cpuid_id(), kpti_safe_list))
+ __pti_enabled = false;
+ /* Defer to CPU feature registers */
+ else
+ __pti_enabled = !has_cpuid_feature(entry, scope);
- /* Don't force KPTI for CPUs that are not vulnerable */
- if (is_midr_in_range_list(read_cpuid_id(), kpti_safe_list))
- return false;
+ pr_info_once("kernel page table isolation %s by %s\n",
+ __pti_enabled ? "ON" : "OFF", str);
+ }
- /* Defer to CPU feature registers */
- return !has_cpuid_feature(entry, scope);
+ return __pti_enabled;
}
static void
--
2.9.5
^ permalink raw reply related
* [PATCH 0/5] rpmsg: Convert to use SPDX license identifiers
From: Suman Anna @ 2018-05-31 17:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi Bjorn,
The following series switches over the current licensing text in
various rpmsg drivers to the SPDX licensing format. I see that you
have already picked up my series for the HwSpinlock drivers, so this
series does the same for the rpmsg drivers. Please pick these as well
for 4.18. Patches done on top of latest upstream kernel.
regards
Suman
Suman Anna (5):
rpmsg: Switch to SPDX license identifier
rpmsg: virtio_rpmsg_bus: Switch to SPDX license identifier
rpmsg: smd: Switch to SPDX license identifier
rpmsg: glink: Switch to SPDX license identifier
rpmsg: char: Switch to SPDX license identifier
drivers/rpmsg/Kconfig | 2 ++
drivers/rpmsg/qcom_glink_native.c | 10 +---------
drivers/rpmsg/qcom_glink_native.h | 10 +---------
drivers/rpmsg/qcom_glink_rpm.c | 10 +---------
drivers/rpmsg/qcom_glink_smem.c | 10 +---------
drivers/rpmsg/qcom_smd.c | 10 +---------
drivers/rpmsg/rpmsg_char.c | 10 +---------
drivers/rpmsg/rpmsg_core.c | 10 +---------
drivers/rpmsg/rpmsg_internal.h | 10 +---------
drivers/rpmsg/virtio_rpmsg_bus.c | 10 +---------
include/linux/rpmsg.h | 27 +--------------------------
include/linux/rpmsg/qcom_glink.h | 2 ++
include/uapi/linux/rpmsg.h | 9 ---------
13 files changed, 14 insertions(+), 116 deletions(-)
--
2.17.0
^ permalink raw reply
* [PATCH 1/5] rpmsg: Switch to SPDX license identifier
From: Suman Anna @ 2018-05-31 17:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531171103.8703-1-s-anna@ti.com>
Use the appropriate SPDX license identifier in the rpmsg core
source files and drop the previous boilerplate license text.
Signed-off-by: Suman Anna <s-anna@ti.com>
---
drivers/rpmsg/Kconfig | 2 ++
drivers/rpmsg/rpmsg_core.c | 10 +---------
drivers/rpmsg/rpmsg_internal.h | 10 +---------
include/linux/rpmsg.h | 27 +--------------------------
4 files changed, 5 insertions(+), 44 deletions(-)
diff --git a/drivers/rpmsg/Kconfig b/drivers/rpmsg/Kconfig
index 65a9f6b892f0..15e7b94dda5e 100644
--- a/drivers/rpmsg/Kconfig
+++ b/drivers/rpmsg/Kconfig
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
menu "Rpmsg drivers"
# RPMSG always gets selected by whoever wants it
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 920a02f0462c..7a57753ad0a1 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* remote processor messaging bus
*
@@ -6,15 +7,6 @@
*
* Ohad Ben-Cohen <ohad@wizery.com>
* Brian Swetland <swetland@google.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#define pr_fmt(fmt) "%s: " fmt, __func__
diff --git a/drivers/rpmsg/rpmsg_internal.h b/drivers/rpmsg/rpmsg_internal.h
index 685aa70e9cbe..0d791c30b7ea 100644
--- a/drivers/rpmsg/rpmsg_internal.h
+++ b/drivers/rpmsg/rpmsg_internal.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* remote processor messaging bus internals
*
@@ -6,15 +7,6 @@
*
* Ohad Ben-Cohen <ohad@wizery.com>
* Brian Swetland <swetland@google.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#ifndef __RPMSG_INTERNAL_H__
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index ca07366c4c33..9fe156d1c018 100644
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
@@ -1,35 +1,10 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Remote processor messaging
*
* Copyright (C) 2011 Texas Instruments, Inc.
* Copyright (C) 2011 Google, Inc.
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name Texas Instruments nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LINUX_RPMSG_H
--
2.17.0
^ permalink raw reply related
* [PATCH 2/5] rpmsg: virtio_rpmsg_bus: Switch to SPDX license identifier
From: Suman Anna @ 2018-05-31 17:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531171103.8703-1-s-anna@ti.com>
Use the appropriate SPDX license identifier in the virtio rpmsg
bus driver source file and drop the previous boilerplate license
text.
Signed-off-by: Suman Anna <s-anna@ti.com>
---
drivers/rpmsg/virtio_rpmsg_bus.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 82b83002fcba..664f957012cd 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Virtio-based remote processor messaging bus
*
@@ -6,15 +7,6 @@
*
* Ohad Ben-Cohen <ohad@wizery.com>
* Brian Swetland <swetland@google.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#define pr_fmt(fmt) "%s: " fmt, __func__
--
2.17.0
^ permalink raw reply related
* [PATCH 3/5] rpmsg: smd: Switch to SPDX license identifier
From: Suman Anna @ 2018-05-31 17:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531171103.8703-1-s-anna@ti.com>
Use the appropriate SPDX license identifier in the rpmsg SMD backend
driver source file and drop the previous boilerplate license text.
Signed-off-by: Suman Anna <s-anna@ti.com>
---
drivers/rpmsg/qcom_smd.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 5ce9bf7b897d..0819836fc178 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1,15 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2015, Sony Mobile Communications AB.
* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#include <linux/interrupt.h>
--
2.17.0
^ permalink raw reply related
* [PATCH 4/5] rpmsg: glink: Switch to SPDX license identifier
From: Suman Anna @ 2018-05-31 17:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531171103.8703-1-s-anna@ti.com>
Use the appropriate SPDX license identifier in various rpmsg
glink driver source files and drop the previous boilerplate
license text.
Signed-off-by: Suman Anna <s-anna@ti.com>
---
drivers/rpmsg/qcom_glink_native.c | 10 +---------
drivers/rpmsg/qcom_glink_native.h | 10 +---------
drivers/rpmsg/qcom_glink_rpm.c | 10 +---------
drivers/rpmsg/qcom_glink_smem.c | 10 +---------
include/linux/rpmsg/qcom_glink.h | 2 ++
5 files changed, 6 insertions(+), 36 deletions(-)
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 768ef542a841..f505f58b797d 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -1,14 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2016-2017, Linaro Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#include <linux/idr.h>
diff --git a/drivers/rpmsg/qcom_glink_native.h b/drivers/rpmsg/qcom_glink_native.h
index 0cae8a8199f8..624184fc458e 100644
--- a/drivers/rpmsg/qcom_glink_native.h
+++ b/drivers/rpmsg/qcom_glink_native.h
@@ -1,14 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2016-2017, Linaro Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#ifndef __QCOM_GLINK_NATIVE_H__
diff --git a/drivers/rpmsg/qcom_glink_rpm.c b/drivers/rpmsg/qcom_glink_rpm.c
index 69b25d157d0f..f64f45d1a735 100644
--- a/drivers/rpmsg/qcom_glink_rpm.c
+++ b/drivers/rpmsg/qcom_glink_rpm.c
@@ -1,14 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2016-2017, Linaro Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#include <linux/idr.h>
diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 3fa9d43e2c87..2b5cf2790954 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -1,14 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2016, Linaro Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#include <linux/io.h>
diff --git a/include/linux/rpmsg/qcom_glink.h b/include/linux/rpmsg/qcom_glink.h
index a622f029836e..96e26d94719f 100644
--- a/include/linux/rpmsg/qcom_glink.h
+++ b/include/linux/rpmsg/qcom_glink.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
#ifndef _LINUX_RPMSG_QCOM_GLINK_H
#define _LINUX_RPMSG_QCOM_GLINK_H
--
2.17.0
^ permalink raw reply related
* [PATCH 5/5] rpmsg: char: Switch to SPDX license identifier
From: Suman Anna @ 2018-05-31 17:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531171103.8703-1-s-anna@ti.com>
Use the appropriate SPDX license identifier in the rpmsg char driver
source file and drop the previous boilerplate license text. The uapi
header file already had the SPDX license identifier added as part of
a mass update but the license text removal was deferred for later,
and this patch drops the same.
Signed-off-by: Suman Anna <s-anna@ti.com>
---
drivers/rpmsg/rpmsg_char.c | 10 +---------
include/uapi/linux/rpmsg.h | 9 ---------
2 files changed, 1 insertion(+), 18 deletions(-)
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
index 1efdf9ff8679..76a4477c6364 100644
--- a/drivers/rpmsg/rpmsg_char.c
+++ b/drivers/rpmsg/rpmsg_char.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2016, Linaro Ltd.
* Copyright (c) 2012, Michal Simek <monstr@monstr.eu>
@@ -7,15 +8,6 @@
*
* Based on rpmsg performance statistics driver by Michal Simek, which in turn
* was based on TI & Google OMX rpmsg driver.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#include <linux/cdev.h>
#include <linux/device.h>
diff --git a/include/uapi/linux/rpmsg.h b/include/uapi/linux/rpmsg.h
index 225eb38705dc..e14c6dab4223 100644
--- a/include/uapi/linux/rpmsg.h
+++ b/include/uapi/linux/rpmsg.h
@@ -1,15 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright (c) 2016, Linaro Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#ifndef _UAPI_RPMSG_H_
--
2.17.0
^ permalink raw reply related
* [linux-sunxi] [PATCH v2] arm64: allwinner: a64-amarula-relic: Enable AP6330 WiFi support
From: Jagan Teki @ 2018-05-31 17:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAP03XeoY8_-gG-2h8WP+3ZZFzxeyHERG=o7Y3Btk2svy5kco_Q@mail.gmail.com>
On Thu, May 31, 2018 at 10:25 PM, Christopher Obbard <chris@64studio.com> wrote:
> Hi Jagan,
>
> I cannot find any information on this board online, so I am guessing
> it has not been released yet and you are developing software support
> now.
>
> Do you have any datasheet/overview document of the board?
It's an industrial board for a real product and not so different than
what we supported a software for other A64 boards [1], I will update
the wiki for the same in couple of days.
[1] https://openedev.amarulasolutions.com/display/ODWIKI/A64
Jagan.
--
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
^ permalink raw reply
* [PATCH 1/2] dt-bindings: Add vendor prefix for ArcherMind
From: Rob Herring @ 2018-05-31 17:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180529045258.1415-2-manivannan.sadhasivam@linaro.org>
On Tue, May 29, 2018 at 10:22:57AM +0530, Manivannan Sadhasivam wrote:
> Add vendor prefix for ArcherMind Technology (Nanjing) Co., Ltd.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> 1 file changed, 1 insertion(+)
I've applied this while you all debate the dts file.
Rob
^ permalink raw reply
* [PATCH 2/2] arm64: dts: Add Mediatek X20 Development Board support
From: Rob Herring @ 2018-05-31 17:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180529045258.1415-3-manivannan.sadhasivam@linaro.org>
tOn Tue, May 29, 2018 at 10:22:58AM +0530, Manivannan Sadhasivam wrote:
> Add initial device tree support for Mediatek X20 Development Board
> based on MT6797 Deca core SoC. This board is one of the 96Boards
> Consumer Edition platform.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> arch/arm64/boot/dts/mediatek/Makefile | 1 +
> .../boot/dts/mediatek/mt6797-x20-dev.dts | 33 +++++++++++++++++++
> 2 files changed, 34 insertions(+)
> create mode 100644 arch/arm64/boot/dts/mediatek/mt6797-x20-dev.dts
>
> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> index ac17f60f998c..5b7fd6ad96e4 100644
> --- a/arch/arm64/boot/dts/mediatek/Makefile
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -3,5 +3,6 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt2712-evb.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt6755-evb.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt6795-evb.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-evb.dtb
> diff --git a/arch/arm64/boot/dts/mediatek/mt6797-x20-dev.dts b/arch/arm64/boot/dts/mediatek/mt6797-x20-dev.dts
> new file mode 100644
> index 000000000000..2c09ca95d9e2
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt6797-x20-dev.dts
> @@ -0,0 +1,33 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for MediaTek X20 Development Board
> + *
> + * Copyright (C) 2018, Linaro Ltd.
> + *
> + */
> +
> +/dts-v1/;
> +
> +#include "mt6797.dtsi"
> +
> +/ {
> + model = "Mediatek X20 Development Board";
> + compatible = "archermind,mt6797-x20-dev", "mediatek,mt6797";
The board compatible needs documenting.
> +
> + aliases {
> + serial0 = &uart1;
> + };
> +
> + memory at 40000000 {
> + device_type = "memory";
> + reg = <0 0x40000000 0 0x1e605000>;
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +};
> +
> +&uart1 {
> + status = "okay";
> +};
> --
> 2.17.0
>
^ permalink raw reply
* [PATCH v5 2/2] arm64: signal: Report signal frame size to userspace via auxv
From: Will Deacon @ 2018-05-31 17:20 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180530104853.GB22983@e103592.cambridge.arm.com>
On Wed, May 30, 2018 at 11:48:59AM +0100, Dave Martin wrote:
> On Tue, May 29, 2018 at 09:42:31PM +0100, Will Deacon wrote:
> > On Fri, May 25, 2018 at 04:17:08PM +0100, Dave Martin wrote:
> > > diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
> > > index fac1c4d..8cf112b 100644
> > > --- a/arch/arm64/include/asm/elf.h
> > > +++ b/arch/arm64/include/asm/elf.h
> > > @@ -121,6 +121,9 @@
> > >
> > > #ifndef __ASSEMBLY__
> > >
> > > +#include <linux/bug.h>
> > > +#include <asm/processor.h> /* for signal_minsigstksz, used by ARCH_DLINFO */
> > > +
> > > typedef unsigned long elf_greg_t;
> > >
> > > #define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t))
> > > @@ -148,6 +151,14 @@ typedef struct user_fpsimd_state elf_fpregset_t;
> > > do { \
> > > NEW_AUX_ENT(AT_SYSINFO_EHDR, \
> > > (elf_addr_t)current->mm->context.vdso); \
> > > + \
> > > + /* \
> > > + * Should always be nonzero unless there's a kernel bug. \
> > > + * If we haven't determined a sensible value to give to \
> > > + * userspace, omit the entry: \
> > > + */ \
> > > + if (likely(signal_minsigstksz)) \
> > > + NEW_AUX_ENT(AT_MINSIGSTKSZ, signal_minsigstksz); \
> > > } while (0)
> >
> > I think this is the desired behaviour, but now I'm worried that we're forced
> > to have AT_VECTOR_SIZE_ARCH defined as 2 and, whilst you're correct that the
> > ELF loader deals with this gracefuly, the FDPIC loader looks a lot less
> > robust (in particular, my reading is that it decrements the stack pointer
> > and then pushes these entries in reverse order by overloading NEW_AUX_ENT).
>
> config BINFMT_ELF_FDPIC
> /* ... */
> depends on (ARM || (SUPERH32 & !MMU) || C6X)
Ok, that's a relief. The checkpoint stuff is still a bit worrying though
(prctl_set_mm_map).
> The FDPIC loader seems to assume it's 32-bit only and also looks broken
> with regard to auxv:
>
> /* force 16 byte _final_ alignment here for generality */
> #define DLINFO_ITEMS 15
>
> /* ... */
>
> nr = 0;
> csp -= 2 * sizeof(unsigned long);
> NEW_AUX_ENT(AT_EXECFD, ...);
> }
>
> /* ... */
>
> csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long);
> NEW_AUX_ENT(AT_HWCAP, ELF_HWCAP);
> #ifdef ELF_HWCAP2
> NEW_AUX_ENT(AT_HWCAP2, ELF_HWCAP2);
> #endif
> /* 14 more NEW_AUX_ENT() */
>
>
> Looks like commit 2171364d1a92 ("powerpc: Add HWCAP2 aux entry") added
> HWCAP2 without ensuring that space is reserved.
>
> I can try to draft a patch to handle the auxv in a more sane way for
> FDPIC, but either way I don't see that it should be relevant to arm64.
>
>
> AT_IGNORE feels like a bit of a fig leaf, but it's harmless enough. I'm
> happy to add it if you prefer.
The only userspace code I could find that uses it is something that prints
out auxv, but I'd still better spitting it out so we don't have to worry
about being smaller than AT_VECTOR_SIZE_ARCH.
Thanks,
Will
^ permalink raw reply
* [PATCH v2 1/2] ARM: debug: Add Iproc UART3 debug addresses
From: Ray Jui @ 2018-05-31 17:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAJiuCcek9KU6QWsAAxVCLUaf1v97uR6FcLOfY=A1LGCMTmjHjg@mail.gmail.com>
On 5/31/2018 1:22 AM, Cl?ment P?ron wrote:
> Hi Rai,
>
> On Wed, 30 May 2018 at 19:25, Ray Jui <ray.jui@broadcom.com> wrote:
>>
>> Hi Cl?ment,
>>
>> Correct me if I'm wrong, but I thought the trend is to move to use
>> earlycon that can be activated from kernel command line for early print
>> before the serial driver is loaded.
>>
>> Have you tried earlcon?
> No, only tested this method.
>
> Thanks,
> Clement
>
If I remember it correctly, I think the trend is to use earlycon. There
are obvious shortcomings by making this configuration compile time based.
>>
>> Thanks,
>>
>> Ray
>>
>> On 5/30/2018 6:19 AM, Cl?ment P?ron wrote:
>>> From: Cl?ment Peron <clement.peron@devialet.com>
>>>
>>> Broadcom Iproc SoCs typically use the UART3 for
>>> debug/console, provide a known good location for that.
>>>
>>> Signed-off-by: Cl?ment Peron <clement.peron@devialet.com>
>>> ---
>>>
>>> arch/arm/Kconfig.debug | 12 +++++++++++-
>>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
>>> index 199ebc1c4538..4ea9d5793b91 100644
>>> --- a/arch/arm/Kconfig.debug
>>> +++ b/arch/arm/Kconfig.debug
>>> @@ -207,6 +207,14 @@ choice
>>> depends on ARCH_BCM_HR2
>>> select DEBUG_UART_8250
>>>
>>> + config DEBUG_BCM_IPROC_UART3
>>> + bool "Kernel low-level debugging on BCM IPROC UART3"
>>> + depends on ARCH_BCM_CYGNUS
>>> + select DEBUG_UART_8250
>>> + help
>>> + Say Y here if you want the debug print routines to direct
>>> + their output to the third serial port on these devices.
>>> +
>>> config DEBUG_BCM_KONA_UART
>>> bool "Kernel low-level debugging messages via BCM KONA UART"
>>> depends on ARCH_BCM_MOBILE
>>> @@ -1557,6 +1565,7 @@ config DEBUG_UART_PHYS
>>> default 0x18000400 if DEBUG_BCM_HR2
>>> default 0x18010000 if DEBUG_SIRFATLAS7_UART0
>>> default 0x18020000 if DEBUG_SIRFATLAS7_UART1
>>> + default 0x18023000 if DEBUG_BCM_IPROC_UART3
>>> default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
>>> default 0x20001000 if DEBUG_HIP01_UART
>>> default 0x20060000 if DEBUG_RK29_UART0
>>> @@ -1676,6 +1685,7 @@ config DEBUG_UART_VIRT
>>> default 0xf1002000 if DEBUG_MT8127_UART0
>>> default 0xf1006000 if DEBUG_MT6589_UART0
>>> default 0xf1009000 if DEBUG_MT8135_UART3
>>> + default 0xf1023000 if DEBUG_BCM_IPROC_UART3
>>> default 0xf11f1000 if DEBUG_VERSATILE
>>> default 0xf1600000 if DEBUG_INTEGRATOR
>>> default 0xf1c28000 if DEBUG_SUNXI_UART0
>>> @@ -1791,7 +1801,7 @@ config DEBUG_UART_8250_WORD
>>> DEBUG_KEYSTONE_UART0 || DEBUG_KEYSTONE_UART1 || \
>>> DEBUG_ALPINE_UART0 || \
>>> DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \
>>> - DEBUG_DAVINCI_DA8XX_UART2 || \
>>> + DEBUG_DAVINCI_DA8XX_UART2 || DEBUG_BCM_IPROC_UART3 || \
>>> DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2
>>>
>>> config DEBUG_UART_8250_PALMCHIP
>>>
^ permalink raw reply
* [PATCHv2 0/4] arm64: SMCCC conduit cleanup
From: Mark Rutland @ 2018-05-31 17:32 UTC (permalink / raw)
To: linux-arm-kernel
Currently, the cpu errata code goes digging into PSCI internals to
discover the SMCCC conduit, using the (arguably misnamed) PSCI_CONDUIT_*
definitions. This lack of abstraction is somewhat unfortunate.
Further, the SDEI code has an almost identical set of CONDUIT_*
definitions, and the duplication is rather unfortunate.
Let's unify things behind a common set of SMCCC_CONDUIT_* definitions,
and expose the SMCCCv1.1 conduit via a new helper that hides the PSCI
driver internals.
Since v1 [1]:
* Rebase to the arm64 for-next/core branch, atop of SSBD patches
* Fold in acks
Mark.
[1] https://lkml.kernel.org/r/20180503170330.5591-1-mark.rutland at arm.com
Mark Rutland (4):
arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
arm64: errata: use arm_smccc_get_conduit()
firmware/psci: use common SMCCC_CONDUIT_*
firmware: arm_sdei: use common SMCCC_CONDUIT_*
arch/arm64/kernel/cpu_errata.c | 34 ++++++++++++----------------------
arch/arm64/kernel/sdei.c | 3 ++-
drivers/firmware/arm_sdei.c | 12 ++++++------
drivers/firmware/psci.c | 24 ++++++++++++++++--------
include/linux/arm-smccc.h | 16 ++++++++++++++++
include/linux/arm_sdei.h | 6 ------
include/linux/psci.h | 9 ++-------
7 files changed, 54 insertions(+), 50 deletions(-)
--
2.11.0
^ permalink raw reply
* [PATCHv2 1/4] arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
From: Mark Rutland @ 2018-05-31 17:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531173223.9668-1-mark.rutland@arm.com>
SMCCC callers are currently amassing a collection of enums for the SMCCC
conduit, and are having to dig into the PSCI driver's internals in order
to figure out what to do.
Let's clean this up, with common SMCCC_CONDUIT_* definitions, and an
arm_smccc_1_1_get_conduit() helper that abstracts the PSCI driver's
internal state.
We can kill off the PSCI_CONDUIT_* definitions once we've migrated users
over to the new interface.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
drivers/firmware/psci.c | 15 +++++++++++++++
include/linux/arm-smccc.h | 16 ++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index c80ec1d03274..d855c20de663 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -64,6 +64,21 @@ struct psci_operations psci_ops = {
.smccc_version = SMCCC_VERSION_1_0,
};
+enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
+{
+ if (psci_ops.smccc_version < SMCCC_VERSION_1_1)
+ return SMCCC_CONDUIT_NONE;
+
+ switch (psci_ops.conduit) {
+ case PSCI_CONDUIT_SMC:
+ return SMCCC_CONDUIT_SMC;
+ case PSCI_CONDUIT_HVC:
+ return SMCCC_CONDUIT_HVC;
+ default:
+ return SMCCC_CONDUIT_NONE;
+ }
+}
+
typedef unsigned long (psci_fn)(unsigned long, unsigned long,
unsigned long, unsigned long);
static psci_fn *invoke_psci_fn;
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index ca1d2cc2cdfa..947f60f5e71e 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -89,6 +89,22 @@
#include <linux/linkage.h>
#include <linux/types.h>
+
+enum arm_smccc_conduit {
+ SMCCC_CONDUIT_NONE,
+ SMCCC_CONDUIT_SMC,
+ SMCCC_CONDUIT_HVC,
+};
+
+/**
+ * arm_smccc_1_1_get_conduit()
+ *
+ * Returns the conduit to be used for SMCCCv1.1 or later.
+ *
+ * When SMCCCv1.1 is not present, returns SMCCC_CONDUIT_NONE.
+ */
+enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void);
+
/**
* struct arm_smccc_res - Result from SMC/HVC call
* @a0-a3 result values from registers 0 to 3
--
2.11.0
^ permalink raw reply related
* [PATCHv2 2/4] arm64: errata: use arm_smccc_get_conduit()
From: Mark Rutland @ 2018-05-31 17:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531173223.9668-1-mark.rutland@arm.com>
Now that we have arm_smccc_get_conduit(), we can hide the PSCI
implementation details from the arm64 cpu errata code, so let's do so.
As arm_smccc_get_conduit() implicitly checks that the SMCCC version is
at least SMCCC_VERSION_1_1, we no longer need to check this explicitly
where switch statements have a default case.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
---
arch/arm64/kernel/cpu_errata.c | 34 ++++++++++++----------------------
1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index cf37ca6fa5f2..0d744b47fd63 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -156,9 +156,7 @@ static void install_bp_hardening_cb(const struct arm64_cpu_capabilities *entry,
__install_bp_hardening_cb(fn, hyp_vecs_start, hyp_vecs_end);
}
-#include <uapi/linux/psci.h>
#include <linux/arm-smccc.h>
-#include <linux/psci.h>
static void call_smc_arch_workaround_1(void)
{
@@ -193,11 +191,8 @@ enable_smccc_arch_workaround_1(const struct arm64_cpu_capabilities *entry)
if (!entry->matches(entry, SCOPE_LOCAL_CPU))
return;
- if (psci_ops.smccc_version == SMCCC_VERSION_1_0)
- return;
-
- switch (psci_ops.conduit) {
- case PSCI_CONDUIT_HVC:
+ switch (arm_smccc_1_1_get_conduit()) {
+ case SMCCC_CONDUIT_HVC:
arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
if ((int)res.a0 < 0)
@@ -208,7 +203,7 @@ enable_smccc_arch_workaround_1(const struct arm64_cpu_capabilities *entry)
smccc_end = NULL;
break;
- case PSCI_CONDUIT_SMC:
+ case SMCCC_CONDUIT_SMC:
arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
if ((int)res.a0 < 0)
@@ -275,11 +270,11 @@ void __init arm64_update_smccc_conduit(struct alt_instr *alt,
BUG_ON(nr_inst != 1);
- switch (psci_ops.conduit) {
- case PSCI_CONDUIT_HVC:
+ switch (arm_smccc_1_1_get_conduit()) {
+ case SMCCC_CONDUIT_HVC:
insn = aarch64_insn_get_hvc_value();
break;
- case PSCI_CONDUIT_SMC:
+ case SMCCC_CONDUIT_SMC:
insn = aarch64_insn_get_smc_value();
break;
default:
@@ -305,12 +300,12 @@ void __init arm64_enable_wa2_handling(struct alt_instr *alt,
void arm64_set_ssbd_mitigation(bool state)
{
- switch (psci_ops.conduit) {
- case PSCI_CONDUIT_HVC:
+ switch (arm_smccc_1_1_get_conduit()) {
+ case SMCCC_CONDUIT_HVC:
arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_WORKAROUND_2, state, NULL);
break;
- case PSCI_CONDUIT_SMC:
+ case SMCCC_CONDUIT_SMC:
arm_smccc_1_1_smc(ARM_SMCCC_ARCH_WORKAROUND_2, state, NULL);
break;
@@ -329,18 +324,13 @@ static bool has_ssbd_mitigation(const struct arm64_cpu_capabilities *entry,
WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
- if (psci_ops.smccc_version == SMCCC_VERSION_1_0) {
- ssbd_state = ARM64_SSBD_UNKNOWN;
- return false;
- }
-
- switch (psci_ops.conduit) {
- case PSCI_CONDUIT_HVC:
+ switch (arm_smccc_1_1_get_conduit()) {
+ case SMCCC_CONDUIT_HVC:
arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
ARM_SMCCC_ARCH_WORKAROUND_2, &res);
break;
- case PSCI_CONDUIT_SMC:
+ case SMCCC_CONDUIT_SMC:
arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
ARM_SMCCC_ARCH_WORKAROUND_2, &res);
break;
--
2.11.0
^ permalink raw reply related
* [PATCHv2 3/4] firmware/psci: use common SMCCC_CONDUIT_*
From: Mark Rutland @ 2018-05-31 17:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531173223.9668-1-mark.rutland@arm.com>
Now that we have common SMCCC_CONDUIT_* definitions, migrate the PSCI
code over to them, and kill off the old PSCI_CONDUIT_* definitions.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
---
drivers/firmware/psci.c | 25 +++++++++----------------
include/linux/psci.h | 9 ++-------
2 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index d855c20de663..6d7d3ccc3a39 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -60,7 +60,7 @@ bool psci_tos_resident_on(int cpu)
}
struct psci_operations psci_ops = {
- .conduit = PSCI_CONDUIT_NONE,
+ .conduit = SMCCC_CONDUIT_NONE,
.smccc_version = SMCCC_VERSION_1_0,
};
@@ -69,14 +69,7 @@ enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
if (psci_ops.smccc_version < SMCCC_VERSION_1_1)
return SMCCC_CONDUIT_NONE;
- switch (psci_ops.conduit) {
- case PSCI_CONDUIT_SMC:
- return SMCCC_CONDUIT_SMC;
- case PSCI_CONDUIT_HVC:
- return SMCCC_CONDUIT_HVC;
- default:
- return SMCCC_CONDUIT_NONE;
- }
+ return psci_ops.conduit;
}
typedef unsigned long (psci_fn)(unsigned long, unsigned long,
@@ -228,13 +221,13 @@ static unsigned long psci_migrate_info_up_cpu(void)
0, 0, 0);
}
-static void set_conduit(enum psci_conduit conduit)
+static void set_conduit(enum arm_smccc_conduit conduit)
{
switch (conduit) {
- case PSCI_CONDUIT_HVC:
+ case SMCCC_CONDUIT_HVC:
invoke_psci_fn = __invoke_psci_fn_hvc;
break;
- case PSCI_CONDUIT_SMC:
+ case SMCCC_CONDUIT_SMC:
invoke_psci_fn = __invoke_psci_fn_smc;
break;
default:
@@ -256,9 +249,9 @@ static int get_set_conduit_method(struct device_node *np)
}
if (!strcmp("hvc", method)) {
- set_conduit(PSCI_CONDUIT_HVC);
+ set_conduit(SMCCC_CONDUIT_HVC);
} else if (!strcmp("smc", method)) {
- set_conduit(PSCI_CONDUIT_SMC);
+ set_conduit(SMCCC_CONDUIT_SMC);
} else {
pr_warn("invalid \"method\" property: %s\n", method);
return -EINVAL;
@@ -714,9 +707,9 @@ int __init psci_acpi_init(void)
pr_info("probing for conduit method from ACPI.\n");
if (acpi_psci_use_hvc())
- set_conduit(PSCI_CONDUIT_HVC);
+ set_conduit(SMCCC_CONDUIT_HVC);
else
- set_conduit(PSCI_CONDUIT_SMC);
+ set_conduit(SMCCC_CONDUIT_SMC);
return psci_probe();
}
diff --git a/include/linux/psci.h b/include/linux/psci.h
index 8b1b3b5935ab..affcd2128df8 100644
--- a/include/linux/psci.h
+++ b/include/linux/psci.h
@@ -14,6 +14,7 @@
#ifndef __LINUX_PSCI_H
#define __LINUX_PSCI_H
+#include <linux/arm-smccc.h>
#include <linux/init.h>
#include <linux/types.h>
@@ -25,12 +26,6 @@ bool psci_tos_resident_on(int cpu);
int psci_cpu_init_idle(unsigned int cpu);
int psci_cpu_suspend_enter(unsigned long index);
-enum psci_conduit {
- PSCI_CONDUIT_NONE,
- PSCI_CONDUIT_SMC,
- PSCI_CONDUIT_HVC,
-};
-
enum smccc_version {
SMCCC_VERSION_1_0,
SMCCC_VERSION_1_1,
@@ -45,7 +40,7 @@ struct psci_operations {
int (*affinity_info)(unsigned long target_affinity,
unsigned long lowest_affinity_level);
int (*migrate_info_type)(void);
- enum psci_conduit conduit;
+ enum arm_smccc_conduit conduit;
enum smccc_version smccc_version;
};
--
2.11.0
^ permalink raw reply related
* [PATCHv2 4/4] firmware: arm_sdei: use common SMCCC_CONDUIT_*
From: Mark Rutland @ 2018-05-31 17:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180531173223.9668-1-mark.rutland@arm.com>
Now that we have common definitions for SMCCC conduits, move the SDEI
code over to them, and remove the SDEI-specific definitions.
There should be no functional change as a result of this patch.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: James Morse <james.morse@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
---
arch/arm64/kernel/sdei.c | 3 ++-
drivers/firmware/arm_sdei.c | 12 ++++++------
include/linux/arm_sdei.h | 6 ------
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/arch/arm64/kernel/sdei.c b/arch/arm64/kernel/sdei.c
index 6b8d90d5ceae..a3be67ae8a88 100644
--- a/arch/arm64/kernel/sdei.c
+++ b/arch/arm64/kernel/sdei.c
@@ -2,6 +2,7 @@
// Copyright (C) 2017 Arm Ltd.
#define pr_fmt(fmt) "sdei: " fmt
+#include <linux/arm-smccc.h>
#include <linux/arm_sdei.h>
#include <linux/hardirq.h>
#include <linux/irqflags.h>
@@ -125,7 +126,7 @@ unsigned long sdei_arch_get_entry_point(int conduit)
return 0;
}
- sdei_exit_mode = (conduit == CONDUIT_HVC) ? SDEI_EXIT_HVC : SDEI_EXIT_SMC;
+ sdei_exit_mode = (conduit == SMCCC_CONDUIT_HVC) ? SDEI_EXIT_HVC : SDEI_EXIT_SMC;
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
if (arm64_kernel_unmapped_at_el0()) {
diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
index 1ea71640fdc2..1357dbd7c7fc 100644
--- a/drivers/firmware/arm_sdei.c
+++ b/drivers/firmware/arm_sdei.c
@@ -896,29 +896,29 @@ static int sdei_get_conduit(struct platform_device *pdev)
if (np) {
if (of_property_read_string(np, "method", &method)) {
pr_warn("missing \"method\" property\n");
- return CONDUIT_INVALID;
+ return SMCCC_CONDUIT_NONE;
}
if (!strcmp("hvc", method)) {
sdei_firmware_call = &sdei_smccc_hvc;
- return CONDUIT_HVC;
+ return SMCCC_CONDUIT_HVC;
} else if (!strcmp("smc", method)) {
sdei_firmware_call = &sdei_smccc_smc;
- return CONDUIT_SMC;
+ return SMCCC_CONDUIT_SMC;
}
pr_warn("invalid \"method\" property: %s\n", method);
} else if (IS_ENABLED(CONFIG_ACPI) && !acpi_disabled) {
if (acpi_psci_use_hvc()) {
sdei_firmware_call = &sdei_smccc_hvc;
- return CONDUIT_HVC;
+ return SMCCC_CONDUIT_HVC;
} else {
sdei_firmware_call = &sdei_smccc_smc;
- return CONDUIT_SMC;
+ return SMCCC_CONDUIT_SMC;
}
}
- return CONDUIT_INVALID;
+ return SMCCC_CONDUIT_NONE;
}
static int sdei_probe(struct platform_device *pdev)
diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h
index 942afbd544b7..21e337d99fa6 100644
--- a/include/linux/arm_sdei.h
+++ b/include/linux/arm_sdei.h
@@ -5,12 +5,6 @@
#include <uapi/linux/arm_sdei.h>
-enum sdei_conduit_types {
- CONDUIT_INVALID = 0,
- CONDUIT_SMC,
- CONDUIT_HVC,
-};
-
#include <asm/sdei.h>
/* Arch code should override this to set the entry point from firmware... */
--
2.11.0
^ permalink raw reply related
* [PATCH] arm64: alternative:flush cache with unpatched code
From: Rohit Khanna @ 2018-05-31 17:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180530090044.GA2452@arm.com>
Will, thanks for the comments.
I will push a new patch set.
We want to avoid using __flush_icache_all as much as possible and hence trying to flush cache by range.
Thanks
Rohit
________________________________________
From: Will Deacon <will.deacon@arm.com>
Sent: Wednesday, May 30, 2018 2:00 AM
To: Rohit Khanna
Cc: catalin.marinas at arm.com; robin.murphy at arm.com; mark.rutland at arm.com; Suzuki.Poulose at arm.com; Bo Yan; Alexander Van Brunt; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] arm64: alternative:flush cache with unpatched code
Hi Rohit,
Please keep me on cc for future versions of this patch. Comments inline.
On Tue, May 29, 2018 at 11:11:28AM -0700, Rohit Khanna wrote:
> In the current implementation, __apply_alternatives patches
> flush_icache_range and then executes it without invalidating the icache.
> Thus, icache can contain some of the old instructions for
> flush_icache_range. This can cause unpredictable behavior as during
> execution we can get a mix of old and new instructions for
> flush_icache_range.
>
> This patch :
> 1. Adds a new function flush_cache_kernel_range for flushing kernel
> memory range. This function uses non hot-patched code and can be
> safely used to flush cache during code patching.
>
> 2. Modifies __apply_alternatives so that it uses
> flush_cache_kernel_range to flush the cache range after patching code.
>
> Signed-off-by: Rohit Khanna <rokhanna@nvidia.com>
> ---
> arch/arm64/kernel/alternative.c | 31 +++++++++++++++++++++++++++++--
> 1 file changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
> index 5c4bce4ac381..e93cfd26a314 100644
> --- a/arch/arm64/kernel/alternative.c
> +++ b/arch/arm64/kernel/alternative.c
> @@ -122,6 +122,33 @@ static void patch_alternative(struct alt_instr *alt,
> }
> }
>
> +/* This is used for flushing kernel memory range after
> + * __apply_alternatives has patched kernel code
> + */
> +static void flush_cache_kernel_range(void *start, void *end)
> +{
How about something like clean_dcache_range_nopatch instead?
> + u64 d_start, i_start, d_size, i_size;
> +
> + /* use sanitized value of ctr_el0 rather than raw value from CPU */
> + d_size = 4 << ((arm64_ftr_reg_ctrel0.sys_val >> 0x10) & 0xF); /* bytes */
> + i_size = 4 << (arm64_ftr_reg_ctrel0.sys_val & 0xF); /* bytes */
You should be able to use read_sanitised_ftr_reg() and
cpuid_feature_extract_unsigned_field() here.
> + d_start = (u64)start & ~(d_size - 1);
> + while (d_start <= (u64)end) {
Please add a comment about the A53 erratum this is handling by using
clean+inv.
> + asm volatile("dc civac, %0" : : "r" (d_start));
> + d_start += d_size;
> + }
> + dsb(ish);
> +
> + i_start = (u64)start & ~(i_size - 1);
> + while (i_start <= (u64)end) {
> + asm volatile("ic ivau, %0" : : "r" (i_start));
> + i_start += i_size;
> + }
> + dsb(ish);
> + isb();
As I mentioned before, I think it would be simpler just to avoid doing the
I-cache invalidation by range and instead call __flush_icache_all once we've
exiting the loop in __apply_alternatives.
Will
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox