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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DBC9C6FA82 for ; Sat, 24 Sep 2022 19:12:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0BBCF4B6F0; Sat, 24 Sep 2022 15:12:32 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kIZUJ50RIYbU; Sat, 24 Sep 2022 15:12:30 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id CCE7A4B17C; Sat, 24 Sep 2022 15:12:30 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8BB7A410DE for ; Sat, 24 Sep 2022 15:12:29 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2CdYP+Ja04ik for ; Sat, 24 Sep 2022 15:12:28 -0400 (EDT) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 45EE840E25 for ; Sat, 24 Sep 2022 15:12:28 -0400 (EDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B2FF6B80E02; Sat, 24 Sep 2022 19:12:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DDA3C433C1; Sat, 24 Sep 2022 19:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664046745; bh=u7Bc4nbhe+xZptPvxYMwvWDt4rQu4WMGFR48vj17/6I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bMIqZ2r3zEjiD9XuLbN/Tjgm6c28olMRXZA+bYvMw80BuUm1g/jzqLLMJHvfSDwt3 /73/ipsvLGc5h+jZ2MejH6rqA+cHpcumsFe/vpucaytZVZt51isSJyiCbxTkvfRZGJ Eq2eJnEJP9Ey+hoKVStaQjxkf7mBbQfwxWfmxrU7RIO6TjqoVO7eVUj+xl8OPcuYQF PRVUox99WKJ3woLMrYcdLO3VrFT4aSAdv+YIZbUHmLG4oV4Qk8pBbr9GVE1HfbYdyz nLe+LgbhlSArhj5Uo+IH58JYyXIVYlIon26rrrBT37oHwp9bE3x2jBvgrcIlakC3Rj jakwThh4ZFPWw== Received: from 82-132-234-24.dab.02.net ([82.132.234.24] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ocAZa-00CNw5-Tp; Sat, 24 Sep 2022 20:12:23 +0100 Date: Sat, 24 Sep 2022 20:12:18 +0100 Message-ID: <877d1sio31.wl-maz@kernel.org> From: Marc Zyngier To: Gavin Shan Subject: Re: [PATCH v3 2/6] KVM: x86: Move declaration of kvm_cpu_dirty_log_size() to kvm_dirty_ring.h In-Reply-To: <20220922003214.276736-3-gshan@redhat.com> References: <20220922003214.276736-1-gshan@redhat.com> <20220922003214.276736-3-gshan@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 82.132.234.24 X-SA-Exim-Rcpt-To: gshan@redhat.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, catalin.marinas@arm.com, bgardon@google.com, shuah@kernel.org, andrew.jones@linux.dev, will@kernel.org, dmatlack@google.com, oliver.upton@linux.dev, peterx@redhat.com, pbonzini@redhat.com, zhenyzha@redhat.com, shan.gavin@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: kvm@vger.kernel.org, catalin.marinas@arm.com, andrew.jones@linux.dev, will@kernel.org, shan.gavin@gmail.com, bgardon@google.com, dmatlack@google.com, pbonzini@redhat.com, zhenyzha@redhat.com, shuah@kernel.org, kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Thu, 22 Sep 2022 01:32:10 +0100, Gavin Shan wrote: > > Not all architectures like ARM64 need to override the function. Move > its declaration to kvm_dirty_ring.h to avoid the following compiling > warning on ARM64 when the feature is enabled. > > arch/arm64/kvm/../../../virt/kvm/dirty_ring.c:14:12: \ > warning: no previous prototype for 'kvm_cpu_dirty_log_size' \ > [-Wmissing-prototypes] \ > int __weak kvm_cpu_dirty_log_size(void) > > Reported-by: kernel test robot > Signed-off-by: Gavin Shan > --- > arch/x86/include/asm/kvm_host.h | 2 -- > arch/x86/kvm/mmu/mmu.c | 2 ++ > include/linux/kvm_dirty_ring.h | 1 + > 3 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 2c96c43c313a..4c0fd517282b 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -2082,8 +2082,6 @@ static inline int kvm_cpu_get_apicid(int mps_cpu) > #define GET_SMSTATE(type, buf, offset) \ > (*(type *)((buf) + (offset) - 0x7e00)) > > -int kvm_cpu_dirty_log_size(void); > - > int memslot_rmap_alloc(struct kvm_memory_slot *slot, unsigned long npages); > > #define KVM_CLOCK_VALID_FLAGS \ > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c > index e418ef3ecfcb..b3eb6a3627ec 100644 > --- a/arch/x86/kvm/mmu/mmu.c > +++ b/arch/x86/kvm/mmu/mmu.c > @@ -1349,10 +1349,12 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm, > kvm_mmu_write_protect_pt_masked(kvm, slot, gfn_offset, mask); > } > > +#ifdef CONFIG_HAVE_KVM_DIRTY_RING I think you can drop the ifdeffery, as HAVE_KVM_DIRTY_RING is unconditionally selected by the arch Kconfig. > int kvm_cpu_dirty_log_size(void) > { > return kvm_x86_ops.cpu_dirty_log_size; > } > +#endif > > bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm, > struct kvm_memory_slot *slot, u64 gfn, > diff --git a/include/linux/kvm_dirty_ring.h b/include/linux/kvm_dirty_ring.h > index 906f899813dc..8c6755981c9b 100644 > --- a/include/linux/kvm_dirty_ring.h > +++ b/include/linux/kvm_dirty_ring.h > @@ -71,6 +71,7 @@ static inline bool kvm_dirty_ring_soft_full(struct kvm_dirty_ring *ring) > > #else /* CONFIG_HAVE_KVM_DIRTY_RING */ > > +int kvm_cpu_dirty_log_size(void); > u32 kvm_dirty_ring_get_rsvd_entries(void); > int kvm_dirty_ring_alloc(struct kvm_dirty_ring *ring, int index, u32 size); Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm