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

[Xen-devel] [PATCH v2 15/17] x86/hvm: make sure translated MMIO reads or writes fall within a page



...otherwise they will simply carry on to the next page using a normal
linear-to-phys translation.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
Cc: Keir Fraser <keir@xxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/hvm/emulate.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 1eab7bd..0d748e7 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -665,7 +665,6 @@ static int __hvmemul_read(
                                         p_data);
             if ( rc != X86EMUL_OKAY || bytes == chunk )
                 return rc;
-            addr += chunk;
             off += chunk;
             gpa += chunk;
             p_data += chunk;
@@ -673,6 +672,8 @@ static int __hvmemul_read(
             if ( bytes < chunk )
                 chunk = bytes;
         }
+
+        return X86EMUL_UNHANDLEABLE;
     }
 
     if ( (seg != x86_seg_none) &&
@@ -809,7 +810,6 @@ static int hvmemul_write(
                                         p_data);
             if ( rc != X86EMUL_OKAY || bytes == chunk )
                 return rc;
-            addr += chunk;
             off += chunk;
             gpa += chunk;
             p_data += chunk;
@@ -817,6 +817,8 @@ static int hvmemul_write(
             if ( bytes < chunk )
                 chunk = bytes;
         }
+
+        return X86EMUL_UNHANDLEABLE;
     }
 
     if ( (seg != x86_seg_none) &&
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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