Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp835930ybl; Tue, 13 Aug 2019 03:27:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJyDnLxMwr9Z0343VUW4JBvwqg5aHqp4b4J+eXmhB0HAq5bjNxF0cJ1nf6r5/AB/Rrocc2 X-Received: by 2002:a17:902:4623:: with SMTP id o32mr36478368pld.112.1565692048709; Tue, 13 Aug 2019 03:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565692048; cv=none; d=google.com; s=arc-20160816; b=pW14756mosgGPcyI5K+8Y54hD0YSnitD4NT/SOlpqYbhdiQiXBbLSxkj57inu7aosd aDqQS2xewSf0o49gXrfouaUopn1jnQ03GGg4s9FhRzmnyPIFLEMDN3KvcDzvxTsTU1QX mlBz/X4j9o5HzgmUNL66Ko65WWXbXI8WWODQ5o9EX3jF6cTWBMddRA4ZHd7Uw//ZeidM 0ktuUvvJuvFuZp1eXn6l0T4FWzU/B/UuXNuT+Pt7t046H69Okie83Q9CjzDIiGcfAlDt zUeOTfdia+D1c0SajxWnGZwqIHK8nZsEeKg6AOD2KNi8IzXSuZKF35jMQPxmUMbpjiLP J1RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=gSsUKvWjzxg/u+NisdUNPHGD/fJ4g59tCqYie3WG7JY=; b=auFK0MAI6kjXI01ErjaZhJBoGI5ilzrRCZW/sr79qKLF63vExgMFNSHStLDaxK9+sp 1jRJpYmIq8YBtqFDbSm11n3A0x8cyNB5sllP6zjheqRwUBrdu1oPT/8ajZ4rUmsAAASg rh6EfDGtw0cNCTN5Pl/iPjIrrBw4dfoe3nBkKcFOMwEwJ/aY/X/dpg6smEJmAL08N82u wi6Hs9hAdSGgwHNU4ATTDCs1rdXTRpLprZqayeX645HS+PgzxmJVyQ/KXZN8L5Rz4wBl NmrVB72JgkmErnZAB6iWOgQIABjRtAEYCQO1f2wHvjXkHXtqMU4gLSXL+7ENaTrPYhUk QKrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22si63486146pli.255.2019.08.13.03.27.13; Tue, 13 Aug 2019 03:27:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728853AbfHMK0Y (ORCPT + 99 others); Tue, 13 Aug 2019 06:26:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:51854 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727416AbfHMK0Y (ORCPT ); Tue, 13 Aug 2019 06:26:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EE3C4ACEC; Tue, 13 Aug 2019 10:26:22 +0000 (UTC) Date: Tue, 13 Aug 2019 12:26:17 +0200 (CEST) From: Miroslav Benes To: Masahiro Yamada cc: Joe Lawrence , Linux Kernel Mailing List , live-patching@vger.kernel.org, Linux Kbuild mailing list Subject: Re: [PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules In-Reply-To: Message-ID: References: <20190509143859.9050-1-joe.lawrence@redhat.com> <20190509143859.9050-7-joe.lawrence@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 Jul 2019, Masahiro Yamada wrote: > Hi Joe, > > > On Thu, May 9, 2019 at 11:39 PM Joe Lawrence wrote: > > > > From: Miroslav Benes > > > > Currently, livepatch infrastructure in the kernel relies on > > MODULE_INFO(livepatch, "Y") statement in a livepatch module. Then the > > kernel module loader knows a module is indeed livepatch module and can > > behave accordingly. > > > > klp-convert, on the other hand relies on LIVEPATCH_* statement in the > > module's Makefile for exactly the same reason. > > > > Remove dependency on modinfo and generate MODULE_INFO flag > > automatically in modpost when LIVEPATCH_* is defined in the module's > > Makefile. Generate a list of all built livepatch modules based on > > the .livepatch file and store it in (MODVERDIR)/livepatchmods. Give > > this list as an argument for modpost which will use it to identify > > livepatch modules. > > > > As MODULE_INFO is no longer needed, remove it. > > > I do not understand this patch. > This makes the implementation so complicated. > > I think MODULE_INFO(livepatch, "Y") is cleaner than > LIVEPATCH_* in Makefile. > > > How about this approach? > > > [1] Make modpost generate the list of livepatch modules. > (livepatch-modules) > > [2] Generate Symbols.list in scripts/Makefile.modpost > (vmlinux + modules excluding livepatch-modules) > > [3] Run klp-convert for modules in livepatch-modules. > > > If you do this, you can remove most of the build system hacks > can't you? > > > I attached an example implementation for [1]. > > Please check whether this works. Yes, it sounds like a better approach. I've never liked LIVEPATCH_* in Makefile much, so I'm all for dropping it. Thanks Miroslav