From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 4/6] KVM: x86: Change parameter of kvm_mmu_slot_remove_write_access Date: Tue, 3 Feb 2015 17:28:13 +0100 Message-ID: <20150203162812.GA3898@potion.redhat.com> References: <1422413668-3509-1-git-send-email-kai.huang@linux.intel.com> <1422413668-3509-5-git-send-email-kai.huang@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: pbonzini@redhat.com, gleb@kernel.org, linux@arm.linux.org.uk, kvm@vger.kernel.org To: Kai Huang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38637 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756059AbbBCQ2Z (ORCPT ); Tue, 3 Feb 2015 11:28:25 -0500 Content-Disposition: inline In-Reply-To: <1422413668-3509-5-git-send-email-kai.huang@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 dir= ty logging > hooks, which will be introduced in further patch. >=20 > Better way is to change second parameter of kvm_arch_commit_memory_re= gion from > 'struct kvm_userspace_memory_region *' to 'struct kvm_memory_slot * n= ew', but it > requires changes on other non-x86 ARCH too, so avoid it now. >=20 > Signed-off-by: Kai Huang > --- Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > --- 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, > =20 > 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 =3D 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 !=3D KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_= PAGES)) > - kvm_mmu_slot_remove_write_access(kvm, mem->slot); > + if ((change !=3D KVM_MR_DELETE) && (new->flags & KVM_MEM_LOG_DIRTY_= PAGES)) > + kvm_mmu_slot_remove_write_access(kvm, new); > } > =20 > void kvm_arch_flush_shadow_all(struct kvm *kvm) > --=20 > 2.1.0 >=20 > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html