KVM: x86 emulator: access GPRs on demand
authorAvi Kivity <avi@redhat.com>
Mon, 27 Aug 2012 20:46:17 +0000 (23:46 +0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 27 Aug 2012 21:38:55 +0000 (18:38 -0300)
commitdd856efafe6097a5c9104725c2bca74430423db8
treed074a16680f3a39798f372e16426476aa7f6e1df
parent66a03505a7fcc70187319ef2318832f4d3c451a6
KVM: x86 emulator: access GPRs on demand

Instead of populating the entire register file, read in registers
as they are accessed, and write back only the modified ones.  This
saves a VMREAD and VMWRITE on Intel (for rsp, since it is not usually
used during emulation), and a two 128-byte copies for the registers.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c