From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: [PATCH] fix process_portio_intercept Date: Wed, 01 Apr 2009 15:19:44 +0100 Message-ID: <49D37800.6000500@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org Hi all, process_portio_intercept and hvm_mmio_access do not correctly check the return value of the intercept action functions they are calling. In particular they are setting p->count to i even if i is 0 and the action function returned X86EMUL_UNHANDLEABLE, leading to errors. Signed-off-by: Stefano Stabellini --- diff -r dbc4014882d0 xen/arch/x86/hvm/intercept.c --- a/xen/arch/x86/hvm/intercept.c Wed Apr 01 08:36:21 2009 +0100 +++ b/xen/arch/x86/hvm/intercept.c Wed Apr 01 15:15:29 2009 +0100 @@ -100,8 +100,10 @@ } } - if ( (p->count = i) != 0 ) + if ( i > 0 ) { + p->count = i; rc = X86EMUL_OKAY; + } return rc; } @@ -165,8 +167,10 @@ } } - if ( (p->count = i) != 0 ) + if ( i > 0 ) { + p->count = i; rc = X86EMUL_OKAY; + } return rc; }