Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1457940yba; Wed, 24 Apr 2019 23:26:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyn1i1v29fGTGbnqpXFa6C4scyYeEfSvvyfwX2MstRQdKJA5pbDWn6EcnScuPrgcv/wfIHH X-Received: by 2002:a63:3287:: with SMTP id y129mr35987003pgy.9.1556173604455; Wed, 24 Apr 2019 23:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556173604; cv=none; d=google.com; s=arc-20160816; b=rC4359dxP4JT3RjeCqVL0TRzAKjRaBiYYNOu4ZiwNgUezzE8mPV35thBCkpgbYfxGI tZTgQXUetS2HOo/C6gSa51Q6K/a1GT3IL1GjidKEUKp3JLlWC1XR6aUwQ/d9l2xV3Lzx K7I1uTPVDkn5B75Mzxp+nRywPEuhGe/51tCWJUtovgMbEKcYuE0bb7MVdNTlGjSqVQ4I m4cbrloJaT4sgZuqtje0zm6EgtT0rMqXbxpDfkthYPT+DdpVd6HI50fGdF1zdf5LdoLA VzcyqX1g1OvqZdZfvcp6ndMbHTwa4vP19KTNH7HMj4NJGKVs5zt0odxKIBxv+4DGKM/8 dPFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0xszdwoV2c7jh549wPDgO9Vh6xMZZD2lb44iRBDkni0=; b=T96ztI2AbeN1SVTgXoBMl8jc2B7sYlIJzo+pMG5oCj2yAbA4fp3cLsmtocK/4QJA0m piIUTsf6uZK5S20OONHIvQ5k26SQeuB2NpWG5aLk+OB8eqstg7z0S/My10WeR0px1or1 ABpeiLypZUvbL5/5p6w+uOTHw7aAqymh/jNQ0VGKOpmtEISfySKmCBrRietpAH6uhLoT wnLyV8yvwMi/A3mDkT/A5khCSp6d329SkZfwH8QObPZq+4qTllykq/HJNzIzCAPm49AU IboVCGmbGjac9ywFwLZHr88WQuRRqtmHYfPfLbmg6FjU/vipmvDGe61LqavnRPKbtvmA ChVQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34si21670248plf.288.2019.04.24.23.26.29; Wed, 24 Apr 2019 23:26:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730574AbfDXTXm (ORCPT + 99 others); Wed, 24 Apr 2019 15:23:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51284 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbfDXTXl (ORCPT ); Wed, 24 Apr 2019 15:23:41 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63B513001A9E; Wed, 24 Apr 2019 19:23:41 +0000 (UTC) Received: from treble (ovpn-123-99.rdu2.redhat.com [10.10.123.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D60FE1797A; Wed, 24 Apr 2019 19:23:36 +0000 (UTC) Date: Wed, 24 Apr 2019 14:23:34 -0500 From: Josh Poimboeuf To: Joao Moreira Cc: Miroslav Benes , Joe Lawrence , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org, Jessica Yu , Jiri Kosina , Konstantin Khlebnikov , Masahiro Yamada , Michael Matz , Nicolai Stange , Petr Mladek Subject: Re: [PATCH v3 0/9] klp-convert livepatch build tooling Message-ID: <20190424192334.pdtbzpuz2dclsxsg@treble> References: <20190410155058.9437-1-joe.lawrence@redhat.com> <20190417201316.GA690@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 24 Apr 2019 19:23:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 24, 2019 at 04:13:59PM -0300, Joao Moreira wrote: > > > Future Work > > > ----------- > > > > > > I don't see an easy way to support multiple homonym > > > symbols with unique values in the current livepatch module > > > Elf format. The only solutions that come to mind right now include > > > renaming homonym symbols somehow to retain the relocation->symbol > > > relationship when separate object files are combined. Perhaps an > > > intermediate linker step could make annotated symbols unique in some way > > > to achieve this. /thinking out loud > > > > I'd set this aside for now and we can return to it later. I think it could > > be quite rare in practice. > > > > I was thinking about renaming the symbol too. We can extend the symbol > > naming convention we have now and deal with it in klp_resolve_symbols(), > > but maybe Josh will come up with something clever and cleaner. > > I think this could work well, but (sorry if I understood Joe's idea wrongly) > not as a linker step. Instead of modifying the linker, I think we could > create another tool and plug it into the kbuild pipeline prior to the > livepatch module linking. This way, we would parse the .o elf files, check > for homonyms and rename them based on a convention that is later understood > by klp-convert, as suggested. > > If I am not missing something, this would fix the case where we have > homonyms pointing to the same or different positions, without additional > user intervention other then adding the SYMPOS annotations. > > If you consider this to be useful I can start experiencing. I tend to agree with Miroslav that it's probably ok to ignore this issue for now, as long as klp-convert can detect it and spit out an error. I assume the patch author could work around it with a kallsyms hack. If we encounter it much in the real world then we could figure out a solution at that point. -- Josh