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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 714D1C7618A for ; Thu, 16 Mar 2023 20:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230242AbjCPUC7 convert rfc822-to-8bit (ORCPT ); Thu, 16 Mar 2023 16:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjCPUCy (ORCPT ); Thu, 16 Mar 2023 16:02:54 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84EEBE6DB2; Thu, 16 Mar 2023 13:02:29 -0700 (PDT) Received: from lhrpeml500002.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PcylF2PMlz6J9fJ; Fri, 17 Mar 2023 03:59:21 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by lhrpeml500002.china.huawei.com (7.191.160.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 16 Mar 2023 20:02:27 +0000 Received: from lhrpeml500005.china.huawei.com ([7.191.163.240]) by lhrpeml500005.china.huawei.com ([7.191.163.240]) with mapi id 15.01.2507.021; Thu, 16 Mar 2023 20:02:27 +0000 From: Shameerali Kolothum Thodi To: Sean Christopherson CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "gshan@redhat.com" , "maz@kernel.org" Subject: RE: [PATCH] KVM: Add the missing stub function for kvm_dirty_ring_check_request() Thread-Topic: [PATCH] KVM: Add the missing stub function for kvm_dirty_ring_check_request() Thread-Index: AQHZWB65hkIreZwmx0eOO2ggOjI5jq79oegAgAArQ8CAAAWkAIAAACPw Date: Thu, 16 Mar 2023 20:02:26 +0000 Message-ID: References: <20230316154554.1237-1-shameerali.kolothum.thodi@huawei.com> <6b9e8589281c4d2bae46eba36f77afe7@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.195.246.25] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Sean Christopherson [mailto:seanjc@google.com] > Sent: 16 March 2023 19:57 > To: Shameerali Kolothum Thodi > Cc: linux-kernel@vger.kernel.org; kvm@vger.kernel.org; gshan@redhat.com; > maz@kernel.org > Subject: Re: [PATCH] KVM: Add the missing stub function for > kvm_dirty_ring_check_request() > > On Thu, Mar 16, 2023, Shameerali Kolothum Thodi wrote: > > > From: Sean Christopherson [mailto:seanjc@google.com] On Thu, Mar 16, > > > 2023, Shameer Kolothum wrote: > > > > The stub for !CONFIG_HAVE_KVM_DIRTY_RING case is missing. > > > > > > No stub is needed. kvm_dirty_ring_check_request() isn't called from > > > common code, and should not (and isn't unless I'm missing something) > > > be called from arch code unless CONFIG_HAVE_KVM_DIRTY_RING=y. > > > > > > x86 and arm64 are the only users, and they both select > > > HAVE_KVM_DIRTY_RING unconditionally when KVM is enabled. > > > > Yes, it is at present not called from anywhere other than x86 and arm64. > > But I still think since it is a common helper, better to have a stub. > > Why? It buys us nothing other than dead code, and even worse it could let > a bug that would otherwise be caught during build time escape to run time. Agree, it buys nothing now:) It just came up while I was playing with a custom build without HAVE_KVM_DIRTY_RING. Since all other functions there has a stub just thought it would make it easier for future common usage. We could very well leave it till that comes up as well. Thanks, Shameer