Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5118878rwb; Mon, 31 Jul 2023 19:01:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlHrLAzOSArLZAT49R5xx6kz7tryQl7U6UWxbSd0PWk6hi6wdZOeLo0umBM/CO8WzXU85O4J X-Received: by 2002:a17:902:f683:b0:1bb:1494:f7f7 with SMTP id l3-20020a170902f68300b001bb1494f7f7mr14832222plg.23.1690855295183; Mon, 31 Jul 2023 19:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690855295; cv=none; d=google.com; s=arc-20160816; b=OsjFk+x4RB7VY9suhD7ci6HFsZfEJo+zGJNoCobIq4Ev+WBe0EU7MUy2b5IBY7pZgY JOrNiJbEHDqtnlrEKSwOqFRUhGInMipk8tXWXY0PdpHaXyht8FilHyvgiLG9xa/jg6wd 3NClopM/keje3iACowgd3ohDqreSAhkGOQAZ7Oihb6OUvcr7d5vtaeTkvuKA3q6O3uZU e5J3vqrnGeUGrXyeJ5VoZTF+bFCCH4MUWeVnkd4z1S5nhO7A7RbQMARWubVI5ZSvixdr qvFQhhV9EMNYKPTjxJHKEI8/Ii8+YJ+/pjFHWcXgO/SJMcgSdhggdR543IQBukt8/d66 cECA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wz5PQDI2T5JD79/VqNSh8cAHB4+Dq2pKqfYEsmYHYJc=; fh=tFmNYfut2FotfAk4IGOQC2nXgt5WoiggL0hdeUzDomQ=; b=F327dOm2KcVX4IydntVRVnE1UjcD7ysktjLjGwdRgShiLMd5DYExW9gXPDEOof+eJU c46HJ2TVtxZri8ltc+waXB73hbnGdohNTq8+MS53M269Yfy2sWkScKvrlltqSQJwDNUB mX+Pwihdrs/OgHbccOECfOXQNUcDpLRaXgKQa6uyjxD6GS38ql5fgJiTh7IOYZemziw+ HE4HLzq4oPicZ87Vmcn82W8UC+P1SQI9RcciPZsfbg+QzcSmIS/NsmSl++s8ZiZvDBcl 0VwjB2689bqyQU5FntKBnLpN8XXOmZpf4S+qJaGqTIR3QKW4biLnR/1sSoh6hHl5w0hk Vw4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=MFYDUohP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id im23-20020a170902bb1700b001bba53994acsi7871884plb.243.2023.07.31.19.01.20; Mon, 31 Jul 2023 19:01:35 -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=@google.com header.s=20221208 header.b=MFYDUohP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbjHAAnI (ORCPT + 99 others); Mon, 31 Jul 2023 20:43:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjHAAnH (ORCPT ); Mon, 31 Jul 2023 20:43:07 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6923A1716 for ; Mon, 31 Jul 2023 17:43:06 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-40a47e8e38dso74161cf.1 for ; Mon, 31 Jul 2023 17:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690850585; x=1691455385; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wz5PQDI2T5JD79/VqNSh8cAHB4+Dq2pKqfYEsmYHYJc=; b=MFYDUohPKYqzUjmRdIik4Kf/M1i09cRnmwx/ISJELixqxj8gzvM0dEKMXyxYAMFbw3 ReLM/cPUTz05PxclkqkBgVsoeT/7EH3dALymU5TM8n9AYViSu4kpjQw8g9TlIr5lYEdx STtN0tXmEUrwz4qA3H7UDuyRNjk2yzkj4bwdACzU8bzIwG8V1u6MRimG2rWhgHRiWHYy eXQ8o14YblAtdc0/rR4R99744OZdbLElco3n3qUL5oyzjog5namRFGU6L/NVq+oZEqqn QLVsLJdbOWotDUgFVkV6iklP9yVqIk7HEQLLekRiuMLcq+3DzGurl/ToVlHLeESVGYUY hxxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690850585; x=1691455385; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wz5PQDI2T5JD79/VqNSh8cAHB4+Dq2pKqfYEsmYHYJc=; b=hb8jZ1Oudglx6H+dP8nwbCiAEFnicamAllo05XtuOHiMmFyy8tbU5bx405QLamLvvC Ycl6+c7oVGUS1A2ppxzp+7Cfln1gKTzPxa3gYj4MWGlrfvmy5nEQvcMul8+4XhDM7rG7 OtMFFOfP0/Tp17gtHO3ILFL16FWG+KX4hDh/hUp1FJjtwzjx5yRDW09/x5l64aELeyRK ciwd7j0rbx4IvA98KKXxZ1HV+vaqEhiRKznxrHbBdrWnXNB85Du3okObG26GdKHTovBY i1Vjjsisi7qk3KfwVnyZHv2RX5IueS3le7s0jJ6G1WbbmbS90x4eTZSMO8QmFX5V1xys 3waA== X-Gm-Message-State: ABy/qLboJ77FAt3reEjJqRURfSKjYCwkAMbAvcoaEPQDavlPlFxR3isD J5bpB3FFYh+75xuMNERQx4M4VEXP7uEmqyf4tTIvWA== X-Received: by 2002:a05:622a:1447:b0:3f4:f0fd:fe7e with SMTP id v7-20020a05622a144700b003f4f0fdfe7emr530327qtx.3.1690850585401; Mon, 31 Jul 2023 17:43:05 -0700 (PDT) MIME-Version: 1.0 References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-2-rananta@google.com> <87v8e5r6s6.wl-maz@kernel.org> In-Reply-To: From: Raghavendra Rao Ananta Date: Mon, 31 Jul 2023 17:42:54 -0700 Message-ID: Subject: Re: [PATCH v7 01/12] KVM: Rename kvm_arch_flush_remote_tlb() to kvm_arch_flush_remote_tlbs() To: Sean Christopherson Cc: Marc Zyngier , 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 , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , Shaoqin Huang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 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 w= rote: > > > > > > 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() an= d > > > > __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/a= sm/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 kvm= _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 *vcpu)= {} > > > > > > > > -#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 having > > > 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" implemen= tation, > 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(struct = 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_? - Raghavendra