Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753743AbbKLUc0 (ORCPT ); Thu, 12 Nov 2015 15:32:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58346 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752650AbbKLUcX (ORCPT ); Thu, 12 Nov 2015 15:32:23 -0500 Date: Thu, 12 Nov 2015 14:32:21 -0600 From: Josh Poimboeuf To: Jessica Yu Cc: Miroslav Benes , 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 Message-ID: <20151112203221.GM4038@treble.hsd1.ky.comcast.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151112202243.GC5841@packer-debian-8-amd64.digitalocean.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1273 Lines: 27 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. 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(). -- Josh -- 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/