x86/hvm: simplify 'mmio_direct' check in epte_get_entry_emt()
authorPaul Durrant <pdurrant@amazon.com>
Fri, 31 Jul 2020 15:43:31 +0000 (17:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 31 Jul 2020 15:43:31 +0000 (17:43 +0200)
commit81fd0d3ca4b2cd309403c6e8da662c325dd35750
treefdbf842737897a7bf8a2d5339bd72fc091e859b7
parentca24b2ffdbd9a25b2d313a547ccbe97baf3e5a8d
x86/hvm: simplify 'mmio_direct' check in epte_get_entry_emt()

Re-factor the code to take advantage of the fact that the APIC access page is
a 'special' page. The VMX code is left alone and hence the APIC access page is
still inserted into the P2M with type p2m_mmio_direct. This is left alone as it
is not obvious there is another suitable type to use, and the necessary
re-ordering in epte_get_entry_emt() is straightforward.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/mtrr.c