Re: [PATCH 1/3] x86/tdx: Share tdx_panic() with the EFI stub
From: Borislav Petkov
Date: Mon Sep 14 2026 - 20:11:14 EST
On Mon, Sep 14, 2026 at 08:37:47PM +0200, Ard Biesheuvel wrote:
> +void __noreturn tdx_panic(const char *msg)
> +{
> + struct tdx_module_args args = {
> + .r10 = TDX_HYPERCALL_STANDARD,
> + .r11 = TDVMCALL_REPORT_FATAL_ERROR,
> + .r12 = 0, /* Error code: 0 is Panic */
> + };
> + union {
> + /* Define register order according to the GHCI */
> + struct { u64 r14, r15, rbx, rdi, rsi, r8, r9, rdx; };
> +
> + char bytes[64] __nonstring;
> + } message = {};
> +
> + /* VMM assumes '\0' in byte 65, if the message took all 64 bytes */
> + memcpy(message.bytes, msg, strnlen(msg, sizeof(message)));
I'd probably do here:
#define MSG_SZ 64
right above them in the function and use that everywhere, esp. instead of
sizeof(message).
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette