0x1c is lower than any value which will actually be observed in
p->extd.max_leaf, but higher than the logical 9 leaves worth of extended data
on Intel systems, causing x86_cpuid_copy_to_buffer() to fail with -ENOBUFS.
Correct the calculation.
The problem was first noticed in c/s
34990446ca9 "libxl: don't ignore the
return value from xc_cpuid_apply_policy" but introduced earlier.
Fixes: 111c8c33a8a1 ("x86/cpuid: do not expand max leaves on restore")
Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
/* Clamp maximum leaves to the ones supported on 4.12. */
p->basic.max_leaf = min(p->basic.max_leaf, 0xdu);
p->feat.max_subleaf = 0;
- p->extd.max_leaf = min(p->extd.max_leaf, 0x1cu);
+ p->extd.max_leaf = min(p->extd.max_leaf, 0x8000001c);
}
if ( featureset )