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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 585B2C001E0 for ; Thu, 27 Jul 2023 10:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HAcewhBFv4tJjKFacngqgsL7QeTazAfzX8R434bQ61A=; b=M7Mgk9S9wEtnEJ SrqtN43xMO5xfhZ3nuXX7UlIFVoSP/rHEuo9+CUsoys21VC1Bwq9/NOsj2ZJ3qtctdNL3obcAj/9S HGji61tMppOj1n6vPnq2u9A8YzikA7fcomWzD7jmck41c2QPWaKbFia6R7kiQ/E1cCL6P6UdcuTuL anhq41O6BF8P55Kxq0prPTEQaVi6tKKIdKXawvQfjLK685fmrPBjaqkpWp0Kwr/IDx2jBwtjiR5gd YukFqdYYhk3RIgc2UodRlfkXBzgoHxUNYNrci8+Hm+mkYjfvaHbD33VXh7QnZfJ2wnQ9Q2ZzCQ00f rRg3wIxwmXQEowrhAjYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOycJ-00D7hc-1B; Thu, 27 Jul 2023 10:53:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOycC-00D7e0-1q; Thu, 27 Jul 2023 10:53:08 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A55D261E26; Thu, 27 Jul 2023 10:53:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DC10C433C7; Thu, 27 Jul 2023 10:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690455183; bh=Kf3PoZcaGR2gkOy5bI0LwvtY2SC896CCkSXbSLWkFBc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jPiusiKewOUry6ypAvPniDaxOhUSPXIOCXtTsmNNz+/7gz1EFs7E8kzftW2B4RaoB cjQ1HUyrhUcWgfrvkf+Vxpa/PRNM1vtXi8BIA8Hn9EXNo/cR3/WvZaW+dQM8fHLZmZ VVCwZmVHCM7nJ80nDfcS+mKecRzQlNH/Yl8WEHhsCulky2Ia7ezh8YBkfb2O22fY1m opNlycFD/nAxb6Qb8w9vsszetxEoy9mV2HE2PvX457L+jGtKCOeEklSA4wdsTxf0oT bSgbizad+4N4QYmI8SK9TxqZ/GFtZs53ijAxdu4PdAOOm/xLWZ+fFl4HLASo9h7uiF qBZ5GfHonID0A== Received: from [104.132.45.102] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qOyc8-00HKTs-J2; Thu, 27 Jul 2023 11:53:00 +0100 Date: Thu, 27 Jul 2023 11:53:00 +0100 Message-ID: <87sf99r5gz.wl-maz@kernel.org> From: Marc Zyngier To: Raghavendra Rao Ananta Cc: Oliver Upton , James Morse , Suzuki K Poulose , Paolo Bonzini , Sean Christopherson , Huacai Chen , Zenghui Yu , Anup Patel , Atish Patra , Jing Zhang , Reiji Watanabe , Colton Lewis , David Matlack , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Gavin Shan , Shaoqin Huang Subject: Re: [PATCH v7 05/12] KVM: Move kvm_arch_flush_remote_tlbs_memslot() to common code In-Reply-To: <20230722022251.3446223-6-rananta@google.com> References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-6-rananta@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 104.132.45.102 X-SA-Exim-Rcpt-To: rananta@google.com, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, pbonzini@redhat.com, seanjc@google.com, chenhuacai@kernel.org, yuzenghui@huawei.com, anup@brainfault.org, atishp@atishpatra.org, jingzhangos@google.com, reijiw@google.com, coltonlewis@google.com, dmatlack@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, gshan@redhat.com, shahuang@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_035304_732433_AF8AFF49 X-CRM114-Status: GOOD ( 26.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 22 Jul 2023 03:22:44 +0100, Raghavendra Rao Ananta wrote: > > From: David Matlack > > Move kvm_arch_flush_remote_tlbs_memslot() to common code and drop > "arch_" from the name. kvm_arch_flush_remote_tlbs_memslot() is just a > range-based TLB invalidation where the range is defined by the memslot. > Now that kvm_flush_remote_tlbs_range() can be called from common code we > can just use that and drop a bunch of duplicate code from the arch > directories. > > Note this adds a lockdep assertion for slots_lock being held when > calling kvm_flush_remote_tlbs_memslot(), which was previously only > asserted on x86. MIPS has calls to kvm_flush_remote_tlbs_memslot(), > but they all hold the slots_lock, so the lockdep assertion continues to > hold true. > > Also drop the CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT ifdef gating > kvm_flush_remote_tlbs_memslot(), since it is no longer necessary. > > Signed-off-by: David Matlack > Signed-off-by: Raghavendra Rao Ananta > Reviewed-by: Gavin Shan > Reviewed-by: Shaoqin Huang > --- > arch/arm64/kvm/arm.c | 6 ------ > arch/mips/kvm/mips.c | 10 ++-------- > arch/riscv/kvm/mmu.c | 6 ------ > arch/x86/kvm/mmu/mmu.c | 16 +--------------- > arch/x86/kvm/x86.c | 2 +- > include/linux/kvm_host.h | 7 +++---- > virt/kvm/kvm_main.c | 18 ++++++++++++++++-- > 7 files changed, 23 insertions(+), 42 deletions(-) > [...] > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 804470fccac7..58213cc4b9b9 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -379,6 +379,20 @@ void kvm_flush_remote_tlbs_range(struct kvm *kvm, gfn_t gfn, u64 pages) > kvm_flush_remote_tlbs(kvm); > } > > +void kvm_flush_remote_tlbs_memslot(struct kvm *kvm, > + const struct kvm_memory_slot *memslot) > +{ > + /* > + * All current use cases for flushing the TLBs for a specific memslot > + * related to dirty logging, and many do the TLB flush out of mmu_lock. I appreciate this is a copy paste of an existing comment, but I can't parse it. My command of the English language is notoriously approximate, but it feels that something is missing in the first sentence, such as a verb. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel