x86/sev: Avoid WARN()s and panic()s in early boot code
authorArd Biesheuvel <ardb@kernel.org>
Thu, 5 Dec 2024 11:28:06 +0000 (12:28 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 5 Dec 2024 12:18:54 +0000 (13:18 +0100)
commit09d35045cd0f4265cf1dfe18ef83285fdc294688
tree18da65f12047f8516a736cff519ec9af28ae1ed3
parentfeffde684ac29a3b7aec82d2df850fbdbdee55e4
x86/sev: Avoid WARN()s and panic()s in early boot code

Using WARN() or panic() while executing from the early 1:1 mapping is
unlikely to do anything useful: the string literals are passed using
their kernel virtual addresses which are not even mapped yet. But even
if they were, calling into the printk() machinery from the early 1:1
mapped code is not going to get very far.

So drop the WARN()s entirely, and replace panic() with a deadloop.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20241205112804.3416920-10-ardb+git@google.com
arch/x86/coco/sev/core.c
arch/x86/coco/sev/shared.c