On Dec 17, 2021, at 07:42, Rafael J. Wysocki [off-list ref] wrote:
First, I would change the subject to "x86/PM/keylocker: Restore
internal wrapping key on resume from ACPI S3/S4".
On Tue, Dec 14, 2021 at 2:00 AM Chang S. Bae [off-list ref] wrote:
quoted
When the system state switches to these sleep states, the internal
wrapping key gets reset in the CPU state.
And here I would say
"When the system enters the ACPI S3 or S4 sleep state, the internal
wrapping key is discarded.”
<snip>
quoted
/**
* setup_keylocker - Enable the feature.
* @c: A pointer to struct cpuinfo_x86
@@ -49,6 +87,7 @@ void __ref setup_keylocker(struct cpuinfo_x86 *c)
if (c == &boot_cpu_data) {
u32 eax, ebx, ecx, edx;
+ bool backup_available;
cpuid_count(KEYLOCKER_CPUID, 0, &eax, &ebx, &ecx, &edx);
/*@@ -62,10 +101,49 @@ void __ref setup_keylocker(struct cpuinfo_x86 *c)
goto disable;
}
+ backup_available = (ebx & KEYLOCKER_CPUID_EBX_BACKUP) ? true : false;
Why not
backup_available = !!(ebx & KEYLOCKER_CPUID_EBX_BACKUP);
Apart from this it looks OK, so with the above addressed, please feel
free to add
Acked-by: Rafael J. Wysocki <redacted>
to this patch.
Thanks Rafael! Will do.
Chang