Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754816AbbKMNvf (ORCPT ); Fri, 13 Nov 2015 08:51:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:52319 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754691AbbKMNv1 (ORCPT ); Fri, 13 Nov 2015 08:51:27 -0500 Date: Fri, 13 Nov 2015 14:51:27 +0100 (CET) From: Miroslav Benes To: Josh Poimboeuf cc: Jessica Yu , Rusty Russell , Seth Jennings , Jiri Kosina , Vojtech Pavlik , linux-api@vger.kernel.org, live-patching@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: livepatch: reuse module loader code to write relocations In-Reply-To: <20151112203221.GM4038@treble.hsd1.ky.comcast.net> Message-ID: References: <1447130755-17383-1-git-send-email-jeyu@redhat.com> <1447130755-17383-4-git-send-email-jeyu@redhat.com> <20151111200732.GB30025@packer-debian-8-amd64.digitalocean.com> <20151112174032.GG4038@treble.hsd1.ky.comcast.net> <20151112202243.GC5841@packer-debian-8-amd64.digitalocean.com> <20151112203221.GM4038@treble.hsd1.ky.comcast.net> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1603 Lines: 35 On Thu, 12 Nov 2015, Josh Poimboeuf wrote: > On Thu, Nov 12, 2015 at 03:22:44PM -0500, Jessica Yu wrote: > > Looking into this more, I think we do need one __klp_rela section per > > function being patched. Each rela section is linked to the section to > > which the relocations apply via the rela section's sh_info field. In > > SHT_RELA sections, the sh_info field contains the section index to > > which the relocs apply. We cannot have one single combined rela > > section per object as the call to apply_relocate_add() simply won't > > work, because we would have relocs that apply to different functions > > (and hence different sections). > > > > So I guess instead of a single field in klp_object specifying the > > __klp_rela section index, we could probably just have an array of > > section indices. > > Ok, makes sense, sounds like we need multiple klp relas per object. Ok, it seems so. > I still don't quite understand the benefit of caching the klp_rela > section indices. What problem does it solve? It seems simpler to just > iterate over all the sections in klp_write_object_relocations(). It was just my need to be efficient and I think it would have made sense with only one dynrela section per object. An array of indices is "ugly" so I am all for iteration over all the sections in klp_write_object_relocations(). Miroslav -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/