Correctly detect CET IBT

According to Intel, EDX[bit 20] corresponds to IBT feature, *not* ECX.

Fixes half of https://github.com/fwupd/fwupd/issues/4960
This commit is contained in:
Richard Hughes 2022-08-29 14:03:02 +01:00
parent 1f7526cce1
commit cc30929339

View File

@ -250,8 +250,9 @@ fu_cpu_device_probe_extended_features(FuDevice *device, GError **error)
FuCpuDevice *self = FU_CPU_DEVICE(device); FuCpuDevice *self = FU_CPU_DEVICE(device);
guint32 ebx = 0; guint32 ebx = 0;
guint32 ecx = 0; guint32 ecx = 0;
guint32 edx = 0;
if (!fu_cpuid(0x7, NULL, &ebx, &ecx, NULL, error)) if (!fu_cpuid(0x7, NULL, &ebx, &ecx, &edx, error))
return FALSE; return FALSE;
if ((ebx >> 20) & 0x1) if ((ebx >> 20) & 0x1)
self->flags |= FU_CPU_DEVICE_FLAG_SMAP; self->flags |= FU_CPU_DEVICE_FLAG_SMAP;
@ -259,7 +260,7 @@ fu_cpu_device_probe_extended_features(FuDevice *device, GError **error)
self->flags |= FU_CPU_DEVICE_FLAG_SHSTK; self->flags |= FU_CPU_DEVICE_FLAG_SHSTK;
if ((ecx >> 13) & 0x1) if ((ecx >> 13) & 0x1)
self->flags |= FU_CPU_DEVICE_FLAG_TME; self->flags |= FU_CPU_DEVICE_FLAG_TME;
if ((ecx >> 20) & 0x1) if ((edx >> 20) & 0x1)
self->flags |= FU_CPU_DEVICE_FLAG_IBT; self->flags |= FU_CPU_DEVICE_FLAG_IBT;
return TRUE; return TRUE;
} }