]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: PPC: 44x: fix DCR read/write
authorAlexander Graf <agraf@suse.de>
Sat, 6 Oct 2012 01:56:35 +0000 (03:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:46:47 +0000 (08:46 -0800)
commit e43a028752fed049e4bd94ef895542f96d79fa74 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: Alexander Graf <agraf@suse.de>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kvm/44x_emulate.c

index c8c61578fdfc6e8420497854971d8da7b6d74598..c39cd0b848b1bcebfc174182a967c9bb40009688 100644 (file)
@@ -76,6 +76,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
                                run->dcr.dcrn = dcrn;
                                run->dcr.data =  0;
                                run->dcr.is_write = 0;
+                               vcpu->arch.dcr_is_write = 0;
                                vcpu->arch.io_gpr = rt;
                                vcpu->arch.dcr_needed = 1;
                                kvmppc_account_exit(vcpu, DCR_EXITS);
@@ -94,6 +95,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
                                run->dcr.dcrn = dcrn;
                                run->dcr.data = kvmppc_get_gpr(vcpu, rs);
                                run->dcr.is_write = 1;
+                               vcpu->arch.dcr_is_write = 1;
                                vcpu->arch.dcr_needed = 1;
                                kvmppc_account_exit(vcpu, DCR_EXITS);
                                emulated = EMULATE_DO_DCR;