diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-10-14 09:51:40 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-10-14 09:51:40 +0200 |
commit | 82ed8716b08ccf2f6239262ecc269c5cd60ef5dd (patch) | |
tree | 593cea15dea26f5bffe14320c7cfc2e936088f3c /xen/include/asm-x86/hvm/vcpu.h | |
parent | f21399e148386ecf3826ab81159eca58cfab2147 (diff) | |
download | xen-82ed8716b08ccf2f6239262ecc269c5cd60ef5dd.tar.gz xen-82ed8716b08ccf2f6239262ecc269c5cd60ef5dd.tar.bz2 xen-82ed8716b08ccf2f6239262ecc269c5cd60ef5dd.zip |
x86/HVM: fix direct PCI port I/O emulation retry and error handling
dpci_ioport_{read,write}() guest memory access failure handling should
be modelled after process_portio_intercept()'s (and others): Upon
encountering an error on other than the first iteration, the count
successfully handled needs to be stored and X86EMUL_OKAY returned, in
order for the generic instruction emulator to update register state
correctly before reporting failure or retrying (both of which would
only happen after re-invoking emulation).
Further we leverage (and slightly extend, due to the above mentioned
need to return X86EMUL_OKAY) the "large MMIO" retry model.
Note that there is still a special case not explicitly taken care of
here: While the first retry on the last iteration of a "rep ins"
correctly recovers the already read data, an eventual subsequent retry
is being handled by the pre-existing mmio-large logic (through
hvmemul_do_io() storing the [recovered] data [again], also taking into
consideration that the emulator converts a single iteration "ins" to
->read_io() plus ->write()).
Also fix an off-by-one in the mmio-large-read logic, and slightly
simplify the copying of the data.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/asm-x86/hvm/vcpu.h')
-rw-r--r-- | xen/include/asm-x86/hvm/vcpu.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h index e8b8cd76ba..1abb364b07 100644 --- a/xen/include/asm-x86/hvm/vcpu.h +++ b/xen/include/asm-x86/hvm/vcpu.h @@ -66,6 +66,11 @@ struct hvm_vcpu_io { /* We may write up to m256 as a number of device-model transactions. */ unsigned int mmio_large_write_bytes; paddr_t mmio_large_write_pa; + /* + * For string instruction emulation we need to be able to signal a + * necessary retry through other than function return codes. + */ + bool_t mmio_retry, mmio_retrying; }; #define VMCX_EADDR (~0ULL) |