x86/cpuid: Fix HLE and RTM handling (again)
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 Jun 2021 12:25:09 +0000 (13:25 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 17 Jun 2021 13:45:37 +0000 (14:45 +0100)
commitee5425c0d532a773093cc4ff91c4c06caf2ff447
treeed88f4ebab93c222858e852d8a729328cb63270a
parent4b4ee05a70d6193fa7c18650743c72b609cd272b
x86/cpuid: Fix HLE and RTM handling (again)

For reasons which are my fault, but I don't recall why, the
FDP_EXCP_ONLY/NO_FPU_SEL adjustment uses the whole special_features[] array
element, not the two relevant bits.

HLE and RTM were recently added to the list of special features, causing them
to be always set in guest view, irrespective of the toolstacks choice on the
matter.

Rewrite the logic to refer to the features specifically, rather than relying
on the contents of the special_features[] array.

Fixes: 8fe24090d9 ("x86/cpuid: Rework HLE and RTM handling")
Reported-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit 60fa12dbf1d4d2c4ffe1ef34b495b24aa7e41aa0)
xen/arch/x86/cpuid.c