AMD/IOMMU: obtain IVHD type to use earlier
authorJan Beulich <jbeulich@suse.com>
Fri, 15 Oct 2021 10:44:20 +0000 (12:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Oct 2021 10:44:20 +0000 (12:44 +0200)
commitd8bd82327b0fffb16841862192e826fcb1344d8c
treefab5c8c5af4885e030d86e3d5b00a5258f1f437c
parent1223c4c0c439faa240f031b3dff2b1667547f830
AMD/IOMMU: obtain IVHD type to use earlier

Doing this in amd_iommu_prepare() is too late for it, in particular, to
be used in amd_iommu_detect_one_acpi(), as a subsequent change will want
to do. Moving it immediately ahead of amd_iommu_detect_acpi() is
(luckily) pretty simple, (pretty importantly) without breaking
amd_iommu_prepare()'s logic to prevent multiple processing.

This involves moving table checksumming, as
amd_iommu_get_supported_ivhd_type() ->  get_supported_ivhd_type() will
now be invoked before amd_iommu_detect_acpi()  -> detect_iommu_acpi(). In
the course of doing so stop open-coding acpi_tb_checksum(), seeing that
we have other uses of this originally ACPI-private function elsewhere in
the tree.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/drivers/passthrough/amd/iommu_acpi.c
xen/drivers/passthrough/amd/iommu_init.c
xen/drivers/passthrough/amd/pci_amd_iommu.c