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=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 CA2CEC00454 for ; Fri, 13 Dec 2019 22:23:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C93820706 for ; Fri, 13 Dec 2019 22:23:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SjmwMMK3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C93820706 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BI9W2h/L8DujCKvg6aBGtNzzfqBBrSpq4PLEe0C7Jbc=; b=SjmwMMK39mSHv4ejCWPMF27jq QCy1+ltLVGRrGU4BZCgrkpc9K3rGvfWH8OmwMJUC8VNtzu6vC0K8U3Js4nlyIIv9cgoesIc0iNHzv gx0Gmc4fpOE77ouNUq8URDrRwmcOatReFwDAvnc34SmrLV6mJLrYYIuamLnpdPCeR6q23LZ1uIosx iSvvu/vxlkrmkyz0cf3J1xp+gamRklIaOb3HuQC9odMN15v+YHSjp44sVPNWTQS1MdoAdPOVT0wjw puCA3aYTclKuTnV83pMcdbAN7hQzUgi9z+qbIVBeHFuXyb+OgczP6dOFngRdjg3xrtVFfScXyqXUq yxfu8rD3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifqAB-00072j-Br; Fri, 13 Dec 2019 18:59:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifqA7-00071k-Tq for linux-arm-kernel@lists.infradead.org; Fri, 13 Dec 2019 18:59:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C33DE106F; Fri, 13 Dec 2019 10:59:35 -0800 (PST) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD07C3F718; Fri, 13 Dec 2019 10:59:33 -0800 (PST) Subject: Re: [PATCH 1/7] KVM: Pass mmu_notifier_range down to kvm_unmap_hva_range() To: Marc Zyngier References: <20191213182503.14460-1-maz@kernel.org> <20191213182503.14460-2-maz@kernel.org> From: Suzuki Kuruppassery Poulose Message-ID: Date: Fri, 13 Dec 2019 18:59:32 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191213182503.14460-2-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191213_105940_007698_0721DC27 X-CRM114-Status: GOOD ( 16.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm-ppc@vger.kernel.org, Wanpeng Li , kvm@vger.kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , James Hogan , Joerg Roedel , linux-mips@vger.kernel.org, Sean Christopherson , Paul Mackerras , James Morse , linux-arm-kernel@lists.infradead.org, Paolo Bonzini , Vitaly Kuznetsov , kvmarm@lists.cs.columbia.edu, Julien Thierry , Jim Mattson Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Otherwise looks good to me. Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel