From: Paul Durrant Date: Thu, 9 Jul 2015 17:16:00 +0000 (+0200) Subject: x86/hvm: always re-emulate I/O from a buffer X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2845 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a9320fef57c74f83e7bdd8bcaa94da7aa64deac5;p=xen.git x86/hvm: always re-emulate I/O from a buffer If memory mapped I/O is 'chunked' then the I/O must be re-emulated, otherwise only the first chunk will be processed. This patch makes sure all I/O from a buffer is re-emulated regardless of whether it is a read or a write. Signed-off-by: Paul Durrant Acked-by: Jan Beulich Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c index 1444b56f8e..89b161639a 100644 --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -147,7 +147,7 @@ static int hvmemul_do_io( (p.data_is_ptr != data_is_addr) ) domain_crash(curr->domain); - if ( data_is_addr || dir == IOREQ_WRITE ) + if ( data_is_addr ) return X86EMUL_UNHANDLEABLE; goto finish_access; default: @@ -187,7 +187,7 @@ static int hvmemul_do_io( rc = hvm_send_assist_req(s, &p); if ( rc != X86EMUL_RETRY || curr->domain->is_shutting_down ) vio->io_req.state = STATE_IOREQ_NONE; - else if ( data_is_addr || dir == IOREQ_WRITE ) + else if ( data_is_addr ) rc = X86EMUL_OKAY; } break; diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h index 01cbfe5b08..13ff54f7c2 100644 --- a/xen/include/asm-x86/hvm/vcpu.h +++ b/xen/include/asm-x86/hvm/vcpu.h @@ -81,8 +81,7 @@ struct hvm_vcpu_io { static inline bool_t hvm_vcpu_io_need_completion(const struct hvm_vcpu_io *vio) { return (vio->io_req.state == STATE_IOREQ_READY) && - !vio->io_req.data_is_ptr && - (vio->io_req.dir == IOREQ_READ); + !vio->io_req.data_is_ptr; } #define VMCX_EADDR (~0ULL)