From: Michael Reeves via B4 Relay <devnull+michael.reeves077.gmail.com@kernel.org>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Cc: Myria Sarvay <myrialsarvay@gmail.com>,
Yureka Lilian <yureka@cyberchaos.dev>,
Fuad Tabba <fuad.tabba@linux.dev>,
Joey Gouly <joey.gouly@arm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
Sven Peter <sven@kernel.org>, Janne Grunau <j@jannau.net>,
Neal Gompa <neal@gompa.dev>,
asahi@lists.linux.dev, linux-kernel@vger.kernel.org,
Michael Reeves <michael.reeves077@gmail.com>
Subject: [PATCH v2 2/2] arm64: Apply existing Apple Silicon CPU workarounds to newer CPUs
Date: Wed, 21 Oct 2026 10:53:21 +1100 [thread overview]
Message-ID: <20261021-apple-m3-m4-kvm-v2-2-04905152cc2a@gmail.com> (raw)
In-Reply-To: <20261021-apple-m3-m4-kvm-v2-0-04905152cc2a@gmail.com>
From: Michael Reeves <michael.reeves077@gmail.com>
Add M3, M3 Pro, M3 Max, base M4, A18 Pro and M5 Pro to apple_cpus
so they receive the existing PMU trap and broken SEIS workarounds.
Add these CPUs to has_vgic_v3 so KVM detects TDIR support and can
trap guest DIR accesses without trapping all common registers.
Co-developed-by: Yureka Lilian <yureka@cyberchaos.dev>
Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
Tested-by: Yureka Lilian <yureka@cyberchaos.dev>
Tested-by: Myria Sarvay <myrialsarvay@gmail.com>
Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
---
arch/arm64/kernel/cpu_errata.c | 12 ++++++++++++
arch/arm64/kernel/cpufeature.c | 12 ++++++++++++
2 files changed, 24 insertions(+)
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index e0c094025..bc91bc13b 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -288,6 +288,18 @@ static const struct midr_range apple_cpus[] = {
MIDR_ALL_VERSIONS(MIDR_APPLE_M2_AVALANCHE_PRO),
MIDR_ALL_VERSIONS(MIDR_APPLE_M2_BLIZZARD_MAX),
MIDR_ALL_VERSIONS(MIDR_APPLE_M2_AVALANCHE_MAX),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_SAWTOOTH),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_EVEREST),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_SAWTOOTH_PRO),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_EVEREST_PRO),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_SAWTOOTH_MAX),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_EVEREST_MAX),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M4_DONAN_ECORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M4_DONAN_PCORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_A18_PRO_TAHITI_ECORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_A18_PRO_TAHITI_PCORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M5_PRO_SOTRA_MCORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M5_PRO_SOTRA_PCORE),
{},
};
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 3ae3ad1a1..bb82b80b3 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -2357,6 +2357,18 @@ static bool can_trap_icv_dir_el1(const struct arm64_cpu_capabilities *entry,
MIDR_ALL_VERSIONS(MIDR_APPLE_M2_AVALANCHE_PRO),
MIDR_ALL_VERSIONS(MIDR_APPLE_M2_BLIZZARD_MAX),
MIDR_ALL_VERSIONS(MIDR_APPLE_M2_AVALANCHE_MAX),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_SAWTOOTH),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_EVEREST),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_SAWTOOTH_PRO),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_EVEREST_PRO),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_SAWTOOTH_MAX),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M3_EVEREST_MAX),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M4_DONAN_ECORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M4_DONAN_PCORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_A18_PRO_TAHITI_ECORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_A18_PRO_TAHITI_PCORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M5_PRO_SOTRA_MCORE),
+ MIDR_ALL_VERSIONS(MIDR_APPLE_M5_PRO_SOTRA_PCORE),
{},
};
struct arm_smccc_res res = {};
--
2.56.0
next prev parent reply other threads:[~2026-10-20 23:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 23:53 [PATCH v2 0/2] arm64: Add KVM support for newer Apple Silicon CPUs Michael Reeves via B4 Relay
2026-10-20 23:53 ` [PATCH v2 1/2] arm64: Add CPU part numbers " Michael Reeves via B4 Relay
2026-11-04 16:29 ` Catalin Marinas
2026-10-20 23:53 ` Michael Reeves via B4 Relay [this message]
2026-11-04 16:29 ` [PATCH v2 2/2] arm64: Apply existing Apple Silicon CPU workarounds to newer CPUs Catalin Marinas
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=20261021-apple-m3-m4-kvm-v2-2-04905152cc2a@gmail.com \
--to=devnull+michael.reeves077.gmail.com@kernel.org \
--cc=asahi@lists.linux.dev \
--cc=catalin.marinas@arm.com \
--cc=fuad.tabba@linux.dev \
--cc=j@jannau.net \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=michael.reeves077@gmail.com \
--cc=myrialsarvay@gmail.com \
--cc=neal@gompa.dev \
--cc=oupton@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=sven@kernel.org \
--cc=will@kernel.org \
--cc=yureka@cyberchaos.dev \
--cc=yuzenghui@huawei.com \
/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
all inboxes | Powered by JetHome®