x86-kvm: only sync SREGS when doing address translation
cpu_synchronize_state is 10x or more expensive on AMD then on intel.
This makes all nand read/writes extremely slow (eg: mounting /system takes
over a minute when KVM is enabled on AMD).
Looking at hw/goldfish* all callers of cpu_synchronize_state want to do
is translate virtual to physical addresses. You can do that with 1 ioctl
(KVM_GET_SREGS). Performance on AMD is significant improved (matching
intel) and intel is not affected.
Converted all callers of cpu_synchronize_state in hw/goldfish-* to sync
over only KVM_GET_SREGS when running in KVM mode.
Change-Id: Id15c4e99c0f541527684fba23d639c9dee3525c6
Signed-off-by: Tom Knych <thomaswk@google.com>
11 files changed