Re: [PATCH 4/6] KVM: x86: Change parameter of kvm_mmu_slot_remove_write_access

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

 



2015-01-28 10:54+0800, Kai Huang:
> This patch changes the second parameter of kvm_mmu_slot_remove_write_access from
> 'slot id' to 'struct kvm_memory_slot *' to align with kvm_x86_ops dirty logging
> hooks, which will be introduced in further patch.
> 
> Better way is to change second parameter of kvm_arch_commit_memory_region from
> 'struct kvm_userspace_memory_region *' to 'struct kvm_memory_slot * new', but it
> requires changes on other non-x86 ARCH too, so avoid it now.
> 
> Signed-off-by: Kai Huang <kai.huang@xxxxxxxxxxxxxxx>
> ---

Reviewed-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>

> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -7557,6 +7557,10 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>  
>  	if (nr_mmu_pages)
>  		kvm_mmu_change_mmu_pages(kvm, nr_mmu_pages);
> +
> +	/* It's OK to get 'new' slot here as it has already been installed */
> +	new = id_to_memslot(kvm->memslots, mem->slot);

(Doint it early doesn't hurt.)

> @@ -7566,8 +7570,8 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>  	 *
>  	 * See the comments in fast_page_fault().
>  	 */
> -	if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
> -		kvm_mmu_slot_remove_write_access(kvm, mem->slot);
> +	if ((change != KVM_MR_DELETE) && (new->flags & KVM_MEM_LOG_DIRTY_PAGES))
> +		kvm_mmu_slot_remove_write_access(kvm, new);
>  }
>  
>  void kvm_arch_flush_shadow_all(struct kvm *kvm)
> -- 
> 2.1.0
> 
> --
> 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
--
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