Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3094318pxb; Thu, 10 Feb 2022 12:06:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGVtjoU21R3C3Wuz6vevgtL6MsjINnNS3vK1qN5pThbRwVoYYISur7PK1IZUOWsMUstkbd X-Received: by 2002:a17:907:3f21:: with SMTP id hq33mr7735749ejc.548.1644523567376; Thu, 10 Feb 2022 12:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644523567; cv=none; d=google.com; s=arc-20160816; b=RbTJ1LYqvtV3xgeXAFDAPOwoidl9ilCC2K2/RamT7K/xCk8/hXqnuhubxAj4USshz/ nM1hiJzWzuBsF7eM5naG43a0I2/HX9+QWr7toSY4PFrjWzlR3NhtxmRj8J8HiEkZgFFu jY2To617k173rhxsJ5qlrEhNAmMV2SwISENM/7KB0m3hp5FShbs11y41Tf9bNElZzO7I Sbp6Y7rlmQGPU8qTo8mkzumqw0u9gDSxFQJRfatDwPiRkUdeCulRdhJAP8grip8RAbUT RrVTjEi0/dtifROxEWXWZTu9RLQlCxMutGE1GuMo2FTP5r84WF2qpNjDJdGoYGRKVW7G u4LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SVIUy3YEzbIOwDBGTHyt0++Vn4z6UjSjAvlypOu8m5g=; b=KLXJlUKM35rgKcH/GObEB7LW/0H/byRVZgg7OzEZgWaOxNtcTQBoOl9oi85VXKtU+G JQ1zWQY+dAdOZZCXaPsoz3h6ZQdkFtDg2B4Gqokmjpci89TJT2Cmj/vyEIUCJUmW+8l4 J2ri1LAR2H67r2v+LNiCtA6dXVINlpQY5GsMSi0E9rp4fCXpev1sbH5vmd1yKrf+UwmV 6WoVFN4vh5EtoSCj1jyzoY/U3HVInSbkcyJR3lx2s/YEK9pMyj7lyUD3uqek6cCaonum w136p74oH4kqqDSuGcg0Ofgl6QHzjn73L5bmaOShF8YlN0hGPvch7tc07IkCStMIIiRU NfHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DkSvr80u; 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 gv8si8833713ejb.572.2022.02.10.12.05.40; Thu, 10 Feb 2022 12:06:07 -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=DkSvr80u; 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 S245125AbiBJRUc (ORCPT + 99 others); Thu, 10 Feb 2022 12:20:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245113AbiBJRUb (ORCPT ); Thu, 10 Feb 2022 12:20:31 -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 D154DE72 for ; Thu, 10 Feb 2022 09:20:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644513631; 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: in-reply-to:in-reply-to:references:references; bh=SVIUy3YEzbIOwDBGTHyt0++Vn4z6UjSjAvlypOu8m5g=; b=DkSvr80uFfoP+XkgSdngUQqbXZLpGeONyq1Nt/hTwuzV4TYbWbNel3XS0khFCdeu53GcZK ytzA706Tkq41RESL65cUR2mFFeBJs3fMjdFOhyYF51gACJ3d4lGuI8wVd0xP1eJMVd/VIT Yc+V17F6UG1jSPAT2nFgqABqrkycaSw= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-f9qRpWCWMYeHvO5yxD65wA-1; Thu, 10 Feb 2022 12:20:29 -0500 X-MC-Unique: f9qRpWCWMYeHvO5yxD65wA-1 Received: by mail-lj1-f198.google.com with SMTP id a13-20020a2e88cd000000b002386c61ffe2so2865600ljk.7 for ; Thu, 10 Feb 2022 09:20:29 -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; bh=SVIUy3YEzbIOwDBGTHyt0++Vn4z6UjSjAvlypOu8m5g=; b=q9ZjFL/YF4XfKr91q5ikfhgeML0BUKi0ODhbGW0R+1pbV78bzD/TdT9gNxcEwnBwBn uQUZwyf1rs0XXHPcDXkcPWHMervkoIsFg2cnF9byiC3CNfT8VJPR/ohG94sIcRdRb+r0 167SJV0MNPhNRakL3MBRzZ5w/kLBQ1WdDCTYhlAGmuT9kKJ44TUa2ZjAiyvPNdRYuLA/ LIsRKlctzzBBVpecXRJLVagI26PUoHpLHo5Q7F2VAqBxu9mPTaMTZX+88lXafCCf8g/Z U/ZqjVr/m0vOcpEobHHv7cTTOgikAoJBuzec8bB3iTQxBY5mJK1Jo9jWGfeht1429uIs AwWg== X-Gm-Message-State: AOAM53315n4UnwBUC+wY0B391iICMf91IM2RVskTXQZYGPTudIq2mo8P oDk/8W2FflDbBwsMEMtmd9wXFMTMWrDT3L/5VHqoDN5Zw/F1PT+6iAaQ8EuVu6pQVVn339ZCgdW dLRXebyuPS92KGlhCS1Dk+qVRyBEldbP64NvyyTk= X-Received: by 2002:a05:6512:10c2:: with SMTP id k2mr2649509lfg.118.1644513627998; Thu, 10 Feb 2022 09:20:27 -0800 (PST) X-Received: by 2002:a05:6512:10c2:: with SMTP id k2mr2649499lfg.118.1644513627797; Thu, 10 Feb 2022 09:20:27 -0800 (PST) MIME-Version: 1.0 References: <20220209170358.3266629-1-atomlin@redhat.com> <20220209170358.3266629-5-atomlin@redhat.com> In-Reply-To: From: Aaron Tomlin Date: Thu, 10 Feb 2022 17:20:16 +0000 Message-ID: Subject: Re: [PATCH v5 04/13] module: Move livepatch support to 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" X-Spam-Status: No, score=-2.8 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 11:44 +0000, Christophe Leroy wrote: > This change is wrong, build fails with it because is_livepatch_module() > is nowhere defined. Yes, sorry about that. This was an omission/or oversight during the rebase attempt. > You could move is_livepatch_module() to include/linux/livepatch.h but as > a separate patch. Fair enough. Albeit, I'd prefer to revert and keep is_livepatch_module() in include/linux/module.h - this is likely the best solution. Note: set_livepatch_module() will remain for internal use only. > > #else /* !CONFIG_LIVEPATCH */ > > static inline bool is_livepatch_module(struct module *mod) > > { > > diff --git a/kernel/module/Makefile b/kernel/module/Makefile > > index 2902fc7d0ef1..ee20d864ad19 100644 > > --- a/kernel/module/Makefile > > +++ b/kernel/module/Makefile > > @@ -7,3 +7,6 @@ obj-$(CONFIG_MODULES) += main.o > > obj-$(CONFIG_MODULE_DECOMPRESS) += decompress.o > > obj-$(CONFIG_MODULE_SIG) += signing.o > > obj-$(CONFIG_MODULE_SIG_FORMAT) += signature.o > > +ifdef CONFIG_MODULES > > CONFIG_LIVEPATCH depends on CONFIG_MODULES so this ifdef is not needed Agreed. > Checkpatch reports the following: > > WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? > #80: > new file mode 100644 > > CHECK: Comparison to NULL could be written "!mod->klp_info" > #109: FILE: kernel/module/livepatch.c:25: > + if (mod->klp_info == NULL) > > CHECK: Comparison to NULL could be written "!mod->klp_info->sechdrs" > #119: FILE: kernel/module/livepatch.c:35: > + if (mod->klp_info->sechdrs == NULL) { > > CHECK: Comparison to NULL could be written "!mod->klp_info->secstrings" > #127: FILE: kernel/module/livepatch.c:43: > + if (mod->klp_info->secstrings == NULL) { > > CHECK: No space is necessary after a cast > #142: FILE: kernel/module/livepatch.c:58: > + mod->klp_info->sechdrs[symndx].sh_addr = (unsigned long) > mod->core_kallsyms.symtab; Ok. > Given how simple this function is, it should be a 'static inline' in > internal.c Agreed. > CHECK: Alignment should match open parenthesis > #285: FILE: kernel/module/main.c:3033: > + pr_err("%s: module is marked as livepatch module, but livepatch > support is disabled", > + mod->name); Fair enough. Kind regards, -- Aaron Tomlin