[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86 hvm: fix up the unified HAP nested-pagefault handler.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259779574 0
# Node ID aa0b5558564f882903ca1c84948bc2a3619d9f73
# Parent  ff04ff0b097e637b7b54afc4ad33e05077751d89
x86 hvm: fix up the unified HAP nested-pagefault handler.
A guest PFN may have been marked dirty and switched to p2m_ram_rw by
another CPU between the VMEXIT and lookup in this handler, so
we can't just check for p2m_ram_logdirty.  Also, handle_mmio
doesn't handle passthrough MMIO.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -r ff04ff0b097e -r aa0b5558564f xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Wed Dec 02 18:43:28 2009 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Wed Dec 02 18:46:14 2009 +0000
@@ -927,7 +927,7 @@ bool_t hvm_hap_nested_page_fault(unsigne
      * If this GFN is emulated MMIO or marked as read-only, pass the fault
      * to the mmio handler.
      */
-    if ( p2m_is_mmio(p2mt) || (p2mt == p2m_ram_ro) )
+    if ( (p2mt == p2m_mmio_dm) || (p2mt == p2m_ram_ro) )
     {
         if ( !handle_mmio() )
             hvm_inject_exception(TRAP_gp_fault, 0, 0);
@@ -935,7 +935,8 @@ bool_t hvm_hap_nested_page_fault(unsigne
     }
 
     /* Log-dirty: mark the page dirty and let the guest write it again */
-    if ( p2mt == p2m_ram_logdirty )
+    if ( paging_mode_log_dirty(current->domain)
+         && p2m_is_ram(p2mt) && (p2mt != p2m_ram_ro) )
     {
         paging_mark_dirty(current->domain, mfn_x(mfn));
         p2m_change_type(current->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.