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

[Xen-changelog] [xen-unstable] x86_emulate: HVM emulation of REP instructions should inject #PF only



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206546645 0
# Node ID 89121c8b3c0d0713131d0494f1f76155e4f480de
# Parent  c02deeae743221cbe9a1ac9769d21c292e267601
x86_emulate: HVM emulation of REP instructions should inject #PF only
if virt-to-phys lookup fails for the first repetition.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/emulate.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff -r c02deeae7432 -r 89121c8b3c0d xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c        Wed Mar 26 14:44:21 2008 +0000
+++ b/xen/arch/x86/hvm/emulate.c        Wed Mar 26 15:50:45 2008 +0000
@@ -74,18 +74,19 @@ static int hvmemul_linear_to_phys(
     for ( i = 1; done < todo; i++ )
     {
         /* Get the next PFN in the range. */
-        if ( (npfn = paging_gva_to_gfn(curr, addr, &pfec)) == INVALID_GFN )
-        {
-            hvm_inject_exception(TRAP_page_fault, pfec, addr);
-            return X86EMUL_EXCEPTION;
-        }
+        npfn = paging_gva_to_gfn(curr, addr, &pfec);
 
         /* Is it contiguous with the preceding PFNs? If not then we're done. */
-        if ( npfn != (pfn + i) )
+        if ( (npfn == INVALID_GFN) || (npfn != (pfn + i)) )
         {
             done /= bytes_per_rep;
             if ( done == 0 )
-                return X86EMUL_UNHANDLEABLE;
+            {
+                if ( npfn != INVALID_GFN )
+                    return X86EMUL_UNHANDLEABLE;
+                hvm_inject_exception(TRAP_page_fault, pfec, addr);
+                return X86EMUL_EXCEPTION;
+            }
             *reps = done;
             break;
         }

_______________________________________________
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®.