diff options
author | Alexander Graf <agraf@suse.de> | 2012-10-05 21:56:35 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-10-30 05:54:50 -0400 |
commit | e43a028752fed049e4bd94ef895542f96d79fa74 (patch) | |
tree | 718d76db085d79f482722b158eb8fa05f1dd9444 | |
parent | 8ca40a70a70988c0bdea106c894843f763ca2989 (diff) |
KVM: PPC: 44x: fix DCR read/write
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>
Cc: stable@vger.kernel.org
-rw-r--r-- | arch/powerpc/kvm/44x_emulate.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/44x_emulate.c b/arch/powerpc/kvm/44x_emulate.c index 1a793c4c4a6..35ec0a8547d 100644 --- a/arch/powerpc/kvm/44x_emulate.c +++ b/arch/powerpc/kvm/44x_emulate.c | |||
@@ -46,6 +46,7 @@ static int emulate_mtdcr(struct kvm_vcpu *vcpu, int rs, int dcrn) | |||
46 | vcpu->run->dcr.dcrn = dcrn; | 46 | vcpu->run->dcr.dcrn = dcrn; |
47 | vcpu->run->dcr.data = kvmppc_get_gpr(vcpu, rs); | 47 | vcpu->run->dcr.data = kvmppc_get_gpr(vcpu, rs); |
48 | vcpu->run->dcr.is_write = 1; | 48 | vcpu->run->dcr.is_write = 1; |
49 | vcpu->arch.dcr_is_write = 1; | ||
49 | vcpu->arch.dcr_needed = 1; | 50 | vcpu->arch.dcr_needed = 1; |
50 | kvmppc_account_exit(vcpu, DCR_EXITS); | 51 | kvmppc_account_exit(vcpu, DCR_EXITS); |
51 | return EMULATE_DO_DCR; | 52 | return EMULATE_DO_DCR; |
@@ -80,6 +81,7 @@ static int emulate_mfdcr(struct kvm_vcpu *vcpu, int rt, int dcrn) | |||
80 | vcpu->run->dcr.dcrn = dcrn; | 81 | vcpu->run->dcr.dcrn = dcrn; |
81 | vcpu->run->dcr.data = 0; | 82 | vcpu->run->dcr.data = 0; |
82 | vcpu->run->dcr.is_write = 0; | 83 | vcpu->run->dcr.is_write = 0; |
84 | vcpu->arch.dcr_is_write = 0; | ||
83 | vcpu->arch.io_gpr = rt; | 85 | vcpu->arch.io_gpr = rt; |
84 | vcpu->arch.dcr_needed = 1; | 86 | vcpu->arch.dcr_needed = 1; |
85 | kvmppc_account_exit(vcpu, DCR_EXITS); | 87 | kvmppc_account_exit(vcpu, DCR_EXITS); |