@@ -528,11 +528,22 @@ static void test_cpuid_out_of_range_clea
},
},
{
+ .name = "no extd",
+ .nr_markers = 0,
+ .p = {
+ /* Clears all markers. */
+ .extd.max_leaf = 0,
+
+ .extd.vendor_ebx = 0xc2,
+ .extd.raw_fms = 0xc2,
+ },
+ },
+ {
.name = "extd",
.nr_markers = 1,
.p = {
/* Retains marker in leaf 0. Clears others. */
- .extd.max_leaf = 0,
+ .extd.max_leaf = 0x80000000,
.extd.vendor_ebx = 0xc2,
.extd.raw_fms = 0xc2,
@@ -285,7 +285,9 @@ void x86_cpu_policy_clear_out_of_range_l
ARRAY_SIZE(p->xstate.raw) - 1);
}
- zero_leaves(p->extd.raw, (p->extd.max_leaf & 0xffff) + 1,
+ zero_leaves(p->extd.raw,
+ ((p->extd.max_leaf >> 16) == 0x8000
+ ? (p->extd.max_leaf & 0xffff) + 1 : 0),
ARRAY_SIZE(p->extd.raw) - 1);
}