Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5002040rwb; Mon, 31 Jul 2023 16:29:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlFbDWDksBZpMVdPr7hxOCi+WCRsK9z7yz8jUx8woveXaRQlpCWA1+n3Om9/5qfDtmQKDCop X-Received: by 2002:a05:6512:3f3:b0:4fe:958:88ad with SMTP id n19-20020a05651203f300b004fe095888admr832962lfq.10.1690846170111; Mon, 31 Jul 2023 16:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690846170; cv=none; d=google.com; s=arc-20160816; b=dzAmaX6kD7NCmnVUSck7tLBNWkAUU/Hz4afY4Y1c4s9C7/bNfJ0WgNtFw8t4mfYmOx 3VlALFgi2l0SbSUheharFaEJdDhHR5BCj13pp7Ib7jZHiNXND18sTlHAvDwgysjOvgMz xG/76JiOVpSz8RNminYnQixNbxpz2oIhDGqZdsDvYjgG6UPYEzVXeazPQraZY8Jkd5+D ZPkFkNtqDRuQ97Vw9nRhdr+bubxPB755dw77pkWm6EsIHRTkA4Hu06JVKc/xFIph5iDe h9bmrw61ZestZiuqsg/A1kfG1AI8FLiJFWLDfUIWUhfpVSp77hagNOBAfh1UVIlcsmu6 5h2g== 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:from:subject :message-id:references:mime-version:in-reply-to:date:dkim-signature; bh=AU1Eyv4/z0dADLWEV1nEcRpLxJELbihGWkSyugO3ex8=; fh=ndjv9QxLdsjQftQ4Dq3UKSNLhmuFXMBvu2r55hZQtNM=; b=RcjB4LKOvNT3pa6FCdBhApwnOqr74uAoS1+s7GQe0hcDzROGWEmN3vefkQMAwPmxgl +ylhWACd0jHXbFJoMsrz5lr+b+2PmuLa/O89NhVzJHAeNlYGXVvomIH/ybVtfbsYqXn+ QiWMzX7jxZmx9O8a748IoSB8H+IWeKiOhFfs9aBj8m0U7vD4e3tFRnNSqNDdTUgQvtKi TgmJ+d9s2j16YNp25GA5d8VhF1JWnBFjU/yXifETxfkIBAe65HwhjS9iq8BYY+aINnq8 LwqvTvlkKH13qnHESY+S3hyk4mLwl/snLcKF5PvcgsHtNdbL0P1Euee3uDKV2rJfHVog MlOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=zHV044O9; 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 d20-20020aa7c1d4000000b00521a873b32csi3321935edp.327.2023.07.31.16.29.05; Mon, 31 Jul 2023 16:29:30 -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=zHV044O9; 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 S231373AbjGaVmY (ORCPT + 99 others); Mon, 31 Jul 2023 17:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbjGaVmU (ORCPT ); Mon, 31 Jul 2023 17:42:20 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0ECBD8 for ; Mon, 31 Jul 2023 14:42:19 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1bbbc4ae328so38341525ad.1 for ; Mon, 31 Jul 2023 14:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690839739; x=1691444539; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=AU1Eyv4/z0dADLWEV1nEcRpLxJELbihGWkSyugO3ex8=; b=zHV044O9XwNQjgOLB3AfcpUidtjFsHSm7411oU0FzT/hBIi1OVCl2irlR0nDqKL8Cv hr4KfnJvAQ8KZYVTxOCRf7feP1xd884smGeXDTwo1Mxw39juIFwqargVifxiYkX3oNFO jGZAeL3BraA/GHqzFzm8zichi53qOSusN9afNCtFEmHZFTDQ5+1SlvbReoCXw9xfn3Sq Nxy3SDA+osZfzK8FprhkAlPfPKaV+dJMo4N5DxnhbU6aEOE2yJsGxe0D1EjnOIUEkic5 iFCs47k5rbIbFAbkVkjH6/FwH8n0Jz0vylbUDue6VIQodFOLNkamKR23aV4KPT1WaTb8 1QIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690839739; x=1691444539; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=AU1Eyv4/z0dADLWEV1nEcRpLxJELbihGWkSyugO3ex8=; b=YdbmcadNu6AtkaIsbUQeGeYUkPyC5z1sGV3UY4dPx7FvQ0vmmXTjhgYIU+KpwieDY8 z5xuKhRWnEN0rRwl+Pxy4MlC85vB3gmYWeQu+HiBB5+13x2s0Kk8SUZVV6YKJ6yz1bF0 r6kDkn/f/KwB2Ds/FEhslXTafFy4g9i94wj4hTDmxRPF4ldjIeuz8i99YWHkWCQVwtOo nytikgxhGx8Lfscqi0SO58RisHBymZecxJ95u067Sw20Dr4mzdO1cXsN2UF1okyiEkpP SBQiFoh56FPJ8I9iWOeDURW2nuQAHsIvPLbt+riANyQi3lkDHtiCU/2rOZtZhvjDM6VE HiWg== X-Gm-Message-State: ABy/qLbhH/gpkR9LT3qSgekvHssVBcbMl8u10TLofgLDSdck2kVGPWNu 3ArXKbhrioFiardcZVc7F7keV6sGieY= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:dac4:b0:1bb:91c9:d334 with SMTP id q4-20020a170902dac400b001bb91c9d334mr42299plx.0.1690839739050; Mon, 31 Jul 2023 14:42:19 -0700 (PDT) Date: Mon, 31 Jul 2023 14:42:17 -0700 In-Reply-To: Mime-Version: 1.0 References: <20230722022251.3446223-1-rananta@google.com> <20230722022251.3446223-2-rananta@google.com> <87v8e5r6s6.wl-maz@kernel.org> Message-ID: Subject: Re: [PATCH v7 01/12] KVM: Rename kvm_arch_flush_remote_tlb() to kvm_arch_flush_remote_tlbs() From: Sean Christopherson To: Raghavendra Rao Ananta 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 , "Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?=" , Shaoqin Huang Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_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, Raghavendra Rao Ananta wrote: > On Thu, Jul 27, 2023 at 3:24=E2=80=AFAM Marc Zyngier wro= te: > > > > 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 m= ore > > > 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 kvm_v= cpu *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 a= gree with Marc, I can't think of a single reason not to have the definition in c= ommon code. Declaring the function doesn't preclude a "static inline" implementa= tion, and we could even keep the prototype under an #ifdef, e.g.=20 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 kv= m *kvm) { return -ENOTSUPP; } +#else +int kvm_arch_flush_remote_tlb(struct kvm *kvm); #endif =20 #ifdef __KVM_HAVE_ARCH_NONCOHERENT_DMA