mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
Recent AMD processors may report up to 128 logical processors in CPUID leaf 1. Doubling this value produces 0 (which OSes sincerely dislike), as the respective field is only 8 bits wide. Suppress doubling the value (and its leaf 0x80000008 counterpart) in such a case. Note that while there's a similar overflow in intel_xc_cpuid_policy(), that one is being left alone for now. Note further that while it was considered to suppress the multiplication by 2 altogether if the host topology already provides at least one bit of thread ID within APIC IDs, it was decided to avoid more change here than really needed at this point. Also zap leaf 4 (and at the same time leaf 2) EDX output for AMD, as it should have been from the beginning. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> libxc/x86: correct overflow avoidance check in AMD CPUID handling Commitdf29d03f1d("libxc/x86: avoid certain overflows in CPUID APIC ID adjustments" introduced a one bit too narrow mask when checking whether multiplying by 1 (in particular in leaf 1) would result in overflow. Reported-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> master commit:df29d03f1dmaster date: 2019-09-24 10:50:33 +0200 master commit:c9c7ac508bmaster date: 2019-09-25 15:50:58 +0200