<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/firmware/efi/cper.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/firmware/efi/cper.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/firmware/efi/cper.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-04-08T09:36:16Z</updated>
<entry>
<title>efi/cper: Reformat CPER memory error location to more readable</title>
<updated>2022-04-08T09:36:16Z</updated>
<author>
<name>Shuai Xue</name>
<email>xueshuai@linux.alibaba.com</email>
</author>
<published>2022-03-08T14:40:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1e0e7f10c4431c704369b6c715a808faf806011d'/>
<id>urn:sha1:1e0e7f10c4431c704369b6c715a808faf806011d</id>
<content type='text'>
Remove the space after the colon in cper_mem_err_location() so that it
is easier to parse its output this way, both by humans and tools.

No functional changes.

Signed-off-by: Shuai Xue &lt;xueshuai@linux.alibaba.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Link: https://lore.kernel.org/r/20220308144053.49090-4-xueshuai@linux.alibaba.com
</content>
</entry>
<entry>
<title>EDAC/ghes: Unify CPER memory error location reporting</title>
<updated>2022-04-08T09:31:18Z</updated>
<author>
<name>Shuai Xue</name>
<email>xueshuai@linux.alibaba.com</email>
</author>
<published>2022-03-08T14:40:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ed27b5df3877458eb24615fd9c202178660db009'/>
<id>urn:sha1:ed27b5df3877458eb24615fd9c202178660db009</id>
<content type='text'>
Switch the GHES EDAC memory error reporting functions to use the common
CPER ones and get rid of code duplication.

  [ bp:
      - rewrite commit message, remove useless text
      - rip out useless reformatting
      - align function params on the opening brace
      - rename function to a more descriptive name
      - drop useless function exports
      - handle buffer lengths properly when printing other detail
      - remove useless casting
  ]

Signed-off-by: Shuai Xue &lt;xueshuai@linux.alibaba.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20220308144053.49090-3-xueshuai@linux.alibaba.com
</content>
</entry>
<entry>
<title>efi/cper: Add a cper_mem_err_status_str() to decode error description</title>
<updated>2022-04-08T09:16:08Z</updated>
<author>
<name>Shuai Xue</name>
<email>xueshuai@linux.alibaba.com</email>
</author>
<published>2022-03-08T14:40:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bdae79651453df0bca20963fc2ab970146ef2a37'/>
<id>urn:sha1:bdae79651453df0bca20963fc2ab970146ef2a37</id>
<content type='text'>
Introduce a new helper function cper_mem_err_status_str() to decode the
error status value into a human readable string.

  [ bp: Massage. ]

Signed-off-by: Shuai Xue &lt;xueshuai@linux.alibaba.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Link: https://lore.kernel.org/r/20220308144053.49090-2-xueshuai@linux.alibaba.com
</content>
</entry>
<entry>
<title>efi/cper: use stack buffer for error record decoding</title>
<updated>2021-10-05T11:05:59Z</updated>
<author>
<name>Ard Biesheuvel</name>
<email>ardb@kernel.org</email>
</author>
<published>2021-09-01T06:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b3a72ca80351917cc23f9e24c35f3c3979d3c121'/>
<id>urn:sha1:b3a72ca80351917cc23f9e24c35f3c3979d3c121</id>
<content type='text'>
Joe reports that using a statically allocated buffer for converting CPER
error records into human readable text is probably a bad idea. Even
though we are not aware of any actual issues, a stack buffer is clearly
a better choice here anyway, so let's move the buffer into the stack
frames of the two functions that refer to it.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efi: cper: check section header more appropriately</title>
<updated>2021-08-27T14:03:01Z</updated>
<author>
<name>Shuai Xue</name>
<email>xueshuai@linux.alibaba.com</email>
</author>
<published>2021-08-23T11:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1be72c8e0786727df375f11c8178ce7e65eea20e'/>
<id>urn:sha1:1be72c8e0786727df375f11c8178ce7e65eea20e</id>
<content type='text'>
When checking a generic status block, we iterate over all the generic data
blocks. The loop condition checks that the generic data block is valid.
Because the size of data blocks (excluding error data) may vary depending
on the revision and the revision is contained within the data block, we
should ensure that enough of the current data block is valid appropriately
for different revision.

Signed-off-by: Shuai Xue &lt;xueshuai@linux.alibaba.com&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efi: cper: fix scnprintf() use in cper_mem_err_location()</title>
<updated>2021-08-27T14:01:27Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2021-04-21T19:31:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5eff88dd6b4badd664d7d3b648103d540b390248'/>
<id>urn:sha1:5eff88dd6b4badd664d7d3b648103d540b390248</id>
<content type='text'>
The last two if-clauses fail to update n, so whatever they might have
written at &amp;msg[n] would be cut off by the final nul-termination.

That nul-termination is redundant; scnprintf(), just like snprintf(),
guarantees a nul-terminated output buffer, provided the buffer size is
positive.

And there's no need to discount one byte from the initial buffer;
vsnprintf() expects to be given the full buffer size - it's not going
to write the nul-terminator one beyond the given (buffer, size) pair.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efi: cper: fix snprintf() use in cper_dimm_err_location()</title>
<updated>2021-05-22T12:05:37Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2021-04-21T19:46:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=942859d969de7f6f7f2659a79237a758b42782da'/>
<id>urn:sha1:942859d969de7f6f7f2659a79237a758b42782da</id>
<content type='text'>
snprintf() should be given the full buffer size, not one less. And it
guarantees nul-termination, so doing it manually afterwards is
pointless.

It's even potentially harmful (though probably not in practice because
CPER_REC_LEN is 256), due to the "return how much would have been
written had the buffer been big enough" semantics. I.e., if the bank
and/or device strings are long enough that the "DIMM location ..."
output gets truncated, writing to msg[n] is a buffer overflow.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Fixes: 3760cd20402d4 ("CPER: Adjust code flow of some functions")
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>cper,edac,efi: Memory Error Record: bank group/address and chip id</title>
<updated>2020-09-17T07:19:52Z</updated>
<author>
<name>Alex Kluver</name>
<email>alex.kluver@hpe.com</email>
</author>
<published>2020-08-19T14:35:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=612b5d506d066cdf0a739963e7cd28642d500ec1'/>
<id>urn:sha1:612b5d506d066cdf0a739963e7cd28642d500ec1</id>
<content type='text'>
Updates to the UEFI 2.8 Memory Error Record allow splitting the bank field
into bank address and bank group, and using the last 3 bits of the extended
field as a chip identifier.

When needed, print correct version of bank field, bank group, and chip
identification.

Based on UEFI 2.8 Table 299. Memory Error Record.

Signed-off-by: Alex Kluver &lt;alex.kluver@hpe.com&gt;
Reviewed-by: Russ Anderson &lt;russ.anderson@hpe.com&gt;
Reviewed-by: Kyle Meyer &lt;kyle.meyer@hpe.com&gt;
Reviewed-by: Steve Wahl &lt;steve.wahl@hpe.com&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20200819143544.155096-3-alex.kluver@hpe.com
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>edac,ghes,cper: Add Row Extension to Memory Error Record</title>
<updated>2020-09-17T07:19:52Z</updated>
<author>
<name>Alex Kluver</name>
<email>alex.kluver@hpe.com</email>
</author>
<published>2020-08-19T14:35:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9baf68cc4544056f33797b78ec09388f54ecc8f0'/>
<id>urn:sha1:9baf68cc4544056f33797b78ec09388f54ecc8f0</id>
<content type='text'>
Memory errors could be printed with incorrect row values since the DIMM
size has outgrown the 16 bit row field in the CPER structure. UEFI
Specification Version 2.8 has increased the size of row by allowing it to
use the first 2 bits from a previously reserved space within the structure.

When needed, add the extension bits to the row value printed.

Based on UEFI 2.8 Table 299. Memory Error Record

Signed-off-by: Alex Kluver &lt;alex.kluver@hpe.com&gt;
Tested-by: Russ Anderson &lt;russ.anderson@hpe.com&gt;
Reviewed-by: Steve Wahl &lt;steve.wahl@hpe.com&gt;
Reviewed-by: Kyle Meyer &lt;kyle.meyer@hpe.com&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20200819143544.155096-2-alex.kluver@hpe.com
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efi: cper: Add support for printing Firmware Error Record Reference</title>
<updated>2020-05-14T09:11:20Z</updated>
<author>
<name>Punit Agrawal</name>
<email>punit1.agrawal@toshiba.co.jp</email>
</author>
<published>2020-05-12T04:55:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=3d8c11efd528d56972d44ed0de51c4e11a9a4fa9'/>
<id>urn:sha1:3d8c11efd528d56972d44ed0de51c4e11a9a4fa9</id>
<content type='text'>
While debugging a boot failure, the following unknown error record was
seen in the boot logs.

    &lt;...&gt;
    BERT: Error records from previous boot:
    [Hardware Error]: event severity: fatal
    [Hardware Error]:  Error 0, type: fatal
    [Hardware Error]:   section type: unknown, 81212a96-09ed-4996-9471-8d729c8e69ed
    [Hardware Error]:   section length: 0x290
    [Hardware Error]:   00000000: 00000001 00000000 00000000 00020002  ................
    [Hardware Error]:   00000010: 00020002 0000001f 00000320 00000000  ........ .......
    [Hardware Error]:   00000020: 00000000 00000000 00000000 00000000  ................
    [Hardware Error]:   00000030: 00000000 00000000 00000000 00000000  ................
    &lt;...&gt;

On further investigation, it was found that the error record with
UUID (81212a96-09ed-4996-9471-8d729c8e69ed) has been defined in the
UEFI Specification at least since v2.4 and has recently had additional
fields defined in v2.7 Section N.2.10 Firmware Error Record Reference.

Add support for parsing and printing the defined fields to give users
a chance to figure out what went wrong.

Signed-off-by: Punit Agrawal &lt;punit1.agrawal@toshiba.co.jp&gt;
Cc: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@rjwysocki.net&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: James Morse &lt;james.morse@arm.com&gt;
Cc: linux-acpi@vger.kernel.org
Cc: linux-efi@vger.kernel.org
Link: https://lore.kernel.org/r/20200512045502.3810339-1-punit1.agrawal@toshiba.co.jp
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
</feed>
