Re: [RFC PATCH 3/3] x86/cpu/amd: Fetch S5_RESET_STATUS from PHAT when supported

From: K Prateek Nayak

Date: Fri Jun 05 2026 - 00:11:06 EST


Hello Mario,

On 6/3/2026 7:56 PM, Mario Limonciello wrote:
>> +    record = (void *)acpi_phat_get_vendor_reset_reason(&guid);
>> +    if (!IS_ERR(record)) {
>> +        bool record_valid = false;
>> +
>> +        /* Sanity check before using the parsed record. */
>> +        if (record->header.length == sizeof(*record)) {
>
> Why not do this sanity check in acpi_phat_get_vendor_reset_reason()
> directly?  Then we can always assume if something is returned it's
> valid and it's simpler here (and any other potential callers in future).

My intention here was to catch any changes to the PHAT record format
for this GUID. If we can reasonably assume that isn't going to happen,
we can skip this check entirely.

--
Thanks and Regards,
Prateek