x86/mem_access: fix vm_event emulation check with altp2m enabled
authorRazvan Cojocaru <rcojocaru@bitdefender.com>
Mon, 6 Mar 2017 16:51:15 +0000 (17:51 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 6 Mar 2017 16:51:15 +0000 (17:51 +0100)
commit06857f3436b987fb4942288d8f750c0a1854976c
treeb30a8866e07d435223541e60c368796e30bb235f
parentc86b899597dccff002313d1ce9bd32b0f4325c62
x86/mem_access: fix vm_event emulation check with altp2m enabled

Currently, p2m_mem_access_emulate_check() uses p2m_get_mem_access()
to check if the page restrictions have been lifted between the time
of sending the vm_event out and the reception of the reply - in
which case emulation is no longer required. Unfortunately,
p2m_get_mem_access() uses p2m_get_hostp2m(d) which only checks the
default EPT (view 0 in altp2m parlance). This patch fixes this by
checking the active altp2m view instead, whenever applicable.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
xen/arch/x86/mm/mem_access.c