]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Remove redundant reading of rax on OUT instructions
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Fri, 5 Feb 2010 08:52:46 +0000 (17:52 +0900)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:09 +0000 (12:36 -0300)
commit7e4581ca82b38b3ba212377aa2af893c90baaa0a
treeb4e12a5300fee56dafb59ad3b3d410d92a3b5f63
parentac9fd46e4c9982c4a2986e3e7ede1f7704c20b56
KVM: Remove redundant reading of rax on OUT instructions

kvm_emulate_pio() and complete_pio() both read out the
RAX register value and copy it to a place into which
the value read out from the port will be copied later.

This patch removes this redundancy.

/*** snippet from arch/x86/kvm/x86.c ***/
int complete_pio(struct kvm_vcpu *vcpu)
{
...
if (!io->string) {
if (io->in) {
val = kvm_register_read(vcpu, VCPU_REGS_RAX);
memcpy(&val, vcpu->arch.pio_data, io->size);
kvm_register_write(vcpu, VCPU_REGS_RAX, val);
}
...

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c