On Mon, May 20, 2019 at 10:56:56AM +1000, Nicholas Piggin wrote: > reset_msr sets the MSR for interrupt injection, but it's cleaner and > more flexible to provide a single op to set both MSR and PC for the > interrupt. Comment below... > diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c > index d5fc624e0655..46015d2e09e0 100644 > --- a/arch/powerpc/kvm/book3s_hv.c > +++ b/arch/powerpc/kvm/book3s_hv.c > @@ -341,6 +341,29 @@ static void kvmppc_core_vcpu_put_hv(struct kvm_vcpu *vcpu) > spin_unlock_irqrestore(&vcpu->arch.tbacct_lock, flags); > } > > +static void kvmppc_inject_interrupt_hv(struct kvm_vcpu *vcpu, int vec, u64 srr1_flags) > +{ > + unsigned long msr, pc, new_msr, new_pc; > + > + msr = kvmppc_get_msr(vcpu); > + pc = kvmppc_get_pc(vcpu); > + new_msr = vcpu->arch.intr_msr; > + new_pc = vec; > + > +#ifdef CONFIG_PPC_TRANSACTIONAL_MEM Do we really need this ifdef? It only saves a few bytes, and it wasn't present in the place where this code came from. And the same comment applies to the code in book3s_pr.c. Paul.