Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1181247rwo; Wed, 2 Aug 2023 09:51:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlGXI5vOfcRLaSUOL1r/9uo718fBBPJ58tAkJGIkgUt5lWe2n7VnrhZ+SAw+47qX2HD1DFRX X-Received: by 2002:a17:906:cc18:b0:997:ea90:96b4 with SMTP id ml24-20020a170906cc1800b00997ea9096b4mr5744777ejb.61.1690995119373; Wed, 02 Aug 2023 09:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690995119; cv=none; d=google.com; s=arc-20160816; b=qbzsFHBwweoJ4F4xPqJoIdB5EiXQGPQ8EC8S5reTlFb0bLJIk58vEAA1GVzqIB/Jcz tOVndIrJNo/lwX7kyn/khc77hw0lstN8sWgvgehIXJJR/vtm/foTrwnSWXVQwaIGHihY //whdY+KHyswBrkA1eVocv3GBPHGf+ygE+/h0j9pQYSd7wT2BpgexVZDo/gtiRlbPxrG zm0eb6FHMy4FZLxmCJecvrjURIrtwlhEMcaduCLER/YahSE3i0nTXH3EpSRrbR3S/H4I SG97iwBeIBq8CDVF44DdWCZGqiUY0jFys0E1EqTtimV6ghTDNxl9Z6i2PWNP7VEC3TxB 7jWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=8Rhqps5wQgOuZKi7hmsB5sndU+Yej9c36FA0jHtySO0=; fh=KDWcf/wNTX1L0zUl5zKINdKIWwiobrN5jWCiaI+MGhs=; b=ohdQmVin38pAwsINzMeXYU9mKgH3gNCWKsQxyUZtN/FNKSKrO3XlSfFKEu7qObBTHQ cDUGH8L2YXaZX5recjWg+DaGsyX96IHGKKWrVPg2KEVsTGIcWHtVSbpBbSVG8XZRmxzX C70KQSiO5n1K1pioV4m/bR/XWb5aR9rlt66bvlgFAQvfVnw7eUsyfHWc9j6pYgJpHXHk XzaER0v7gN8dRrg9Yx5XjJGcSCPfajLq4xCIp9hTsi6Hnn/2vIQ1DivjwBA97SPPyqC/ BTYH4FIOS6kc+IPKpEc+nMhZXvhL/3YPQ4QBqTVXB7J79T/9KLHFavxHbCS0muNrLTbC 2bvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d8goIOTr; 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 n6-20020a170906688600b0099364d9f0e4si10570343ejr.278.2023.08.02.09.51.33; Wed, 02 Aug 2023 09:51:59 -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=d8goIOTr; 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 S235450AbjHBPzU (ORCPT + 99 others); Wed, 2 Aug 2023 11:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233405AbjHBPzC (ORCPT ); Wed, 2 Aug 2023 11:55:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B6C198A; Wed, 2 Aug 2023 08:54:19 -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 45586619D9; Wed, 2 Aug 2023 15:54:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4222C433C7; Wed, 2 Aug 2023 15:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690991658; bh=CG7zRefX3vIt6QnpDyTwXaNQXmqFTUj9YMbM/HH75A0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d8goIOTrUwi6bz/hFXw/xgAPyKfedzSYI+8GscwiW+tk8X1vQfN9RoaEx7Wd+cZ3t 8T3UVktGFblRsP6mQnD6+knUpp4KO/+zZfDwZmD0RhvemS/YDOQayojvRsnELfXQ0T /pfE3VxAvD/pOCC/dudtI6dA5vx31U68ofpyFoPJX3M5xG98QEjJLQABi2DSZvu8yW h8n3JiQhSLptcmtD9seypjNp0fXMIiDboCwxMo5q44zQ1se/GfJLnrqG2o2XBmLTj0 vFZfkTIhUeI1xWJ6335xw0GNFy9x+eYeDkeoTXFKAq+ptse9HMlvDiUaX+8V4a8TW1 HBrpcfxcWbpog== Received: from [104.132.1.99] (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 1qREAx-001Prr-LD; Wed, 02 Aug 2023 16:54:16 +0100 Date: Wed, 02 Aug 2023 16:54:10 +0100 Message-ID: <878ratqw2l.wl-maz@kernel.org> From: Marc Zyngier To: Raghavendra Rao Ananta Cc: Sean Christopherson , Oliver Upton , James Morse , Suzuki K Poulose , Paolo Bonzini , 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 , Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= , Shaoqin Huang Subject: Re: [PATCH v7 01/12] KVM: Rename kvm_arch_flush_remote_tlb() to kvm_arch_flush_remote_tlbs() In-Reply-To: References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-2-rananta@google.com> <87v8e5r6s6.wl-maz@kernel.org> 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 104.132.1.99 X-SA-Exim-Rcpt-To: rananta@google.com, seanjc@google.com, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, pbonzini@redhat.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, philmd@linaro.org, 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 Tue, 01 Aug 2023 01:42:54 +0100, Raghavendra Rao Ananta wrote: >=20 > On Mon, Jul 31, 2023 at 2:42=E2=80=AFPM Sean Christopherson wrote: > > > > On Mon, Jul 31, 2023, Raghavendra Rao Ananta wrote: > > > On Thu, Jul 27, 2023 at 3:24=E2=80=AFAM Marc Zyngier = wrote: > > > > > > > > On Sat, 22 Jul 2023 03:22:40 +0100, > > > > Raghavendra Rao Ananta wrote: > > > > > > > > > > From: David Matlack > > > > > > > > > > Rename kvm_arch_flush_remote_tlb() and the associated macro > > > > > __KVM_HAVE_ARCH_FLUSH_REMOTE_TLB to kvm_arch_flush_remote_tlbs() = and > > > > > __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS respectively. > > > > > > > > > > Making the name plural matches kvm_flush_remote_tlbs() and makes = it more > > > > > clear that this function can affect more than one remote TLB. > > > > > > > > > > No functional change intended. > > > > > > > > > > Signed-off-by: David Matlack > > > > > Signed-off-by: Raghavendra Rao Ananta > > > > > Reviewed-by: Gavin Shan > > > > > Reviewed-by: Philippe Mathieu-Daud=C3=A9 > > > > > Reviewed-by: Shaoqin Huang > > > > > --- > > > > > arch/mips/include/asm/kvm_host.h | 4 ++-- > > > > > arch/mips/kvm/mips.c | 2 +- > > > > > arch/x86/include/asm/kvm_host.h | 4 ++-- > > > > > include/linux/kvm_host.h | 4 ++-- > > > > > virt/kvm/kvm_main.c | 2 +- > > > > > 5 files changed, 8 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include= /asm/kvm_host.h > > > > > index 04cedf9f8811..9b0ad8f3bf32 100644 > > > > > --- a/arch/mips/include/asm/kvm_host.h > > > > > +++ b/arch/mips/include/asm/kvm_host.h > > > > > @@ -896,7 +896,7 @@ static inline void kvm_arch_sched_in(struct k= vm_vcpu *vcpu, int cpu) {} > > > > > static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu)= {} > > > > > static inline void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcp= u) {} > > > > > > > > > > -#define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLB > > > > > -int kvm_arch_flush_remote_tlb(struct kvm *kvm); > > > > > +#define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS > > > > > +int kvm_arch_flush_remote_tlbs(struct kvm *kvm); > > > > > > > > How about making this prototype global? I don't see a point in havi= ng > > > > it per-architecture, specially as you are adding arm64 to that mix = in > > > > the following patch. > > > > > > > We can make it global, but I'm not sure what was the intention of the > > > original author. My guess is that he was following the same style that > > > we have for some of the other kvm_arch_*() functions > > > (kvm_arch_free_vm() for example)? > > > > Heh, KVM has a *lot* of code that was written with questionable style. = I agree > > with Marc, I can't think of a single reason not to have the definition = in common > > code. Declaring the function doesn't preclude a "static inline" implem= entation, > > and we could even keep the prototype under an #ifdef, e.g. > > > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index 9d3ac7720da9..5ac64f933547 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host.h > > @@ -1484,6 +1484,8 @@ static inline int kvm_arch_flush_remote_tlb(struc= t kvm *kvm) > > { > > return -ENOTSUPP; > > } > > +#else > > +int kvm_arch_flush_remote_tlb(struct kvm *kvm); > > #endif > > > > #ifdef __KVM_HAVE_ARCH_NONCOHERENT_DMA > > > Thanks for the suggestions; I can go with a common declaration. Along > with that, do we want to keep defining > __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS in the arch code that supports it or > convert it into a CONFIG_? This isn't something that a user can select, more something that is an architectural decision. Maybe in a later patch if there is a consensus around that, but probably not as part of this series. Thanks, M. --=20 Without deviation from the norm, progress is not possible.