x86/PVH: avoid call to handle_mmio
authorMukesh Rathor <mukesh.rathor@oracle.com>
Wed, 4 Jun 2014 09:27:50 +0000 (11:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 4 Jun 2014 09:27:50 +0000 (11:27 +0200)
commit7c4870915c2d50acbc66347a532e33b452f64f17
treeaf0f1d2913d09a17b3cea1cafb3cea699e0e36fb
parent9c1e8cae657bc13e8b1ddeede17603d77f3ad341
x86/PVH: avoid call to handle_mmio

handle_mmio() is currently unsafe for pvh guests. A call to it would
result in call to vioapic_range that will crash xen since the vioapic
ptr in struct hvm_domain is not initialized for pvh guests.

However, one path exists for such a call. If a pvh guest, dom0 or domU,
unintentionally touches non-existing memory, an EPT violation would occur.
This would result in unconditional call to hvm_hap_nested_page_fault. In
that function, because get_gfn_type_access returns p2m_mmio_dm for non
existing mfns by default, handle_mmio() will get called. This would result
in xen crash instead of the guest crash. This patch addresses that.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/io.c