From: sashiko-bot@kernel.org
To: "Michael Reeves" <michael.reeves077@gmail.com>
Cc: "Marc Zyngier" <maz@kernel.org>,
kvmarm@lists.linux.dev, "Oliver Upton" <oupton@kernel.org>
Subject: Re: [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4
Date: Thu, 08 Oct 2026 12:25:46 +0000 [thread overview]
Message-ID: <sashiko-outbox-164141@kernel.org> (raw)
In-Reply-To: <20261008-apple-m3-m4-kvm-v1-2-7bb4cbf3d63b@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] arm64: missing M3 and M4 from has_vgic_v3 KVM capability array
--
commit adcc2ca70d0cb38584f5c01ccf8a91f249b43c44
Author: Michael Reeves <michael.reeves077@gmail.com>
arm64: Apply existing Apple CPU workarounds to M3 and M4
Add M3, M3 Pro, M3 Max and base M4 to apple_cpus so they receive the
existing PMU trap and broken SEIS workarounds needed by KVM.
> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index e0c09402540ce..8a7703b86f3ef 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -288,6 +288,14 @@ 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),
> {},
> };
[Severity: High]
Does this commit also need to update the has_vgic_v3 array in
can_trap_icv_dir_el1() in arch/arm64/kernel/cpufeature.c with these M3 and M4
MIDRs?
Because Apple SoCs use AIC instead of a standard physical GIC, they lack the
ARM64_HAS_GICV3_CPUIF CPU capability. To use the hardware vGIC's TDIR (Trap
DIR) feature on Apple Silicon, KVM relies on the has_vgic_v3 array in
can_trap_icv_dir_el1().
Since M3 and M4 are omitted from has_vgic_v3, can_trap_icv_dir_el1() returns
false on M3 and M4, clearing the ARM64_HAS_ICH_HCR_EL2_TDIR capability.
When this capability is missing, KVM's fallback path in
kvm_compute_ich_hcr_trap_bits() forces common_trap = true (setting the
ICH_HCR_EL2.TC bit). This traps all guest GICv3 system register accesses to
EL2 for software emulation, causing a catastrophic performance degradation
for interrupt-heavy virtualization workloads.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261008-apple-m3-m4-kvm-v1-0-7bb4cbf3d63b@gmail.com?part=2
next prev parent reply other threads:[~2026-10-08 12:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 12:15 [PATCH 0/2] arm64: Add support for Apple M3 and M4 CPUs in KVM Michael Reeves via B4 Relay
2026-10-08 12:15 ` Michael Reeves
2026-10-08 12:15 ` [PATCH 1/2] arm64: Add Apple M3 and M4 CPU part numbers Michael Reeves via B4 Relay
2026-10-08 12:15 ` Michael Reeves
2026-10-08 12:15 ` [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4 Michael Reeves via B4 Relay
2026-10-08 12:15 ` Michael Reeves
2026-10-08 12:25 ` sashiko-bot [this message]
2026-10-08 13:19 ` Marc Zyngier
2026-10-09 0:03 ` Michael Reeves
2026-10-09 8:16 ` Marc Zyngier
2026-10-10 10:54 ` Myria Sarvay
2026-10-10 11:10 ` Marc Zyngier
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=sashiko-outbox-164141@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=michael.reeves077@gmail.com \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.