From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xen.org
Cc: Paul Durrant <paul.durrant@citrix.com>, Keir Fraser <keir@xen.org>
Subject: [PATCH v8 12/13] x86/hvm: always re-emulate I/O from a buffer
Date: Thu, 9 Jul 2015 17:55:25 +0100 [thread overview]
Message-ID: <1436460926-16976-13-git-send-email-paul.durrant@citrix.com> (raw)
In-Reply-To: <1436460926-16976-1-git-send-email-paul.durrant@citrix.com>
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 <paul.durrant@citrix.com>
Cc: Keir Fraser <keir@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
v7:
- No change
v6:
- Added Andrew's reviewed-by
v5:
- Added Jan's acked-by
---
xen/arch/x86/hvm/emulate.c | 4 ++--
xen/include/asm-x86/hvm/vcpu.h | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 1444b56..89b1616 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 01cbfe5..13ff54f 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)
--
1.7.10.4
next prev parent reply other threads:[~2015-07-09 16:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 16:55 [PATCH v8 00/13] x86/hvm: I/O emulation cleanup and fix Paul Durrant
2015-07-09 16:55 ` [PATCH v8 01/13] x86/hvm: change portio port numbers and sizes to unsigned int Paul Durrant
2015-07-09 16:55 ` [PATCH v8 02/13] x86/hvm: unify internal portio and mmio intercepts Paul Durrant
2015-07-09 16:55 ` [PATCH v8 03/13] x86/hvm: add length to mmio check op Paul Durrant
2015-07-09 16:55 ` [PATCH v8 04/13] x86/hvm: unify dpci portio intercept with standard portio intercept Paul Durrant
2015-07-09 16:55 ` [PATCH v8 05/13] x86/hvm: unify stdvga mmio intercept with standard mmio intercept Paul Durrant
2015-07-09 16:55 ` [PATCH v8 06/13] x86/hvm: limit reps to avoid the need to handle retry Paul Durrant
2015-07-09 16:55 ` [PATCH v8 07/13] x86/hvm: only call hvm_io_assist() from hvm_wait_for_io() Paul Durrant
2015-07-09 16:55 ` [PATCH v8 08/13] x86/hvm: split I/O completion handling from state model Paul Durrant
2015-07-09 16:55 ` [PATCH v8 09/13] x86/hvm: remove HVMIO_dispatched I/O state Paul Durrant
2015-07-09 16:55 ` [PATCH v8 10/13] x86/hvm: remove hvm_io_state enumeration Paul Durrant
2015-07-09 16:55 ` [PATCH v8 11/13] x86/hvm: use ioreq_t to track in-flight state Paul Durrant
2015-07-09 16:55 ` Paul Durrant [this message]
2015-07-09 16:55 ` [PATCH v8 13/13] x86/hvm: track large memory mapped accesses by buffer offset Paul Durrant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436460926-16976-13-git-send-email-paul.durrant@citrix.com \
--to=paul.durrant@citrix.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).