]> xenbits.xensource.com Git - xen.git/commit
x86/HVM: split page straddling emulated accesses in more cases
authorJan Beulich <jbeulich@suse.com>
Tue, 11 Sep 2018 09:03:46 +0000 (11:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Sep 2018 09:03:46 +0000 (11:03 +0200)
commit3bdec530a5f50b212aa5fd05d97e7349e8bdba82
tree98d4180cfa8a4c1fabb79f5f853e8c357abd0c44
parent9f232721deaeb9f56eeffb555c4b7ecd62708667
x86/HVM: split page straddling emulated accesses in more cases

Assuming consecutive linear addresses map to all RAM or all MMIO is not
correct. Nor is assuming that a page straddling MMIO access will access
the same emulating component for both parts of the access. If a guest
RAM read fails with HVMTRANS_bad_gfn_to_mfn and if the access straddles
a page boundary, issue accesses separately for both parts.

The extra call to known_gla() from hvmemul_write() is just to preserve
original behavior; for consistency the check also gets added to
hvmemul_rmw() (albeit I continue to be unsure whether we wouldn't better
drop both).

Note that the correctness of this depends on the MMIO caching used
elsewhere in the emulation code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
xen/arch/x86/hvm/emulate.c