Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5255816pxb; Sun, 13 Feb 2022 13:58:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3cPdr5qbejY4S4ac/QhKzgBiIezs8ZEe5ehusKAmex2x6PoJ6W4VJP02N9Tlq6mysgy3j X-Received: by 2002:a17:906:b842:: with SMTP id ga2mr9534647ejb.158.1644789504372; Sun, 13 Feb 2022 13:58:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644789504; cv=none; d=google.com; s=arc-20160816; b=iy//3rBYi0ix/oWNhasz8kCS5xqCl0QRBNSjHnivh/8P1Iynj+wbygvrbgwVRarnPY DpNwIfSw5NcUAASEa3c4QIeA4DqV2IJji71p8YHUmyhR2EbyieiZj2F3UoCvvXh/L+dW O41i4JrtThnhpSzMcQXYemiFRAlhCooS9/eIe9JiuhmyNusFeCBl/I67uCK1RticCT72 oCMM7OYUOxfAg1Z+CjgK8QM2G1NZd3BSX+gkv1UHik/vYBrobbkITT9HO9w+cDWAgE6u xEUUUIOk0h+InLDIPfJ2Qg5rZXniTplFGwG+yT9286rAJjLp3LvDX01Rc6oRSo+Nprnl kpBg== 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=MzMGv99OCi8+2Db1ZNZFSg9ybIYsKPglxX6rxpaRY6Y=; b=JYXnVaDmP1+/wS7rqbD2hONSkRv/+FGeczI/BOEfmh1E9nICFaNObqRigQGchqRTZn m/hoDU7DpMrdMMVnbzinjLm7Kg0BgsclVoFr2z5PUZCD2IKf3P1yKCzTL+cvxt3y8F6I r4ctenvO9FLaW+T/ntxQi87xfzG8Zgfk3ye2lhFgsHkpEVw3IgMCYcr6MWU35DFr7Tdd A8z9k3KptwiePITaQnZiqvced2Tox6OHm21hWwbxg04o1g/4KdPja47Nj613gkXJ0vfp jVe1CgeMfLlmLlt/+UzCZaG11DYI0Sv8BDLot2CUlvbuEF+KXeZcgT0ebqd3FNRP0OCi +sIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XIncsxXz; 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 v3si13375532edc.280.2022.02.13.13.57.25; Sun, 13 Feb 2022 13:58:24 -0800 (PST) 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=XIncsxXz; 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 S237662AbiBMSD6 (ORCPT + 99 others); Sun, 13 Feb 2022 13:03:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237654AbiBMSD6 (ORCPT ); Sun, 13 Feb 2022 13:03:58 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6F3FA5C34D for ; Sun, 13 Feb 2022 10:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644775430; 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=MzMGv99OCi8+2Db1ZNZFSg9ybIYsKPglxX6rxpaRY6Y=; b=XIncsxXzvZ2aQfZK9acvXzIcOfcnC7bSdazE/8dsYtoy3PuI07QrO2WURRMGmmBv5BjrN3 Txm5z05RCxqWYtouyDizwN8mpU8BcJ9P6QM0ilTbvleNOiKnKFl958w3eXgqql9j7SsDVN ZE4uR5+Ipf/3EHGSPBKQMIn+eYGUIz8= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-362-ilgTA_fTPIGeYbW6kFz4_g-1; Sun, 13 Feb 2022 13:03:49 -0500 X-MC-Unique: ilgTA_fTPIGeYbW6kFz4_g-1 Received: by mail-lj1-f197.google.com with SMTP id m13-20020a2e97cd000000b0023e09d49ce4so4910896ljj.6 for ; Sun, 13 Feb 2022 10:03:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MzMGv99OCi8+2Db1ZNZFSg9ybIYsKPglxX6rxpaRY6Y=; b=J83vtPjZMGVJOBVTEjbrBv21Q9Fxb+Yq9mycpzrkLE8xHdmnRl6pyamEfifN9cPXk0 ZOk+pRUtQPskOhyznKpUUk+0qm+16N9KiUqRJfDGBvT/bixsCLOvMyl1U0VNdWNrAL/0 YXN5Hbc0F1Sh6JZF5glNYcl49jbXOtSiem1ZpmOWwMlCxw2M/QkERE/8pZZo7Dk9dcrl Gubtnr59aJO9qaRLje2UVzI3hzCgskBj7NdPXtgSLN49+OiUZZhV2t6BSzRaKeCcSlmY GcuHDtt0QFomQeHG1izt80Z0vC+BNcRcgK058Rh1GF2Dn6B+80uXzpMT2dsEEDmDd9p5 RKWQ== X-Gm-Message-State: AOAM533MXJrtJ/po9mv7TqCuJONHMkDIwyfv6ABlNSykBEurtqV7BOXm 0aD9bd3oCvF7WgVelntvNni4jw5GhGMDaJQxjTYn1aCOMvgmt1fC5+5qzUjDrkd/akGhYMOXOrM 6yVo+1AaUp2Uv++CYi9383xr8mr2cbUk2mSzfoY4= X-Received: by 2002:a05:6512:1032:: with SMTP id r18mr8185989lfr.678.1644775427511; Sun, 13 Feb 2022 10:03:47 -0800 (PST) X-Received: by 2002:a05:6512:1032:: with SMTP id r18mr8185979lfr.678.1644775427325; Sun, 13 Feb 2022 10:03:47 -0800 (PST) MIME-Version: 1.0 References: <20220209171118.3269581-1-atomlin@redhat.com> <20220209171118.3269581-3-atomlin@redhat.com> <14a1678f-0c56-1237-c5c7-4ca1bac4b42a@csgroup.eu> In-Reply-To: <14a1678f-0c56-1237-c5c7-4ca1bac4b42a@csgroup.eu> From: Aaron Tomlin Date: Sun, 13 Feb 2022 18:03:36 +0000 Message-ID: Subject: Re: [PATCH v5 13/13] module: Move version support into a separate file To: Christophe Leroy Cc: "mcgrof@kernel.org" , "cl@linux.com" , "pmladek@suse.com" , "mbenes@suse.cz" , "akpm@linux-foundation.org" , "jeyu@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-modules@vger.kernel.org" , "live-patching@vger.kernel.org" , "atomlin@atomlin.com" , "ghalat@redhat.com" , "allen.lkml@gmail.com" , "void@manifault.com" , "joe@perches.com" , "msuchanek@suse.de" , "oleksandr@natalenko.name" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Thu 2022-02-10 14:28 +0000, Christophe Leroy wrote: > > > Le 09/02/2022 =C3=A0 18:11, Aaron Tomlin a =C3=A9crit : > > No functional change. > > > > This patch migrates module version support out of core code into > > kernel/module/version.c. In addition simple code refactoring to > > make this possible. > > > > Signed-off-by: Aaron Tomlin > > --- > > kernel/module/Makefile | 1 + > > kernel/module/internal.h | 50 +++++++++++++ > > kernel/module/main.c | 150 +-------------------------------------= - > > kernel/module/version.c | 110 ++++++++++++++++++++++++++++ > > 4 files changed, 163 insertions(+), 148 deletions(-) > > create mode 100644 kernel/module/version.c > > Sparse reports: > > CHECK kernel/module/version.c > kernel/module/version.c:103:6: warning: symbol 'module_layout' was not > declared. Should it be static? The function module_layout() does not appear to be used. So, I've decided to remove it. > Checkpatch: > > total: 0 errors, 2 warnings, 3 checks, 337 lines checked Ok. > > +struct symsearch { > > + const struct kernel_symbol *start, *stop; > > + const s32 *crcs; > > + enum mod_license { > > + NOT_GPL_ONLY, > > + GPL_ONLY, > > + } license; > > +}; > > Why don't leave this in main.c ? Yes, struct 'symsearch' is not used outside of kernel/module/main.c. > > +inline int check_modstruct_version(const struct load_info *info, > > + struct module *mod) > > inline is pointless for a non static function This was an unfortunate oversight. > > +inline int same_magic(const char *amagic, const char *bmagic, > > + bool has_crcs) > > Same, not point for inline keyword here. Agreed. Kind regards, --=20 Aaron Tomlin