ARM Error Source Table Support
cover ARM Error Source Table Support
This series adds support for the ARM Error Source Table (AEST) based on the latest version of ACPI for the Armv8 RAS Extensions [0].
The AEST driver supports both memory mapped and system register interfaces. This series assumes system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in it's system registers.
This is meant to be initial support for AEST to address the current gaps with systems that support ARMv8 RAS extensions but don't have firmware-first support. This series simply logs all the errors it finds and triggers a kernel panic if there is an UE present.
I have tested this series on Ampere Altra using processor errors to exercise PPI handling with system register interface and memory errors to exercise SPI handling with MMIO interface. Both corrected and uncorrected errors were tested to verify the non-fatal vs fatal scenarios.
Future work:
- UER handling to avoid panic
- Looping through all external abort capable (ERR<n>FR.UE != 0) error nodes in SEA/SEI handling
Changes from RFC patch series [1]:
- Updated for latest AEST spec
- Utilize ACPICA header defines of AEST structures
- Added support for ARMv8.4 RAS extension
- Dropped the SEA/SEI dumping of SR RAS registers
- Removed unused defines
- Unified RAS extension register printing to a single function
- Updated trace event with additional fields
- Addressed other feedback from RFC series
- Added myself to ARM64 ACPI MAINTAINERS as a reviewer
[0] https://developer.arm.com/documentation/den0085/latest
[1] https://lkml.org/lkml/2019/7/2/781
Tyler Baicar (2):
ACPI/AEST: Initial AEST driver
trace, ras: add ARM RAS extension trace event
MAINTAINERS | 1 + arch/arm64/include/asm/ras.h | 52 ++++ arch/arm64/include/asm/sysreg.h | 2 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/ras.c | 129 +++++++++ arch/arm64/kvm/sys_regs.c | 2 + drivers/acpi/arm64/Kconfig | 3 + drivers/acpi/arm64/Makefile | 1 + drivers/acpi/arm64/aest.c | 455 ++++++++++++++++++++++++++++++++ include/linux/acpi_aest.h | 50 ++++ include/linux/cpuhotplug.h | 1 + include/ras/ras_event.h | 55 ++++ 12 files changed, 752 insertions(+) create mode 100644 arch/arm64/include/asm/ras.h create mode 100644 arch/arm64/kernel/ras.c create mode 100644 drivers/acpi/arm64/aest.c create mode 100644 include/linux/acpi_aest.h
Signature · 1 line
2.33.1
PATCH 1/2 ACPI/AEST: Initial AEST driver
Add support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register interfaces.
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
--- MAINTAINERS | 1 + arch/arm64/include/asm/ras.h | 52 ++++ arch/arm64/include/asm/sysreg.h | 2 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/ras.c | 125 +++++++++ arch/arm64/kvm/sys_regs.c | 2 + drivers/acpi/arm64/Kconfig | 3 + drivers/acpi/arm64/Makefile | 1 + drivers/acpi/arm64/aest.c | 450 ++++++++++++++++++++++++++++++++ include/linux/acpi_aest.h | 50 ++++ include/linux/cpuhotplug.h | 1 + 11 files changed, 688 insertions(+) create mode 100644 arch/arm64/include/asm/ras.h create mode 100644 arch/arm64/kernel/ras.c create mode 100644 drivers/acpi/arm64/aest.c create mode 100644 include/linux/acpi_aest.h
MAINTAINERS +1 -0
@@ -382,6 +382,7 @@ ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <[email protected]> M: Hanjun Guo <[email protected]> M: Sudeep Holla <[email protected]> +R: Tyler Baicar <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: Maintained
arch/arm64/include/asm/ras.h new file +52 -0
52 lines not on this page · raw message
arch/arm64/include/asm/sysreg.h +2 -0
@@ -230,6 +230,8 @@#define SYS_ERXADDR_EL1 sys_reg(3, 0, 5, 4, 3)#define SYS_ERXMISC0_EL1 sys_reg(3, 0, 5, 5, 0)#define SYS_ERXMISC1_EL1 sys_reg(3, 0, 5, 5, 1) +#define SYS_ERXMISC2_EL1 sys_reg(3, 0, 5, 5, 2) +#define SYS_ERXMISC3_EL1 sys_reg(3, 0, 5, 5, 3)#define SYS_TFSR_EL1 sys_reg(3, 0, 5, 6, 0)#define SYS_TFSRE0_EL1 sys_reg(3, 0, 5, 6, 1)
arch/arm64/kernel/Makefile +1 -0
@@ -73,6 +73,7 @@ obj-$(CONFIG_ARM64_PTR_AUTH) += pointer_auth.o obj-$(CONFIG_ARM64_MTE) += mte.o obj-y += vdso-wrap.o obj-$(CONFIG_COMPAT_VDSO) += vdso32-wrap.o +obj-$(CONFIG_ARM64_RAS_EXTN) += ras.o obj-y += probes/ head-y := head.o
arch/arm64/kernel/ras.c new file +125 -0
125 lines not on this page · raw message
arch/arm64/kvm/sys_regs.c +2 -0
@@ -1573,6 +1573,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_ERXADDR_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC0_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC1_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC2_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC3_EL1), trap_raz_wi },MTE_REG (TFSR_EL1 ), MTE_REG(TFSRE0_EL1),
drivers/acpi/arm64/Kconfig +3 -0
@@ -8,3 +8,6 @@ config ACPI_IORT config ACPI_GTDT bool + +config ACPI_AEST + bool "ARM Error Source Table Support"
drivers/acpi/arm64/Makefile +1 -0
@@ -2,3 +2,4 @@ obj-$(CONFIG_ACPI_IORT) += iort.o obj-$(CONFIG_ACPI_GTDT) += gtdt.o obj-y += dma.o +obj-$(CONFIG_ACPI_AEST) += aest.o
drivers/acpi/arm64/aest.c new file +450 -0
450 lines not on this page · raw message
include/linux/acpi_aest.h new file +50 -0
50 lines not on this page · raw message
include/linux/cpuhotplug.h +1 -0
@@ -186,6 +186,7 @@ enum cpuhp_state {CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING ,CPUHP_AP_KVM_ARM_VGIC_STARTING ,CPUHP_AP_KVM_ARM_TIMER_STARTING , +CPUHP_AP_ARM_AEST_STARTING ,/* Must be the last timer callback */ CPUHP_AP_DUMMY_TIMER_STARTING , CPUHP_AP_ARM_XEN_STARTING,
Signature · 1 line
2.33.1
PATCH 2/2 trace, ras: add ARM RAS extension trace event
In reply to Tyler BaicarAdd a trace event for hardware errors reported by the ARMv8 RAS extension registers.
--- arch/arm64/kernel/ras.c | 4 +++ drivers/acpi/arm64/aest.c | 5 ++++ include/ras/ras_event.h | 55 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+)
arch/arm64/kernel/ras.c +4 -0
@@ -6,6 +6,8 @@#include <asm/cpufeature.h> #include <asm/ras.h> +#include <ras/ras_event.h> +static bool ras_extn_v1p1 (void ) {unsigned long fld, reg =read_sanitised_ftr_reg (SYS_ID_AA64PFR0_EL1 );
@@ -95,6 +97,8 @@ void arch_arm_ras_report_error(u64 implemented, bool clear_misc)arch_arm_ras_print_error (®s, i, misc23_present); +trace_arm_ras_ext_event (0 , cpu_num,0 , i, ®s); +/* * In the future, we will treat UER conditions as potentially * recoverable.
drivers/acpi/arm64/aest.c +5 -0
@@ -14,6 +14,8 @@#include <asm/ras.h> +#include <ras/ras_event.h> +#undef pr_fmt#define pr_fmt (fmt) "ACPI AEST: " fmt
@@ -126,6 +128,9 @@ static void aest_proc(struct aest_node_data *data)aest_print (data, regs, i, misc23_present); +trace_arm_ras_ext_event (data->node_type, data->data.vendor.acpi_hid, + data->data.vendor.acpi_uid, i, ®s); +if (regs.err_status &ERR_STATUS_UE ) fatal = true;
include/ras/ras_event.h +55 -0
61 lines not on this page · raw message
Signature · 1 line
2.33.1
Marc Zyngier
maintainerRe: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Tyler BaicarQuoted 36 lines · Tyler Baicar
Add support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register interfaces.
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>--- MAINTAINERS | 1 + arch/arm64/include/asm/ras.h | 52 ++++ arch/arm64/include/asm/sysreg.h | 2 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/ras.c | 125 +++++++++ arch/arm64/kvm/sys_regs.c | 2 + drivers/acpi/arm64/Kconfig | 3 + drivers/acpi/arm64/Makefile | 1 + drivers/acpi/arm64/aest.c | 450 ++++++++++++++++++++++++++++++++ include/linux/acpi_aest.h | 50 ++++ include/linux/cpuhotplug.h | 1 + 11 files changed, 688 insertions(+) create mode 100644 arch/arm64/include/asm/ras.h create mode 100644 arch/arm64/kernel/ras.c create mode 100644 drivers/acpi/arm64/aest.c create mode 100644 include/linux/acpi_aest.hMAINTAINERS +0
-0
MAINTAINERS ACPI FOR ARM64 (ACPI/arm64) · line 388
Quoted 7 lines
MAINTAINERS +1
-0@@ -382,6 +382,7 @@ ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <[email protected]> M: Hanjun Guo <[email protected]> M: Sudeep Holla <[email protected]> +R: Tyler Baicar <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: Maintained
Isn't this a bit premature? This isn't even mentioned in the commit message, only in passing in the cover letter.
Quoted 18 lines
arch/arm64/include/asm/sysreg.h +2
-0@@ -230,6 +230,8 @@#define SYS_ERXADDR_EL1 sys_reg(3, 0, 5, 4, 3)#define SYS_ERXMISC0_EL1 sys_reg(3, 0, 5, 5, 0)#define SYS_ERXMISC1_EL1 sys_reg(3, 0, 5, 5, 1) +#define SYS_ERXMISC2_EL1 sys_reg(3, 0, 5, 5, 2) +#define SYS_ERXMISC3_EL1 sys_reg(3, 0, 5, 5, 3)#define SYS_TFSR_EL1 sys_reg(3, 0, 5, 6, 0)#define SYS_TFSRE0_EL1 sys_reg(3, 0, 5, 6, 1)arch/arm64/kvm/sys_regs.c +0
-0
arch/arm64/kvm/sys_regs.c static const struct sys_reg_desc sys_reg_descs[] = { · line 1578
Quoted 6 lines
arch/arm64/kvm/sys_regs.c +2
-0@@ -1573,6 +1573,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_ERXADDR_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC0_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC1_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC2_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC3_EL1), trap_raz_wi },
This looks like a fix that would deserve its own patch.
Thanks,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Mark Rutland
reviewerRe: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Tyler BaicarHi,
I haven't looked at this in great detail, but I spotted a few issues from an initial scan.
Quoted 7 lines · Tyler Baicar
Add support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register interfaces.
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Can we actually assume that? What does the specification mandate?
Quoted 2 lines
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Has this been tested on any hardware or software platform?
[...]
Quoted 1 line
+#define
ERRDEVARCH_REV_SHIFT0x16
IIUC This should be 16, not 0x16 (i.e. 22).
Quoted 4 lines
arch/arm64/include/asm/ras.h new file +4
-0+#define ERRDEVARCH_REV_MASK 0xf + +#define RAS_REV_v1_1 0x1 +
arch/arm64/include/asm/ras.h line 40
Quoted 10 lines
arch/arm64/include/asm/ras.h new file +10
-0+struct ras_ext_regs { +u64 err_fr; +u64 err_ctlr; +u64 err_status; +u64 err_addr; +u64 err_misc0; +u64 err_misc1; +u64 err_misc2; +u64 err_misc3; +};
These last four might be better an an array.
[...]
arch/arm64/kernel/ras.c line 16
Quoted 8 lines
arch/arm64/kernel/ras.c new file +8
-0+static bool ras_extn_v1p1 (void ) +{ +unsigned long fld, reg =read_sanitised_ftr_reg (SYS_ID_AA64PFR0_EL1 ); + + fld =cpuid_feature_extract_unsigned_field (reg,ID_AA64PFR0_RAS_SHIFT ); + +return fld >=ID_AA64PFR0_RAS_V1P1 ; +}
I suspect it'd be better to pass this value around directly as version, rather than dropping this into a misc23_present temporary variable, as that would be a little clearer, and future-proof if/when more registers get added.
[...]
arch/arm64/kernel/ras.c line 65
Quoted 12 lines
arch/arm64/kernel/ras.c new file +12
-0+void arch_arm_ras_report_error (u64 implemented,bool clear_misc) +{ +struct ras_ext_regs regs = {0 }; +unsigned int i, cpu_num; +bool misc23_present; +bool fatal = false; +u64 num_records; + +if (!this_cpu_has_cap (ARM64_HAS_RAS_EXTN )) +return ; + + cpu_num =get_cpu ();
Why get_cpu() here? Do you just need smp_processor_id()?
The commit message explained that this would be PE-local (e.g. in a PPI handler), and we've already checked this_cpu_has_cap() which assumes we're not preemptible.
So I don't see why we should use get_cpu() here -- any time it would have a difference implies something has already gone wrong.
Quoted 4 lines
arch/arm64/kernel/ras.c new file +4
-0+ num_records =read_sysreg_s (SYS_ERRIDR_EL1 ) &ERRIDR_NUM_MASK ; + +for (i =0 ; i < num_records; i++) { +if (!(implemented &BIT (i)))
arch/arm64/kernel/ras.c line 79
Quoted 10 lines
arch/arm64/kernel/ras.c new file +10
-0+continue ; + +write_sysreg_s (i,SYS_ERRSELR_EL1 ); +isb (); + regs.err_status =read_sysreg_s (SYS_ERXSTATUS_EL1 ); + +if (!(regs.err_status &ERR_STATUS_V )) +continue ; + +pr_err ("error from processor 0x%x\n" , cpu_num);
Why in hex? We normally print 'cpu%d' or 'CPU%d', since this is a logical ID anyway.
arch/arm64/kernel/ras.c line 84
Quoted 5 lines
arch/arm64/kernel/ras.c new file +5
-0+ +if (regs.err_status &ERR_STATUS_AV ) + regs.err_addr =read_sysreg_s (SYS_ERXADDR_EL1 ); + + misc23_present =ras_extn_v1p1 ();
As above, I reckon it's better to have this as 'version' or 'ras_version', and have the checks below be:
if (version >= ID_AA64PFR0_RAS_V1P1) {
// poke SYS_ERXMISC2_EL1
// poke SYS_ERXMISC3_EL1
}Quoted 22 lines
arch/arm64/kernel/ras.c new file +22
-0+ +if (regs.err_status &ERR_STATUS_MV ) { + regs.err_misc0 =read_sysreg_s (SYS_ERXMISC0_EL1 ); + regs.err_misc1 =read_sysreg_s (SYS_ERXMISC1_EL1 ); + +if (misc23_present) { + regs.err_misc2 =read_sysreg_s (SYS_ERXMISC2_EL1 ); + regs.err_misc3 =read_sysreg_s (SYS_ERXMISC3_EL1 ); + } + } + +arch_arm_ras_print_error (®s, i, misc23_present); + +/* +* In the future, we will treat UER conditions as potentially +* recoverable. +*/ +if (regs.err_status &ERR_STATUS_UE ) + fatal = true; + + regs.err_status =arch_arm_ras_get_status_clear_value (regs.err_status); +write_sysreg_s (regs.err_status,SYS_ERXSTATUS_EL1 );
arch/arm64/kernel/ras.c line 116
Quoted 10 lines
arch/arm64/kernel/ras.c new file +10
-0+ +if (clear_misc) { +write_sysreg_s (0x0 ,SYS_ERXMISC0_EL1 ); +write_sysreg_s (0x0 ,SYS_ERXMISC1_EL1 ); + +if (misc23_present) { +write_sysreg_s (0x0 ,SYS_ERXMISC2_EL1 ); +write_sysreg_s (0x0 ,SYS_ERXMISC3_EL1 ); + } + }
Any reason not to clear when we read, above? e.g.
#define READ_CLEAR_MISC(nr, clear) \
({ \
unsigned long __val = read_sysreg_s(SYS_ERXMISC##nr##_EL1); \
if (clear); \
write_sysreg_s(0, SYS_ERXMISC##nr##_EL1); \
__val; \
})if (regs.err_status & ERR_STATUS_MV) {
regs.err_misc0 = READ_CLEAR_MISC(0, clear_misc);
regs.err_misc1 = READ_CLEAR_MISC(1, clear_misc);
if (version >= ID_AA64PFR0_RAS_V1P1) {
regs.err_misc2 = READ_CLEAR_MISC(2, clear_misc);
regs.err_misc3 = READ_CLEAR_MISC(3, clear_misc);
}}
... why does the clearing need to be conditional?
Quoted 14 lines
arch/arm64/kernel/ras.c new file +9
-0+ +isb (); + } + +if (fatal) +panic ("ARM RAS: uncorrectable error encountered" ); + +put_cpu (); +}arch/arm64/kvm/sys_regs.c +0
-0
arch/arm64/kvm/sys_regs.c static const struct sys_reg_desc sys_reg_descs[] = { · line 1577
Quoted 5 lines
arch/arm64/kvm/sys_regs.c +2
-0@@ -1573,6 +1573,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_ERXADDR_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC0_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC1_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC2_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC3_EL1), trap_raz_wi },
This should be a preparatory patch; this is preumably a latent bug in KVM.
[...]
arch/arm64/kvm/sys_regs.c static const struct sys_reg_desc sys_reg_descs[] = {
Quoted 4 lines
arch/arm64/kvm/sys_regs.c +4
-0+static struct aest_node_data __percpu **ppi_data; +static int ppi_irqs[AEST_MAX_PPI ]; +static u8 num_ppi; +static u8 ppi_idx;
As above, do we have any guarantee these are actually PPIs?
arch/arm64/kvm/sys_regs.c
Quoted 10 lines
arch/arm64/kvm/sys_regs.c +10
-0+static bool aest_mmio_ras_misc23_present (u64 base_addr) +{ +u32 val; + + val =readl ((void *) (base_addr +ERRDEVARCH_OFFSET )); + val <<=ERRDEVARCH_REV_SHIFT ; + val &=ERRDEVARCH_REV_MASK ; + +return val >= RAS_REV_v1_1; +}
Is the shift the wrong way around?
Above we have:
#define ERRDEVARCH_REV_SHIFT 0x16 #define ERRDEVARCH_REV_MASK 0xf #define RAS_REV_v1_1 0x1
.. so this is:
val <<= 0x16; val &= 0xf; // val[0x15:0] == 0, so this is 0 return val >= 0x1; // false
It'd be nicer to use FIELD_GET() here.
As above, I also think it would be better to retrun the value of the field, and check that explciitly, for future proofing.
[...]
Quoted 62 lines
arch/arm64/kvm/sys_regs.c +62
-0+static void aest_proc (struct aest_node_data *data) +{ +struct ras_ext_regs *regs_p, regs = {0 }; +bool misc23_present; +bool fatal = false; +u64 errgsr =0 ; +int i; + +/* +* Currently SR based handling is done through the architected +* discovery exposed through SRs. That may change in the future +* if there is supplemental information in the AEST that is +* needed. +*/ +if (data->interface.type ==ACPI_AEST_NODE_SYSTEM_REGISTER ) { +arch_arm_ras_report_error (data->interface.implemented, + data->interface.flags &AEST_INTERFACE_CLEAR_MISC ); +return ; + } + + regs_p = data->interface.regs; + errgsr =readq ((void *) (((u64 ) regs_p) +ERRGSR_OFFSET )); + +for (i = data->interface.start; i < data->interface.end; i++) { +if (!(data->interface.implemented &BIT (i))) +continue ; + +if (!(data->interface.status_reporting &BIT (i)) && !(errgsr &BIT (i))) +continue ; + + regs.err_status =readq (®s_p[i].err_status); +if (!(regs.err_status &ERR_STATUS_V )) +continue ; + +if (regs.err_status &ERR_STATUS_AV ) + regs.err_addr =readq (®s_p[i].err_addr); + + regs.err_fr =readq (®s_p[i].err_fr); + regs.err_ctlr =readq (®s_p[i].err_ctlr); + +if (regs.err_status &ERR_STATUS_MV ) { + misc23_present =aest_mmio_ras_misc23_present ((u64 ) regs_p); + regs.err_misc0 =readq (®s_p[i].err_misc0); + regs.err_misc1 =readq (®s_p[i].err_misc1); + +if (misc23_present) { + regs.err_misc2 =readq (®s_p[i].err_misc2); + regs.err_misc3 =readq (®s_p[i].err_misc3); + } + } + +aest_print (data, regs, i, misc23_present); + +if (regs.err_status &ERR_STATUS_UE ) + fatal = true; + + regs.err_status =arch_arm_ras_get_status_clear_value (regs.err_status); +writeq (regs.err_status, ®s_p[i].err_status); + +if (data->interface.flags &AEST_INTERFACE_CLEAR_MISC ) { +writeq (0x0 , ®s_p[i].err_misc0); +writeq (0x0 , ®s_p[i].err_misc1);
arch/arm64/kvm/sys_regs.c
Quoted 10 lines
arch/arm64/kvm/sys_regs.c +10
-0+ +if (misc23_present) { +writeq (0x0 , ®s_p[i].err_misc2); +writeq (0x0 , ®s_p[i].err_misc3); + } + } + } + +if (fatal) +panic ("AEST: uncorrectable error encountered" );
Why don't we call panic() as soon as we realise an error is fatal?
Thanks,
Mark.
kernel test robot
build botRe: [PATCH 2/2] trace, ras: add ARM RAS extension trace event
In reply to Tyler BaicarI love your patch! Yet something to improve:
Hi Tyler,
I love your patch! Yet something to improve:
[auto build test ERROR on arm64/for-next/core]
[also build test ERROR on rafael-pm/linux-next kvmarm/next linus/master v5.16-rc2 next-20211126] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Tyler-Baicar/ARM-Error-Source-Table-Support/20211125-011746 base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core config: arm64-buildonly-randconfig-r006-20211126 (https://download.01.org/0day-ci/archive/20211128/202111281921.pUlQlG7z-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/f57618adb3ac894e9f3631edcb692dab7b78fa3b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tyler-Baicar/ARM-Error-Source-Table-Support/20211125-011746 git checkout f57618adb3ac894e9f3631edcb692dab7b78fa3b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: __tracepoint_arm_ras_ext_event >>> referenced by ras.c >>> kernel/ras.o:(arch_arm_ras_report_error) in archive arch/arm64/built-in.a >>> referenced by ras.c >>> kernel/ras.o:(arch_arm_ras_report_error) in archive arch/arm64/built-in.a >>> referenced by ras.c >>> kernel/ras.o:(__jump_table+0x8) in archive arch/arm64/built-in.a -- >> ld.lld: error: undefined symbol: __traceiter_arm_ras_ext_event >>> referenced by ras.c >>> kernel/ras.o:(arch_arm_ras_report_error) in archive arch/arm64/built-in.a
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Marc ZyngierQuoted 33 lines · Marc Zyngier
Quoted 31 lines · Tyler Baicar
Add support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register interfaces.
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>--- MAINTAINERS | 1 + arch/arm64/include/asm/ras.h | 52 ++++ arch/arm64/include/asm/sysreg.h | 2 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/ras.c | 125 +++++++++ arch/arm64/kvm/sys_regs.c | 2 + drivers/acpi/arm64/Kconfig | 3 + drivers/acpi/arm64/Makefile | 1 + drivers/acpi/arm64/aest.c | 450 ++++++++++++++++++++++++++++++++ include/linux/acpi_aest.h | 50 ++++ include/linux/cpuhotplug.h | 1 + 11 files changed, 688 insertions(+) create mode 100644 arch/arm64/include/asm/ras.h create mode 100644 arch/arm64/kernel/ras.c create mode 100644 drivers/acpi/arm64/aest.c create mode 100644 include/linux/acpi_aest.h
Quoted 16 lines
MAINTAINERS ACPI FOR ARM64 (ACPI/arm64) · line 388
Quoted 12 lines
MAINTAINERS +1
-0@@ -382,6 +382,7 @@ ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <[email protected]> M: Hanjun Guo <[email protected]> M: Sudeep Holla <[email protected]> +R: Tyler Baicar <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: MaintainedIsn't this a bit premature? This isn't even mentioned in the commit message, only in passing in the cover letter.
Hi Marc,
This was something I encouraged Tyler to add during internal review, both in response to the checkpatch.pl warning about adding new drivers as well as our interest in reviewing any future changes to the aest driver. Since refactoring is common, this level made sense to me - but would it be preferable to add a new entry for just the new driver Tyler added?
Thanks,
Signature · 2 lines
Darren Hart Ampere Computing / OS and Kernel
Marc Zyngier
maintainerRe: [PATCH 1/2] ACPI/AEST: Initial AEST driver
Hi Darren,
Quoted 21 lines · Darren Hart
Quoted 18 lines · Marc Zyngier
On Wed, 24 Nov 2021 17:07:07 +0000,
MAINTAINERS ACPI FOR ARM64 (ACPI/arm64) · line 388
Quoted 13 lines
MAINTAINERS +1
-0@@ -382,6 +382,7 @@ ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <[email protected]> M: Hanjun Guo <[email protected]> M: Sudeep Holla <[email protected]> +R: Tyler Baicar <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: MaintainedIsn't this a bit premature? This isn't even mentioned in the commit message, only in passing in the cover letter.
Quoted 8 lines
Hi Marc,
This was something I encouraged Tyler to add during internal review, both in response to the checkpatch.pl warning about adding new drivers as well as our interest in reviewing any future changes to the aest driver. Since refactoring is common, this level made sense to me - but would it be preferable to add a new entry for just the new driver Tyler added?
Adding someone as the co-maintainer/co-reviewer of a whole subsystem (ACPI/arm64 in this case) comes, IMO, with a number of pre-requisites:
has the proposed co-{maintainer,reviewer} contributed and/or reviewed a significant number of patches to that subsystem and/or actively participated in the public discussions on the design and the maintenance of the subsystem, so that their reviewing is authoritative enough? I won't be judge of this, but it is definitely something to consider.
I don't think preemptively adding someone to the MAINTAINERS entry to indicate an interest in a whole subsystem is the right way to do it. One could argue that this is what a mailing list is for! ;-) On the other hand, an active participation to the review process is the perfect way to engage with fellow developers and to grow a profile. It is at this stage that adding oneself as an upstream reviewer makes a lot of sense.
Alternatively, adding a MAINTAINERS entry for a specific driver is definitely helpful and will certainly result in the listed maintainer to be Cc'd on changes affecting it. But I would really like this maintainer to actively engage with upstream, rather than simply be on the receiving end of a stream of changes.
Thanks,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
Quoted 34 lines · Marc Zyngier
Hi Darren,
Quoted 21 lines · Darren Hart
Quoted 18 lines · Marc Zyngier
On Wed, 24 Nov 2021 17:07:07 +0000,
MAINTAINERS ACPI FOR ARM64 (ACPI/arm64) · line 388
Quoted 13 lines
MAINTAINERS +1
-0@@ -382,6 +382,7 @@ ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <[email protected]> M: Hanjun Guo <[email protected]> M: Sudeep Holla <[email protected]> +R: Tyler Baicar <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: MaintainedIsn't this a bit premature? This isn't even mentioned in the commit message, only in passing in the cover letter.
Quoted 8 lines
Hi Marc,
This was something I encouraged Tyler to add during internal review, both in response to the checkpatch.pl warning about adding new drivers as well as our interest in reviewing any future changes to the aest driver. Since refactoring is common, this level made sense to me - but would it be preferable to add a new entry for just the new driver Tyler added?
Quoted 8 lines
Adding someone as the co-maintainer/co-reviewer of a whole subsystem (ACPI/arm64 in this case) comes, IMO, with a number of pre-requisites:
has the proposed co-{maintainer,reviewer} contributed and/or reviewed a significant number of patches to that subsystem and/or actively participated in the public discussions on the design and the maintenance of the subsystem, so that their reviewing is authoritative enough? I won't be judge of this, but it is definitely something to consider.
Hi Marc,
Agreed. I applied similar criteria when considering sub maintainers for the platform/x86 subsystem while I maintained it.
Quoted 7 lines
I don't think preemptively adding someone to the
MAINTAINERSentry to indicate an interest in a whole subsystem is the right way to do it. One could argue that this is what a mailing list is for! ;-) On the other hand, an active participation to the review process is the perfect way to engage with fellow developers and to grow a profile. It is at this stage that adding oneself as an upstream reviewer makes a lot of sense.
Also generally agree. In this specific case, our interest was in the driver itself, and we had to decide between the whole subsystem or adding another F: entry in MAINTAINERS for the specific driver. Since drivers/acpi/arm64 only has 3 .c files in it, adding another entry seemed premature and overly granular. Certainly a subjective thing and we have no objection to adding the extra line if that's preferred. This should have been noted in the commit message.
Quoted 5 lines
Alternatively, adding a
MAINTAINERSentry for a specific driver is definitely helpful and will certainly result in the listed maintainer to be Cc'd on changes affecting it. But I would really like this maintainer to actively engage with upstream, rather than simply be on the receiving end of a stream of changes.
Agree for subsystems. For individual drivers, I think having the author as a reviewer is appropriate and should result in more patch reviews, which moves us in the direction of more community participation which we all want to see.
Thanks,
Signature · 2 lines
Darren Hart Ampere Computing / OS and Kernel
RE: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Tyler BaicarHi, Tyler.
We would like to make a few comments.
Quoted 34 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Thursday, November 25, 2021 2:07 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ishii, Shuuichirou/石井 周一郎 <[email protected]>; [email protected]
Cc: Tyler Baicar <[email protected]>
Subject: [PATCH 1/2] ACPI/AEST: Initial AEST driverAdd support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register interfaces.
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>---
[...]
Quoted 60 lines
drivers/acpi/arm64/aest.c new file +14
-0+static int __init aest_init_node (struct acpi_aest_hdr *node) +{ +union acpi_aest_processor_data *proc_data; +union aest_node_spec *node_spec; +struct aest_node_data *data; +int ret; + + data =kzalloc (sizeof (struct aest_node_data ),GFP_KERNEL ); +if (!data) +return -ENOMEM ; + + data->node_type = node->type; + + node_spec = ACPI_ADD_PTR(union aest_node_spec, node,
node->node_specific_offset);drivers/acpi/arm64/aest.c new file +4
-0+ +switch (node->type) { +case ACPI_AEST_PROCESSOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_processor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_MEMORY_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_memory));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_SMMU_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_smmu));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_VENDOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_vendor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_GIC_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_gic));drivers/acpi/arm64/aest.c new file +8
-0+break ; +default : +kfree (data); +return -EINVAL ; + } + +if (node->type ==ACPI_AEST_PROCESSOR_ERROR_NODE ) { + proc_data = ACPI_ADD_PTR(union acpi_aest_processor_data,
node_spec,drivers/acpi/arm64/aest.c new file +15
-0+ sizeof(acpi_aest_processor)); + +switch (data->data.processor.resource_type) { +case ACPI_AEST_CACHE_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_cache )); +break ; +case ACPI_AEST_TLB_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_tlb )); +break ; +case ACPI_AEST_GENERIC_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_generic )); +break ;
drivers/acpi/arm64/aest.c line 340
Quoted 10 lines
drivers/acpi/arm64/aest.c new file +10
-0+ } + } + + ret =aest_init_interface (node, data); +if (ret) { +kfree (data); +return ret; + } + +return aest_init_interrupts (node, data);
If aest_init_interrupts() failed, is it necessary to release the data pointer acquired by kzalloc?
Quoted 18 lines
drivers/acpi/arm64/aest.c new file +18
-0+} + +static void aest_count_ppi (struct acpi_aest_hdr *node) +{ +struct acpi_aest_node_interrupt *interrupt; +int i; + + interrupt = ACPI_ADD_PTR(struct acpi_aest_node_interrupt, node, + node->node_interrupt_offset); + +for (i =0 ; i < node->node_interrupt_count; i++, interrupt++) { +if (interrupt->gsiv >=16 && interrupt->gsiv <32 ) + num_ppi++; + } +} + +static int aest_starting_cpu (unsigned int cpu) +{
drivers/acpi/arm64/aest.c line 368
Quoted 10 lines
drivers/acpi/arm64/aest.c new file +10
-0+int i; + +for (i =0 ; i < num_ppi; i++) +enable_percpu_irq (ppi_irqs[i],IRQ_TYPE_NONE ); + +return 0 ; +} + +static int aest_dying_cpu (unsigned int cpu) +{
Wouldn't it be better to execute disable_percpu_irq(), which is paired with enable_percpu_irq(), in aest_dying_cpu()?
drivers/acpi/arm64/aest.c line 202
Quoted 3 lines
drivers/acpi/arm64/aest.c new file +3
-0+return 0 ; +} +
[...]
Best regards,
Shuuichirou.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Darren Hart-Moved ACPI for ARM64 maintainers to "to:"
Hi Marc, Darren,
Quoted 50 lines · Darren Hart
Quoted 29 lines · Marc Zyngier
Hi Darren,
Quoted 17 lines · Darren Hart
Quoted 16 lines · Marc Zyngier
On Wed, 24 Nov 2021 17:07:07 +0000,
MAINTAINERS ACPI FOR ARM64 (ACPI/arm64) · line 388
Quoted 12 lines
MAINTAINERS +1
-0@@ -382,6 +382,7 @@ ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <[email protected]> M: Hanjun Guo <[email protected]> M: Sudeep Holla <[email protected]> +R: Tyler Baicar <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: MaintainedIsn't this a bit premature? This isn't even mentioned in the commit message, only in passing in the cover letter.
Quoted 8 lines
Hi Marc,
This was something I encouraged Tyler to add during internal review, both in response to the checkpatch.pl warning about adding new drivers as well as our interest in reviewing any future changes to the aest driver. Since refactoring is common, this level made sense to me - but would it be preferable to add a new entry for just the new driver Tyler added?
Quoted 8 lines
Adding someone as the co-maintainer/co-reviewer of a whole subsystem (ACPI/arm64 in this case) comes, IMO, with a number of pre-requisites:
has the proposed co-{maintainer,reviewer} contributed and/or reviewed a significant number of patches to that subsystem and/or actively participated in the public discussions on the design and the maintenance of the subsystem, so that their reviewing is authoritative enough? I won't be judge of this, but it is definitely something to consider.Hi Marc,
Agreed. I applied similar criteria when considering sub maintainers for the platform/x86 subsystem while I maintained it.
Quoted 7 lines
I don't think preemptively adding someone to the
MAINTAINERSentry to indicate an interest in a whole subsystem is the right way to do it. One could argue that this is what a mailing list is for! ;-) On the other hand, an active participation to the review process is the perfect way to engage with fellow developers and to grow a profile. It is at this stage that adding oneself as an upstream reviewer makes a lot of sense.
Quoted 7 lines
Also generally agree. In this specific case, our interest was in the driver itself, and we had to decide between the whole subsystem or adding another F: entry in
MAINTAINERSfor the specific driver. Sincedrivers/acpi/arm64only has 3 .c files in it, adding another entry seemed premature and overly granular. Certainly a subjective thing and we have no objection to adding the extra line if that's preferred. This should have been noted in the commit message.
Thank you for the feedback here, I will make sure to add this to the commit message and cover letter in the next version.
Hi Lorenzo, Hanjun, Sudeep,
As for adding myself as a reviewer under ACPI for ARM64 or adding another F: entry, do you have a preference or guidance on what I should do here?
Thanks,
Tyler
Quoted 11 lines
Quoted 5 lines
Alternatively, adding a
MAINTAINERSentry for a specific driver is definitely helpful and will certainly result in the listed maintainer to be Cc'd on changes affecting it. But I would really like this maintainer to actively engage with upstream, rather than simply be on the receiving end of a stream of changes.Agree for subsystems. For individual drivers, I think having the author as a reviewer is appropriate and should result in more patch reviews, which moves us in the direction of more community participation which we all want to see.
Thanks,
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Mark RutlandHi Mark,
Thank you for the initial feedback!
Quoted 6 lines · Mark Rutland
Hi,
I haven't looked at this in great detail, but I spotted a few issues from an initial scan.
On Wed, Nov 24, 2021 at 12:07:07PM -0500, Tyler Baicar wrote:
Quoted 8 lines
Quoted 7 lines
Add support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register interfaces.
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Can we actually assume that? What does the specification mandate?
The ARM Architecture Reference Manual Supplement RAS document (https://developer.arm.com/documentation/ddi0587/latest) states in section 3.9 the following:
"For an Arm Generic Interrupt Controller (GIC), if the error records of the node that generates the interrupts are only accessible via the System registers of one or more PEs, Arm strongly recommends that the interrupt is a Private Peripheral Interrupt (PPI) targeting that PE or one of those PEs."
Quoted 3 lines
Quoted 2 lines
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Has this been tested on any hardware or software platform?
Yes, I have tested this on Ampere Altra hardware. I've tested both the PPI and SPI interrupt handling as well as system register and memory mapped interface options.
Quoted 5 lines
[...]
Quoted 1 line
+#define
ERRDEVARCH_REV_SHIFT0x16IIUC This should be 16, not
0x16(i.e. 22).
Yes, this should be 16. I'll fix that in the next version.
Quoted 7 lines
Quoted 7 lines
arch/arm64/include/asm/ras.h new file +7
-0+#define ERRDEVARCH_REV_MASK 0xf + +#define RAS_REV_v1_1 0x1 + +struct ras_ext_regs { +u64 err_fr; +u64 err_ctlr;
Quoted 8 lines
arch/arm64/include/asm/ras.h line 40
Quoted 7 lines
arch/arm64/include/asm/ras.h new file +7
-0+u64 err_status; +u64 err_addr; +u64 err_misc0; +u64 err_misc1; +u64 err_misc2; +u64 err_misc3; +};These last four might be better an an array.
Will do.
Quoted 14 lines
[...]
arch/arm64/kernel/ras.c line 16
Quoted 8 lines
arch/arm64/kernel/ras.c new file +8
-0+static bool ras_extn_v1p1 (void ) +{ +unsigned long fld, reg =read_sanitised_ftr_reg (SYS_ID_AA64PFR0_EL1 ); + + fld =cpuid_feature_extract_unsigned_field (reg,ID_AA64PFR0_RAS_SHIFT ); + +return fld >=ID_AA64PFR0_RAS_V1P1 ; +}I suspect it'd be better to pass this value around directly as
version, rather than dropping this into amisc23_presenttemporary variable, as that would be a little clearer, and future-proof if/when more registers get added.
That's a good point. I'll update this in the next version.
Quoted 16 lines
[...]
arch/arm64/kernel/ras.c line 65
Quoted 12 lines
arch/arm64/kernel/ras.c new file +12
-0+void arch_arm_ras_report_error (u64 implemented,bool clear_misc) +{ +struct ras_ext_regs regs = {0 }; +unsigned int i, cpu_num; +bool misc23_present; +bool fatal = false; +u64 num_records; + +if (!this_cpu_has_cap (ARM64_HAS_RAS_EXTN )) +return ; + + cpu_num =get_cpu ();Why
get_cpu()here? Do you just needsmp_processor_id()?
Quoted 6 lines
The commit message explained that this would be PE-local (e.g. in a PPI handler), and we've already checked
this_cpu_has_cap()which assumes we're not preemptible.So I don't see why we should use
get_cpu()here -- any time it would have a difference implies something has already gone wrong.
Yes, will update.
Quoted 8 lines
Quoted 8 lines
arch/arm64/kernel/ras.c new file +8
-0+ num_records =read_sysreg_s (SYS_ERRIDR_EL1 ) &ERRIDR_NUM_MASK ; + +for (i =0 ; i < num_records; i++) { +if (!(implemented &BIT (i))) +continue ; + +write_sysreg_s (i,SYS_ERRSELR_EL1 ); +isb ();
Quoted 8 lines
arch/arm64/kernel/ras.c line 79
Quoted 6 lines
arch/arm64/kernel/ras.c new file +6
-0+ regs.err_status =read_sysreg_s (SYS_ERXSTATUS_EL1 ); + +if (!(regs.err_status &ERR_STATUS_V )) +continue ; + +pr_err ("error from processor 0x%x\n" , cpu_num);Why in hex? We normally print 'cpu%d' or 'CPU%d', since this is a logical ID anyway.
I will update to use decimal print.
Quoted 8 lines
arch/arm64/kernel/ras.c line 84
Quoted 5 lines
arch/arm64/kernel/ras.c new file +5
-0+ +if (regs.err_status &ERR_STATUS_AV ) + regs.err_addr =read_sysreg_s (SYS_ERXADDR_EL1 ); + + misc23_present =ras_extn_v1p1 ();As above, I reckon it's better to have this as 'version' or '
ras_version', and have the checks below be:
Quoted 4 lines
if (version >= ID_AA64PFR0_RAS_V1P1) {
// poke SYS_ERXMISC2_EL1
// poke SYS_ERXMISC3_EL1
}Will do.
Quoted 51 lines
Quoted 22 lines
arch/arm64/kernel/ras.c new file +22
-0+ +if (regs.err_status &ERR_STATUS_MV ) { + regs.err_misc0 =read_sysreg_s (SYS_ERXMISC0_EL1 ); + regs.err_misc1 =read_sysreg_s (SYS_ERXMISC1_EL1 ); + +if (misc23_present) { + regs.err_misc2 =read_sysreg_s (SYS_ERXMISC2_EL1 ); + regs.err_misc3 =read_sysreg_s (SYS_ERXMISC3_EL1 ); + } + } + +arch_arm_ras_print_error (®s, i, misc23_present); + +/* +* In the future, we will treat UER conditions as potentially +* recoverable. +*/ +if (regs.err_status &ERR_STATUS_UE ) + fatal = true; + + regs.err_status =arch_arm_ras_get_status_clear_value (regs.err_status); +write_sysreg_s (regs.err_status,SYS_ERXSTATUS_EL1 );arch/arm64/kernel/ras.c line 116
Quoted 10 lines
arch/arm64/kernel/ras.c new file +10
-0+ +if (clear_misc) { +write_sysreg_s (0x0 ,SYS_ERXMISC0_EL1 ); +write_sysreg_s (0x0 ,SYS_ERXMISC1_EL1 ); + +if (misc23_present) { +write_sysreg_s (0x0 ,SYS_ERXMISC2_EL1 ); +write_sysreg_s (0x0 ,SYS_ERXMISC3_EL1 ); + } + }Any reason not to clear when we read, above? e.g.
#define
READ_CLEAR_MISC(nr, clear)\({ \ unsigned long __val = read_sysreg_s(SYS_ERXMISC##nr##_EL1); \ if (clear); \ write_sysreg_s(0, SYS_ERXMISC##nr##_EL1); \ __val; \ })if (regs.err_status & ERR_STATUS_MV) { regs.err_misc0 = READ_CLEAR_MISC(0, clear_misc); regs.err_misc1 = READ_CLEAR_MISC(1, clear_misc); if (version >= ID_AA64PFR0_RAS_V1P1) { regs.err_misc2 = READ_CLEAR_MISC(2, clear_misc); regs.err_misc3 = READ_CLEAR_MISC(3, clear_misc); }
Quoted 3 lines
}
... why does the clearing need to be conditional?
I like this proposal and will adopt it in the next version. The clearing is conditional based on an option in the ACPI table. The misc registers report mostly IMPDEF information which may or may not need to be cleared after reporting depending on the hardware IP.
Quoted 13 lines
Quoted 13 lines
arch/arm64/kernel/ras.c new file +9
-0+ +isb (); + } + +if (fatal) +panic ("ARM RAS: uncorrectable error encountered" ); + +put_cpu (); +}arch/arm64/kvm/sys_regs.c +0
-0
Quoted 8 lines
arch/arm64/kvm/sys_regs.c static const struct sys_reg_desc sys_reg_descs[] = { · line 1577
Quoted 6 lines
arch/arm64/kvm/sys_regs.c +2
-0@@ -1573,6 +1573,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_ERXADDR_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC0_EL1), trap_raz_wi }, { SYS_DESC(SYS_ERXMISC1_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC2_EL1), trap_raz_wi }, + { SYS_DESC(SYS_ERXMISC3_EL1), trap_raz_wi },This should be a preparatory patch; this is preumably a latent bug in KVM.
I'll separate this into it's own patch. It's not just a bug in KVM, these system registers are not defined at all today in the arm64 sysreg.h file (adding those is part of this patch as well).
Quoted 7 lines
[...]
arch/arm64/kvm/sys_regs.c
Quoted 4 lines
arch/arm64/kvm/sys_regs.c +4
-0+static struct aest_node_data __percpu **ppi_data; +static int ppi_irqs[AEST_MAX_PPI ]; +static u8 num_ppi; +static u8 ppi_idx;As above, do we have any guarantee these are actually PPIs?
Yes, aest_register_gsi() sets these up so that only PPIs are added to the PPI list.
Quoted 26 lines
arch/arm64/kvm/sys_regs.c
Quoted 10 lines
arch/arm64/kvm/sys_regs.c +10
-0+static bool aest_mmio_ras_misc23_present (u64 base_addr) +{ +u32 val; + + val =readl ((void *) (base_addr +ERRDEVARCH_OFFSET )); + val <<=ERRDEVARCH_REV_SHIFT ; + val &=ERRDEVARCH_REV_MASK ; + +return val >= RAS_REV_v1_1; +}Is the shift the wrong way around?
Above we have:
#define ERRDEVARCH_REV_SHIFT 0x16 #define ERRDEVARCH_REV_MASK 0xf #define RAS_REV_v1_1 0x1.. so this is:
val <<= 0x16; val &= 0xf; // val[0x15:0] == 0, so this is 0 return val >= 0x1; // false
Quoted 4 lines
It'd be nicer to use
FIELD_GET()here.As above, I also think it would be better to retrun the value of the field, and check that explciitly, for future proofing.
Yes, I can do that. When I tested this the IP I used did not have a DEVARCH register which followed the spec, otherwise I would have caught this.
Quoted 68 lines
[...]
Quoted 65 lines
arch/arm64/kvm/sys_regs.c +65
-0+static void aest_proc (struct aest_node_data *data) +{ +struct ras_ext_regs *regs_p, regs = {0 }; +bool misc23_present; +bool fatal = false; +u64 errgsr =0 ; +int i; + +/* +* Currently SR based handling is done through the architected +* discovery exposed through SRs. That may change in the future +* if there is supplemental information in the AEST that is +* needed. +*/ +if (data->interface.type ==ACPI_AEST_NODE_SYSTEM_REGISTER ) { +arch_arm_ras_report_error (data->interface.implemented, + data->interface.flags &AEST_INTERFACE_CLEAR_MISC ); +return ; + } + + regs_p = data->interface.regs; + errgsr =readq ((void *) (((u64 ) regs_p) +ERRGSR_OFFSET )); + +for (i = data->interface.start; i < data->interface.end; i++) { +if (!(data->interface.implemented &BIT (i))) +continue ; + +if (!(data->interface.status_reporting &BIT (i)) && !(errgsr &BIT (i))) +continue ; + + regs.err_status =readq (®s_p[i].err_status); +if (!(regs.err_status &ERR_STATUS_V )) +continue ; + +if (regs.err_status &ERR_STATUS_AV ) + regs.err_addr =readq (®s_p[i].err_addr); + + regs.err_fr =readq (®s_p[i].err_fr); + regs.err_ctlr =readq (®s_p[i].err_ctlr); + +if (regs.err_status &ERR_STATUS_MV ) { + misc23_present =aest_mmio_ras_misc23_present ((u64 ) regs_p); + regs.err_misc0 =readq (®s_p[i].err_misc0); + regs.err_misc1 =readq (®s_p[i].err_misc1); + +if (misc23_present) { + regs.err_misc2 =readq (®s_p[i].err_misc2); + regs.err_misc3 =readq (®s_p[i].err_misc3); + } + } + +aest_print (data, regs, i, misc23_present); + +if (regs.err_status &ERR_STATUS_UE ) + fatal = true; + + regs.err_status =arch_arm_ras_get_status_clear_value (regs.err_status); +writeq (regs.err_status, ®s_p[i].err_status); + +if (data->interface.flags &AEST_INTERFACE_CLEAR_MISC ) { +writeq (0x0 , ®s_p[i].err_misc0); +writeq (0x0 , ®s_p[i].err_misc1); + +if (misc23_present) { +writeq (0x0 , ®s_p[i].err_misc2);
Quoted 8 lines
arch/arm64/kvm/sys_regs.c
Quoted 7 lines
arch/arm64/kvm/sys_regs.c +7
-0+writeq (0x0 , ®s_p[i].err_misc3); + } + } + } + +if (fatal) +panic ("AEST: uncorrectable error encountered" );Why don't we call
panic()as soon as we realise an error is fatal?
Good point. We should panic at least before clearing the error. I think the panic should happen immediately after the aest_print() call, do you agree? We should still print the error before panicking (APEI/GHES prints the full error prior to panicking as well).
Thanks,
Tyler
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to [email protected]Hi Shuuichirou,
Thank you for your feedback!
Quoted 104 lines · On 12/9/2021 3:10 AM, [email protected] wrote:
Hi, Tyler.
We would like to make a few comments.
Quoted 34 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Thursday, November 25, 2021 2:07 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ishii, Shuuichirou/石井 周一郎 <[email protected]>; [email protected]
Cc: Tyler Baicar <[email protected]>
Subject: [PATCH 1/2] ACPI/AEST: Initial AEST driverAdd support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register interfaces.
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>---
[...]
Quoted 64 lines
drivers/acpi/arm64/aest.c new file +14
-0+static int __init aest_init_node (struct acpi_aest_hdr *node) +{ +union acpi_aest_processor_data *proc_data; +union aest_node_spec *node_spec; +struct aest_node_data *data; +int ret; + + data =kzalloc (sizeof (struct aest_node_data ),GFP_KERNEL ); +if (!data) +return -ENOMEM ; + + data->node_type = node->type; + + node_spec = ACPI_ADD_PTR(union aest_node_spec, node,
node->node_specific_offset);drivers/acpi/arm64/aest.c new file +4
-0+ +switch (node->type) { +case ACPI_AEST_PROCESSOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_processor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_MEMORY_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_memory));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_SMMU_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_smmu));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_VENDOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_vendor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_GIC_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_gic));drivers/acpi/arm64/aest.c new file +8
-0+break ; +default : +kfree (data); +return -EINVAL ; + } + +if (node->type ==ACPI_AEST_PROCESSOR_ERROR_NODE ) { + proc_data = ACPI_ADD_PTR(union acpi_aest_processor_data,
node_spec,drivers/acpi/arm64/aest.c new file +19
-0+ sizeof(acpi_aest_processor)); + +switch (data->data.processor.resource_type) { +case ACPI_AEST_CACHE_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_cache )); +break ; +case ACPI_AEST_TLB_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_tlb )); +break ; +case ACPI_AEST_GENERIC_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_generic )); +break ; + } + } + + ret =aest_init_interface (node, data);
Quoted 8 lines
drivers/acpi/arm64/aest.c line 340
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+if (ret) { +kfree (data); +return ret; + } + +return aest_init_interrupts (node, data);If
aest_init_interrupts()failed, is it necessary to release the data pointer acquired by kzalloc?
aest_init_interrupts() returns an error if any of the interrupts in the interrupt list fails, but it's possible that some interrupts in the list registered successfully. So we attempt to keep chugging along in that scenario because some interrupts may be enabled and registered with the interface successfully. If any interrupt registration fails, there will be a print notifying that there was a failure when initializing that node.
Quoted 22 lines
Quoted 22 lines
drivers/acpi/arm64/aest.c new file +22
-0+} + +static void aest_count_ppi (struct acpi_aest_hdr *node) +{ +struct acpi_aest_node_interrupt *interrupt; +int i; + + interrupt = ACPI_ADD_PTR(struct acpi_aest_node_interrupt, node, + node->node_interrupt_offset); + +for (i =0 ; i < node->node_interrupt_count; i++, interrupt++) { +if (interrupt->gsiv >=16 && interrupt->gsiv <32 ) + num_ppi++; + } +} + +static int aest_starting_cpu (unsigned int cpu) +{ +int i; + +for (i =0 ; i < num_ppi; i++) +enable_percpu_irq (ppi_irqs[i],IRQ_TYPE_NONE );
Quoted 8 lines
drivers/acpi/arm64/aest.c line 368
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+ +return 0 ; +} + +static int aest_dying_cpu (unsigned int cpu) +{Wouldn't it be better to execute
disable_percpu_irq(), which is paired withenable_percpu_irq(), inaest_dying_cpu()?
Good point. I will add that in the next version.
Thanks,
Tyler
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Tyler BaicarQuoted 63 lines · Tyler Baicar
-Moved ACPI for ARM64 maintainers to "to:"
Hi Marc, Darren,
Quoted 50 lines · Darren Hart
Quoted 29 lines · Marc Zyngier
Hi Darren,
Quoted 17 lines · Darren Hart
Quoted 16 lines · Marc Zyngier
On Wed, 24 Nov 2021 17:07:07 +0000,
MAINTAINERS ACPI FOR ARM64 (ACPI/arm64) · line 388
Quoted 12 lines
MAINTAINERS +1
-0@@ -382,6 +382,7 @@ ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <[email protected]> M: Hanjun Guo <[email protected]> M: Sudeep Holla <[email protected]> +R: Tyler Baicar <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: MaintainedIsn't this a bit premature? This isn't even mentioned in the commit message, only in passing in the cover letter.
Quoted 8 lines
Hi Marc,
This was something I encouraged Tyler to add during internal review, both in response to the checkpatch.pl warning about adding new drivers as well as our interest in reviewing any future changes to the aest driver. Since refactoring is common, this level made sense to me - but would it be preferable to add a new entry for just the new driver Tyler added?
Quoted 8 lines
Adding someone as the co-maintainer/co-reviewer of a whole subsystem (ACPI/arm64 in this case) comes, IMO, with a number of pre-requisites:
has the proposed co-{maintainer,reviewer} contributed and/or reviewed a significant number of patches to that subsystem and/or actively participated in the public discussions on the design and the maintenance of the subsystem, so that their reviewing is authoritative enough? I won't be judge of this, but it is definitely something to consider.Hi Marc,
Agreed. I applied similar criteria when considering sub maintainers for the platform/x86 subsystem while I maintained it.
Quoted 7 lines
I don't think preemptively adding someone to the
MAINTAINERSentry to indicate an interest in a whole subsystem is the right way to do it. One could argue that this is what a mailing list is for! ;-) On the other hand, an active participation to the review process is the perfect way to engage with fellow developers and to grow a profile. It is at this stage that adding oneself as an upstream reviewer makes a lot of sense.Quoted 7 lines
Also generally agree. In this specific case, our interest was in the driver itself, and we had to decide between the whole subsystem or adding another F: entry in
MAINTAINERSfor the specific driver. Sincedrivers/acpi/arm64only has 3 .c files in it, adding another entry seemed premature and overly granular. Certainly a subjective thing and we have no objection to adding the extra line if that's preferred. This should have been noted in the commit message.
Quoted 2 lines
Thank you for the feedback here, I will make sure to add this to the commit message and cover letter in the next version.
Hi Marc,
Thanks for responding and providing all the necessary details.
Quoted 6 lines
Hi Lorenzo, Hanjun, Sudeep,
As for adding myself as a reviewer under ACPI for ARM64 or adding another F:
entry, do you have a preference or guidance on what I should do here?
I prefer to start with an entry specific to the $subject driver for all the reasons Marc has already stated. It may also add confusion and provide misleading reference to others who want to maintain specific drivers like this in the future. Further it will result in this list to grow even though not all in that will be interested in reviewing or maintaining ARM64 ACPI subsystem if we take the approach in this patch and more confusion to the developers.
Ofcourse if you are interested and get engaged in the review of ARM64 ACPI in the future we can always revisit and update accordingly.
Hope this helps and provides clarification you are looking for.
Signature · 2 lines
Regards, Sudeep
RE: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Tyler BaicarHi, Tyler.
When do you plan to post the v2 patch series?
Please let me know if you don't mind.
Best regards.
Quoted 182 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Friday, December 17, 2021 8:33 AM
To: Ishii, Shuuichirou/石井 周一郎 <[email protected]>; 'Tyler Baicar' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/2] ACPI/AEST: Initial AEST driverHi Shuuichirou,
Thank you for your feedback!
Quoted 29 lines · On 12/9/2021 3:10 AM, [email protected] wrote:
Hi, Tyler.
We would like to make a few comments.
Quoted 25 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Thursday, November 25, 2021 2:07 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ishii, Shuuichirou/石井
周一郎 <[email protected]>; [email protected]
Cc: Tyler Baicar <[email protected]>
Subject: [PATCH 1/2] ACPI/AEST: Initial AEST driverAdd support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register
interfaces.
Quoted 76 lines
Quoted 11 lines
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>---
[...]
Quoted 63 lines
drivers/acpi/arm64/aest.c new file +13
-0+static int __init aest_init_node (struct acpi_aest_hdr *node) { +union acpi_aest_processor_data *proc_data; +union aest_node_spec *node_spec; +struct aest_node_data *data; +int ret; + + data =kzalloc (sizeof (struct aest_node_data ),GFP_KERNEL ); +if (!data) +return -ENOMEM ; + + data->node_type = node->type; + + node_spec = ACPI_ADD_PTR(union aest_node_spec, node,
node->node_specific_offset);drivers/acpi/arm64/aest.c new file +4
-0+ +switch (node->type) { +case ACPI_AEST_PROCESSOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_processor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_MEMORY_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_memory));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_SMMU_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_smmu));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_VENDOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_vendor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_GIC_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_gic));drivers/acpi/arm64/aest.c new file +8
-0+break ; +default : +kfree (data); +return -EINVAL ; + } + +if (node->type ==ACPI_AEST_PROCESSOR_ERROR_NODE ) { + proc_data = ACPI_ADD_PTR(union acpi_aest_processor_data,
node_spec,drivers/acpi/arm64/aest.c new file +19
-0+ sizeof(acpi_aest_processor)); + +switch (data->data.processor.resource_type) { +case ACPI_AEST_CACHE_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_cache )); +break ; +case ACPI_AEST_TLB_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_tlb )); +break ; +case ACPI_AEST_GENERIC_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_generic )); +break ; + } + } + + ret =aest_init_interface (node, data);Quoted 8 lines
drivers/acpi/arm64/aest.c line 340
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+if (ret) { +kfree (data); +return ret; + } + +return aest_init_interrupts (node, data);If
aest_init_interrupts()failed, is it necessary to release the data pointer acquired by kzalloc?
aest_init_interrupts()returns an error if any of the interrupts in the interrupt list fails, but it's possible that some interrupts in the list registered successfully. So we attempt to keep chugging along in that scenario because some interrupts may be enabled and registered with the interface successfully. If any interrupt registration fails, there will be a print notifying that there was a failure when initializing that node.Quoted 22 lines
Quoted 22 lines
drivers/acpi/arm64/aest.c new file +22
-0+} + +static void aest_count_ppi (struct acpi_aest_hdr *node) +{ +struct acpi_aest_node_interrupt *interrupt; +int i; + + interrupt = ACPI_ADD_PTR(struct acpi_aest_node_interrupt, node, + node->node_interrupt_offset); + +for (i =0 ; i < node->node_interrupt_count; i++, interrupt++) { +if (interrupt->gsiv >=16 && interrupt->gsiv <32 ) + num_ppi++; + } +} + +static int aest_starting_cpu (unsigned int cpu) +{ +int i; + +for (i =0 ; i < num_ppi; i++) +enable_percpu_irq (ppi_irqs[i],IRQ_TYPE_NONE );Quoted 8 lines
drivers/acpi/arm64/aest.c line 368
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+ +return 0 ; +} + +static int aest_dying_cpu (unsigned int cpu) +{Wouldn't it be better to execute
disable_percpu_irq(), which is paired withenable_percpu_irq(), inaest_dying_cpu()?Good point. I will add that in the next version.
Thanks,
Tyler
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
Hi Shuuichirou,
I should be able to get a v2 patch series out by the end of the month.
Thanks,
Tyler
Quoted 190 lines · On 4/20/2022 3:54 AM, [email protected] wrote:
Hi, Tyler.
When do you plan to post the v2 patch series?
Please let me know if you don't mind.Best regards.
Quoted 182 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Friday, December 17, 2021 8:33 AM
To: Ishii, Shuuichirou/石井 周一郎 <[email protected]>; 'Tyler Baicar' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/2] ACPI/AEST: Initial AEST driverHi Shuuichirou,
Thank you for your feedback!
Quoted 29 lines · On 12/9/2021 3:10 AM, [email protected] wrote:
Hi, Tyler.
We would like to make a few comments.
Quoted 25 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Thursday, November 25, 2021 2:07 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ishii, Shuuichirou/石井
周一郎 <[email protected]>; [email protected]
Cc: Tyler Baicar <[email protected]>
Subject: [PATCH 1/2] ACPI/AEST: Initial AEST driverAdd support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register
interfaces.
Quoted 76 lines
Quoted 11 lines
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>---
[...]
Quoted 63 lines
drivers/acpi/arm64/aest.c new file +13
-0+static int __init aest_init_node (struct acpi_aest_hdr *node) { +union acpi_aest_processor_data *proc_data; +union aest_node_spec *node_spec; +struct aest_node_data *data; +int ret; + + data =kzalloc (sizeof (struct aest_node_data ),GFP_KERNEL ); +if (!data) +return -ENOMEM ; + + data->node_type = node->type; + + node_spec = ACPI_ADD_PTR(union aest_node_spec, node,
node->node_specific_offset);drivers/acpi/arm64/aest.c new file +4
-0+ +switch (node->type) { +case ACPI_AEST_PROCESSOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_processor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_MEMORY_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_memory));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_SMMU_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_smmu));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_VENDOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_vendor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_GIC_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_gic));drivers/acpi/arm64/aest.c new file +8
-0+break ; +default : +kfree (data); +return -EINVAL ; + } + +if (node->type ==ACPI_AEST_PROCESSOR_ERROR_NODE ) { + proc_data = ACPI_ADD_PTR(union acpi_aest_processor_data,
node_spec,drivers/acpi/arm64/aest.c new file +19
-0+ sizeof(acpi_aest_processor)); + +switch (data->data.processor.resource_type) { +case ACPI_AEST_CACHE_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_cache )); +break ; +case ACPI_AEST_TLB_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_tlb )); +break ; +case ACPI_AEST_GENERIC_RESOURCE : +memcpy (&data->proc_data, proc_data, +sizeof (struct acpi_aest_processor_generic )); +break ; + } + } + + ret =aest_init_interface (node, data);Quoted 8 lines
drivers/acpi/arm64/aest.c line 340
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+if (ret) { +kfree (data); +return ret; + } + +return aest_init_interrupts (node, data);If
aest_init_interrupts()failed, is it necessary to release the data pointer acquired by kzalloc?
aest_init_interrupts()returns an error if any of the interrupts in the interrupt list fails, but it's possible that some interrupts in the list registered successfully. So we attempt to keep chugging along in that scenario because some interrupts may be enabled and registered with the interface successfully. If any interrupt registration fails, there will be a print notifying that there was a failure when initializing that node.Quoted 22 lines
Quoted 22 lines
drivers/acpi/arm64/aest.c new file +22
-0+} + +static void aest_count_ppi (struct acpi_aest_hdr *node) +{ +struct acpi_aest_node_interrupt *interrupt; +int i; + + interrupt = ACPI_ADD_PTR(struct acpi_aest_node_interrupt, node, + node->node_interrupt_offset); + +for (i =0 ; i < node->node_interrupt_count; i++, interrupt++) { +if (interrupt->gsiv >=16 && interrupt->gsiv <32 ) + num_ppi++; + } +} + +static int aest_starting_cpu (unsigned int cpu) +{ +int i; + +for (i =0 ; i < num_ppi; i++) +enable_percpu_irq (ppi_irqs[i],IRQ_TYPE_NONE );Quoted 8 lines
drivers/acpi/arm64/aest.c line 368
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+ +return 0 ; +} + +static int aest_dying_cpu (unsigned int cpu) +{Wouldn't it be better to execute
disable_percpu_irq(), which is paired withenable_percpu_irq(), inaest_dying_cpu()?Good point. I will add that in the next version.
Thanks,
Tyler
RE: [PATCH 1/2] ACPI/AEST: Initial AEST driver
Hi, Tyler
Thank you for your reply.
After the v2 patch series is posted,
we would like to review the source locations we noted.
Best regards,
Shuuichirou.
Quoted 228 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Monday, May 9, 2022 10:38 PM
To: Ishii, Shuuichirou/石井 周一郎 <[email protected]>; 'Tyler Baicar' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/2] ACPI/AEST: Initial AEST driverHi Shuuichirou,
I should be able to get a v2 patch series out by the end of the month.
Thanks,
TylerQuoted 11 lines · On 4/20/2022 3:54 AM, [email protected] wrote:
Hi, Tyler.
When do you plan to post the v2 patch series?
Please let me know if you don't mind.Best regards.
Quoted 4 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Friday, December 17, 2021 8:33 AM
To: Ishii, Shuuichirou/石井 周一郎 <[email protected]>; 'TylerBaicar'
Quoted 24 lines
Quoted 24 lines
<[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/2] ACPI/AEST: Initial AEST driverHi Shuuichirou,
Thank you for your feedback!
On 12/9/2021 3:10 AM, [email protected] wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Hi, Tyler.
We would like to make a few comments.
Quoted 4 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Thursday, November 25, 2021 2:07 AM
To: [email protected];Quoted 71 lines
Quoted 71 lines
Quoted 19 lines
Quoted 19 lines
[email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ishii, Shuuichirou/石井
周一郎 <[email protected]>; [email protected]
Cc: Tyler Baicar <[email protected]>
Subject: [PATCH 1/2] ACPI/AEST: Initial AEST driverQuoted 3 lines
Quoted 3 lines
Add support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register
interfaces.
Quoted 48 lines
Quoted 11 lines
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>---
[...]
Quoted 35 lines
drivers/acpi/arm64/aest.c new file +13
-0+static int __init aest_init_node (struct acpi_aest_hdr *node) { +union acpi_aest_processor_data *proc_data; +union aest_node_spec *node_spec; +struct aest_node_data *data; +int ret; + + data =kzalloc (sizeof (struct aest_node_data ),GFP_KERNEL ); +if (!data) +return -ENOMEM ; + + data->node_type = node->type; + + node_spec = ACPI_ADD_PTR(union aest_node_spec, node,
node->node_specific_offset);drivers/acpi/arm64/aest.c new file +4
-0+ +switch (node->type) { +case ACPI_AEST_PROCESSOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_processor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_MEMORY_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_memory));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_SMMU_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_smmu));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_VENDOR_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_vendor));drivers/acpi/arm64/aest.c new file +3
-0+break ; +case ACPI_AEST_GIC_ERROR_NODE : + memcpy(&data->data, node_spec, sizeof(struct
acpi_aest_gic));Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/acpi/arm64/aest.c
Quoted 8 lines
drivers/acpi/arm64/aest.c new file +8
-0+break ; +default : +kfree (data); +return -EINVAL ; + } + +if (node->type ==ACPI_AEST_PROCESSOR_ERROR_NODE ) { + proc_data = ACPI_ADD_PTR(union
acpi_aest_processor_data,Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
node_spec,
+
sizeof(acpi_aest_processor));Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/acpi/arm64/aest.c
Quoted 5 lines
drivers/acpi/arm64/aest.c new file +5
-0+ +switch (data->data.processor.resource_type) { +case ACPI_AEST_CACHE_RESOURCE : + memcpy(&data->proc_data, proc_data, + sizeof(struct
acpi_aest_processor_cache));Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/acpi/arm64/aest.c
Quoted 4 lines
drivers/acpi/arm64/aest.c new file +4
-0+break ; +case ACPI_AEST_TLB_RESOURCE : + memcpy(&data->proc_data, proc_data, + sizeof(struct
acpi_aest_processor_tlb));Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/acpi/arm64/aest.c
Quoted 4 lines
drivers/acpi/arm64/aest.c new file +4
-0+break ; +case ACPI_AEST_GENERIC_RESOURCE : + memcpy(&data->proc_data, proc_data, + sizeof(struct
acpi_aest_processor_generic));Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/acpi/arm64/aest.c line 340
Quoted 11 lines
drivers/acpi/arm64/aest.c new file +11
-0+break ; + } + } + + ret =aest_init_interface (node, data); +if (ret) { +kfree (data); +return ret; + } + +return aest_init_interrupts (node, data);If
aest_init_interrupts()failed, is it necessary to release the data pointer acquired by kzalloc?Quoted 6 lines
Quoted 6 lines
aest_init_interrupts()returns an error if any of the interrupts in the interrupt list fails, but it's possible that some interrupts in the list registered successfully. So we attempt to keep chugging along in that scenario because some interrupts may be enabled and registered with the interface successfully. If any interrupt registration fails, there will be a print notifying that there was a failure wheninitializing that node.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/acpi/arm64/aest.c
Quoted 7 lines
drivers/acpi/arm64/aest.c new file +7
-0+} + +static void aest_count_ppi (struct acpi_aest_hdr *node) { +struct acpi_aest_node_interrupt *interrupt; +int i; + + interrupt = ACPI_ADD_PTR(struct acpi_aest_node_interrupt,node,
Quoted 27 lines
Quoted 26 lines
Quoted 12 lines
Quoted 12 lines
drivers/acpi/arm64/aest.c new file +12
-0+ node->node_interrupt_offset); + +for (i =0 ; i < node->node_interrupt_count; i++, interrupt++) { +if (interrupt->gsiv >=16 && interrupt->gsiv <32 ) + num_ppi++; + } +} + +static int aest_starting_cpu (unsigned int cpu) { +int i; + +for (i =0 ; i < num_ppi; i++)Quoted 8 lines
drivers/acpi/arm64/aest.c
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+enable_percpu_irq (ppi_irqs[i],IRQ_TYPE_NONE ); + +return 0 ; +} + +static int aest_dying_cpu (unsigned int cpu) {Wouldn't it be better to execute
disable_percpu_irq(), which is paired withenable_percpu_irq(), inaest_dying_cpu()?Good point. I will add that in the next version.
Thanks,
Tyler
Re: [PATCH 1/2] ACPI/AEST: Initial AEST driver
In reply to Tyler BaicarHi, Tyler.
I am very interested in your work about AEST.
When do you plan to update the v2 patch series?
Best regards.
Quoted 202 lines · Tyler Baicar
Hi Shuuichirou,
I should be able to get a v2 patch series out by the end of the month.
Thanks,
TylerQuoted 190 lines · On 4/20/2022 3:54 AM, [email protected] wrote:
Hi, Tyler.
When do you plan to post the v2 patch series?
Please let me know if you don't mind.Best regards.
Quoted 182 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Friday, December 17, 2021 8:33 AM
To: Ishii, Shuuichirou/石井 周一郎 <[email protected]>; 'Tyler Baicar' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/2] ACPI/AEST: Initial AEST driverHi Shuuichirou,
Thank you for your feedback!
Quoted 29 lines · On 12/9/2021 3:10 AM, [email protected] wrote:
Hi, Tyler.
We would like to make a few comments.
Quoted 25 lines
-----Original Message-----
From: Tyler Baicar <[email protected]>
Sent: Thursday, November 25, 2021 2:07 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ishii, Shuuichirou/石井
周一郎 <[email protected]>; [email protected]
Cc: Tyler Baicar <[email protected]>
Subject: [PATCH 1/2] ACPI/AEST: Initial AEST driverAdd support for parsing the ARM Error Source Table and basic handling of errors reported through both memory mapped and system register
interfaces.
Quoted 76 lines
Quoted 11 lines
Assume system register interfaces are only registered with private peripheral interrupts (PPIs); otherwise there is no guarantee the core handling the error is the core which took the error and has the syndrome info in its system registers.
Add logging for all detected errors and trigger a kernel panic if there is any uncorrected error present.
Signed-off-by Tyler Baicar <[email protected]>---
[...]
Quoted 63 lines
drivers/acpi/arm64/aest.c new file +13
-0+static int __init aest_init_node (struct acpi_aest_hdr *node) { + union acpi_aest_processor_data *proc_data; + union aest_node_spec *node_spec; + struct aest_node_data *data; + int ret; + + data = kzalloc(sizeof(struct aest_node_data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->node_type = node->type; + + node_spec = ACPI_ADD_PTR(union aest_node_spec, node,
node->node_specific_offset);
+
+ switch (node->type) {
+ caseACPI_AEST_PROCESSOR_ERROR_NODE:
+memcpy(&data->data, node_spec, sizeof(struct acpi_aest_processor));
+ break;
+ caseACPI_AEST_MEMORY_ERROR_NODE:
+memcpy(&data->data, node_spec, sizeof(struct acpi_aest_memory));
+ break;
+ caseACPI_AEST_SMMU_ERROR_NODE:
+memcpy(&data->data, node_spec, sizeof(struct acpi_aest_smmu));
+ break;
+ caseACPI_AEST_VENDOR_ERROR_NODE:
+memcpy(&data->data, node_spec, sizeof(struct acpi_aest_vendor));
+ break;
+ caseACPI_AEST_GIC_ERROR_NODE:
+memcpy(&data->data, node_spec, sizeof(struct acpi_aest_gic));
+ break;
+ default:
+ kfree(data);
+ return-EINVAL;
+ }
+
+ if (node->type==ACPI_AEST_PROCESSOR_ERROR_NODE) { +proc_data= ACPI_ADD_PTR(unionacpi_aest_processor_data,node_spec,
+sizeof(acpi_aest_processor));drivers/acpi/arm64/aest.c new file +18
-0+ + switch (data->data.processor.resource_type) { + case ACPI_AEST_CACHE_RESOURCE: + memcpy(&data->proc_data, proc_data, + sizeof(struct acpi_aest_processor_cache)); + break; + case ACPI_AEST_TLB_RESOURCE: + memcpy(&data->proc_data, proc_data, + sizeof(struct acpi_aest_processor_tlb)); + break; + case ACPI_AEST_GENERIC_RESOURCE: + memcpy(&data->proc_data, proc_data, + sizeof(struct acpi_aest_processor_generic)); + break; + } + } + + ret = aest_init_interface(node, data);Quoted 8 lines
Quoted 6 lines
+ if (ret) {
+ kfree(data);
+ return ret;
+ }
+
+ returnaest_init_interrupts(node, data);If
aest_init_interrupts()failed, is it necessary to release the data pointer acquired by kzalloc?
aest_init_interrupts()returns an error if any of the interrupts in the interrupt list fails, but it's possible that some interrupts in the list registered successfully. So we attempt to keep chugging along in that scenario because some interrupts may be enabled and registered with the interface successfully. If any interrupt registration fails, there will be a print notifying that there was a failure when initializing that node.Quoted 22 lines
Quoted 22 lines
drivers/acpi/arm64/aest.c new file +22
-0+} + +static void aest_count_ppi (struct acpi_aest_hdr *node) +{ + struct acpi_aest_node_interrupt *interrupt; + int i; + + interrupt = ACPI_ADD_PTR(struct acpi_aest_node_interrupt, node, + node->node_interrupt_offset); + + for (i = 0; i < node->node_interrupt_count; i++, interrupt++) { + if (interrupt->gsiv >= 16 && interrupt->gsiv < 32) + num_ppi++; + } +} + +static int aest_starting_cpu (unsigned int cpu) +{ + int i; + + for (i = 0; i < num_ppi; i++) + enable_percpu_irq(ppi_irqs[i], IRQ_TYPE_NONE);Quoted 8 lines
drivers/acpi/arm64/aest.c line 368
Quoted 6 lines
drivers/acpi/arm64/aest.c new file +6
-0+ + return 0; +} + +static int aest_dying_cpu (unsigned int cpu) +{Wouldn't it be better to execute
disable_percpu_irq(), which is paired withenable_percpu_irq(), inaest_dying_cpu()?Good point. I will add that in the next version.
Thanks,
Tyler
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm