Re: [PATCH v2 10/12] KVM: MMU: unify the code of walking pte list

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

 



On 01/27/2013 09:28 PM, Gleb Natapov wrote:

>>
>> @@ -1256,19 +1243,18 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp,
>>
>>  		if (pte_write(*ptep)) {
>>  			drop_spte(kvm, sptep);
>> -			sptep = rmap_get_first(*rmapp, &iter);
>> -		} else {
>> -			new_spte = *sptep & ~PT64_BASE_ADDR_MASK;
>> -			new_spte |= (u64)new_pfn << PAGE_SHIFT;
>> +			goto restart;
> I do not like this "goto restart" pattern throughout this patch. Follow up
> patch gets rid of most of them, so they are tolerable as a temporary solution
> here, but this one stays. What about moving pte_write(*ptep) outside
> for_each_spte_in_rmap() loop like that:
> 
> if (pte_write(*ptep))
> 	need_flush = kvm_unmap_rmapp();
> else
> 	for_each_spte_in_rmap() {
> 	}

Nice. Will do.

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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux