From cc30929339eb46d10f676ea816d77274635515d3 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 29 Aug 2022 14:03:02 +0100 Subject: [PATCH] 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 --- plugins/cpu/fu-cpu-device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/cpu/fu-cpu-device.c b/plugins/cpu/fu-cpu-device.c index cdc41c101..78bb35894 100644 --- a/plugins/cpu/fu-cpu-device.c +++ b/plugins/cpu/fu-cpu-device.c @@ -250,8 +250,9 @@ fu_cpu_device_probe_extended_features(FuDevice *device, GError **error) FuCpuDevice *self = FU_CPU_DEVICE(device); guint32 ebx = 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; if ((ebx >> 20) & 0x1) 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; if ((ecx >> 13) & 0x1) self->flags |= FU_CPU_DEVICE_FLAG_TME; - if ((ecx >> 20) & 0x1) + if ((edx >> 20) & 0x1) self->flags |= FU_CPU_DEVICE_FLAG_IBT; return TRUE; }