Commit 9d2fdadb authored by Alexander Graf's avatar Alexander Graf Committed by Greg Kroah-Hartman

KVM: PPC: 44x: fix DCR read/write

commit e43a0287 upstream.

When remembering the direction of a DCR transaction, we should write
to the same variable that we interpret on later when doing vcpu_run
again.
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarCAI Qian <caiqian@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5b8692bf
...@@ -79,6 +79,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -79,6 +79,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
run->dcr.dcrn = dcrn; run->dcr.dcrn = dcrn;
run->dcr.data = 0; run->dcr.data = 0;
run->dcr.is_write = 0; run->dcr.is_write = 0;
vcpu->arch.dcr_is_write = 0;
vcpu->arch.io_gpr = rt; vcpu->arch.io_gpr = rt;
vcpu->arch.dcr_needed = 1; vcpu->arch.dcr_needed = 1;
kvmppc_account_exit(vcpu, DCR_EXITS); kvmppc_account_exit(vcpu, DCR_EXITS);
...@@ -100,6 +101,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -100,6 +101,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
run->dcr.dcrn = dcrn; run->dcr.dcrn = dcrn;
run->dcr.data = kvmppc_get_gpr(vcpu, rs); run->dcr.data = kvmppc_get_gpr(vcpu, rs);
run->dcr.is_write = 1; run->dcr.is_write = 1;
vcpu->arch.dcr_is_write = 1;
vcpu->arch.dcr_needed = 1; vcpu->arch.dcr_needed = 1;
kvmppc_account_exit(vcpu, DCR_EXITS); kvmppc_account_exit(vcpu, DCR_EXITS);
emulated = EMULATE_DO_DCR; emulated = EMULATE_DO_DCR;
......
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