Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1456018pxb; Tue, 8 Feb 2022 18:40:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYtnCee/Q4YmwtxzB8CKLsRwsTOUU6F6zq2Lbl8ydwysEVs/StTSni0atpj6fG7QtxHEM1 X-Received: by 2002:a50:eb46:: with SMTP id z6mr301654edp.229.1644374449313; Tue, 08 Feb 2022 18:40:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644374449; cv=none; d=google.com; s=arc-20160816; b=RPaixJ/FdTtR2KBAPmvpjk6e/HIvOV8+TEqTB5puWdF5dtdp6KUE/pajCHnRCVy/rp UnB70XmZF0b4WlDDz+aCLOw+weml0lwXAD1q9gOeQOBn7elUgi2DqHjngM4hJ+HwUMN0 G6rpe1+CdymYLdGsRxnrn9J/HWHPDwxCSYawEUJ+9aNRkOFU0mt7CgDotTgoGfr5u4H1 /SURXD8cJUMQ409FcEHViuBdnk8miABclVgO8/4I9LX9W8hPWGZyhf0bIlgCRf4yEc/n OlLgZ8GJCd5hYKRrDKfqzLgNVE80JqDvraOEjuOedhrfAWidaCYHZYk+ZmyXnZzg6BKE lcQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=txkE5XzzyFXzIuOv7AWLb7NWIjo0bQa6foIWhGJ1WH8=; b=hJuLKaZ7IVwX9N52c0wHoN12cpPFfht3qKSBGl/G+15wJXm0BIuyYXTlCzepkiutjB WMq+j+zvvTbE247va/f2oULR1ij7aJpm88Wk6aSeT4c3S26JGTz81p0Ea39fCoffn9TS 3JCTjO+koIukF7q7CYCiXv0O0niZZA7NfT+DywWqUYGkh/asG2rr5tS0/WJWxLdVhuCo 11OcDWoqzo6X4i1MMzfQdjVT99/3jIhPDWrt8GgKoRmw7Z3pgmxGHC2mLg7XmYSV05Tl jxyrn2ZB0wn0hVEefXEvBpziW0XpMQwJcfLSWMdUBCZtBCH+xcNm+4us+8AxZ88Xm/Ow wdsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NTxXEVyu; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw22si11766953ejc.25.2022.02.08.18.40.23; Tue, 08 Feb 2022 18:40:49 -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=@suse.com header.s=susede1 header.b=NTxXEVyu; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358389AbiBHLv0 (ORCPT + 99 others); Tue, 8 Feb 2022 06:51:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357980AbiBHLuQ (ORCPT ); Tue, 8 Feb 2022 06:50:16 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3364C02549C; Tue, 8 Feb 2022 03:42:15 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 71654210F5; Tue, 8 Feb 2022 11:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1644320534; h=from:from:reply-to: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=txkE5XzzyFXzIuOv7AWLb7NWIjo0bQa6foIWhGJ1WH8=; b=NTxXEVyuDBlX93//ziag9/u/YKfr/o63OWd+BvhP4eq4trTMgcsXcL04QBfS8sP33AlWOc I0oenl/j5W9toXdR1zZcvNgtta5Paomkkeup5R75HYtjIuECDKnOLGFA4SekBLA3+YOw5c 2JQG8NRQe9nuigXqWua6laRNVH5zQq8= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 28308A3B83; Tue, 8 Feb 2022 11:42:14 +0000 (UTC) Date: Tue, 8 Feb 2022 12:42:10 +0100 From: Petr Mladek To: Aaron Tomlin Cc: mcgrof@kernel.org, cl@linux.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 Subject: Re: [RFC PATCH v4 03/13] module: Move livepatch support to a separate file Message-ID: References: <20220130213214.1042497-1-atomlin@redhat.com> <20220130213214.1042497-4-atomlin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220130213214.1042497-4-atomlin@redhat.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Sun 2022-01-30 21:32:04, Aaron Tomlin wrote: > No functional change. > > This patch migrates livepatch support (i.e. used during module > add/or load and remove/or deletion) from core module code into > kernel/module/livepatch.c. At the moment it contains code to > persist Elf information about a given livepatch module, only. > > diff --git a/include/linux/module.h b/include/linux/module.h > index f4338235ed2c..c7daac4d16ee 100644 > --- a/include/linux/module.h > +++ b/include/linux/module.h > @@ -663,17 +663,23 @@ static inline bool module_requested_async_probing(struct module *module) > return module && module->async_probe_requested; > } > > -#ifdef CONFIG_LIVEPATCH > static inline bool is_livepatch_module(struct module *mod) > { > - return mod->klp; > + if (IS_ENABLED(CONFIG_LIVEPATCH)) { > + if (mod->klp) > + return true; > + } > + return false; The following is easier to follow for me. But it is a matter of taste. Feel free to use whatever you prefer. return IS_ENABLED(CONFIG_LIVEPATCH) && mod->klp; > } > -#else /* !CONFIG_LIVEPATCH */ > -static inline bool is_livepatch_module(struct module *mod) > + > +static inline bool set_livepatch_module(struct module *mod) > { > + if (IS_ENABLED(CONFIG_LIVEPATCH)) { > + mod->klp = true; > + return true; > + } > return false; This should go to internal.h. Alternative is to move both is_livepatch_module() and set_livepatch_module() into include/linux/livepatch.h. I do not have strong opinion. > } > -#endif /* CONFIG_LIVEPATCH */ > > bool is_module_sig_enforced(void); > void set_module_sig_enforced(void); Otherwise, it looks good to me. Best Regards, Petr