From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02CBAC43603 for ; Sat, 14 Dec 2019 10:37:40 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 8E3AC20700 for ; Sat, 14 Dec 2019 10:37:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E3AC20700 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id EF1CE4A968; Sat, 14 Dec 2019 05:37:38 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qfwg5XsYuBCi; Sat, 14 Dec 2019 05:37:37 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E59614A3B4; Sat, 14 Dec 2019 05:37:37 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 950FF4A3B4 for ; Sat, 14 Dec 2019 05:37:36 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lsRIzRjeKR-I for ; Sat, 14 Dec 2019 05:37:35 -0500 (EST) Received: from inca-roads.misterjones.org (inca-roads.misterjones.org [213.251.177.50]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 781424A389 for ; Sat, 14 Dec 2019 05:37:35 -0500 (EST) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=big-swifty.misterjones.org) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:AES256-GCM-SHA384:256) (Exim 4.80) (envelope-from ) id 1ig4nM-0004C7-WF; Sat, 14 Dec 2019 11:37:09 +0100 Date: Sat, 14 Dec 2019 10:37:10 +0000 Message-ID: <86fthni46h.wl-maz@kernel.org> From: Marc Zyngier To: Suzuki Kuruppassery Poulose Subject: Re: [PATCH 1/7] KVM: Pass mmu_notifier_range down to kvm_unmap_hva_range() In-Reply-To: References: <20191213182503.14460-1-maz@kernel.org> <20191213182503.14460-2-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: suzuki.poulose@arm.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, jhogan@kernel.org, paulus@ozlabs.org, pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Cc: kvm-ppc@vger.kernel.org, Wanpeng Li , kvm@vger.kernel.org, James Hogan , Joerg Roedel , linux-mips@vger.kernel.org, Sean Christopherson , Paul Mackerras , linux-arm-kernel@lists.infradead.org, Paolo Bonzini , Vitaly Kuznetsov , kvmarm@lists.cs.columbia.edu, Jim Mattson X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Suzuki, On Fri, 13 Dec 2019 18:59:32 +0000, Suzuki Kuruppassery Poulose wrote: > > Hi Marc, > > > On 13/12/2019 18:24, Marc Zyngier wrote: > > kvm_unmap_hva_range() is currently passed both start and end > > fields from the mmu_notifier_range structure. As this struct > > now contains important information about the reason of the > > unmap (the event field), replace the start/end parameters > > with the range struct, and update all architectures. > > > > No functionnal change. > > > > Signed-off-by: Marc Zyngier > > > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index 00268290dcbd..7c3665ad1035 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -158,7 +158,7 @@ static unsigned long long kvm_createvm_count; > > static unsigned long long kvm_active_vms; > > __weak int kvm_arch_mmu_notifier_invalidate_range(struct kvm > > *kvm, > > - unsigned long start, unsigned long end, bool blockable) > > + const struct mmu_notifier_range *range, bool blockable) > > { > > return 0; > > } > > @@ -415,7 +415,7 @@ static int kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, > > * count is also read inside the mmu_lock critical section. > > */ > > kvm->mmu_notifier_count++; > > - need_tlb_flush = kvm_unmap_hva_range(kvm, range->start, range->end); > > + need_tlb_flush = kvm_unmap_hva_range(kvm, range); > > need_tlb_flush |= kvm->tlbs_dirty; > > /* we've to flush the tlb before the pages can be freed */ > > if (need_tlb_flush) > > @@ -423,8 +423,7 @@ static int kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, > > spin_unlock(&kvm->mmu_lock); > > - ret = kvm_arch_mmu_notifier_invalidate_range(kvm, > > range->start, > > - range->end, > > + ret = kvm_arch_mmu_notifier_invalidate_range(kvm, range, > > mmu_notifier_range_blockable(range)); > > minor nit: > > Since we now have the range passed on to the arch hooks, we could get > rid of the "blockable" too, as it is something you can deduce from the > range. Absolutely. That'd be a nice cleanup. > Otherwise looks good to me. Thanks, M. -- Jazz is not dead, it just smells funny. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm