VT-d: fix !HVM build
authorJan Beulich <jbeulich@suse.com>
Fri, 20 May 2022 10:17:52 +0000 (12:17 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 20 May 2022 10:17:52 +0000 (12:17 +0200)
commitc038304b46ffb3d3d314819d1331ca61e9ff668b
tree320946ac03893641db0d690018e83ee9c9643877
parent43aa3f6e72d340a85d3943b86350f6196a87289c
VT-d: fix !HVM build

EPT is of no interest when !HVM. While I'm observing gcc11 to fully
eliminate the function, older gcc's DCE looks to not be as good.
CONFIG_UBSAN apparently also limits how aggressively dead code is
eliminated. Aid the compiler in eliminating the accesses of
opt_hap_{2mb,1gb}, which otherwise cause undefined symbol errors when
linking.

While there adjust types.

Fixes: c479415610f0 ("x86/P2M: p2m.c is HVM-only")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c