Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86_emulate: HVM emulation of REP instruc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86_emulate: HVM emulation of REP instructions should inject #PF only
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 27 Mar 2008 05:30:26 -0700
Delivery-date: Thu, 27 Mar 2008 05:30:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86_emulate: HVM emulation of REP instructions should inject #PF only, Xen patchbot-unstable <=