x86/hvm: limit reps to avoid the need to handle retry
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 9 Jul 2015 17:04:00 +0000 (19:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Jul 2015 08:05:03 +0000 (10:05 +0200)
commit4faffc41dfeb7c5a59ce3597a2db7ca8a47d2fb3
treed6ae9129ad2aaf621184549ad5d5c8feb2d5e466
parent3bbaaec09b1b942f5624dee176da6e416d31f982
x86/hvm: limit reps to avoid the need to handle retry

By limiting hvmemul_do_io_addr() to reps falling within the page on which
a reference has already been taken, we can guarantee that calls to
hvm_copy_to/from_guest_phys() will not hit the HVMCOPY_gfn_paged_out
or HVMCOPY_gfn_shared cases. Thus we can remove the retry logic (added
by c/s 82ed8716b "fix direct PCI port I/O emulation retry and error
handling") from the intercept code and simplify it significantly.

Normally hvmemul_do_io_addr() will only reference single page at a time.
It will, however, take an extra page reference for I/O spanning a page
boundary.

It is still important to know, upon returning from x86_emulate(), whether
the number of reps was reduced so the mmio_retry flag is retained for that
purpose.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/intercept.c
xen/include/asm-x86/hvm/vcpu.h