Skip to content

Commit 7310f3a

Browse files
kvaneeshagraf
authored andcommitted
KVM: PPC: BOOK3S: Always use the saved DAR value
Although it's optional, IBM POWER cpus always had DAR value set on alignment interrupt. So don't try to compute these values. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
1 parent 5c165ae commit 7310f3a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎arch/powerpc/kvm/book3s_emulate.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,12 @@ u32 kvmppc_alignment_dsisr(struct kvm_vcpu *vcpu, unsigned int inst)
676676

677677
ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned int inst)
678678
{
679+
#ifdef CONFIG_PPC_BOOK3S_64
680+
/*
681+
* Linux's fix_alignment() assumes that DAR is valid, so can we
682+
*/
683+
return vcpu->arch.fault_dar;
684+
#else
679685
ulong dar = 0;
680686
ulong ra = get_ra(inst);
681687
ulong rb = get_rb(inst);
@@ -700,4 +706,5 @@ ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned int inst)
700706
}
701707

702708
return dar;
709+
#endif
703710
}

0 commit comments

Comments
 (0)