vtd: make sure QI/IR are disabled before initialisation
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Fri, 12 Mar 2021 16:01:52 +0000 (17:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 12 Mar 2021 16:01:52 +0000 (17:01 +0100)
commit04181c6fb543db01f635227c7681ced4073109ba
treed5296744f18332573809c8fc6b14bb352cffb1a5
parent0570d7f276dd20a3adee80ca44a5fe7daf7566cd
vtd: make sure QI/IR are disabled before initialisation

BIOS might pass control to Xen leaving QI and/or IR in enabled and/or
partially configured state. In case of x2APIC code path where EIM is
enabled early in boot - those are correctly disabled by Xen before any
attempt to configure. But for xAPIC that step is missing which was
proven to cause QI initialization failures on some ICX based platforms
where QI is left pre-enabled and partially configured by BIOS. That
problem becomes hard to avoid since those platforms are shipped with
x2APIC opt out being advertised by default at the same time by firmware.

Unify the behaviour between x2APIC and xAPIC code paths keeping that in
line with what Linux does.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/arch/x86/apic.c
xen/drivers/passthrough/vtd/iommu.c
xen/include/asm-x86/apic.h