Commit 49c6799a authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

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: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent af5b4f7f
...@@ -587,8 +587,7 @@ void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw, ...@@ -587,8 +587,7 @@ void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw,
unsigned long *rflags); unsigned long *rflags);
unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr); unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr);
void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value, void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value);
unsigned long *rflags);
void kvm_enable_efer_bits(u64); void kvm_enable_efer_bits(u64);
int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data); int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data);
int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
......
...@@ -2534,8 +2534,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -2534,8 +2534,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
case 0x22: /* mov reg, cr */ case 0x22: /* mov reg, cr */
if (c->modrm_mod != 3) if (c->modrm_mod != 3)
goto cannot_emulate; goto cannot_emulate;
realmode_set_cr(ctxt->vcpu, realmode_set_cr(ctxt->vcpu, c->modrm_reg, c->modrm_val);
c->modrm_reg, c->modrm_val, &ctxt->eflags);
c->dst.type = OP_NONE; c->dst.type = OP_NONE;
break; break;
case 0x23: /* mov from reg to dr */ case 0x23: /* mov from reg to dr */
......
...@@ -4080,13 +4080,11 @@ unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr) ...@@ -4080,13 +4080,11 @@ unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr)
return value; return value;
} }
void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val, void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val)
unsigned long *rflags)
{ {
switch (cr) { switch (cr) {
case 0: case 0:
kvm_set_cr0(vcpu, mk_cr_64(kvm_read_cr0(vcpu), val)); kvm_set_cr0(vcpu, mk_cr_64(kvm_read_cr0(vcpu), val));
*rflags = kvm_get_rflags(vcpu);
break; break;
case 2: case 2:
vcpu->arch.cr2 = val; vcpu->arch.cr2 = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment