Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info Structure

2018-04-02 Thread Ard Biesheuvel
On 2 April 2018 at 15:21, Ghannam, Yazen <yazen.ghan...@amd.com> wrote:
>> -Original Message-
>> From: Ard Biesheuvel <ard.biesheu...@linaro.org>
>> Sent: Friday, March 30, 2018 7:25 AM
>> To: Ghannam, Yazen <yazen.ghan...@amd.com>
>> Cc: Borislav Petkov <b...@alien8.de>; linux-efi@vger.kernel.org; linux-
>> ker...@vger.kernel.org; x...@kernel.org; tony.l...@intel.com
>> Subject: Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info 
>> Structure
>>
>> On 29 March 2018 at 14:53, Ghannam, Yazen <yazen.ghan...@amd.com>
>> wrote:
>> >> -Original Message-
>> >> From: Borislav Petkov <b...@alien8.de>
>> >> Sent: Thursday, March 29, 2018 6:55 AM
>> >> To: Ghannam, Yazen <yazen.ghan...@amd.com>
>> >> Cc: linux-efi@vger.kernel.org; linux-ker...@vger.kernel.org;
>> >> ard.biesheu...@linaro.org; x...@kernel.org; tony.l...@intel.com
>> >> Subject: Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info
>> >> Structure
>> >>
>> >> On Sat, Mar 24, 2018 at 01:49:35PM -0500, Yazen Ghannam wrote:
>> >> > From: Yazen Ghannam <yazen.ghan...@amd.com>
>> >> >
>> >> > Print the fields in the IA32/X64 Processor Error Info Structure.
>> >> >
>> >> > Based on UEFI 2.7 Table 253. IA32/X64 Processor Error Information
>> >> > Structure.
>> >> >
>> >> > Signed-off-by: Yazen Ghannam <yazen.ghan...@amd.com>
>> >> > ---
>> >> > Link:
>> >> > https://lkml.kernel.org/r/20180226193904.20532-4-
>> >> yazen.ghan...@amd.com
>> >> >
>> >> > v2->v3:
>> >> > * Fix table number in commit message.
>> >> > * Don't print raw validation bits.
>> >> >
>> >> > v1->v2:
>> >> > * Add parantheses around "bits" expression in macro.
>> >> > * Fix indentation on multi-line statements.
>> >> >
>> >> >  drivers/firmware/efi/cper-x86.c | 50
>> >> +
>> >> >  1 file changed, 50 insertions(+)
>> >> >
>> >> > diff --git a/drivers/firmware/efi/cper-x86.c 
>> >> > b/drivers/firmware/efi/cper-
>> >> x86.c
>> >> > index 863f0cd2a0ff..a9ab3bbf7986 100644
>> >> > --- a/drivers/firmware/efi/cper-x86.c
>> >> > +++ b/drivers/firmware/efi/cper-x86.c
>> >> > @@ -3,15 +3,28 @@
>> >> >
>> >> >  #include 
>> >> >
>> >> > +#define INDENT_SP  " "
>> >>
>> >> There's that thing again. So it was a total waste of time discussing
>> >> this last time. So let me save my time this time:
>> >>
>> >> NAKed-by: Borislav Petkov <b...@suse.de>
>> >>
>> >
>> > IIRC, the arguments for keeping this are
>> > 1) convention for CPER
>> > 2) code readability
>> >
>> > The argument against was
>> > 1) it's dumb
>> >
>> > So I decided to keep it. I don't really mind either way so I'll change it
>> > if there's a second opinion.
>> >
>>
>> Yes, please change it.
>
> Okay, will do. Should I include a patch that changes it for the other CPER
> code also?
>

No worries, Boris already sent that out.
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info Structure

2018-04-02 Thread Ghannam, Yazen
> -Original Message-
> From: Ard Biesheuvel <ard.biesheu...@linaro.org>
> Sent: Friday, March 30, 2018 7:25 AM
> To: Ghannam, Yazen <yazen.ghan...@amd.com>
> Cc: Borislav Petkov <b...@alien8.de>; linux-efi@vger.kernel.org; linux-
> ker...@vger.kernel.org; x...@kernel.org; tony.l...@intel.com
> Subject: Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info 
> Structure
> 
> On 29 March 2018 at 14:53, Ghannam, Yazen <yazen.ghan...@amd.com>
> wrote:
> >> -Original Message-
> >> From: Borislav Petkov <b...@alien8.de>
> >> Sent: Thursday, March 29, 2018 6:55 AM
> >> To: Ghannam, Yazen <yazen.ghan...@amd.com>
> >> Cc: linux-efi@vger.kernel.org; linux-ker...@vger.kernel.org;
> >> ard.biesheu...@linaro.org; x...@kernel.org; tony.l...@intel.com
> >> Subject: Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info
> >> Structure
> >>
> >> On Sat, Mar 24, 2018 at 01:49:35PM -0500, Yazen Ghannam wrote:
> >> > From: Yazen Ghannam <yazen.ghan...@amd.com>
> >> >
> >> > Print the fields in the IA32/X64 Processor Error Info Structure.
> >> >
> >> > Based on UEFI 2.7 Table 253. IA32/X64 Processor Error Information
> >> > Structure.
> >> >
> >> > Signed-off-by: Yazen Ghannam <yazen.ghan...@amd.com>
> >> > ---
> >> > Link:
> >> > https://lkml.kernel.org/r/20180226193904.20532-4-
> >> yazen.ghan...@amd.com
> >> >
> >> > v2->v3:
> >> > * Fix table number in commit message.
> >> > * Don't print raw validation bits.
> >> >
> >> > v1->v2:
> >> > * Add parantheses around "bits" expression in macro.
> >> > * Fix indentation on multi-line statements.
> >> >
> >> >  drivers/firmware/efi/cper-x86.c | 50
> >> +
> >> >  1 file changed, 50 insertions(+)
> >> >
> >> > diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-
> >> x86.c
> >> > index 863f0cd2a0ff..a9ab3bbf7986 100644
> >> > --- a/drivers/firmware/efi/cper-x86.c
> >> > +++ b/drivers/firmware/efi/cper-x86.c
> >> > @@ -3,15 +3,28 @@
> >> >
> >> >  #include 
> >> >
> >> > +#define INDENT_SP  " "
> >>
> >> There's that thing again. So it was a total waste of time discussing
> >> this last time. So let me save my time this time:
> >>
> >> NAKed-by: Borislav Petkov <b...@suse.de>
> >>
> >
> > IIRC, the arguments for keeping this are
> > 1) convention for CPER
> > 2) code readability
> >
> > The argument against was
> > 1) it's dumb
> >
> > So I decided to keep it. I don't really mind either way so I'll change it
> > if there's a second opinion.
> >
> 
> Yes, please change it.

Okay, will do. Should I include a patch that changes it for the other CPER
code also?

Thanks,
Yazen


Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info Structure

2018-03-30 Thread Ard Biesheuvel
On 29 March 2018 at 14:53, Ghannam, Yazen <yazen.ghan...@amd.com> wrote:
>> -Original Message-
>> From: Borislav Petkov <b...@alien8.de>
>> Sent: Thursday, March 29, 2018 6:55 AM
>> To: Ghannam, Yazen <yazen.ghan...@amd.com>
>> Cc: linux-efi@vger.kernel.org; linux-ker...@vger.kernel.org;
>> ard.biesheu...@linaro.org; x...@kernel.org; tony.l...@intel.com
>> Subject: Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info
>> Structure
>>
>> On Sat, Mar 24, 2018 at 01:49:35PM -0500, Yazen Ghannam wrote:
>> > From: Yazen Ghannam <yazen.ghan...@amd.com>
>> >
>> > Print the fields in the IA32/X64 Processor Error Info Structure.
>> >
>> > Based on UEFI 2.7 Table 253. IA32/X64 Processor Error Information
>> > Structure.
>> >
>> > Signed-off-by: Yazen Ghannam <yazen.ghan...@amd.com>
>> > ---
>> > Link:
>> > https://lkml.kernel.org/r/20180226193904.20532-4-
>> yazen.ghan...@amd.com
>> >
>> > v2->v3:
>> > * Fix table number in commit message.
>> > * Don't print raw validation bits.
>> >
>> > v1->v2:
>> > * Add parantheses around "bits" expression in macro.
>> > * Fix indentation on multi-line statements.
>> >
>> >  drivers/firmware/efi/cper-x86.c | 50
>> +
>> >  1 file changed, 50 insertions(+)
>> >
>> > diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-
>> x86.c
>> > index 863f0cd2a0ff..a9ab3bbf7986 100644
>> > --- a/drivers/firmware/efi/cper-x86.c
>> > +++ b/drivers/firmware/efi/cper-x86.c
>> > @@ -3,15 +3,28 @@
>> >
>> >  #include 
>> >
>> > +#define INDENT_SP  " "
>>
>> There's that thing again. So it was a total waste of time discussing
>> this last time. So let me save my time this time:
>>
>> NAKed-by: Borislav Petkov <b...@suse.de>
>>
>
> IIRC, the arguments for keeping this are
> 1) convention for CPER
> 2) code readability
>
> The argument against was
> 1) it's dumb
>
> So I decided to keep it. I don't really mind either way so I'll change it
> if there's a second opinion.
>

Yes, please change it.
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info Structure

2018-03-29 Thread Ghannam, Yazen
> -Original Message-
> From: Borislav Petkov <b...@alien8.de>
> Sent: Thursday, March 29, 2018 6:55 AM
> To: Ghannam, Yazen <yazen.ghan...@amd.com>
> Cc: linux-efi@vger.kernel.org; linux-ker...@vger.kernel.org;
> ard.biesheu...@linaro.org; x...@kernel.org; tony.l...@intel.com
> Subject: Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info
> Structure
> 
> On Sat, Mar 24, 2018 at 01:49:35PM -0500, Yazen Ghannam wrote:
> > From: Yazen Ghannam <yazen.ghan...@amd.com>
> >
> > Print the fields in the IA32/X64 Processor Error Info Structure.
> >
> > Based on UEFI 2.7 Table 253. IA32/X64 Processor Error Information
> > Structure.
> >
> > Signed-off-by: Yazen Ghannam <yazen.ghan...@amd.com>
> > ---
> > Link:
> > https://lkml.kernel.org/r/20180226193904.20532-4-
> yazen.ghan...@amd.com
> >
> > v2->v3:
> > * Fix table number in commit message.
> > * Don't print raw validation bits.
> >
> > v1->v2:
> > * Add parantheses around "bits" expression in macro.
> > * Fix indentation on multi-line statements.
> >
> >  drivers/firmware/efi/cper-x86.c | 50
> +
> >  1 file changed, 50 insertions(+)
> >
> > diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-
> x86.c
> > index 863f0cd2a0ff..a9ab3bbf7986 100644
> > --- a/drivers/firmware/efi/cper-x86.c
> > +++ b/drivers/firmware/efi/cper-x86.c
> > @@ -3,15 +3,28 @@
> >
> >  #include 
> >
> > +#define INDENT_SP  " "
> 
> There's that thing again. So it was a total waste of time discussing
> this last time. So let me save my time this time:
> 
> NAKed-by: Borislav Petkov <b...@suse.de>
> 

IIRC, the arguments for keeping this are
1) convention for CPER
2) code readability

The argument against was
1) it's dumb

So I decided to keep it. I don't really mind either way so I'll change it
if there's a second opinion.

Thanks,
Yazen


Re: [PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info Structure

2018-03-29 Thread Borislav Petkov
On Sat, Mar 24, 2018 at 01:49:35PM -0500, Yazen Ghannam wrote:
> From: Yazen Ghannam 
> 
> Print the fields in the IA32/X64 Processor Error Info Structure.
> 
> Based on UEFI 2.7 Table 253. IA32/X64 Processor Error Information
> Structure.
> 
> Signed-off-by: Yazen Ghannam 
> ---
> Link:
> https://lkml.kernel.org/r/20180226193904.20532-4-yazen.ghan...@amd.com
> 
> v2->v3:
> * Fix table number in commit message.
> * Don't print raw validation bits.
> 
> v1->v2:
> * Add parantheses around "bits" expression in macro.
> * Fix indentation on multi-line statements.
> 
>  drivers/firmware/efi/cper-x86.c | 50 
> +
>  1 file changed, 50 insertions(+)
> 
> diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-x86.c
> index 863f0cd2a0ff..a9ab3bbf7986 100644
> --- a/drivers/firmware/efi/cper-x86.c
> +++ b/drivers/firmware/efi/cper-x86.c
> @@ -3,15 +3,28 @@
>  
>  #include 
>  
> +#define INDENT_SP" "

There's that thing again. So it was a total waste of time discussing
this last time. So let me save my time this time:

NAKed-by: Borislav Petkov 

-- 
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/8] efi: Decode IA32/X64 Processor Error Info Structure

2018-03-24 Thread Yazen Ghannam
From: Yazen Ghannam 

Print the fields in the IA32/X64 Processor Error Info Structure.

Based on UEFI 2.7 Table 253. IA32/X64 Processor Error Information
Structure.

Signed-off-by: Yazen Ghannam 
---
Link:
https://lkml.kernel.org/r/20180226193904.20532-4-yazen.ghan...@amd.com

v2->v3:
* Fix table number in commit message.
* Don't print raw validation bits.

v1->v2:
* Add parantheses around "bits" expression in macro.
* Fix indentation on multi-line statements.

 drivers/firmware/efi/cper-x86.c | 50 +
 1 file changed, 50 insertions(+)

diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-x86.c
index 863f0cd2a0ff..a9ab3bbf7986 100644
--- a/drivers/firmware/efi/cper-x86.c
+++ b/drivers/firmware/efi/cper-x86.c
@@ -3,15 +3,28 @@
 
 #include 
 
+#define INDENT_SP  " "
+
 /*
  * We don't need a "CPER_IA" prefix since these are all locally defined.
  * This will save us a lot of line space.
  */
 #define VALID_LAPIC_ID BIT_ULL(0)
 #define VALID_CPUID_INFO   BIT_ULL(1)
+#define VALID_PROC_ERR_INFO_NUM(bits)  (((bits) & GENMASK_ULL(7, 2)) >> 2)
+
+#define INFO_VALID_CHECK_INFO  BIT_ULL(0)
+#define INFO_VALID_TARGET_ID   BIT_ULL(1)
+#define INFO_VALID_REQUESTOR_IDBIT_ULL(2)
+#define INFO_VALID_RESPONDER_IDBIT_ULL(3)
+#define INFO_VALID_IP  BIT_ULL(4)
 
 void cper_print_proc_ia(const char *pfx, const struct cper_sec_proc_ia *proc)
 {
+   int i;
+   struct cper_ia_err_info *err_info;
+   char newpfx[64];
+
if (proc->validation_bits & VALID_LAPIC_ID)
printk("%sLocal APIC_ID: 0x%llx\n", pfx, proc->lapic_id);
 
@@ -20,4 +33,41 @@ void cper_print_proc_ia(const char *pfx, const struct 
cper_sec_proc_ia *proc)
print_hex_dump(pfx, "", DUMP_PREFIX_OFFSET, 16, 4, proc->cpuid,
   sizeof(proc->cpuid), 0);
}
+
+   snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP);
+
+   err_info = (struct cper_ia_err_info *)(proc + 1);
+   for (i = 0; i < VALID_PROC_ERR_INFO_NUM(proc->validation_bits); i++) {
+   printk("%sError Information Structure %d:\n", pfx, i);
+
+   printk("%sError Structure Type: %pUl\n", newpfx,
+  _info->err_type);
+
+   if (err_info->validation_bits & INFO_VALID_CHECK_INFO) {
+   printk("%sCheck Information: 0x%016llx\n", newpfx,
+  err_info->check_info);
+   }
+
+   if (err_info->validation_bits & INFO_VALID_TARGET_ID) {
+   printk("%sTarget Identifier: 0x%016llx\n",
+  newpfx, err_info->target_id);
+   }
+
+   if (err_info->validation_bits & INFO_VALID_REQUESTOR_ID) {
+   printk("%sRequestor Identifier: 0x%016llx\n",
+  newpfx, err_info->requestor_id);
+   }
+
+   if (err_info->validation_bits & INFO_VALID_RESPONDER_ID) {
+   printk("%sResponder Identifier: 0x%016llx\n",
+  newpfx, err_info->responder_id);
+   }
+
+   if (err_info->validation_bits & INFO_VALID_IP) {
+   printk("%sInstruction Pointer: 0x%016llx\n",
+  newpfx, err_info->ip);
+   }
+
+   err_info++;
+   }
 }
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html