From: James Morse <james.morse@arm.com>
To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
James Morse <james.morse@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Subject: [PATCH 0/6] arm64: errata: Disable FWB on parts with non-ARM interconnects
Date: Thu, 30 Mar 2023 17:51:22 +0100 [thread overview]
Message-ID: <20230330165128.3237939-1-james.morse@arm.com> (raw)
Hello!
Changes since the RFC?:
* Added DT support, in a way that means we don't end up with per-erratum
strings, or bloat in the calling code to check for those strings.
* Added a commandline argument. (boo)
* Changes to support errata affecting features on big-little systems properly.
~
When stage1 translation is disabled, the SCTRL_E1.I bit controls the
attributes used for instruction fetch, one of the options results in a
non-cacheable access. A whole host of CPUs missed the FWB override
in this case, meaning a KVM guest could fetch stale/junk data instead of
instructions.
The workaround is to disable FWB, and do the required cache maintenance
instead.
The good news is, this isn't a problem for systems using Arm's
interconnect IP. The bad news is: linux can't know this. Arm knows of
at least one platform that is affected by this erratum.
This series adds support for the 'Errata Management Firmware Interface', [0]
and queries that to determine if the CPU is affected or not. DT support is
added so that the firmware interface values can be queried directly from the
DT. This can be used as a fallback for platforms that don't yet support the
interface.
Unfortunately, no-one has firmware that supports this new interface yet,
and the least surprising thing to do is to enable the workaround by default,
meaning FWB is disabled on all these cores, even for unaffected platforms.
ACPI Platforms that are not-affected can either take a firmware-update to
support the interface, or if the kernel they run will only run on hardware
that is unaffected, disable the workaround at build time.
The trusted firmware series to implement the interface is here:
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19835
the trusted firmware code to advertise a value for this erratum is here:
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/20076
The SDEN documents that describe this are:
Cortex-A78:
https://developer.arm.com/documentation/SDEN1401784/1800/?lang=en
Cortex-A78C:
https://developer.arm.com/documentation/SDEN1707916/1300/?lang=en
https://developer.arm.com/documentation/SDEN2004089/0700/?lang=en
(yes, there are two!)
Cortex-A710:
https://developer.arm.com/documentation/SDEN1775101/1500/?lang=en
Cortex-X1:
https://developer.arm.com/documentation/SDEN1401782/1800/?lang=en
Cortex-X2:
https://developer.arm.com/documentation/SDEN1775100/1500/?lang=en
Cortex-X3:
https://developer.arm.com/documentation/SDEN2055130/1000/?lang=en
Cortex-V1:
https://developer.arm.com/documentation/SDEN1401781/1600/?lang=en
Cortex-V2:
https://developer.arm.com/documentation/SDEN2332927/0500/?lang=en
Cortex-N2:
https://developer.arm.com/documentation/SDEN1982442/1200/?lang=en
Thanks,
James
[0] https://developer.arm.com/documentation/den0100/1-0/?lang=en
[RFC] https://lore.kernel.org/linux-arm-kernel/20230216182201.1705406-1-james.morse@arm.com/
James Morse (6):
dt-bindings: firmware: Add arm,errata-management
firmware: smccc: Add support for erratum discovery API
arm64: cputype: Add new part numbers for Cortex-X3, and Neoverse-V2
arm64: errata: Disable FWB on parts with non-ARM interconnects
firmware: smccc: Allow errata management to be overridden by device
tree
arm64: errata: Add a commandline option to enable/disable #2701951
.../admin-guide/kernel-parameters.txt | 4 +
Documentation/arm64/silicon-errata.rst | 18 ++
.../devicetree/bindings/arm/cpus.yaml | 5 +
.../firmware/arm,errata-management.yaml | 72 +++++
arch/arm64/Kconfig | 27 ++
arch/arm64/include/asm/cpufeature.h | 1 +
arch/arm64/include/asm/cputype.h | 4 +
arch/arm64/kernel/cpu_errata.c | 123 ++++++++
arch/arm64/kernel/cpufeature.c | 23 +-
arch/arm64/tools/cpucaps | 1 +
drivers/firmware/smccc/Kconfig | 8 +
drivers/firmware/smccc/Makefile | 1 +
drivers/firmware/smccc/em.c | 284 ++++++++++++++++++
include/linux/arm-smccc.h | 28 ++
include/linux/arm_smccc_em.h | 11 +
15 files changed, 609 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/firmware/arm,errata-management.yaml
create mode 100644 drivers/firmware/smccc/em.c
create mode 100644 include/linux/arm_smccc_em.h
--
2.39.2
next reply other threads:[~2023-03-30 16:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 16:51 James Morse [this message]
2023-03-30 16:51 ` [PATCH 1/6] dt-bindings: firmware: Add arm,errata-management James Morse
2023-03-30 20:50 ` Rob Herring
2023-03-31 8:29 ` Krzysztof Kozlowski
2023-03-31 16:58 ` James Morse
2023-04-03 9:15 ` Krzysztof Kozlowski
2023-04-03 12:05 ` Marc Zyngier
2023-03-31 13:46 ` Rob Herring
2023-03-31 16:58 ` James Morse
2023-04-03 15:45 ` Rob Herring
2023-04-04 15:19 ` James Morse
2023-03-30 16:51 ` [PATCH 2/6] firmware: smccc: Add support for erratum discovery API James Morse
2023-03-30 20:34 ` kernel test robot
2023-03-30 16:51 ` [PATCH 3/6] arm64: cputype: Add new part numbers for Cortex-X3, and Neoverse-V2 James Morse
2023-03-30 16:51 ` [PATCH 4/6] arm64: errata: Disable FWB on parts with non-ARM interconnects James Morse
2023-03-30 16:51 ` [PATCH 5/6] firmware: smccc: Allow errata management to be overridden by device tree James Morse
2023-03-30 20:44 ` kernel test robot
2023-03-31 17:05 ` James Morse
2023-03-30 16:51 ` [PATCH 6/6] arm64: errata: Add a commandline option to enable/disable #2701951 James Morse
2023-03-31 12:57 ` [PATCH 0/6] arm64: errata: Disable FWB on parts with non-ARM interconnects Rob Herring
2023-03-31 13:03 ` Rob Herring
2023-05-11 17:15 ` Catalin Marinas
2023-05-11 18:42 ` Marc Zyngier
2023-05-11 21:13 ` Catalin Marinas
2023-05-16 16:29 ` James Morse
2023-05-23 12:24 ` Robin Murphy
2023-05-23 10:48 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230330165128.3237939-1-james.morse@arm.com \
--to=james.morse@arm.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=robh+dt@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).