Re: [PATCH 2/5] KVM: PPC: Book3S: Replace reset_msr mmu op with inject_interrupt arch op

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux