From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751304AbdAQNxR (ORCPT ); Tue, 17 Jan 2017 08:53:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:37665 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbdAQNxP (ORCPT ); Tue, 17 Jan 2017 08:53:15 -0500 Date: Tue, 17 Jan 2017 14:53:06 +0100 (CET) From: Miroslav Benes To: Jessica Yu cc: Abel Vesa , linux@armlinux.org.uk, jpoimboe@redhat.com, jikos@kernel.org, pmladek@suse.com, rostedt@goodmis.org, mingo@redhat.com, gregkh@linuxfoundation.org, geert+renesas@glider.be, davem@davemloft.net, akpm@linux-foundation.org, emil.l.velikov@gmail.com, mchehab@kernel.org, linux@roeck-us.net, ard.biesheuvel@linaro.org, jens.wiklander@linaro.org, jean-philippe.brucker@arm.com, viro@zeniv.linux.org.uk, stefano.stabellini@eu.citrix.com, chris.brandt@renesas.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org Subject: Re: arm: Add livepatch arch specific code In-Reply-To: <20170117002239.GF9045@packer-debian-8-amd64.digitalocean.com> Message-ID: References: <1481043967-15602-1-git-send-email-abelvesa@linux.com> <1481043967-15602-2-git-send-email-abelvesa@linux.com> <20170117002239.GF9045@packer-debian-8-amd64.digitalocean.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) 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 > > But apply_relocate_add() is not implemented on arm yet. I guess it would > > nice to have it... otherwise we could get to an unpleasant situation. > > Livepatch module can rely on its livepatching relocations (that is, there > > are some). apply_relocate_add() returns 0 on arm, so everything seems to > > be nice and then boom some time later. > > Doesn't it return -ENOEXEC? MODULES_USE_ELF_RELA is not defined > on arm, I think (see moduleloader.h). You're right. It confused me too. > > The question is what happens with normal modules. There are no SHT_RELA > > records probably. > > For arm, I think there are only SHT_REL relocation sections > (MODULES_USE_ELF_REL is set instead of MODULES_USE_ELF_RELA), so > during apply_relocations() in load_module(), only apply_relocate() > should be called, and not apply_relocate_add(). True. > Hm, I guess that means if we want livepatch support for the > architectures that don't support RELA relocations, we would have to > check if the section is SHT_REL or SHT_RELA before calling the right > apply_relocate* function. Agreed. Miroslav