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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 E7439C43603 for ; Sat, 14 Dec 2019 10:37:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB0E624658 for ; Sat, 14 Dec 2019 10:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576319857; bh=VbghNNwIkzYBYuaFvm+tJu3GojanjCSwGRfeFrnZDG4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=zy3gIja9oU1yGvApbGX1Xhw1H3z8TN5ofE7ygLvT19suTVw+Voxtqo7CkD77quHdD Wkj38FPsjO/unxYd/VuGaq7owzMgVcUju0FBQwEg9oExjdaZHLirr0aPFm+S6e056s RqGDtm8D1tlB170jEcP2zsj0QoDgxo/4W1fjhXxM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725895AbfLNKhh (ORCPT ); Sat, 14 Dec 2019 05:37:37 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:37215 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbfLNKhh (ORCPT ); Sat, 14 Dec 2019 05:37:37 -0500 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 Cc: James Morse , Julien Thierry , James Hogan , Paul Mackerras , Paolo Bonzini , Radim =?UTF-8?B?S3LEjW3DocWZ?= , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , 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 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") Content-Type: text/plain; charset=US-ASCII 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 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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.