From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [RESEND PATCH v7 3/4] arm: dirty log write protect management support Date: Fri, 06 Jun 2014 13:52:33 +0800 Message-ID: <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> 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: Mario Smarduch Return-path: Received: from e23smtp06.au.ibm.com ([202.81.31.148]:38064 "EHLO e23smtp06.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbaFFFvR (ORCPT ); Fri, 6 Jun 2014 01:51:17 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jun 2014 15:51:14 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 9271E3578048 for ; Fri, 6 Jun 2014 15:51:11 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s565TGYl46923888 for ; Fri, 6 Jun 2014 15:29:16 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s565p9uT024024 for ; Fri, 6 Jun 2014 15:51:10 +1000 In-Reply-To: <5390C04F.6060201@samsung.com> Sender: kvm-owner@vger.kernel.org List-ID: 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?