amd/npt/shadow: replace assert that prevents creating 2M/1G MMIO entries
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 18 Feb 2019 12:44:24 +0000 (13:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 18 Feb 2019 12:44:24 +0000 (13:44 +0100)
commit6fa1755644d0e63793007c8d911b4b520ca95301
tree4a3acfda071e98f613fa3b0aff9d79d63ad0e940
parent036c6cbddca28be5a526da045bb379fedfad8255
amd/npt/shadow: replace assert that prevents creating 2M/1G MMIO entries

The assert was originally added to make sure that higher order
regions (> PAGE_ORDER_4K) could not be used to bypass the
mmio_ro_ranges check performed by p2m_type_to_flags.

This however is already checked in set_mmio_p2m_entry, which makes
sure that higher order mappings don't overlap with mmio_ro_ranges,
thus allowing the creation of high order MMIO mappings safely.

Replace the assert to allow 2M/1G entries to be created for MMIO
regions and add some extra asserts as a replacement to make sure
there's no overlapping with MMIO read-only ranges.

Note that 1G MMIO entries will not be created unless mmio_order is
changed to allow it.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/mm/p2m-pt.c