x86/APIC: avoid iommu_supports_x2apic() on error path
authorJan Beulich <jbeulich@suse.com>
Thu, 4 Nov 2021 13:44:43 +0000 (14:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Nov 2021 13:44:43 +0000 (14:44 +0100)
commit0f50d1696b3c13cbf0b18fec817fc291d5a30a31
tree143a05a4d73341ceac2e6942eb106ab1461945b8
parent46c4061cd2bf69e8039021af615c2bdb94e50088
x86/APIC: avoid iommu_supports_x2apic() on error path

The value it returns may change from true to false in case
iommu_enable_x2apic() fails and, as a side effect, clears iommu_intremap
(as can happen at least on AMD). Latch the return value from the first
invocation to replace the second one.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/arch/x86/apic.c