Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2180891rwb; Thu, 27 Jul 2023 03:30:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlHHyOccj6T20d9SYUlJGFqKKjenEUvu9Rqwyk+483f9hIgbZdZEOLZhRyHbNRcnYN6sn1rU X-Received: by 2002:a17:907:7807:b0:978:90cc:bf73 with SMTP id la7-20020a170907780700b0097890ccbf73mr1590852ejc.48.1690453806388; Thu, 27 Jul 2023 03:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690453806; cv=none; d=google.com; s=arc-20160816; b=g9PJzAQZ3wOOncCUZbLNBr914n8AghbBRUR0ReElMVLl+8Xw9JENmyMpHZ+4ZyN4sM RUVnybAvtTG9aby6eCJ69T7oo7Ahl6p1RCZnhI7OQaavm4A2cvL7DEQj7PkbBy60oL+x sO46pmcXf6S1OPHkvP6dlLy//lNgBPGWP5JPjRrka4jQZ/mrNiG6kBCuyNSjoeJwIkgy ubDRM3qrrCMo7nFvrcojDfVtDZ4c0IKudpHsSieFDq660qtFMtDQHJbZgcVkjTAEpU7R EIPNjloxmPEe4yZ8McThrOYHm4A9ich1XRvW1ujA3GpTz++jf2K1ZgeS/YC92n8O/MzL Ao3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=8pM22QzC1JrCzyV0u9rhWwJQiJwitZvOmx+uJiEbc04=; fh=WyypX3RQYrUB8CslwpBzrfKl9A8f4OUAzy4EkEy6y78=; b=PjmVdRmi6/bdYdbOTnFrRMdnQubkmuz3U74soP082rOqh1Bmk+StCNg3AiC0lFi/ZC 9Yu61U7yYdQdcfDo03VWBm69QU9h3em/qiTBwWxcGIZpWu061JuatBAGjNk82PRc/7H1 kVyuu52NpstZxM8bB5t5UK7ogK/0FR201naiC1BMOzCdFrSlhQ+ZbuA7jPyPFa+yC7Dr hhvc30YYPPlriEqG6mRUVRs7afB040SauSpOZyDhv3iaEfq212+thry42ecIxxa1lzef YzIfbtKiZ2TqPoJtj/QAmHJtS/Dod8SWNHS848+pngudvAxwUZ7tGCGtDbDTBw3ej/9u DodA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d34o//Y1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g24-20020a1709064e5800b00993860a6d3fsi826956ejw.281.2023.07.27.03.29.32; Thu, 27 Jul 2023 03:30:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d34o//Y1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234279AbjG0K0W (ORCPT + 99 others); Thu, 27 Jul 2023 06:26:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233972AbjG0KZo (ORCPT ); Thu, 27 Jul 2023 06:25:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC40930FC; Thu, 27 Jul 2023 03:25:29 -0700 (PDT) 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 1D82061E0A; Thu, 27 Jul 2023 10:25:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71561C433C8; Thu, 27 Jul 2023 10:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690453528; bh=FJXkSwPbNKQ95t2XWfcMnomXfcixhy3pOfTMwv/ZpIY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d34o//Y1Y5dfRtLOi0HwE+uJT9nrmc86QQYqcYJdz/AHsxhgaNQsqF7UP/xrRQ2NT w8XAntI7jmFAiqr/E/wpvRSLxf8uYhHIRwLomfc5yXPAGjUbx3beZtQNZ3NO8/bGfM SO5/yPRn5VmsYTc7wQYtVoHKkQRyfoXt+XI6wnSciqBudTsm5vTNHzV6U0EoZJ9zvp VEjRTroyGZQkKHhywR4iNOZS+o9Xy/q3CaBfdzJcrSXh3BtJWUfXdfO3scRNsBFKo2 oEg05/s96neKp6o3O5RgRJGeS0EgRhuiHLkhrd/kdMqtGtukWh7A6507mmz3a6kWSD rjB0xXlHJI8dA== 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 1qOyBR-00HK5u-Rg; Thu, 27 Jul 2023 11:25:26 +0100 Date: Thu, 27 Jul 2023 11:25:25 +0100 Message-ID: <87tttpr6qy.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 Subject: Re: [PATCH v7 02/12] KVM: arm64: Use kvm_arch_flush_remote_tlbs() In-Reply-To: <20230722022251.3446223-3-rananta@google.com> References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-3-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") Content-Type: text/plain; charset=US-ASCII 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 X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 Jul 2023 03:22:41 +0100, Raghavendra Rao Ananta wrote: > > Stop depending on CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL and opt to > standardize on kvm_arch_flush_remote_tlbs() since it avoids > duplicating the generic TLB stats across architectures that implement > their own remote TLB flush. > > This adds an extra function call to the ARM64 kvm_flush_remote_tlbs() > path, but that is a small cost in comparison to flushing remote TLBs. Well, there is no such thing as a "remote TLB" anyway. We either have a non-shareable or inner-shareable invalidation. The notion of remote would imply that we track who potentially has a TLB, which we obviously don't. More x86 nonsense... > > In addition, instead of just incrementing remote_tlb_flush_requests > stat, the generic interface would also increment the > remote_tlb_flush stat. > > Signed-off-by: Raghavendra Rao Ananta > --- > arch/arm64/include/asm/kvm_host.h | 3 +++ > arch/arm64/kvm/Kconfig | 1 - > arch/arm64/kvm/mmu.c | 6 +++--- > 3 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index 8b6096753740..7281222f24ef 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -1111,6 +1111,9 @@ int __init kvm_set_ipa_limit(void); > #define __KVM_HAVE_ARCH_VM_ALLOC > struct kvm *kvm_arch_alloc_vm(void); > > +#define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS > +int kvm_arch_flush_remote_tlbs(struct kvm *kvm); See my earlier comment about making this prototype global. M. -- Without deviation from the norm, progress is not possible.