From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Smarduch Subject: Re: [RESEND PATCH v7 3/4] arm: dirty log write protect management support Date: Fri, 06 Jun 2014 10:36:41 -0700 Message-ID: <5391FC29.9030502@samsung.com> References: <1401916278-24835-1-git-send-email-m.smarduch@samsung.com> <5390146F.8020407@linux.vnet.ibm.com> <5390C04F.6060201@samsung.com> <53915721.9090006@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, steve.capper@arm.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gavin.guo@canonical.com, peter.maydell@linaro.org, jays.lee@samsung.com, sungjinn.chung@samsung.com To: Xiao Guangrong Return-path: Received: from mailout2.w2.samsung.com ([211.189.100.12]:41979 "EHLO usmailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981AbaFFRgn (ORCPT ); Fri, 6 Jun 2014 13:36:43 -0400 Received: from uscpsbgex1.samsung.com (u122.gpu85.samsung.co.kr [203.254.195.122]) by mailout2.w2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N6R00GQUCX6Q040@mailout2.w2.samsung.com> for kvm@vger.kernel.org; Fri, 06 Jun 2014 13:36:42 -0400 (EDT) In-reply-to: <53915721.9090006@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/05/2014 10:52 PM, Xiao Guangrong wrote: > On 06/06/2014 03:09 AM, Mario Smarduch wrote: >> On 06/04/2014 11:55 PM, Xiao Guangrong wrote: >>> On 06/05/2014 05:11 AM, Mario Smarduch wrote: >>> >>>> + spin_lock(&kvm->mmu_lock); >>>> + >>>> + for (i = 0; i < n / sizeof(long); i++) { >>>> + unsigned long mask; >>>> + gfn_t offset; >>>> + >>>> + if (!dirty_bitmap[i]) >>>> + continue; >>>> + >>>> + is_dirty = true; >>>> + >>>> + mask = xchg(&dirty_bitmap[i], 0); >>>> + dirty_bitmap_buffer[i] = mask; >>>> + >>>> + offset = i * BITS_PER_LONG; >>>> + kvm_mmu_write_protect_pt_masked(kvm, memslot, offset, mask); >>>> + } >>>> + if (is_dirty) >>>> + kvm_flush_remote_tlbs(kvm); >>> >>> You moved the flush into mmu-lock. Please do not :). >>> >>> See commit 198c74f43f0f5473f99967aead30ddc622804bc1 >>> >> >> Thanks for reviewing, I revised to pick up your version. >> >> Functionally there should be no impact on ARM, the >> TLB flush function is different. > > Yeah, i agree your point on ARM, but your patch moved > the function from x86 to the common code, that means > this function is reused between ARM and x86. No? > Yes you pretty much summarized it. My point was more like I'm glad the change had no impact on ARM :) Thanks, - Mario From mboxrd@z Thu Jan 1 00:00:00 1970 From: m.smarduch@samsung.com (Mario Smarduch) Date: Fri, 06 Jun 2014 10:36:41 -0700 Subject: [RESEND PATCH v7 3/4] arm: dirty log write protect management support In-Reply-To: <53915721.9090006@linux.vnet.ibm.com> References: <1401916278-24835-1-git-send-email-m.smarduch@samsung.com> <5390146F.8020407@linux.vnet.ibm.com> <5390C04F.6060201@samsung.com> <53915721.9090006@linux.vnet.ibm.com> Message-ID: <5391FC29.9030502@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 06/05/2014 10:52 PM, Xiao Guangrong wrote: > On 06/06/2014 03:09 AM, Mario Smarduch wrote: >> On 06/04/2014 11:55 PM, Xiao Guangrong wrote: >>> On 06/05/2014 05:11 AM, Mario Smarduch wrote: >>> >>>> + spin_lock(&kvm->mmu_lock); >>>> + >>>> + for (i = 0; i < n / sizeof(long); i++) { >>>> + unsigned long mask; >>>> + gfn_t offset; >>>> + >>>> + if (!dirty_bitmap[i]) >>>> + continue; >>>> + >>>> + is_dirty = true; >>>> + >>>> + mask = xchg(&dirty_bitmap[i], 0); >>>> + dirty_bitmap_buffer[i] = mask; >>>> + >>>> + offset = i * BITS_PER_LONG; >>>> + kvm_mmu_write_protect_pt_masked(kvm, memslot, offset, mask); >>>> + } >>>> + if (is_dirty) >>>> + kvm_flush_remote_tlbs(kvm); >>> >>> You moved the flush into mmu-lock. Please do not :). >>> >>> See commit 198c74f43f0f5473f99967aead30ddc622804bc1 >>> >> >> Thanks for reviewing, I revised to pick up your version. >> >> Functionally there should be no impact on ARM, the >> TLB flush function is different. > > Yeah, i agree your point on ARM, but your patch moved > the function from x86 to the common code, that means > this function is reused between ARM and x86. No? > Yes you pretty much summarized it. My point was more like I'm glad the change had no impact on ARM :) Thanks, - Mario