Re: [PATCH 2/3] powerpc/kvm: fix rare but potential deadlock scene

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

 



On Tue, Nov 05, 2013 at 03:42:43PM +0800, Liu Ping Fan wrote:
> Since kvmppc_hv_find_lock_hpte() is called from both virtmode and
> realmode, so it can trigger the deadlock.

Good catch, we should have preemption disabled while ever we have a
HPTE locked.

> @@ -474,8 +474,10 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
>  	}
>  
>  	/* Find the HPTE in the hash table */
> +	preempt_disable();
>  	index = kvmppc_hv_find_lock_hpte(kvm, eaddr, slb_v,
>  					 HPTE_V_VALID | HPTE_V_ABSENT);
> +	preempt_enable();

Which means we need to add the preempt_enable after unlocking the
HPTE, not here.

Regards,
Paul.
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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