Re: [PATCH v10 4/6] arm: KVM: Add initial dirty page locking infrastructure

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

 



On 09/10/2014 08:12 PM, Christoffer Dall wrote:
> On Tue, Aug 26, 2014 at 05:04:06PM -0700, Mario Smarduch wrote:
>> Patch adds support for initial write protection of VM memlsot. This patch series
>> assumes that huge PUDs will not be used in 2nd stage tables, which is awlays
>> valid on ARMv7.
>>
>> Signed-off-by: Mario Smarduch <m.smarduch@xxxxxxxxxxx>
>> ---
>>  arch/arm/include/asm/kvm_host.h       |   1 +
>>  arch/arm/include/asm/kvm_mmu.h        |  20 ++++++
>>  arch/arm/include/asm/pgtable-3level.h |   1 +
>>  arch/arm/kvm/arm.c                    |   9 +++
>>  arch/arm/kvm/mmu.c                    | 128 ++++++++++++++++++++++++++++++++++
>>  5 files changed, 159 insertions(+)
[...]
>> +
>> +void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot)
>> +{
>> +	struct kvm_memory_slot *memslot = id_to_memslot(kvm->memslots, slot);
>> +	phys_addr_t start = memslot->base_gfn << PAGE_SHIFT;
>> +	phys_addr_t end = (memslot->base_gfn + memslot->npages) << PAGE_SHIFT;
>> +
>> +	spin_lock(&kvm->mmu_lock);
>> +	stage2_wp_range(kvm, start, end);
>> +	kvm_flush_remote_tlbs(kvm);
> 
> do you need to hold the lock while flushing the TLBs?

Sorry just noticed the comment, yes the flush could be outside
the lock, starting to loose track with the revisions :)

- Mario
> 
>> +	spin_unlock(&kvm->mmu_lock);
>> +}
>> +#endif
>> +
>>  static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>>  			  struct kvm_memory_slot *memslot,
>>  			  unsigned long fault_status)
>> -- 
>> 1.8.3.2
>>
> Thanks,
> -Christoffer
> 

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm




[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux