From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Durrant Subject: [PATCH v2 15/17] x86/hvm: make sure translated MMIO reads or writes fall within a page Date: Thu, 11 Jun 2015 16:42:59 +0100 Message-ID: <1434037381-10917-16-git-send-email-paul.durrant@citrix.com> References: <1434037381-10917-1-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z34ld-0000G8-4f for xen-devel@lists.xenproject.org; Thu, 11 Jun 2015 15:51:45 +0000 In-Reply-To: <1434037381-10917-1-git-send-email-paul.durrant@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Paul Durrant , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org ...otherwise they will simply carry on to the next page using a normal linear-to-phys translation. Signed-off-by: Paul Durrant Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper --- 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