Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1385038 > unrolled thread
| Started by | Suzuki K Poulose <suzuki.poulose@arm.com> |
|---|---|
| First post | 2016-04-22 13:30 +0200 |
| Last post | 2016-04-22 15:50 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v4 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-04-22 13:30 +0200
Re: [PATCH v4 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU Catalin Marinas <catalin.marinas@arm.com> - 2016-04-22 15:50 +0200
Re: [PATCH v4 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-22 15:50 +0200
| From | Suzuki K Poulose <suzuki.poulose@arm.com> |
|---|---|
| Date | 2016-04-22 13:30 +0200 |
| Subject | [PATCH v4 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU |
| Message-ID | <rqHrA-1aV-23@gated-at.bofh.it> |
CPU Errata work arounds are detected and applied to the
kernel code at boot time and the data is then freed up.
If a new hotplugged CPU requires a work around which
was not applied at boot time, there is nothing we can
do but simply fail the booting.
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
arch/arm64/include/asm/cpufeature.h | 1 +
arch/arm64/kernel/cpu_errata.c | 20 ++++++++++++++++++++
arch/arm64/kernel/cpufeature.c | 1 +
3 files changed, 22 insertions(+)
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index d39db63..224efe7 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -193,6 +193,7 @@ void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
const char *info);
void check_local_cpu_errata(void);
+void verify_local_cpu_errata(void);
void verify_local_cpu_capabilities(void);
u64 read_system_reg(u32 id);
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 2fdecd7..d427894 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -103,6 +103,26 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
}
};
+/*
+ * The CPU Errata work arounds are detected and applied at boot time
+ * and the related information is freed soon after. If the new CPU requires
+ * an errata not detected at boot, fail this CPU.
+ */
+void verify_local_cpu_errata(void)
+{
+ const struct arm64_cpu_capabilities *caps = arm64_errata;
+
+ for (; caps->matches; caps++)
+ if (!cpus_have_cap(caps->capability) &&
+ caps->matches(caps, SCOPE_LOCAL_CPU)) {
+ pr_crit("CPU%d: Requires work around for %s, not detected"
+ " at boot time\n",
+ smp_processor_id(),
+ caps->desc ? : "an erratum");
+ cpu_die_early();
+ }
+}
+
void check_local_cpu_errata(void)
{
update_cpu_capabilities(arm64_errata, "enabling workaround for");
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 79ec6c6..1cc3446 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -993,6 +993,7 @@ void verify_local_cpu_capabilities(void)
if (!sys_caps_initialised)
return;
+ verify_local_cpu_errata();
verify_local_cpu_features(arm64_features);
verify_local_elf_hwcaps(arm64_elf_hwcaps);
if (system_supports_32bit_el0())
--
1.7.9.5
[toc] | [next] | [standalone]
| From | Catalin Marinas <catalin.marinas@arm.com> |
|---|---|
| Date | 2016-04-22 15:50 +0200 |
| Subject | Re: [PATCH v4 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU |
| Message-ID | <rqJD4-2KJ-7@gated-at.bofh.it> |
| In reply to | #1385038 |
On Fri, Apr 22, 2016 at 12:25:34PM +0100, Suzuki K. Poulose wrote: > CPU Errata work arounds are detected and applied to the > kernel code at boot time and the data is then freed up. > If a new hotplugged CPU requires a work around which > was not applied at boot time, there is nothing we can > do but simply fail the booting. > > Cc: Will Deacon <will.deacon@arm.com> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Andre Przywara <andre.przywara@arm.com> > Cc: Catalin Marinas <catalin.marinas@arm.com> > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> I think Will commented on this previously. Was a decision made to leave this patch as it is and subsequently add support for enabling local workarounds for hot-plugged CPUs? I'm fine with this given that most per-CPU workarounds like undocumented bits are set by firmware. But I'd like to see it done properly once we have a workaround that needs per-CPU enabling. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
[toc] | [prev] | [next] | [standalone]
| From | Suzuki K Poulose <Suzuki.Poulose@arm.com> |
|---|---|
| Date | 2016-04-22 15:50 +0200 |
| Subject | Re: [PATCH v4 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU |
| Message-ID | <rqJD4-2KJ-11@gated-at.bofh.it> |
| In reply to | #1385187 |
On 22/04/16 14:40, Catalin Marinas wrote: > On Fri, Apr 22, 2016 at 12:25:34PM +0100, Suzuki K. Poulose wrote: >> CPU Errata work arounds are detected and applied to the >> kernel code at boot time and the data is then freed up. >> If a new hotplugged CPU requires a work around which >> was not applied at boot time, there is nothing we can >> do but simply fail the booting. >> >> Cc: Will Deacon <will.deacon@arm.com> >> Cc: Mark Rutland <mark.rutland@arm.com> >> Cc: Andre Przywara <andre.przywara@arm.com> >> Cc: Catalin Marinas <catalin.marinas@arm.com> >> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> > > I think Will commented on this previously. Was a decision made to leave > this patch as it is and subsequently add support for enabling local > workarounds for hot-plugged CPUs? I'm fine with this given that most Yes. Applying work arounds for a hot-plugged CPU will be addressed in a new series. I updated the cover letter, but missed to update the same here. > > Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Thanks Suzuki
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web