Re: [PATCH] tpm: include EFI status code in "unknown TPM error" message

Leo Sandoval via Grub-devel <[email protected]> Fri, 27 Mar 2026 10:45:48 -0600
Newsgroups org.gnu.grub-devel
Message-ID <CACF7NTjSn0HVYz=kiY8djH35=zYX_SDTAd=-NNQSm3ayyat1aw@mail.gmail.com>
--===============6135809671101067119==
Content-Type: multipart/alternative; boundary="00000000000054264e064e043c8d"

--00000000000054264e064e043c8d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Mikhail,

Please read this new document (just merged) to turn this contribution into
a MR.

https://gitlab.freedesktop.org/gnu-grub/grub/-/blob/master/CONTRIBUTING?ref=
_type=3Dheads

Let me know if you have any questions.



On Fri, Mar 27, 2026 at 7:58=E2=80=AFAM <[email protected]> wrote:

> From: Mikhail Malyshev <[email protected]>
>
> When grub_efi_log_event_status() encounters an EFI status code that
> doesn't match any known case, it prints the unhelpful generic "unknown
> TPM error" message, making root cause analysis impossible.
>
> This was observed on Dell R630 servers booting EVE OS, where the boot
> process gets stuck at the "unknown TPM error" prompt after a hardware
> watchdog reset. The watchdog performs a hard reset without allowing the
> TPM to cleanly shut down, leaving the TPM in an unexpected state on
> the next boot that returns an EFI status code outside the handled set.
>
> Include the raw EFI status value in hex so the actual code is visible
> in the GRUB output, enabling proper diagnosis.
>
> Signed-off-by: Mikhail Malyshev <[email protected]>
> ---
>  grub-core/commands/efi/tpm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/commands/efi/tpm.c b/grub-core/commands/efi/tpm.c
> index 1c4906403..6c1ae57a8 100644
> --- a/grub-core/commands/efi/tpm.c
> +++ b/grub-core/commands/efi/tpm.c
> @@ -149,7 +149,8 @@ grub_efi_log_event_status (grub_efi_status_t status)
>      case GRUB_EFI_NOT_FOUND:
>        return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("TPM unavailable"))=
;
>      default:
> -      return grub_error (grub_is_tpm_fail_fatal () ?
> GRUB_ERR_UNKNOWN_DEVICE : GRUB_ERR_NONE, N_("unknown TPM error"));
> +      return grub_error (grub_is_tpm_fail_fatal () ?
> GRUB_ERR_UNKNOWN_DEVICE : GRUB_ERR_NONE,
> +                        "unknown TPM error: 0x%lx", (unsigned long)
> status);
>      }
>  }
>
> --
> 2.43.0
>
>
> _______________________________________________
> Grub-devel mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

--00000000000054264e064e043c8d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Mikhail,<div><br><div>Please read this new document (ju=
st merged) to turn this contribution into a MR.=C2=A0</div><div><br></div><=
div><a href=3D"https://gitlab.freedesktop.org/gnu-grub/grub/-/blob/master/C=
ONTRIBUTING?ref_type=3Dheads">https://gitlab.freedesktop.org/gnu-grub/grub/=
-/blob/master/CONTRIBUTING?ref_type=3Dheads</a></div><div><br></div><div>Le=
t me know if you have any questions.</div><div><br></div><div><br></div></d=
iv></div><br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"l=
tr" class=3D"gmail_attr">On Fri, Mar 27, 2026 at 7:58=E2=80=AFAM &lt;<a hre=
f=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Mikhail M=
alyshev &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">mi=
[email protected]</a>&gt;<br>
<br>
When grub_efi_log_event_status() encounters an EFI status code that<br>
doesn&#39;t match any known case, it prints the unhelpful generic &quot;unk=
nown<br>
TPM error&quot; message, making root cause analysis impossible.<br>
<br>
This was observed on Dell R630 servers booting EVE OS, where the boot<br>
process gets stuck at the &quot;unknown TPM error&quot; prompt after a hard=
ware<br>
watchdog reset. The watchdog performs a hard reset without allowing the<br>
TPM to cleanly shut down, leaving the TPM in an unexpected state on<br>
the next boot that returns an EFI status code outside the handled set.<br>
<br>
Include the raw EFI status value in hex so the actual code is visible<br>
in the GRUB output, enabling proper diagnosis.<br>
<br>
Signed-off-by: Mikhail Malyshev &lt;<a href=3D"mailto:[email protected]=
om" target=3D"_blank">[email protected]</a>&gt;<br>
---<br>
=C2=A0grub-core/commands/efi/tpm.c | 3 ++-<br>
=C2=A01 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/grub-core/commands/efi/tpm.c b/grub-core/commands/efi/tpm.c<br=
>
index 1c4906403..6c1ae57a8 100644<br>
--- a/grub-core/commands/efi/tpm.c<br>
+++ b/grub-core/commands/efi/tpm.c<br>
@@ -149,7 +149,8 @@ grub_efi_log_event_status (grub_efi_status_t status)<br=
>
=C2=A0 =C2=A0 =C2=A0case GRUB_EFI_NOT_FOUND:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_(&=
quot;TPM unavailable&quot;));<br>
=C2=A0 =C2=A0 =C2=A0default:<br>
-=C2=A0 =C2=A0 =C2=A0 return grub_error (grub_is_tpm_fail_fatal () ? GRUB_E=
RR_UNKNOWN_DEVICE : GRUB_ERR_NONE, N_(&quot;unknown TPM error&quot;));<br>
+=C2=A0 =C2=A0 =C2=A0 return grub_error (grub_is_tpm_fail_fatal () ? GRUB_E=
RR_UNKNOWN_DEVICE : GRUB_ERR_NONE,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 &quot;unknown TPM error: 0x%lx&quot;, (unsigned long) status);<b=
r>
=C2=A0 =C2=A0 =C2=A0}<br>
=C2=A0}<br>
<br>
-- <br>
2.43.0<br>
<br>
<br>
_______________________________________________<br>
Grub-devel mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]<=
/a><br>
<a href=3D"https://lists.gnu.org/mailman/listinfo/grub-devel" rel=3D"norefe=
rrer" target=3D"_blank">https://lists.gnu.org/mailman/listinfo/grub-devel</=
a><br>
</blockquote></div>

--00000000000054264e064e043c8d--



--===============6135809671101067119==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KR3J1Yi1kZXZl
bCBtYWlsaW5nIGxpc3QKR3J1Yi1kZXZlbEBnbnUub3JnCmh0dHBzOi8vbGlzdHMuZ251Lm9yZy9t
YWlsbWFuL2xpc3RpbmZvL2dydWItZGV2ZWwK

--===============6135809671101067119==--