]> xenbits.xensource.com Git - xen.git/commit
x86/traps: Correct pagefault handling issues introduced in c/s d5c251c
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Dec 2016 11:33:17 +0000 (11:33 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Dec 2016 18:23:51 +0000 (18:23 +0000)
commit7b9f21cabc14d823d888ff00413e49b41ca430fe
treeb1aaf975aebb9822b79925f78c5a3d8359723435
parent6a6bbedd39e39f6c45001ce468c5e53a3a2b3ba6
x86/traps: Correct pagefault handling issues introduced in c/s d5c251c

There are two bugs.

Firstly, the ASSERT(paging_mode_only_log_dirty(d)) can trip when servicing a
hypervisor #PF in the context of an HVM guest, e.g. a copy_to_user() failure
in the shadow pagetable code.

Secondly, the entry conditions paging_fault() were previously guarded on
!paging_mode_external(d) which limited entry to PV contexts, but for both
guest and hypervisor faults.  Switching this to paging_mode_log_dirty() opened
it up to HVM contexts as well.

Reinstate the old !paging_mode_external(d) check, as it is actually the
relevent fact, and extend the comment to explicitly state that hypervisor
faults should follow this path.

Inside, we are now guarenteed to be in the context of a PV guest, so can
safely use the assertion about log dirty.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/traps.c