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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259779772 0
# Node ID 3accd87a8a50f27f52e63e7bd48348177d8283ae
# Parent  072eb8f654df4a14782e3ed12e9c4d1b8a8d6ca0
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-unstable changeset:   20568:aa0b5558564f
xen-unstable date:        Wed Dec 02 18:46:14 2009 +0000
---
 xen/arch/x86/hvm/hvm.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -r 072eb8f654df -r 3accd87a8a50 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Wed Dec 02 14:06:58 2009 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Wed Dec 02 18:49:32 2009 +0000
@@ -837,7 +837,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);
@@ -845,7 +845,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®.