From: Borislav Petkov <bp@suse.de>
To: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
Cc: "linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v2 2/8] efi: Decode IA32/X64 Processor Error Section
Date: Tue, 27 Feb 2018 19:34:17 +0100 [thread overview]
Message-ID: <20180227183417.GP26382@pd.tnic> (raw)
In-Reply-To: <DM5PR12MB1916C280DA5B51FE9666EE21F8C00@DM5PR12MB1916.namprd12.prod.outlook.com>
On Tue, Feb 27, 2018 at 06:06:21PM +0000, Ghannam, Yazen wrote:
> It's not just about arches but record types. A single platform can report
> using arch-specific records, memory records, PCIe records, etc.
>
> So all the other record types only show fields with a valid bit set and this
> has always been the case. There may be users or tools who expect that
> same behavior.
You know we have this thing called tracepoints for that, don't you?
You define one tracepoint which regurgitates an error record and then
all arches which have the same table, share them.
> Please see the other patches where these are decoded further. As I
> mentioned the cover letter, the decoding is applied incrementally rather
> than having one large patch.
Here's what needs to go:
All the validation bits crap:
printk("%sValidation Bits: 0x%04x\n", pfx, validation_bits);
Instead, you simply dump all entries unconditionally and say whether
they're valid or not. This way you have the same format for each error
record - much easier to work with.
printk("%sCPUID Info:\n", pfx);
print_hex_dump(pfx, "", DUMP_PREFIX_OFFSET, 16, 4, proc->cpuid,
sizeof(proc->cpuid), 0);
Frankly, I have no clue why we should even dump CPUID for *every* error.
It is completely sufficient to dump family/model/stepping like we do in
mce_amd.c. Besides, when debugging, you collect much more info from the
system - CPUID only is not enough.
printk("%sError Structure Type: %pUl\n", newpfx,
&err_info->err_type);
Unreadable GUIDs.
What are those even:
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);
}
some 8-byte ids? Who knows... Either remove them or make them
human-readable, *explaining* what the requestor is and the target is and
so on.
printk("%sRegister Array Size: 0x%04x\n", newpfx,
ctx_info->reg_arr_size);
I have no clue what that is for.
if (ctx_info->reg_ctx_type == CTX_TYPE_MSR) {
groupsize = 8; /* MSRs are 8 bytes wide. */
printk("%sMSR Address: 0x%08x\n", newpfx,
ctx_info->msr_addr);
}
What do I need the MSR *addresses* for?
if (ctx_info->reg_ctx_type == CTX_TYPE_MMREG) {
printk("%sMM Register Address: 0x%016llx\n", newpfx,
ctx_info->mm_reg_addr);
}
memory mapped registers?!?!
> Also, like I said in another thread, we should always print the raw value
> followed by the decoding. That way the raw info is there in case a user
> wants to send the data to the vendor or other expert party.
By that logic we shouldn't be decoding at all - we should be dumping a
fat hex blob.
Again, there's this thing called tracepoints which have exactly that,
you know. You can dump human readable info to dmesg and dump a whole raw
record into the tracepoint.
When the error is critical and we're about to die, the tracepoint
contents goes to dmesg too.
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
next prev parent reply other threads:[~2018-02-27 18:34 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-26 19:38 [PATCH v2 0/8] Decode IA32/X64 CPER Yazen Ghannam
2018-02-26 19:38 ` [PATCH v2 1/8] efi: Fix IA32/X64 Processor Error Record definition Yazen Ghannam
2018-02-27 10:47 ` Borislav Petkov
2018-02-27 15:05 ` Ghannam, Yazen
2018-02-26 19:38 ` [PATCH v2 2/8] efi: Decode IA32/X64 Processor Error Section Yazen Ghannam
2018-02-27 11:22 ` Borislav Petkov
2018-02-27 15:13 ` Ghannam, Yazen
2018-02-27 17:00 ` Borislav Petkov
2018-02-27 17:27 ` Ghannam, Yazen
2018-02-27 17:44 ` Borislav Petkov
2018-02-27 18:06 ` Ghannam, Yazen
2018-02-27 18:34 ` Borislav Petkov [this message]
2018-02-26 19:38 ` [PATCH v2 3/8] efi: Decode IA32/X64 Processor Error Info Structure Yazen Ghannam
2018-02-27 14:25 ` Borislav Petkov
2018-02-27 15:25 ` Ghannam, Yazen
2018-02-27 17:04 ` Borislav Petkov
2018-02-27 17:46 ` Ghannam, Yazen
2018-02-27 18:02 ` Borislav Petkov
2018-02-27 18:40 ` Ghannam, Yazen
2018-02-27 19:09 ` Borislav Petkov
2018-02-27 21:32 ` Ghannam, Yazen
2018-02-27 22:10 ` Borislav Petkov
2018-02-26 19:39 ` [PATCH v2 4/8] efi: Decode UEFI-defined IA32/X64 Error Structure GUIDs Yazen Ghannam
2018-02-27 14:30 ` Borislav Petkov
2018-02-27 15:28 ` Ghannam, Yazen
2018-02-27 15:31 ` Ard Biesheuvel
2018-02-26 19:39 ` [PATCH v2 5/8] efi: Decode IA32/X64 Cache, TLB, and Bus Check structures Yazen Ghannam
2018-02-27 15:03 ` Borislav Petkov
2018-02-27 15:33 ` Ghannam, Yazen
2018-02-27 17:06 ` Borislav Petkov
2018-02-26 19:39 ` [PATCH v2 6/8] efi: Decode additional IA32/X64 Bus Check fields Yazen Ghannam
2018-02-26 19:39 ` [PATCH v2 7/8] efi: Decode IA32/X64 MS Check structure Yazen Ghannam
2018-02-26 19:39 ` [PATCH v2 8/8] efi: Decode IA32/X64 Context Info structure Yazen Ghannam
2018-02-28 8:43 ` [PATCH v2 0/8] Decode IA32/X64 CPER Borislav Petkov
2018-02-28 15:12 ` Ghannam, Yazen
2018-02-28 16:35 ` Borislav Petkov
2018-02-28 20:58 ` Ghannam, Yazen
2018-03-01 11:59 ` Borislav Petkov
2018-03-23 0:19 ` Ghannam, Yazen
2018-03-23 15:29 ` Borislav Petkov
2018-03-01 16:38 ` Luck, Tony
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180227183417.GP26382@pd.tnic \
--to=bp@suse.de \
--cc=Yazen.Ghannam@amd.com \
--cc=ard.biesheuvel@linaro.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox