From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03B61C0015E for ; Thu, 20 Jul 2023 01:17:11 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=cR5knavF; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4R5vtG3Q0bz3bcD for ; Thu, 20 Jul 2023 11:17:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=cR5knavF; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=yuan.yao@linux.intel.com; receiver=lists.ozlabs.org) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4R5vsF1nNnz2yFK for ; Thu, 20 Jul 2023 11:16:15 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689815777; x=1721351777; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=0X3B3RFBvIohiBDiMK6hMbRCxfxPASWhBjQpW8WFunc=; b=cR5knavFH338bhWxR2FwjraGxLpx2aUXeHrnr/+N3Uj3C7QGzTfgGpuP ycm/X8O/PHSCpjZeCZKPZrEC5tsjlnAXe0My8xrpN9H9FF0gDmeJzLn9/ YgESl69e1xjPlEekvDHEd6PXkt1MZjZ4HG/LBgIXIwOND1aoQly2plSz/ vifBTn7YEvDzmbUpSPOH+S2hGH9odPMo9O34yPDUSoqWemyUb7+haiZwU h2F+ROlc4gQlmCv7/zASDCsvpCOrsYn3ighDBaJQi6PENQeC3OCFM3dLp bTx96NwIqbR4AzSQLPFR8IGF53nBYoqOVtBkPGoOdJ1o2mw+Pwc20b8XM w==; X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="364065932" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="364065932" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2023 18:16:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="674516361" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="674516361" Received: from yy-desk-7060.sh.intel.com (HELO localhost) ([10.239.159.76]) by orsmga003.jf.intel.com with ESMTP; 19 Jul 2023 18:15:44 -0700 Date: Thu, 20 Jul 2023 09:15:41 +0800 From: Yuan Yao To: Sean Christopherson Subject: Re: [RFC PATCH v11 05/29] KVM: Convert KVM_ARCH_WANT_MMU_NOTIFIER to CONFIG_KVM_GENERIC_MMU_NOTIFIER Message-ID: <20230720011541.6ti5sygwwfwko6ab@yy-desk-7060> References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-6-seanjc@google.com> <20230719073115.vuedo2cf3mp27xm4@yy-desk-7060> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, David Hildenbrand , Yu Zhang , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Chao Peng , linux-riscv@lists.infradead.org, Isaku Yamahata , Paul Moore , Marc Zyngier , Huacai Chen , James Morris , "Matthew Wilcox \(Oracle\)" , Wang , Fuad Tabba , Jarkko Sakkinen , "Serge E. Hallyn" , Maciej Szmigiero , Albert Ou , Vlastimil Babka , Michael Roth , Ackerley Tng , Paul Walmsley , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Quentin Perret , Liam Merwick , linux-mips@vger.kernel.org, Oliver Upton , linux-security-module@vger.kernel.org, Palmer Dabbelt , kvm-riscv@lists.infradead.org, Anup Patel , linux-fsdevel@vger.kernel.org, Paolo Bonzini , Andrew Morton , Vishal Annapurve , linuxppc-dev@lists.ozlabs.org, "Kirill A . Shutemov" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Jul 19, 2023 at 07:15:09AM -0700, Sean Christopherson wrote: > On Wed, Jul 19, 2023, Yuan Yao wrote: > > On Tue, Jul 18, 2023 at 04:44:48PM -0700, Sean Christopherson wrote: > > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > > index 90a0be261a5c..d2d3e083ec7f 100644 > > > --- a/include/linux/kvm_host.h > > > +++ b/include/linux/kvm_host.h > > > @@ -255,7 +255,9 @@ bool kvm_setup_async_pf(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, > > > int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); > > > #endif > > > > > > -#ifdef KVM_ARCH_WANT_MMU_NOTIFIER > > > +struct kvm_gfn_range; > > > > Not sure why a declaration here, it's defined for ARCHs which defined > > KVM_ARCH_WANT_MMU_NOTIFIER before. > > The forward declaration exists to handle cases where CONFIG_KVM=n, specifically > arch/powerpc/include/asm/kvm_ppc.h's declaration of hooks to forward calls to > uarch modules: > > bool (*unmap_gfn_range)(struct kvm *kvm, struct kvm_gfn_range *range); > bool (*age_gfn)(struct kvm *kvm, struct kvm_gfn_range *range); > bool (*test_age_gfn)(struct kvm *kvm, struct kvm_gfn_range *range); > bool (*set_spte_gfn)(struct kvm *kvm, struct kvm_gfn_range *range); > > Prior to using a Kconfig, a forward declaration wasn't necessary because > arch/powerpc/include/asm/kvm_host.h would #define KVM_ARCH_WANT_MMU_NOTIFIER even > if CONFIG_KVM=n. > > Alternatively, kvm_ppc.h could declare the struct. I went this route mainly to > avoid the possibility of someone encountering the same problem on a different > architecture. Ah I see, thanks for your explanation!