xen: introduce XENFEAT_direct_mapped and XENFEAT_not_direct_mapped
authorStefano Stabellini <sstabellini@kernel.org>
Fri, 12 Mar 2021 23:16:32 +0000 (15:16 -0800)
committerJulien Grall <jgrall@amazon.com>
Thu, 1 Apr 2021 16:12:05 +0000 (17:12 +0100)
commitd66bf122c0ab79063a607d6cf68edf5e91d17d5e
treeb3bde2c4a47035cfe4fee9a0427d4f4c93f4f178
parente650311d4ebfd5bdff1f689b237f790ac05e1cab
xen: introduce XENFEAT_direct_mapped and XENFEAT_not_direct_mapped

Introduce two feature flags to tell the domain whether it is
direct-mapped or not. It allows the guest kernel to make informed
decisions on things such as swiotlb-xen enablement.

The introduction of both flags (XENFEAT_direct_mapped and
XENFEAT_not_direct_mapped) allows the guest kernel to avoid any
guesswork if one of the two is present, or fallback to the current
checks if neither of them is present.

XENFEAT_direct_mapped is always set for not auto-translated guests.

For auto-translated guests, only Dom0 on ARM is direct-mapped. Also,
see is_domain_direct_mapped() which refers to auto-translated guests:
xen/include/asm-arm/domain.h:is_domain_direct_mapped
xen/include/asm-x86/domain.h:is_domain_direct_mapped

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
CC: jbeulich@suse.com
CC: andrew.cooper3@citrix.com
CC: julien@xen.org
xen/common/kernel.c
xen/include/public/features.h