* [PATCH v3 0/5] arm64: Add workarounds for FUJITSU-MONAKA CPU
@ 2026-11-19 9:04 Tomohiro Misono
2026-11-19 9:04 ` [PATCH v3 1/5] arm64: cputype: Add FUJITSU MONAKA definition Tomohiro Misono
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Tomohiro Misono @ 2026-11-19 9:04 UTC (permalink / raw)
To: Tomohiro Misono, Catalin Marinas, Will Deacon, Mark Rutland,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Marc Zyngier,
Thomas Gleixner, Radu Rendec, Oliver Upton, Fuad Tabba,
Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
Vladimir Murzin
Cc: Kohei Enju, linux-arm-kernel, linux-kernel, linux-doc,
linux-perf-users, kvmarm
This series adds workarounds for the FUJITSU-MONAKA CPU.
Unfortunately, another erratum has been found since v2 and
I added patch 5 for this new workaround.
- Patch 1 ... Add the FUJITSU-MONAKA CPU type definition
- Patch 2 ... Add a workaround for TLBI operation
- Patch 3 ... Add a workaround for perf operation
- Patch 4 ... Add a workaround for GIC operation
- Patch 5 ... Add a workaround for WFE operation
Although these workarounds do not depend on each other functionally,
I have combined them into one series because patch 2-5
use the CPU type definition added by the first patch,
and all the workarounds update silicon-errata.rst.
If preferred, I will resend them as separate patches.
Best Regards,
Tomohiro Misono
Changes in v3:
- Add new workaround for WFE as patch 5
- Address review comments in patch 2-4.
Especially now patch 2 disables TLBI range operations on MONAKA CPU.
See each commits for the details
- Add Acked-by by Mark in patch 1
- Rebased on 7.4-rc3
- Link to v2: https://lore.kernel.org/r/20261016-monaka-fix-for-upstream-v2-0-fc7ede7f9f48@fujitsu.com
Changes in v2:
- Address review comments in patch 2-4. See each commits for the details
- rebased on 7.3-rc7
- Link to v1: https://lore.kernel.org/r/20261002-monaka-fix-for-upstream-v1-0-4aec0b0cbe34@fujitsu.com
Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
---
Kohei Enju (1):
irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003
Tomohiro Misono (4):
arm64: cputype: Add FUJITSU MONAKA definition
arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001
perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002
arm64: Add workaround to replace WFE with NOP for FUJITSU-MONAKA Erratum E#030004
Documentation/arch/arm64/silicon-errata.rst | 8 ++++
arch/arm64/Kconfig | 58 +++++++++++++++++++++++++++++
arch/arm64/include/asm/assembler.h | 4 ++
arch/arm64/include/asm/barrier.h | 3 +-
arch/arm64/include/asm/cmpxchg.h | 4 +-
arch/arm64/include/asm/cpucaps.h | 6 +++
arch/arm64/include/asm/cputype.h | 2 +
arch/arm64/kernel/cpu_errata.c | 32 ++++++++++++++++
arch/arm64/kernel/cpufeature.c | 11 +++++-
arch/arm64/kvm/sys_regs.c | 8 ++++
arch/arm64/tools/cpucaps | 3 ++
drivers/irqchip/irq-gic-v3.c | 35 +++++++++++++++++
drivers/perf/arm_pmu.c | 13 +++++++
13 files changed, 183 insertions(+), 4 deletions(-)
---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261002-monaka-fix-for-upstream-680801dea92f
Best regards,
--
Tomohiro Misono <misono.tomohiro@fujitsu.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/5] arm64: cputype: Add FUJITSU MONAKA definition
2026-11-19 9:04 [PATCH v3 0/5] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
@ 2026-11-19 9:04 ` Tomohiro Misono
2026-11-19 9:09 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 2/5] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001 Tomohiro Misono
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Tomohiro Misono @ 2026-11-19 9:04 UTC (permalink / raw)
To: Tomohiro Misono, Catalin Marinas, Will Deacon, Mark Rutland,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Marc Zyngier,
Thomas Gleixner, Radu Rendec, Oliver Upton, Fuad Tabba,
Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
Vladimir Murzin
Cc: Kohei Enju, linux-arm-kernel, linux-kernel, linux-doc,
linux-perf-users, kvmarm
Add cpu part definition for FUJITSU-MONAKA.
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
---
arch/arm64/include/asm/cputype.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index 6002d1d5f55f..fff0f460f43f 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -139,6 +139,7 @@
#define NVIDIA_CPU_PART_RIGEL 0x011
#define FUJITSU_CPU_PART_A64FX 0x001
+#define FUJITSU_CPU_PART_MONAKA 0x003
#define HISI_CPU_PART_TSV110 0xD01
#define HISI_CPU_PART_HIP09 0xD02
@@ -237,6 +238,7 @@
#define MIDR_NVIDIA_OLYMPUS MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_OLYMPUS)
#define MIDR_NVIDIA_RIGEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_RIGEL)
#define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX)
+#define MIDR_FUJITSU_MONAKA MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_MONAKA)
#define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110)
#define MIDR_HISI_HIP09 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP09)
#define MIDR_HISI_HIP12 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP12)
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/5] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001
2026-11-19 9:04 [PATCH v3 0/5] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
2026-11-19 9:04 ` [PATCH v3 1/5] arm64: cputype: Add FUJITSU MONAKA definition Tomohiro Misono
@ 2026-11-19 9:04 ` Tomohiro Misono
2026-11-19 9:30 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 3/5] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002 Tomohiro Misono
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Tomohiro Misono @ 2026-11-19 9:04 UTC (permalink / raw)
To: Tomohiro Misono, Catalin Marinas, Will Deacon, Mark Rutland,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Marc Zyngier,
Thomas Gleixner, Radu Rendec, Oliver Upton, Fuad Tabba,
Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
Vladimir Murzin
Cc: Kohei Enju, linux-arm-kernel, linux-kernel, linux-doc,
linux-perf-users, kvmarm
FUJITSU-MONAKA Erratum E#030001 affects FUJITSU-MONAKA CPU
when using TLBI range operations.
On affected FUJITSU-MONAKA CPUs, range-based TLBI operations
targeting a VA or IPA may fail to invalidate TLB entries when
addr[34:29] == all 1 && addr[28:0] == 0 for 512MB mappings.
The affected instructions are:
RVA[L]E{1,2,3}*, RVAA[L]E1*, and RIPAS2[L]E1*.
Work around the erratum by disabling TLB range operations on
both host and guest.
Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
---
Changes in v3:
- rework patch to disable TLB range operations on both host and guest
- use ERRATA_MIDR_ALL_VERSIONS macro
---
Documentation/arch/arm64/silicon-errata.rst | 2 ++
arch/arm64/Kconfig | 18 ++++++++++++++++++
arch/arm64/include/asm/cpucaps.h | 2 ++
arch/arm64/kernel/cpu_errata.c | 7 +++++++
arch/arm64/kernel/cpufeature.c | 11 ++++++++++-
arch/arm64/kvm/sys_regs.c | 8 ++++++++
arch/arm64/tools/cpucaps | 1 +
7 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index dc4144ac895b..bd9ac993495b 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -393,6 +393,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 |
+----------------+-----------------+-----------------+-----------------------------+
+| Fujitsu | MONAKA | E#030001 | FUJITSU_ERRATUM_030001 |
++----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| ASR | ASR8601 | #8601001 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9b08b2457a55..8a0c94a0c879 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1384,6 +1384,24 @@ config FUJITSU_ERRATUM_010001
If unsure, say Y.
+config FUJITSU_ERRATUM_030001
+ bool "FUJITSU-MONAKA erratum E#030001: Range TLBI may fail to invalidate some entries"
+ default y
+ help
+ This option adds a workaround for FUJITSU-MONAKA erratum E#030001.
+ On affected FUJITSU-MONAKA CPUs, range-based TLBI operation
+ targeting a VA or IPA may fail to invalidate some TLB entries
+ when hugepage is used in a certain condition. The affected
+ instructions are RVA[L]E{1,2,3}*, RVAA[L]E1*, and RIPAS2[L]E1*
+ and this affects on both S1 and S2 tables.
+
+ Work around the erratum by disabling TLB range operations on both
+ host and guest.
+
+ The erratum only affects the FUJITSU-MONAKA.
+
+ If unsure, say Y.
+
config HISILICON_ERRATUM_161600802
bool "Hip07 161600802: Erroneous redistributor VLPI base"
default y
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index 0c3bfbe99aad..7c73a739eee1 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -68,6 +68,8 @@ cpucap_is_possible(const unsigned int cap)
return IS_ENABLED(CONFIG_ARM64_ERRATUM_4193714);
case ARM64_WORKAROUND_NXP_ERR050104:
return IS_ENABLED(CONFIG_NXP_IMX8QM_ERRATUM_ERR050104);
+ case ARM64_WORKAROUND_FUJITSU_030001:
+ return IS_ENABLED(CONFIG_FUJITSU_ERRATUM_030001);
case ARM64_MPAM:
/*
* KVM MPAM support doesn't rely on the host kernel supporting MPAM.
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index ca31d33152e9..c8a0ea73ec1a 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -1096,6 +1096,13 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
.matches = has_impdef_pmuv3,
.cpu_enable = cpu_enable_impdef_pmuv3_traps,
},
+#ifdef CONFIG_FUJITSU_ERRATUM_030001
+ {
+ .desc = "FUJITSU-MONAKA Erratum E#030001",
+ .capability = ARM64_WORKAROUND_FUJITSU_030001,
+ ERRATA_MIDR_ALL_VERSIONS(MIDR_FUJITSU_MONAKA),
+ },
+#endif
{
.desc = "Known broken GICv3 SEIS implementation",
.capability = ARM64_WORKAROUND_GICv3_BROKEN_SEIS,
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index c9c9a6889455..097d283169a0 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1662,6 +1662,15 @@ static bool has_cache_dic(const struct arm64_cpu_capabilities *entry,
return ctr & BIT(CTR_EL0_DIC_SHIFT);
}
+static bool has_tlb_range(const struct arm64_cpu_capabilities *entry,
+ int scope)
+{
+ if (cpus_have_cap(ARM64_WORKAROUND_FUJITSU_030001))
+ return false;
+
+ return has_cpuid_feature(entry, scope);
+}
+
static bool __maybe_unused
has_useable_cnp(const struct arm64_cpu_capabilities *entry, int scope)
{
@@ -2638,7 +2647,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
.desc = "TLB range maintenance instructions",
.capability = ARM64_HAS_TLB_RANGE,
.type = ARM64_CPUCAP_SYSTEM_FEATURE,
- .matches = has_cpuid_feature,
+ .matches = has_tlb_range,
ARM64_CPUID_FIELDS(ID_AA64ISAR0_EL1, TLB, RANGE)
},
#ifdef CONFIG_ARM64_HW_AFDBM
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index c7d91138a6d4..2e8965b7702e 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -1949,6 +1949,14 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
case SYS_ID_AA64PFR2_EL1:
val = sanitise_id_aa64pfr2_el1(vcpu, val);
break;
+ case SYS_ID_AA64ISAR0_EL1:
+ if (cpus_have_final_cap(ARM64_WORKAROUND_FUJITSU_030001)) {
+ /* disable TLBI range operatoins on guest */
+ val &= ~ID_AA64ISAR0_EL1_TLB_MASK;
+ val |= SYS_FIELD_PREP(ID_AA64ISAR0_EL1, TLB,
+ ID_AA64ISAR0_EL1_TLB_OS);
+ }
+ break;
case SYS_ID_AA64ISAR1_EL1:
if (!vcpu_has_ptrauth(vcpu))
val &= ~(ID_AA64ISAR1_EL1_APA |
diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps
index 3125695122a0..1a199502614d 100644
--- a/arch/arm64/tools/cpucaps
+++ b/arch/arm64/tools/cpucaps
@@ -134,3 +134,4 @@ WORKAROUND_SPECULATIVE_SSBS
WORKAROUND_SPECULATIVE_UNPRIV_LOAD
WORKAROUND_BROKEN_AMU_CONSTCNT
WORKAROUND_BROKEN_AMU_CORECNT
+WORKAROUND_FUJITSU_030001
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 3/5] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002
2026-11-19 9:04 [PATCH v3 0/5] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
2026-11-19 9:04 ` [PATCH v3 1/5] arm64: cputype: Add FUJITSU MONAKA definition Tomohiro Misono
2026-11-19 9:04 ` [PATCH v3 2/5] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001 Tomohiro Misono
@ 2026-11-19 9:04 ` Tomohiro Misono
2026-11-19 9:16 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 4/5] irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003 Tomohiro Misono
2026-11-19 9:04 ` [PATCH v3 5/5] arm64: Add workaround to replace WFE with NOP for FUJITSU-MONAKA Erratum E#030004 Tomohiro Misono
4 siblings, 1 reply; 11+ messages in thread
From: Tomohiro Misono @ 2026-11-19 9:04 UTC (permalink / raw)
To: Tomohiro Misono, Catalin Marinas, Will Deacon, Mark Rutland,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Marc Zyngier,
Thomas Gleixner, Radu Rendec, Oliver Upton, Fuad Tabba,
Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
Vladimir Murzin
Cc: Kohei Enju, linux-arm-kernel, linux-kernel, linux-doc,
linux-perf-users, kvmarm
FUJITSU-MONAKA Erratum E#030002 affects FUJITSU-MONAKA CPU.
On affected FUJITSU-MONAKA CPUs, after a PMU event counter is
stopped at a value just before overflow, an overflow might still
be incorrectly detected, resulting interrupt storm in some case.
For example, if the following conditions are met:
1) Running perf to count an event in user space only
2) The event can also occur in kernel space
3) The counter value is set just before the overflow
(when using the -F option, initial counter value is -1)
when the kernel is about to return to user space after enabling
the count, an overflow interrupt is incorrectly triggered by an
event that occurred in kernel space. Since the counter value is
not updated (correctly), the interrupt handler does nothing and
returns with the same condition. This leads to another wrong interrupt
and results in an interrupt storm and eventually a softlockup.
Work around the erratum by avoiding programming PMU event counters
with values within 7 counts of overflow because the counter
can increase up to 7 at a time.
Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
---
Changes in v3:
- use ERRATA_MIDR_ALL_VERSIONS macro
- Correct the maximum number of increments at a time from 5 to 7,
since it was found that micro-op fusion can increase the number
of evetns counted at a time for certain events.
---
Documentation/arch/arm64/silicon-errata.rst | 2 ++
arch/arm64/Kconfig | 18 ++++++++++++++++++
arch/arm64/include/asm/cpucaps.h | 2 ++
arch/arm64/kernel/cpu_errata.c | 7 +++++++
arch/arm64/tools/cpucaps | 1 +
drivers/perf/arm_pmu.c | 13 +++++++++++++
6 files changed, 43 insertions(+)
diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index bd9ac993495b..65bbdaf1f925 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -395,6 +395,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| Fujitsu | MONAKA | E#030001 | FUJITSU_ERRATUM_030001 |
+----------------+-----------------+-----------------+-----------------------------+
+| Fujitsu | MONAKA | E#030002 | FUJITSU_ERRATUM_030002 |
++----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| ASR | ASR8601 | #8601001 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 8a0c94a0c879..5a2758ad3ab0 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1402,6 +1402,24 @@ config FUJITSU_ERRATUM_030001
If unsure, say Y.
+config FUJITSU_ERRATUM_030002
+ bool "FUJITSU-MONAKA erratum E#030002: PMU overflow may be incorrectly detected"
+ depends on ARM_PMUV3
+ default y
+ help
+ This option adds a workaround for FUJITSU-MONAKA erratum E#030002.
+ On affected FUJITSU-MONAKA CPUs, after a PMU event counter is
+ stopped at a value just before overflow, an overflow might still
+ be incorrectly detected, resulting interrupt storm in some case.
+
+ Work around the erratum by avoiding programming PMU event counters
+ with values within seven counts of overflow because the counter
+ can increase up to 7 at a time.
+
+ The workaround only affects the FUJITSU-MONAKA.
+
+ If unsure, say Y.
+
config HISILICON_ERRATUM_161600802
bool "Hip07 161600802: Erroneous redistributor VLPI base"
default y
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index 7c73a739eee1..f4aa6bd257c5 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -70,6 +70,8 @@ cpucap_is_possible(const unsigned int cap)
return IS_ENABLED(CONFIG_NXP_IMX8QM_ERRATUM_ERR050104);
case ARM64_WORKAROUND_FUJITSU_030001:
return IS_ENABLED(CONFIG_FUJITSU_ERRATUM_030001);
+ case ARM64_WORKAROUND_FUJITSU_030002:
+ return IS_ENABLED(CONFIG_FUJITSU_ERRATUM_030002);
case ARM64_MPAM:
/*
* KVM MPAM support doesn't rely on the host kernel supporting MPAM.
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index c8a0ea73ec1a..37bbe8268499 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -1102,6 +1102,13 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
.capability = ARM64_WORKAROUND_FUJITSU_030001,
ERRATA_MIDR_ALL_VERSIONS(MIDR_FUJITSU_MONAKA),
},
+#endif
+#ifdef CONFIG_FUJITSU_ERRATUM_030002
+ {
+ .desc = "FUJITSU-MONAKA Erratum E#030002",
+ .capability = ARM64_WORKAROUND_FUJITSU_030002,
+ ERRATA_MIDR_ALL_VERSIONS(MIDR_FUJITSU_MONAKA),
+ },
#endif
{
.desc = "Known broken GICv3 SEIS implementation",
diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps
index 1a199502614d..73a4aeb535a0 100644
--- a/arch/arm64/tools/cpucaps
+++ b/arch/arm64/tools/cpucaps
@@ -135,3 +135,4 @@ WORKAROUND_SPECULATIVE_UNPRIV_LOAD
WORKAROUND_BROKEN_AMU_CONSTCNT
WORKAROUND_BROKEN_AMU_CORECNT
WORKAROUND_FUJITSU_030001
+WORKAROUND_FUJITSU_030002
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 115069565389..bbf9f3a52adf 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -234,6 +234,19 @@ int armpmu_event_set_period(struct perf_event *event)
if (left > (max_period >> 1))
left = (max_period >> 1);
+#if IS_ENABLED(CONFIG_ARM64)
+ if (alternative_has_cap_unlikely(ARM64_WORKAROUND_FUJITSU_030002)) {
+ /*
+ * Due to the errata, overflow might be incorrectly detected in the handler
+ * when the counter is about to overflow in a single increment, resulting
+ * interrupt storm in some case. As the counter can increase by up to
+ * 7 at a time, set 8 here to prevent the condition.
+ */
+ if (left > 0 && left < 8)
+ left = 8;
+ }
+#endif
+
local64_set(&hwc->prev_count, (u64)-left);
armpmu->write_counter(event, (u64)(-left) & max_period);
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 4/5] irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003
2026-11-19 9:04 [PATCH v3 0/5] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
` (2 preceding siblings ...)
2026-11-19 9:04 ` [PATCH v3 3/5] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002 Tomohiro Misono
@ 2026-11-19 9:04 ` Tomohiro Misono
2026-11-19 9:21 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 5/5] arm64: Add workaround to replace WFE with NOP for FUJITSU-MONAKA Erratum E#030004 Tomohiro Misono
4 siblings, 1 reply; 11+ messages in thread
From: Tomohiro Misono @ 2026-11-19 9:04 UTC (permalink / raw)
To: Tomohiro Misono, Catalin Marinas, Will Deacon, Mark Rutland,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Marc Zyngier,
Thomas Gleixner, Radu Rendec, Oliver Upton, Fuad Tabba,
Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
Vladimir Murzin
Cc: Kohei Enju, linux-arm-kernel, linux-kernel, linux-doc,
linux-perf-users, kvmarm
From: Kohei Enju <enju.kohei@fujitsu.com>
On affected FUJITSU-MONAKA CPUs, the erratum may occur when an SGI is
generated by writing to ICC_SGI0R_EL1, ICC_SGI1R_EL1, or ICC_ASGI1R_EL1,
if the operation races with CPU interface processing triggered by the
arrival of a higher-priority interrupt, an update to a pending
interrupt, or a transition of the PE to the Sleep state. When the
erratum occurs, the SGI is lost and the system register write does not
complete, causing the issuing core to hang.
Guest accesses to these registers are not affected by this erratum, as
they are trapped to EL2 and handled without issuing the affected system
register write.
Work around the erratum by writing 1 to the bit corresponding to the
target SGI INTID in GICR_ISPENDR0 of each target PE's GIC Redistributor,
instead of writing to the affected system registers.
Accessing a target PE's GICR_ISPENDR0 requires its Redistributor base to
have been discovered. Affected platforms conform to SBBR, which requires
PSCI for secondary CPU boot. They therefore do not use the ACPI Parking
protocol, which sends an IPI before the secondary CPU has initialized
its Redistributor. With PSCI, a secondary CPU discovers its
Redistributor before becoming an IPI target.
Signed-off-by: Kohei Enju <enju.kohei@fujitsu.com>
Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
---
Changes in v3:
- Remove the unnecessary DSB after writes to GICR_ISPENDR0.
- Fix build issue when CONFIG_ARM=y.
- Add an SoB of Tomohiro.
Changes in v2:
- Clarify the erratum description and document that virtual accesses are
unaffected.
- Remove the gic_send_sgi_via_rdist() helper.
- Remove the write-count rationale.
- Use the CPU MIDR instead of the SoC ID for filtering.
---
Documentation/arch/arm64/silicon-errata.rst | 2 ++
drivers/irqchip/irq-gic-v3.c | 35 +++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index 65bbdaf1f925..df57078d3727 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -397,6 +397,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| Fujitsu | MONAKA | E#030002 | FUJITSU_ERRATUM_030002 |
+----------------+-----------------+-----------------+-----------------------------+
+| Fujitsu | MONAKA GICv3/v4 | E#030003 | N/A |
++----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| ASR | ASR8601 | #8601001 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 94873646d46f..18f8b2b40543 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -80,6 +80,8 @@ static DEFINE_STATIC_KEY_FALSE(gic_nvidia_t241_erratum);
static DEFINE_STATIC_KEY_FALSE(gic_arm64_2941627_erratum);
+static DEFINE_STATIC_KEY_FALSE(gic_fujitsu_030003_erratum);
+
static struct gic_chip_data gic_data __read_mostly;
static DEFINE_STATIC_KEY_TRUE(supports_deactivate_key);
@@ -240,6 +242,9 @@ static DEFINE_PER_CPU(bool, has_rss);
#define gic_data_rdist() (this_cpu_ptr(gic_data.rdists.rdist))
#define gic_data_rdist_rd_base() (gic_data_rdist()->rd_base)
#define gic_data_rdist_sgi_base() (gic_data_rdist_rd_base() + SZ_64K)
+#define gic_data_rdist_cpu(cpu) (per_cpu_ptr(gic_data.rdists.rdist, cpu))
+#define gic_data_rdist_rd_base_cpu(cpu) (gic_data_rdist_cpu(cpu)->rd_base)
+#define gic_data_rdist_sgi_base_cpu(cpu) (gic_data_rdist_rd_base_cpu(cpu) + SZ_64K)
/* Our default, arbitrary priority value. Linux only uses one anyway. */
#define DEFAULT_PMR_VALUE 0xf0
@@ -1388,6 +1393,16 @@ static void gic_ipi_send_mask(struct irq_data *d, const struct cpumask *mask)
*/
dsb(ishst);
+ if (static_branch_unlikely(&gic_fujitsu_030003_erratum)) {
+ for_each_cpu(cpu, mask) {
+ void __iomem *base = gic_data_rdist_sgi_base_cpu(cpu);
+
+ writel_relaxed(BIT(d->hwirq), base + GICR_ISPENDR0);
+ }
+
+ return;
+ }
+
for_each_cpu(cpu, mask) {
u64 cluster_id = MPIDR_TO_SGI_CLUSTER_ID(gic_cpu_to_affinity(cpu));
u16 tlist;
@@ -1874,6 +1889,18 @@ static bool gic_enable_quirk_rk3399(void *data)
return false;
}
+#ifdef CONFIG_ARM64
+static bool gic_enable_quirk_fujitsu_030003(void *data)
+{
+ if (read_cpuid_implementor() != ARM_CPU_IMP_FUJITSU ||
+ read_cpuid_part_number() != FUJITSU_CPU_PART_MONAKA)
+ return false;
+
+ static_branch_enable(&gic_fujitsu_030003_erratum);
+ return true;
+}
+#endif
+
static bool rd_set_non_coherent(void *data)
{
struct gic_chip_data *d = data;
@@ -1954,6 +1981,14 @@ static const struct gic_quirk gic_quirks[] = {
.mask = 0xff000fff,
.init = gic_enable_quirk_rk3399,
},
+#ifdef CONFIG_ARM64
+ {
+ .desc = "GICv3: FUJITSU-MONAKA Erratum E#030003",
+ .iidr = 0x0403043b,
+ .mask = 0xffffffff,
+ .init = gic_enable_quirk_fujitsu_030003,
+ },
+#endif
{
}
};
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 5/5] arm64: Add workaround to replace WFE with NOP for FUJITSU-MONAKA Erratum E#030004
2026-11-19 9:04 [PATCH v3 0/5] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
` (3 preceding siblings ...)
2026-11-19 9:04 ` [PATCH v3 4/5] irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003 Tomohiro Misono
@ 2026-11-19 9:04 ` Tomohiro Misono
2026-11-19 9:19 ` sashiko-bot
4 siblings, 1 reply; 11+ messages in thread
From: Tomohiro Misono @ 2026-11-19 9:04 UTC (permalink / raw)
To: Tomohiro Misono, Catalin Marinas, Will Deacon, Mark Rutland,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Marc Zyngier,
Thomas Gleixner, Radu Rendec, Oliver Upton, Fuad Tabba,
Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
Vladimir Murzin
Cc: Kohei Enju, linux-arm-kernel, linux-kernel, linux-doc,
linux-perf-users, kvmarm
This option adds a workaround for FUJITSU-MONAKA erratum E#030004.
On affected CPUs, if a wake-up event generated by clearing the
global exclusive monitor or by a SEV instruction arrives in the
same cycle as a WFE instruction commits, the CPU may fail to
advance the program counter and re-execute the same WFE
instruction. If no further wake-up event occurs, the CPU may
remain waiting indefinitely (for example, in spinlock code).
This may cause a system hang before the generic timer event stream
is enabled. WFI, WFIT, and WFET instructions are not affected.
After the event stream is enabled (shortly after the secondary CPU
bring-up), event stream could wake up affected cores.
However, in order to prevent the condition during secondary CPU
bring-up, the workaround replaces all WFE instructions in host kernel
code with NOP using the boot alternative framework before the secondary
CPU bring-up on the MONAKA CPU.
Note that there is no need to take care of WFE usage in Host EL0 and
VHE Guest since if event stream is enabled in Host EL2, the event
reaches to every ELx & world. This effectively means FUJITSU-MONAKA
does not guarantee disabling event stream
(clocksource.arm_arch_timer.evtstrm=0) nor running nVHE guests
(kvm-arm.mode=nvhe/protected), although these configurations
are not rejected by this patch.
This only affects FUJITSU-MONAKA CPUs.
Assisted-by: LLM
Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
---
Changes in v3:
- New patch
- Note that wfe instruction used in nVHE spinlock code is
not updated since nVHE is out of scope of this patch as the
above commit message explains
---
Documentation/arch/arm64/silicon-errata.rst | 2 ++
arch/arm64/Kconfig | 22 ++++++++++++++++++++++
arch/arm64/include/asm/assembler.h | 4 ++++
arch/arm64/include/asm/barrier.h | 3 ++-
arch/arm64/include/asm/cmpxchg.h | 4 ++--
arch/arm64/include/asm/cpucaps.h | 2 ++
arch/arm64/kernel/cpu_errata.c | 18 ++++++++++++++++++
arch/arm64/tools/cpucaps | 1 +
8 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index df57078d3727..3e333156ad10 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -399,6 +399,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| Fujitsu | MONAKA GICv3/v4 | E#030003 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
+| Fujitsu | MONAKA | E#030004 | FUJITSU_ERRATUM_030004 |
++----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| ASR | ASR8601 | #8601001 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 5a2758ad3ab0..648d824f90b7 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1420,6 +1420,28 @@ config FUJITSU_ERRATUM_030002
If unsure, say Y.
+config FUJITSU_ERRATUM_030004
+ bool "FUJITSU-MONAKA erratum E#030004: CPU may hang when executing WFE"
+ default y
+ help
+ This option adds a workaround for FUJITSU-MONAKA erratum E#030004.
+ On affected CPUs, if a wake-up event generated by clearing the
+ global exclusive monitor or by a SEV instruction arrives in the
+ same cycle as a WFE instruction commits, the CPU may fail to
+ advance the program counter and re-execute the same WFE
+ instruction. If no further wake-up event occurs, the CPU may
+ remain waiting indefinitely (for example, in spinlock code).
+ This may cause a system hang before the generic timer event stream
+ is enabled. WFI, WFIT, and WFET instructions are not affected.
+
+ The workaround replaces host WFE instructions in arm64 code with
+ NOP using the boot alternative framework before the secondary
+ CPU bring-up on the MONAKA CPU.
+
+ The workaround only affects the FUJITSU-MONAKA.
+
+ If unsure, say Y.
+
config HISILICON_ERRATUM_161600802
bool "Hip07 161600802: Erroneous redistributor VLPI base"
default y
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 020670814bda..a83db010a88e 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -69,6 +69,10 @@
9990:
.endm
+ .macro wfe
+alternative_insn "hint #2", nop, ARM64_WORKAROUND_FUJITSU_030004
+ .endm
+
/*
* RAS Error Synchronization barrier
*/
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
index 9495c4441a46..28598d441c10 100644
--- a/arch/arm64/include/asm/barrier.h
+++ b/arch/arm64/include/asm/barrier.h
@@ -17,7 +17,8 @@
#define nops(n) asm volatile(__nops(n))
#define sev() asm volatile("sev" : : : "memory")
-#define wfe() asm volatile("wfe" : : : "memory")
+#define ARM64_WFE_INSN ALTERNATIVE("wfe", "nop", ARM64_WORKAROUND_FUJITSU_030004)
+#define wfe() asm volatile(ARM64_WFE_INSN : : : "memory")
#define wfet(val) asm volatile("msr s0_3_c1_c0_0, %0" \
: : "r" (val) : "memory")
#define wfi() asm volatile("wfi" : : : "memory")
diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h
index 6cf3cd6873f5..afedf2788469 100644
--- a/arch/arm64/include/asm/cmpxchg.h
+++ b/arch/arm64/include/asm/cmpxchg.h
@@ -218,11 +218,11 @@ static inline void __cmpwait_case_##sz(volatile void *ptr, \
\
asm volatile( \
" sevl\n" \
- " wfe\n" \
+ ARM64_WFE_INSN "\n" \
" ldxr" #sfx "\t%" #w "[tmp], %[v]\n" \
" eor %" #w "[tmp], %" #w "[tmp], %" #w "[val]\n" \
" cbnz %" #w "[tmp], 1f\n" \
- " wfe\n" \
+ ARM64_WFE_INSN "\n" \
"1:" \
: [tmp] "=&r" (tmp), [v] "+Q" (*(u##sz *)ptr) \
: [val] "r" (val)); \
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index f4aa6bd257c5..cc6b8f2270e1 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -72,6 +72,8 @@ cpucap_is_possible(const unsigned int cap)
return IS_ENABLED(CONFIG_FUJITSU_ERRATUM_030001);
case ARM64_WORKAROUND_FUJITSU_030002:
return IS_ENABLED(CONFIG_FUJITSU_ERRATUM_030002);
+ case ARM64_WORKAROUND_FUJITSU_030004:
+ return IS_ENABLED(CONFIG_FUJITSU_ERRATUM_030004);
case ARM64_MPAM:
/*
* KVM MPAM support doesn't rely on the host kernel supporting MPAM.
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 37bbe8268499..2a91292b6329 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -723,6 +723,15 @@ static const struct midr_range cnp_erratum_cpus[] = {
};
#endif
+#ifdef CONFIG_FUJITSU_ERRATUM_030004
+static bool
+has_fujitsu_monaka_erratum_030004(const struct arm64_cpu_capabilities *entry,
+ int __unused)
+{
+ return is_midr_in_range(&entry->midr_range);
+}
+#endif
+
const struct arm64_cpu_capabilities arm64_errata[] = {
#ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
{
@@ -1109,6 +1118,15 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
.capability = ARM64_WORKAROUND_FUJITSU_030002,
ERRATA_MIDR_ALL_VERSIONS(MIDR_FUJITSU_MONAKA),
},
+#endif
+#ifdef CONFIG_FUJITSU_ERRATUM_030004
+ {
+ .desc = "FUJITSU-MONAKA Erratum E#030004",
+ .capability = ARM64_WORKAROUND_FUJITSU_030004,
+ .type = ARM64_CPUCAP_SCOPE_BOOT_CPU,
+ .matches = has_fujitsu_monaka_erratum_030004,
+ .midr_range = MIDR_ALL_VERSIONS(MIDR_FUJITSU_MONAKA),
+ },
#endif
{
.desc = "Known broken GICv3 SEIS implementation",
diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps
index 73a4aeb535a0..4d97f20aad07 100644
--- a/arch/arm64/tools/cpucaps
+++ b/arch/arm64/tools/cpucaps
@@ -136,3 +136,4 @@ WORKAROUND_BROKEN_AMU_CONSTCNT
WORKAROUND_BROKEN_AMU_CORECNT
WORKAROUND_FUJITSU_030001
WORKAROUND_FUJITSU_030002
+WORKAROUND_FUJITSU_030004
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/5] arm64: cputype: Add FUJITSU MONAKA definition
2026-11-19 9:04 ` [PATCH v3 1/5] arm64: cputype: Add FUJITSU MONAKA definition Tomohiro Misono
@ 2026-11-19 9:09 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-19 9:09 UTC (permalink / raw)
To: Tomohiro Misono; +Cc: linux-perf-users
> Add cpu part definition for FUJITSU-MONAKA.
>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-monaka-fix-for-upstream-v3-0-057df4d2ca3c@fujitsu.com?part=1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 3/5] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002
2026-11-19 9:04 ` [PATCH v3 3/5] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002 Tomohiro Misono
@ 2026-11-19 9:16 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-19 9:16 UTC (permalink / raw)
To: Tomohiro Misono; +Cc: linux-perf-users
> FUJITSU-MONAKA Erratum E#030002 affects FUJITSU-MONAKA CPU.
>
> On affected FUJITSU-MONAKA CPUs, after a PMU event counter is
> stopped at a value just before overflow, an overflow might still
> be incorrectly detected, resulting interrupt storm in some case.
>
> For example, if the following conditions are met:
> 1) Running perf to count an event in user space only
> 2) The event can also occur in kernel space
> 3) The counter value is set just before the overflow
> (when using the -F option, initial counter value is -1)
>
> when the kernel is about to return to user space after enabling
> the count, an overflow interrupt is incorrectly triggered by an
> event that occurred in kernel space. Since the counter value is
> not updated (correctly), the interrupt handler does nothing and
> returns with the same condition. This leads to another wrong interrupt
> and results in an interrupt storm and eventually a softlockup.
>
> Work around the erratum by avoiding programming PMU event counters
> with values within 7 counts of overflow because the counter
> can increase up to 7 at a time.
>
> Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-monaka-fix-for-upstream-v3-0-057df4d2ca3c@fujitsu.com?part=3
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 5/5] arm64: Add workaround to replace WFE with NOP for FUJITSU-MONAKA Erratum E#030004
2026-11-19 9:04 ` [PATCH v3 5/5] arm64: Add workaround to replace WFE with NOP for FUJITSU-MONAKA Erratum E#030004 Tomohiro Misono
@ 2026-11-19 9:19 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-19 9:19 UTC (permalink / raw)
To: Tomohiro Misono; +Cc: linux-perf-users
> This option adds a workaround for FUJITSU-MONAKA erratum E#030004.
>
> On affected CPUs, if a wake-up event generated by clearing the
> global exclusive monitor or by a SEV instruction arrives in the
> same cycle as a WFE instruction commits, the CPU may fail to
> advance the program counter and re-execute the same WFE
> instruction. If no further wake-up event occurs, the CPU may
> remain waiting indefinitely (for example, in spinlock code).
> This may cause a system hang before the generic timer event stream
> is enabled. WFI, WFIT, and WFET instructions are not affected.
>
> After the event stream is enabled (shortly after the secondary CPU
> bring-up), event stream could wake up affected cores.
> However, in order to prevent the condition during secondary CPU
> bring-up, the workaround replaces all WFE instructions in host kernel
> code with NOP using the boot alternative framework before the secondary
> CPU bring-up on the MONAKA CPU.
>
> Note that there is no need to take care of WFE usage in Host EL0 and
> VHE Guest since if event stream is enabled in Host EL2, the event
> reaches to every ELx & world. This effectively means FUJITSU-MONAKA
> does not guarantee disabling event stream
> (clocksource.arm_arch_timer.evtstrm=0) nor running nVHE guests
> (kvm-arm.mode=nvhe/protected), although these configurations
> are not rejected by this patch.
>
> This only affects FUJITSU-MONAKA CPUs.
>
> Assisted-by: LLM
> Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-monaka-fix-for-upstream-v3-0-057df4d2ca3c@fujitsu.com?part=5
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 4/5] irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003
2026-11-19 9:04 ` [PATCH v3 4/5] irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003 Tomohiro Misono
@ 2026-11-19 9:21 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-19 9:21 UTC (permalink / raw)
To: Tomohiro Misono; +Cc: linux-perf-users, kvmarm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] irqchip/gic-v3: unused variable gic_fujitsu_030003_erratum on
ARM !SMP
--
commit f40f855ff6d7f791ef5d86b82bce961af1c3d29b
Author: Kohei Enju <enju.kohei@fujitsu.com>
irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003
This commit adds a quirk for FUJITSU-MONAKA Erratum E#030003 to send SGIs
by writing to the target redistributor's GICR_ISPENDR0 register instead of
the ICC_SGI*R_EL1 system registers.
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index 94873646d46fb..18f8b2b40543a 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -80,6 +80,8 @@ static DEFINE_STATIC_KEY_FALSE(gic_nvidia_t241_erratum);
>
> static DEFINE_STATIC_KEY_FALSE(gic_arm64_2941627_erratum);
>
> +static DEFINE_STATIC_KEY_FALSE(gic_fujitsu_030003_erratum);
> +
> static struct gic_chip_data gic_data __read_mostly;
> static DEFINE_STATIC_KEY_TRUE(supports_deactivate_key);
>
[Severity: Low]
Does defining gic_fujitsu_030003_erratum unconditionally trigger a
-Wunused-variable warning when building with CONFIG_ARM=y and
CONFIG_SMP=n?
Its only two users are gic_ipi_send_mask() (under #ifdef CONFIG_SMP) and
gic_enable_quirk_fujitsu_030003() (under #ifdef CONFIG_ARM64), so both are
compiled out on 32-bit ARM UP builds. Marking it __maybe_unused (like
broken_rdists earlier in the file) or guarding it with #ifdef CONFIG_SMP
would avoid the warning.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-monaka-fix-for-upstream-v3-0-057df4d2ca3c@fujitsu.com?part=4
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/5] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001
2026-11-19 9:04 ` [PATCH v3 2/5] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001 Tomohiro Misono
@ 2026-11-19 9:30 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-19 9:30 UTC (permalink / raw)
To: Tomohiro Misono; +Cc: linux-perf-users, kvmarm, Oliver Upton, Marc Zyngier
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] KVM: arm64: pvm_calc_id_reg() exposes FEAT_TLBIRANGE on
FUJITSU-MONAKA
- [Low] KVM: arm64: __kvm_read_sanitised_id_reg() elevates
ID_AA64ISAR0_EL1.TLB to OS
--
commit 913abeb45fc613951715127a954e31a80a0e00cf
Author: Tomohiro Misono <misono.tomohiro@fujitsu.com>
arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001
This commit adds a workaround for FUJITSU-MONAKA Erratum E#030001 by
disabling ARM64_HAS_TLB_RANGE on the host and downgrading
ID_AA64ISAR0_EL1.TLB to OS for KVM guests.
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index c7d91138a6d49..2e8965b7702e1 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -1949,6 +1949,14 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
> case SYS_ID_AA64PFR2_EL1:
> val = sanitise_id_aa64pfr2_el1(vcpu, val);
> break;
> + case SYS_ID_AA64ISAR0_EL1:
> + if (cpus_have_final_cap(ARM64_WORKAROUND_FUJITSU_030001)) {
> + /* disable TLBI range operatoins on guest */
> + val &= ~ID_AA64ISAR0_EL1_TLB_MASK;
> + val |= SYS_FIELD_PREP(ID_AA64ISAR0_EL1, TLB,
> + ID_AA64ISAR0_EL1_TLB_OS);
> + }
> + break;
> case SYS_ID_AA64ISAR1_EL1:
> if (!vcpu_has_ptrauth(vcpu))
> val &= ~(ID_AA64ISAR1_EL1_APA |
[Severity: Medium]
Does this leave FEAT_TLBIRANGE exposed to protected VMs under pKVM?
has_tlb_range() disables ARM64_HAS_TLB_RANGE on the host without modifying
the sanitised feature register value returned by
read_sanitised_ftr_reg(SYS_ID_AA64ISAR0_EL1). For protected VMs
(kvm_arm.mode=protected), guest ID registers do not go through
__kvm_read_sanitised_id_reg(): kvm_hyp_init_symbols() copies
read_sanitised_ftr_reg(SYS_ID_AA64ISAR0_EL1) into id_aa64isar0_el1_sys_val,
and kvm_init_pvm_id_regs() -> pvm_calc_id_reg() returns
id_aa64isar0_el1_sys_val unchanged for SYS_ID_AA64ISAR0_EL1. A protected
guest on FUJITSU-MONAKA will still observe ID_AA64ISAR0_EL1.TLB == RANGE and
issue the affected RVA[L]E1* and RVAA[L]E1* instructions, leaving stale TLB
entries when invalidating an affected 512MB mapping.
[Severity: Low]
Can overwriting ID_AA64ISAR0_EL1.TLB with ID_AA64ISAR0_EL1_TLB_OS elevate
the field from NI (0) to OS (1)?
If an L1 KVM host on FUJITSU-MONAKA had ID_AA64ISAR0_EL1.TLB downgraded to
NI by its L0 VMM, setting ID_AA64ISAR0_EL1_TLB_OS unconditionally advertises
FEAT_TLBIOS to L2 guests when the host does not have it, causing L0 to
inject an UNDEFINED exception on outer-shareable TLBI instructions. Using
ID_REG_LIMIT_FIELD_ENUM(val, ID_AA64ISAR0_EL1, TLB, OS) would clamp the
field with min() instead of elevating it.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-monaka-fix-for-upstream-v3-0-057df4d2ca3c@fujitsu.com?part=2
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-11-19 9:30 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 9:04 [PATCH v3 0/5] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
2026-11-19 9:04 ` [PATCH v3 1/5] arm64: cputype: Add FUJITSU MONAKA definition Tomohiro Misono
2026-11-19 9:09 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 2/5] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001 Tomohiro Misono
2026-11-19 9:30 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 3/5] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002 Tomohiro Misono
2026-11-19 9:16 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 4/5] irqchip/gicv3: Add workaround for FUJITSU-MONAKA Erratum E#030003 Tomohiro Misono
2026-11-19 9:21 ` sashiko-bot
2026-11-19 9:04 ` [PATCH v3 5/5] arm64: Add workaround to replace WFE with NOP for FUJITSU-MONAKA Erratum E#030004 Tomohiro Misono
2026-11-19 9:19 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox