Zaid Alali wrote: > Enable injection using EINJv2 mode of operation. > > [Tony: Mostly Zaid's original code. I just changed how the error ID > and syndrome bits are implemented. Also swapped out some camelcase > variable names] > > Co-developed-by: Tony Luck <tony.luck@xxxxxxxxx> > Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx> > Signed-off-by: Zaid Alali <zaidal@xxxxxxxxxxxxxxxxxxxxxx> > --- > drivers/acpi/apei/einj-core.c | 56 ++++++++++++++++++++++++++++------- > 1 file changed, 45 insertions(+), 11 deletions(-) > > diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c > index 8d60e5f1785c..7741c2082f33 100644 > --- a/drivers/acpi/apei/einj-core.c > +++ b/drivers/acpi/apei/einj-core.c > @@ -87,6 +87,7 @@ enum { > SETWA_FLAGS_APICID = 1, > SETWA_FLAGS_MEM = 2, > SETWA_FLAGS_PCIE_SBDF = 4, > + SETWA_FLAGS_EINJV2 = 8, > }; > > /* > @@ -181,6 +182,7 @@ bool einj_initialized __ro_after_init; > > static void __iomem *einj_param; > static u32 v5param_size; > +static bool is_v2; > > static void einj_exec_ctx_init(struct apei_exec_context *ctx) > { > @@ -507,12 +509,20 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, > return rc; > } > > +static bool is_end_of_list(u8 *val) > +{ > + for (int i = 0; i < COMPONENT_LEN; ++i) { Back in patch 3/7 these are defined using a hard coded value. I think it might be better to at least use COMPONENT_LEN for those definitions. I'm also wondering if it would be better to have some type safety here... but probably fine. > + if (val[i] != 0xFF) > + return false; > + } > + return true; I'm unclear of the way this list is terminated. The cover letter does not mention it. I read the documentation patch and it looks like you echo '' to the id to terminate. How does that work here?