Re: [PATCH] x86/CPU/AMD: Prevent reset reasons from being retained among boots

From: Borislav Petkov

Date: Mon Oct 06 2025 - 17:42:04 EST


On Tue, Oct 07, 2025 at 01:07:45AM +0800, Rong Zhang wrote:
> Perhaps we could improve the wording in the documentation? I.e., mentioning
> that non-listed bits have nothing to do with reboot reasons.

You don't need to document in that detail. That's in the code itself:
s5_reset_reason_txt is sparse and that already tells you that not every bit in
the corresponding register is a reboot reason. It could just as well be junk
for all we know...

> That said, I am OK to remove the debug message printing the cleared
> value. If we decide that it's better to remove it, I will send a [PATCH
> v2].

The fix should be to simply write back the value read before we return from
that function.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette