Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1071947rwl; Thu, 10 Aug 2023 06:09:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/sqIdRacqudI9j7thQj7QouVfdu1+DhtwQZzLDTXUB68RDoBeOAaoTzTBL+2h9cvUlbhD X-Received: by 2002:a05:6a00:842:b0:64a:2dd6:4f18 with SMTP id q2-20020a056a00084200b0064a2dd64f18mr2752804pfk.13.1691672982448; Thu, 10 Aug 2023 06:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691672982; cv=none; d=google.com; s=arc-20160816; b=l3UU+nD/fg/TmSJuU1RpXdoXT5Gf1E0i+bsX3KCvdyD+7Q4SYy5OTaHlKRWK/vK3JH Umx9fZ7wPnBl8dKM/Wn6Q7CUQ5K8xmro2StTkfDIPBPTQ8Y1dlFdu2HVxcZooFZG/Nr6 t9OTxpOSmNYp/FTmugzGN/ElOcxx4sPfNuNJiTSi+RJx3Szr4Z0qGF1Ho/pSfgxFyPgH StAf8KHjwrlXVA8eltWOqr9EGmDCI0JKFsQETcDiIKgcoaWQFo8fl0VgwUbUvHs6p3NX 8b+zvFD2QdckQBnQuZIwkG1SPzorldWTsdYutEm0EqmY1fx8ej5e4bEuNsfuPVXzRhiz Z+2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mnvMtwrO+HlpCnGD+Ie1TBrDV8keaKNA7WfaJ+XMfts=; fh=GeN8rbZMPUFgdfZ6J9vcoJHweJONPPZNv9WYygy0Wgc=; b=iP5trzhIZ5cFKHYgq8BiLPnKKrn2dz7hiid+KVyDlO1lLjRKlBQl7c6PnvM+bcug2F oZm/0wf61nWkHHGl1HRy4yrOE2tOeXHgnzApYLUyClyNdEIsOMjMR/bkMLkyb9sa4Py8 Nmi5sAUJ5VKB42hD1+N9PvdjoOcvq/ZSb7e0+Te8ilC1XMibqrMUSYNn3XAHGIdXhJbe O/n11kLe4/vzc6rqKA3jLJJTecU2Ykt87DuCvmDD7UjZUmbaHFHCJlCD5eh5UeVSfVvC t7UYShmjpdFgBYL3s8Q45JpLD6aILkgyrZJUP8JJJwc93T57Q+wu5B2lr5PrmVXPaJA1 EYqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PThITPCV; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq12-20020a056a00330c00b006687255a465si1070390pfb.298.2023.08.10.06.09.29; Thu, 10 Aug 2023 06:09:42 -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=@redhat.com header.s=mimecast20190719 header.b=PThITPCV; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235257AbjHJM1K (ORCPT + 99 others); Thu, 10 Aug 2023 08:27:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235199AbjHJM1J (ORCPT ); Thu, 10 Aug 2023 08:27:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6730B2724 for ; Thu, 10 Aug 2023 05:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691670379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mnvMtwrO+HlpCnGD+Ie1TBrDV8keaKNA7WfaJ+XMfts=; b=PThITPCV91zKh135syv7wW8rJbf8dZOP8YA3duXGMz/cGQH8wLsvzIULnY53qbPxfYXAQ4 VbCReSC32+VDIcQWUIeF+V0aIFbQriTeuTyVDPVt+ABPz+SA91wJ2dQRZahBwukOb1lYe5 HdWHv+GMM4J9VHpzP/dIjUtP0t90SRU= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-wV-JGXe-OnmoY4fVFzg3-Q-1; Thu, 10 Aug 2023 08:26:18 -0400 X-MC-Unique: wV-JGXe-OnmoY4fVFzg3-Q-1 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-686f376f2b8so191943b3a.0 for ; Thu, 10 Aug 2023 05:26:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691670377; x=1692275177; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mnvMtwrO+HlpCnGD+Ie1TBrDV8keaKNA7WfaJ+XMfts=; b=f7ssIIpwqG+KnnpQJizlPwnfVs0Z+18l093n1BQq1U9s53nX7E3yUOblHkeNZFjk3D SKxW+L4vqxJOY4pf0Zq3e17odcuGmpxbClCNseibPZN/crLxll0IByYG/CiAh7put7F3 grnYGyLFTT/Vs65GPSfqBZmP789xoO8ujBJjYs61GZ9clOj4Qz7Vw8nbo+qwizPv0wdJ EqEX0RlRpPiELHkZJ1qwLwc/hnZwV5g9prjWnhEHQe+dV2Ev/+WLgLYgUjs1Lf46dEkq qcaVCCtRBl2n6yADr/ECna5kAgujKLnBu08QVEUfQqYzDDFgpykw0KOhGeiwHpi+YvA5 0HQg== X-Gm-Message-State: AOJu0YzZlforsJBqd0tsr57aSfqOMfJEPoHVl9xyQZ/dcSGPVMA3e5zn S1v7cX7EDsWW9pMtKP6CZls4JyOr5UE5LyxcfaSAO5WAW2X+o0ZGIVaF0PLJScDz5f0a+pbvtgt iAfCq+tgkVIXRByKJ6hEuxgSS X-Received: by 2002:a05:6a00:d96:b0:687:874c:7ce0 with SMTP id bf22-20020a056a000d9600b00687874c7ce0mr2463241pfb.1.1691670377122; Thu, 10 Aug 2023 05:26:17 -0700 (PDT) X-Received: by 2002:a05:6a00:d96:b0:687:874c:7ce0 with SMTP id bf22-20020a056a000d9600b00687874c7ce0mr2463218pfb.1.1691670376757; Thu, 10 Aug 2023 05:26:16 -0700 (PDT) Received: from [10.72.112.92] ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id s11-20020aa78d4b000000b006878f50d071sm1393686pfe.203.2023.08.10.05.26.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Aug 2023 05:26:16 -0700 (PDT) Message-ID: <30e45ef3-309a-63de-e085-be1645c1be79@redhat.com> Date: Thu, 10 Aug 2023 20:26:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v8 02/14] KVM: Declare kvm_arch_flush_remote_tlbs() globally Content-Language: en-US To: Raghavendra Rao Ananta , 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 References: <20230808231330.3855936-1-rananta@google.com> <20230808231330.3855936-3-rananta@google.com> From: Shaoqin Huang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 8/10/23 00:38, Raghavendra Rao Ananta wrote: > Hi Gavin, > > On Tue, Aug 8, 2023 at 9:00 PM 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/kvm_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 kvm_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(struct 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_remote_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. This is amazing to me. This change can be compiled without any error even if the declaration inconsistent between the kvm_host.h and x86's header file. I'm curious which option make it possible? Thanks, Shaoqin > > Thank you. > Raghavendra >> Thanks, >> Gavin >> > -- Shaoqin