x86/hvm/emulate: make sure rep I/O emulation does not cross GFN boundaries
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 8 Oct 2018 12:27:48 +0000 (14:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Oct 2018 12:27:48 +0000 (14:27 +0200)
commitd7cbb4b5c93525b18bccd1da3abb17bde8d2b616
treefd6225da0bd8489b6aa451054c1e729798a3b917
parentbb6d070c16b9332d533c4b714823d3201e794fe7
x86/hvm/emulate: make sure rep I/O emulation does not cross GFN boundaries

When emulating a rep I/O operation it is possible that the ioreq will
describe a single operation that spans multiple GFNs. This is fine as long
as all those GFNs fall within an MMIO region covered by a single device
model, but unfortunately the higher levels of the emulation code do not
guarantee that. This is something that should almost certainly be fixed,
but in the meantime this patch makes sure that MMIO is truncated at GFN
boundaries and hence the appropriate device model is re-evaluated for each
target GFN.

NOTE: This patch does not deal with the case of a single MMIO operation
      spanning a GFN boundary. That is more complex to deal with and is
      deferred to a subsequent patch.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Convert calculations to be 32-bit only.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
master commit: 7626edeaca972e3e823535dcc44338f6b2f0b21f
master date: 2018-08-16 09:27:30 +0200
xen/arch/x86/hvm/emulate.c