Handle PoD case in hvm_hap_nested_page_fault()
PATCH 1/1 Handle PoD case in hvm_hap_nested_page_fault()
The new combined nested page fault handling doesn't consider the case where the gfn_to_mfn() translation caused the page to be transparently populated. Attached patch is one solution; a more robust solution would be to take the access type (read or write) and check it against the type returned by gfn_to_mfn() to handle spurious NPFs as well (if such things ever happen).
xen/arch/x86/hvm/hvm.c +10 -0
@@ -937,6 +937,16 @@ mfn =gfn_to_mfn_type_current (gfn, &p2mt, p2m_guest);/* +* If this is a valid entry now, it was probably populated by the PoD code, +* or perhaps the nested fault was spurious. Continue. +*/ +if ( p2mt == p2m_ram_rw ) + { +ASSERT (mfn_valid (mfn) );/* implied by p2mt == p2m_ram_rw */ +return 1 ; + } + +/* * If this GFN is emulated MMIO or marked as read-only, pass the fault * to the mmio handler. */
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
I checked in a different version as c/s 20763: take a look. It's questionable whether returning 0 from the function is ever a sensible thing. I suppose at least this way we have to have considered all cases properly. At least I think we won't change it during the 4.0.0 freeze.
-- Keir
Quoted 8 lines · George Dunlap
The new combined nested page fault handling doesn't consider the case where the
gfn_to_mfn()translation caused the page to be transparently populated. Attached patch is one solution; a more robust solution would be to take the access type (read or write) and check it against the type returned bygfn_to_mfn()to handle spurious NPFs as well (if such things ever happen).Signed-off-by George Dunlap <[email protected]>