Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp75146rwl; Wed, 9 Aug 2023 11:07:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhZlImgVAeik5i1ununDBTFpyGOJYx2PWtk09qNr5mguep8xzj/QEybtuL0QS4ZD8grlXX X-Received: by 2002:a17:906:5dae:b0:989:450:e585 with SMTP id n14-20020a1709065dae00b009890450e585mr2425664ejv.45.1691604466763; Wed, 09 Aug 2023 11:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691604466; cv=none; d=google.com; s=arc-20160816; b=WXkDdnCswY9Xz39YDKUucKnh9tONJZMzZOiqv50ETSqs3moppTcSy945hbSB/uaCER sAL8yGytSbpJQbGVZuUR/hdsUwgwfqbXIEi0BIgtaTAuSzewZoDICNcEP6XG0V7Zr1qV t05n4TsIzATIi3cXLZOHPCfpXPBy/d0o/BeXi30SwYml9Ku8lHRpyTqb2wjWmxkPaJcO 1mSIywZ3Yzz6+f/9FBkOqus9dP5wCRxysYNyOTSbL2Vl7i8SviYR5SGAE4uyJ48Fhn6T AmDsHWC9caVA9GxZxCIQFYMkm3+EUaRJAZ3mTSc3FR8TAcmvWagsNbEhp4KLnf1sz4Ua m3qQ== 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=rAabttuUSlISLQ9kur95AJErnuBmKPlF1t5IPI4xLW8=; fh=39FopgQl20BagAaeQeQRGjnJQh4jsf+UIrR8eQTaSDI=; b=iI+joyydZ4omKx1FJcwmb5bNXU0sJ3y1zZx+Q5FMpZI9sqVcjB0UcLg7K2JzdXkzcP 9/PyHwhhLn23KsyCxw/OUsq5b6/TCiHH12xcKBFginL1Z8SGEiHg4m6MUhlbIOlxwuDT xdJ/Bk2nt7fwKv6Z1B27eshW+Lu55i428VlXAThcMJ4XuSA4qISep9K7xvHtZGZ8f9VO qJS24m47zITjEJZTjNtV5D+GTsLb+tWP3FjxjDc7PuKk8p9LVm3Oq+ZQTY/6300sKQTX PX/lyrAxgGWSy8qHyNgXsxAnNv4CvOIFqdPUiiT9K0WOFiuk5sbMI9VZ9YjWfBhKtxGi tJ7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="QK/Md6pL"; 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 z15-20020a17090665cf00b0099cc36c6bdcsi6910179ejn.151.2023.08.09.11.07.22; Wed, 09 Aug 2023 11:07:46 -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="QK/Md6pL"; 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 S229924AbjHIQjE (ORCPT + 99 others); Wed, 9 Aug 2023 12:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjHIQjD (ORCPT ); Wed, 9 Aug 2023 12:39:03 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98B3B1986 for ; Wed, 9 Aug 2023 09:39:02 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-407db3e9669so311651cf.1 for ; Wed, 09 Aug 2023 09:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691599141; x=1692203941; 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=rAabttuUSlISLQ9kur95AJErnuBmKPlF1t5IPI4xLW8=; b=QK/Md6pLtQcnNYaG7FaNR8YGO5V1BDDGTN1QNcb5t4M8hyK/g2UzsOCkQFbfYrRiBB G0kclZmDhOUC4jPYSDgzil3jq7z68Wq4Y/XsBYF1MGe9Iir+sC7RphbJoMfImBbhq2T/ pEhwFheHJqKkE6YRXMAxkXUnF8lSNA2TqIGy9iPTw7Y7ze+v2ZO6wVbfvsq9lZ13AZGe qcvfeTRsEBx541O+obhMMtIFxCFLknFX2bE3VoAPa0QB2Ao3Loe9vbjMaWTez52X0ZNb c1pWu8dZp76+bEISHoUz6Gcb1Dks1IYF1WyX0qZyE1sqGI1eUsOyDxlWzYy0GZ7RrbKU pVQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691599141; x=1692203941; 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=rAabttuUSlISLQ9kur95AJErnuBmKPlF1t5IPI4xLW8=; b=SIJFTAqWe7qwD4slkn+ovO0OI6cWoAhwcjikBZWNb4RuQQMNpMum+ScoWv3D7IfNtc x3oh3Jsm9w/Sk66+IKrE4RxtrMVnN73WFmj+S07X3LvSn5Er0Ef2GqZm0mX8XE2MqJ+L 0ssrN61SXp8KJfGJc/UhRdRM5vmdeKeR0zV0y22fZQv9zWtSvuFt0QPCZ46axXQWuSw3 YIlazHjye4qoR1tDWtnnaHQF/0UZc33jx7SJBhloxwpj4piKSBjAY3kw+oXqi1O2cCnx usiMZzePlexZ2HawMhCv6jxTf82YjKsW2TZdg6rcF3wziAp9z4F2XBI7Cryg77a6tZP3 5mEg== X-Gm-Message-State: AOJu0YylE6x9Zi46KYMCfm1i6drBs3Gj2Ohl9xW2oe0IRwW87T7PIxNw Rmq+hvmr1BxIypx6csFpEKzsCe0Cf3qAa4j72Ocm8Q== X-Received: by 2002:a05:622a:206:b0:3ef:302c:319e with SMTP id b6-20020a05622a020600b003ef302c319emr161886qtx.8.1691599141628; Wed, 09 Aug 2023 09:39:01 -0700 (PDT) MIME-Version: 1.0 References: <20230808231330.3855936-1-rananta@google.com> <20230808231330.3855936-3-rananta@google.com> In-Reply-To: From: Raghavendra Rao Ananta Date: Wed, 9 Aug 2023 09:38:49 -0700 Message-ID: Subject: Re: [PATCH v8 02/14] KVM: Declare kvm_arch_flush_remote_tlbs() globally To: Gavin Shan Cc: Oliver Upton , Marc Zyngier , 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 , Fuad Tabba , 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 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, 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 Hi Gavin, On Tue, Aug 8, 2023 at 9:00=E2=80=AFPM Gavin Shan wrote: > > > On 8/9/23 09:13, Raghavendra Rao Ananta wrote: > > There's no reason for the architectures to declare > > kvm_arch_flush_remote_tlbs() in their own headers. Hence to > > avoid this duplication, make the declaration global, leaving > > the architectures to define only __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS > > as needed. > > > > Signed-off-by: Raghavendra Rao Ananta > > --- > > arch/mips/include/asm/kvm_host.h | 1 - > > include/linux/kvm_host.h | 2 ++ > > 2 files changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/k= vm_host.h > > index 9b0ad8f3bf327..54a85f1d4f2c8 100644 > > --- a/arch/mips/include/asm/kvm_host.h > > +++ b/arch/mips/include/asm/kvm_host.h > > @@ -897,6 +897,5 @@ static inline void kvm_arch_vcpu_blocking(struct kv= m_vcpu *vcpu) {} > > static inline void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu) {} > > > > #define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS > > -int kvm_arch_flush_remote_tlbs(struct kvm *kvm); > > > > #endif /* __MIPS_KVM_HOST_H__ */ > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index e3f968b38ae97..ade5d4500c2ce 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host.h > > @@ -1484,6 +1484,8 @@ static inline int kvm_arch_flush_remote_tlbs(stru= ct kvm *kvm) > > { > > return -ENOTSUPP; > > } > > +#else > > +int kvm_arch_flush_remote_tlbs(struct kvm *kvm); > > #endif > > > > #ifdef __KVM_HAVE_ARCH_NONCOHERENT_DMA > > Is the declaration inconsistent to that in arch/x86/include/asm/kvm_host.= h? > In order to keep them consistent, I guess we need move kvm_arch_flush_rem= ote_tlbs() > from x86's header file to arch/x86/kvm/mmu/mmu.c and 'inline' needs to be= dropped. > Unsure of the original intentions, I didn't want to disturb any existing arrangements. If more people agree to this refactoring, I'm happy to move. Thank you. Raghavendra > Thanks, > Gavin >