Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752208AbdLLLji (ORCPT ); Tue, 12 Dec 2017 06:39:38 -0500 Received: from ozlabs.org ([103.22.144.67]:45753 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbdLLLj2 (ORCPT ); Tue, 12 Dec 2017 06:39:28 -0500 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: a443bf6e8a7674b86221f4922cae82d67dc9e8ad In-Reply-To: <20171114092910.20399-2-kamalesh@linux.vnet.ibm.com> To: Kamalesh Babulal From: Michael Ellerman Cc: Aravinda Prasad , Jessica Yu , linux-kernel@vger.kernel.org, Kamalesh Babulal , Torsten Duwe , Josh Poimboeuf , live-patching@vger.kernel.org, "Naveen N . Rao" , linuxppc-dev@lists.ozlabs.org Subject: Re: [v4, 1/3] kernel/modules: Add REL24 relocation support of livepatch symbols Message-Id: <3ywyXZ6nm7z9t2f@ozlabs.org> Date: Tue, 12 Dec 2017 22:39:26 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1386 Lines: 32 On Tue, 2017-11-14 at 09:29:08 UTC, Kamalesh Babulal wrote: > Livepatch re-uses module loader function apply_relocate_add() to write > relocations, instead of managing them by arch-dependent > klp_write_module_reloc() function. > > apply_relocate_add() doesn't understand livepatch symbols (marked with > SHN_LIVEPATCH symbol section index) and assumes them to be local symbols > by default for R_PPC64_REL24 relocation type. It fails with an error, > when trying to calculate offset with local_entry_offset(): > > module_64: kpatch_meminfo: REL24 -1152921504897399800 out of range! > > Whereas livepatch symbols are essentially SHN_UNDEF, should be > called via stub used for global calls. This issue can be fixed by > teaching apply_relocate_add() to handle both SHN_UNDEF/SHN_LIVEPATCH > symbols via the same stub. This patch extends SHN_UNDEF code to handle > livepatch symbols too. > > Signed-off-by: Kamalesh Babulal > CC: Balbir Singh > Cc: Naveen N. Rao > Cc: Josh Poimboeuf > Cc: Jessica Yu > Cc: Ananth N Mavinakayanahalli > Cc: Aravinda Prasad > Cc: Torsten Duwe Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/a443bf6e8a7674b86221f4922cae82 cheers