Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3386979imd; Mon, 29 Oct 2018 06:25:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5fs3BdyyaAo0DmsCn2d9s9xldvduyJ1ldt7/9rHges0CYca3hThyD4c++TdllrRCAx+cD/+ X-Received: by 2002:a62:678a:: with SMTP id t10-v6mr12731741pfj.139.1540819554284; Mon, 29 Oct 2018 06:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540819554; cv=none; d=google.com; s=arc-20160816; b=R3Zplx7329hhk67bcRUH7BfbYUsY5/TUJcGwIoRreK5AtlGpr6vcPwROWsFl5d3sxW uZPJyHMiksjCoB5YkxcpeiZGPJYy9V4jKAWd20lrtq8i6kmlBrHs1s2aLkVG8/N/Y++Y 6CfXm6orwhdO/SHH+nQ3lB4TZkNB0W0v96YiGjsv2CUJ8cfycwdbyLHf4cwSyThJXtyA Sdu+VbxRekK3I4SvkSFINEZNbCY5MAs2u8pGqTztw4VcOZkXMG8WcSSA/qgQx2mYRACc xHJoTrq2IhmU2wDr6GPzbMJ7e50s3izP60jhBc8Ze447uZCCkUc/SMzY/xOo3QeAlFjN oaPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=iHHtMRrv+T6lna77bi0wbB2YdhiyGPOXegbp7dSVcH8=; b=rWeuTaNHoJ67TOi/y03FLDrdyPADhg0adciMI2x/u4ao9Wk0Q2WnHxfYvnFiRWPYXT qd8RfTw5e8tVeOf8TuJ5po87Nh8bdMXTswbYTMQKbqP3VVLHhBFXx8ij/mQ+kmfiR5tL PytgoZo5ovroWCN9jKowD0V+KkIEYZO8Ff4VABBXuLiITITZk/oaYLrLUaLPSf4AaOyr zN59l6YkMvX6gkSUxpV/ImZNI+jt+f4qAGFY0Pm6kTXqRNi2UxWhohHWlEWTVAXrgFDx l/DkjyGP0z1++ThUbLveesEk+Wuc4sNY7Uy6Bt1DUJmw5FyREWJjYxsGA+Xxh9t9yDXX msJA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1-v6si9836692pfb.148.2018.10.29.06.25.38; Mon, 29 Oct 2018 06:25:54 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727284AbeJ2WNA (ORCPT + 99 others); Mon, 29 Oct 2018 18:13:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:35982 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725862AbeJ2WM7 (ORCPT ); Mon, 29 Oct 2018 18:12:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 950EBAE03; Mon, 29 Oct 2018 13:24:17 +0000 (UTC) Date: Mon, 29 Oct 2018 14:24:16 +0100 (CET) From: Miroslav Benes To: Jessica Yu cc: Torsten Duwe , Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , Petr Mladek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v2] arm64/module: use mod->klp_info section header information for livepatch modules In-Reply-To: <20181026172500.g65bl2p7cvey3qsx@linux-8ccs> Message-ID: References: <20181001140910.086E768BC7@newverein.lst.de> <20181001141652.5478C68BE1@newverein.lst.de> <20181023175553.gaobskk26koft6s2@linux-8ccs> <20181026172500.g65bl2p7cvey3qsx@linux-8ccs> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c > index dd23655fda3a..490e56070a7e 100644 > --- a/arch/arm64/kernel/module.c > +++ b/arch/arm64/kernel/module.c > @@ -461,5 +461,15 @@ int module_finalize(const Elf_Ehdr *hdr, > #endif > } > > +#ifdef CONFIG_LIVEPATCH > + /* > + * For livepatching, switch to the saved section header info for .plt > + * stored in mod->klp_info. This is needed so that livepatch is able to > + * call apply_relocate_add() after patch module load. > + */ > + if (is_livepatch_module(me)) > + me->arch.core.plt = me->klp_info->sechdrs + me->arch.core.plt_shndx; > +#endif I missed it before, but the hunk should be under "#ifdef CONFIG_ARM64_MODULE_PLTS" protection similarly to ftrace_trampoline just above. me->arch.core.plt may not exist otherwise. Miroslav