aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-03-15 10:38:31 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:15:50 -0400
commit49c6799a2ce3a6a4dd66021dabeb468901c7a700 (patch)
tree3830df00dd47736fa1eaa2ce13c3f868b80018f1
parentaf5b4f7ff7ec76400b89db9538accd9aeb996da4 (diff)
KVM: Remove pointer to rflags from realmode_set_cr parameters.
Mov reg, cr instruction doesn't change flags in any meaningful way, so no need to update rflags after instruction execution. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--arch/x86/include/asm/kvm_host.h3
-rw-r--r--arch/x86/kvm/emulate.c3
-rw-r--r--arch/x86/kvm/x86.c4
3 files changed, 3 insertions, 7 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 28826c82d1e2..53f520259471 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -587,8 +587,7 @@ void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw,
587 unsigned long *rflags); 587 unsigned long *rflags);
588 588
589unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr); 589unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr);
590void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value, 590void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value);
591 unsigned long *rflags);
592void kvm_enable_efer_bits(u64); 591void kvm_enable_efer_bits(u64);
593int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data); 592int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data);
594int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); 593int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 670ca8f151d2..91450b5cd49e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2534,8 +2534,7 @@ twobyte_insn:
2534 case 0x22: /* mov reg, cr */ 2534 case 0x22: /* mov reg, cr */
2535 if (c->modrm_mod != 3) 2535 if (c->modrm_mod != 3)
2536 goto cannot_emulate; 2536 goto cannot_emulate;
2537 realmode_set_cr(ctxt->vcpu, 2537 realmode_set_cr(ctxt->vcpu, c->modrm_reg, c->modrm_val);
2538 c->modrm_reg, c->modrm_val, &ctxt->eflags);
2539 c->dst.type = OP_NONE; 2538 c->dst.type = OP_NONE;
2540 break; 2539 break;
2541 case 0x23: /* mov from reg to dr */ 2540 case 0x23: /* mov from reg to dr */
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index dd4a7ad63aff..35db4f0db4ea 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4080,13 +4080,11 @@ unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr)
4080 return value; 4080 return value;
4081} 4081}
4082 4082
4083void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val, 4083void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val)
4084 unsigned long *rflags)
4085{ 4084{
4086 switch (cr) { 4085 switch (cr) {
4087 case 0: 4086 case 0:
4088 kvm_set_cr0(vcpu, mk_cr_64(kvm_read_cr0(vcpu), val)); 4087 kvm_set_cr0(vcpu, mk_cr_64(kvm_read_cr0(vcpu), val));
4089 *rflags = kvm_get_rflags(vcpu);
4090 break; 4088 break;
4091 case 2: 4089 case 2:
4092 vcpu->arch.cr2 = val; 4090 vcpu->arch.cr2 = val;