* [PATCH 0/2] arm64: Add support for Apple M3 and M4 CPUs in KVM
@ 2026-10-08 12:15 Michael Reeves via B4 Relay
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 ` [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4 Michael Reeves via B4 Relay
0 siblings, 2 replies; 6+ messages in thread
From: Michael Reeves via B4 Relay @ 2026-10-08 12:15 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, Catalin Marinas, Will Deacon, Mark Rutland
Cc: Myria Sarvay, Yureka Lilian, Fuad Tabba, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, linux-arm-kernel,
kvmarm, Sven Peter, Janne Grunau, Neal Gompa, asahi,
linux-kernel, Michael Reeves
Hi,
This series enables KVM support on Apple Silicon M3 series and base M4
CPUs.
The first patch adds the part numbers and MIDR definitions for M3
(base, Pro and Max) and base M4 CPU cores.
The second patch adds these CPUs to the existing Apple CPU workarounds
list, which is required for KVM to function correctly.
This series was developed from testing on:
- Apple M3 and M3 Pro by Michael Reeves
- Apple M3 Max by Myria Sarvay and Yureka Lilian
- Apple M4 by Yureka Lilian
---
Michael Reeves (1):
arm64: Apply existing Apple CPU workarounds to M3 and M4
Myria Sarvay (1):
arm64: Add Apple M3 and M4 CPU part numbers
arch/arm64/include/asm/cputype.h | 16 ++++++++++++++++
arch/arm64/kernel/cpu_errata.c | 8 ++++++++
2 files changed, 24 insertions(+)
---
base-commit: a90ee4305c4a5df72c11b31dacfdc76e00fcf78a
change-id: 20261008-apple-m3-m4-kvm-b7b9b2e34bcd
Best regards,
--
Michael Reeves <michael.reeves077@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] arm64: Add Apple M3 and M4 CPU part numbers
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 via B4 Relay
2026-10-08 12:15 ` [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4 Michael Reeves via B4 Relay
1 sibling, 0 replies; 6+ messages in thread
From: Michael Reeves via B4 Relay @ 2026-10-08 12:15 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, Catalin Marinas, Will Deacon, Mark Rutland
Cc: Myria Sarvay, Yureka Lilian, Fuad Tabba, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, linux-arm-kernel,
kvmarm, Sven Peter, Janne Grunau, Neal Gompa, asahi,
linux-kernel, Michael Reeves
From: Myria Sarvay <myrialsarvay@gmail.com>
Add CPU part numbers and MIDR definitions for M3, M3 Pro, M3 Max and
base M4 so CPU workarounds can identify these cores.
Separate M4 core codenames are not known, so use the SoC codename with
ECORE and PCORE suffixes.
Signed-off-by: Myria Sarvay <myrialsarvay@gmail.com>
Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
---
arch/arm64/include/asm/cputype.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index 1fa29616e..ca44c354c 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -155,6 +155,14 @@
#define APPLE_CPU_PART_M2_AVALANCHE_PRO 0x035
#define APPLE_CPU_PART_M2_BLIZZARD_MAX 0x038
#define APPLE_CPU_PART_M2_AVALANCHE_MAX 0x039
+#define APPLE_CPU_PART_M3_SAWTOOTH 0x042
+#define APPLE_CPU_PART_M3_EVEREST 0x043
+#define APPLE_CPU_PART_M3_SAWTOOTH_PRO 0x044
+#define APPLE_CPU_PART_M3_EVEREST_PRO 0x045
+#define APPLE_CPU_PART_M3_SAWTOOTH_MAX 0x048
+#define APPLE_CPU_PART_M3_EVEREST_MAX 0x049
+#define APPLE_CPU_PART_M4_DONAN_ECORE 0x052
+#define APPLE_CPU_PART_M4_DONAN_PCORE 0x053
#define AMPERE_CPU_PART_AMPERE1 0xAC3
#define AMPERE_CPU_PART_AMPERE1A 0xAC4
@@ -250,6 +258,14 @@
#define MIDR_APPLE_M2_AVALANCHE_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_AVALANCHE_PRO)
#define MIDR_APPLE_M2_BLIZZARD_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_BLIZZARD_MAX)
#define MIDR_APPLE_M2_AVALANCHE_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_AVALANCHE_MAX)
+#define MIDR_APPLE_M3_SAWTOOTH MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M3_SAWTOOTH)
+#define MIDR_APPLE_M3_EVEREST MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M3_EVEREST)
+#define MIDR_APPLE_M3_SAWTOOTH_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M3_SAWTOOTH_PRO)
+#define MIDR_APPLE_M3_EVEREST_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M3_EVEREST_PRO)
+#define MIDR_APPLE_M3_SAWTOOTH_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M3_SAWTOOTH_MAX)
+#define MIDR_APPLE_M3_EVEREST_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M3_EVEREST_MAX)
+#define MIDR_APPLE_M4_DONAN_ECORE MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M4_DONAN_ECORE)
+#define MIDR_APPLE_M4_DONAN_PCORE MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M4_DONAN_PCORE)
#define MIDR_AMPERE1 MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1)
#define MIDR_AMPERE1A MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1A)
#define MIDR_MICROSOFT_AZURE_COBALT_100 MIDR_CPU_MODEL(ARM_CPU_IMP_MICROSOFT, MICROSOFT_CPU_PART_AZURE_COBALT_100)
--
2.56.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4
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 ` [PATCH 1/2] arm64: Add Apple M3 and M4 CPU part numbers Michael Reeves via B4 Relay
@ 2026-10-08 12:15 ` Michael Reeves via B4 Relay
2026-10-08 13:19 ` Marc Zyngier
1 sibling, 1 reply; 6+ messages in thread
From: Michael Reeves via B4 Relay @ 2026-10-08 12:15 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, Catalin Marinas, Will Deacon, Mark Rutland
Cc: Myria Sarvay, Yureka Lilian, Fuad Tabba, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, linux-arm-kernel,
kvmarm, Sven Peter, Janne Grunau, Neal Gompa, asahi,
linux-kernel, Michael Reeves
From: Michael Reeves <michael.reeves077@gmail.com>
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.
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 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index e0c094025..8a7703b86 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),
{},
};
--
2.56.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4
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 13:19 ` Marc Zyngier
2026-10-09 0:03 ` Michael Reeves
0 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2026-10-08 13:19 UTC (permalink / raw)
To: michael.reeves077
Cc: Oliver Upton, Catalin Marinas, Will Deacon, Mark Rutland,
Myria Sarvay, Yureka Lilian, Fuad Tabba, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, linux-arm-kernel,
kvmarm, Sven Peter, Janne Grunau, Neal Gompa, asahi,
linux-kernel
Hi Michael,
On Thu, 08 Oct 2026 13:15:41 +0100,
Michael Reeves via B4 Relay <devnull+michael.reeves077.gmail.com@kernel.org> wrote:
>
> From: Michael Reeves <michael.reeves077@gmail.com>
>
> 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.
>
How have you established that these CPUs suffer from the same SEIS
erratum? I'm all for working around bugs, but I'd like to make sure
the new fancy stuff is indeed just as broken as the old shit...
For the record, the EDKII build in the QEMU EFI package that was in
part of Debian Bullseye was able to trigger the bug semi reliably
(series of writes to ICC_EOIR1_EL1 for interrupts that were never
active). This happens on handover to the guest kernel.
I can provide the binary (and a few scripts) to test this easily.
Should they have been fixed, we can always create a second
implementation list to cover the PMU.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4
2026-10-08 13:19 ` Marc Zyngier
@ 2026-10-09 0:03 ` Michael Reeves
2026-10-09 8:16 ` Marc Zyngier
0 siblings, 1 reply; 6+ messages in thread
From: Michael Reeves @ 2026-10-09 0:03 UTC (permalink / raw)
To: Marc Zyngier
Cc: Oliver Upton, Catalin Marinas, Will Deacon, Mark Rutland,
Myria Sarvay, Yureka Lilian, Fuad Tabba, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, linux-arm-kernel,
kvmarm, Sven Peter, Janne Grunau, Neal Gompa, asahi,
linux-kernel
Hi Marc,
> How have you established that these CPUs suffer from the same SEIS
> erratum? I'm all for working around bugs, but I'd like to make sure
> the new fancy stuff is indeed just as broken as the old shit...
We tested both the PMU and SEIS fixes together (as in 7.3, both fixes were
combined into just the one apple_cpu list). It's probably a good idea to test
them in isolation, thanks.
> For the record, the EDKII build in the QEMU EFI package that was in
> part of Debian Bullseye was able to trigger the bug semi reliably
> (series of writes to ICC_EOIR1_EL1 for interrupts that were never
> active). This happens on handover to the guest kernel.
>
> I can provide the binary (and a few scripts) to test this easily.
> Should they have been fixed, we can always create a second
> implementation list to cover the PMU.
Can you please send that so we can try? That would be much
appreciated, thank you.
Thanks,
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] arm64: Apply existing Apple CPU workarounds to M3 and M4
2026-10-09 0:03 ` Michael Reeves
@ 2026-10-09 8:16 ` Marc Zyngier
0 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2026-10-09 8:16 UTC (permalink / raw)
To: Michael Reeves
Cc: Oliver Upton, Catalin Marinas, Will Deacon, Mark Rutland,
Myria Sarvay, Yureka Lilian, Fuad Tabba, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, linux-arm-kernel,
kvmarm, Sven Peter, Janne Grunau, Neal Gompa, asahi,
linux-kernel
On Fri, 09 Oct 2026 01:03:57 +0100,
Michael Reeves <michael.reeves077@gmail.com> wrote:
>
> > I can provide the binary (and a few scripts) to test this easily.
> > Should they have been fixed, we can always create a second
> > implementation list to cover the PMU.
>
> Can you please send that so we can try? That would be much
> appreciated, thank you.
I've sent you (and Yureka) details over IRC. If you need help with
setting things up, let me know directly.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-09 8:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 1/2] arm64: Add Apple M3 and M4 CPU part numbers Michael Reeves via B4 Relay
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 13:19 ` Marc Zyngier
2026-10-09 0:03 ` Michael Reeves
2026-10-09 8:16 ` Marc Zyngier
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®