]> xenbits.xensource.com Git - xen.git/commit
x86/HVM: use single (atomic) MOV for aligned emulated writes
authorJan Beulich <jbeulich@suse.com>
Fri, 3 Jan 2020 16:04:41 +0000 (17:04 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Jan 2020 16:04:41 +0000 (17:04 +0100)
commitbf08a8a08a2ee8cef5fb7b3b274b0e09123a41bd
tree115b93ef6a2ed93011182bb96dacb6dc42557de9
parent7ad3d07b37e8f3b15772de8bc1367c68ea681eee
x86/HVM: use single (atomic) MOV for aligned emulated writes

Using memcpy() may result in multiple individual byte accesses
(dependening how memcpy() is implemented and how the resulting insns,
e.g. REP MOVSB, get carried out in hardware), which isn't what we
want/need for carrying out guest insns as correctly as possible. Fall
back to memcpy() only for accesses not 2, 4, or 8 bytes in size.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/emulate.c