Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp841044imj; Fri, 15 Feb 2019 07:41:07 -0800 (PST) X-Google-Smtp-Source: AHgI3IaXTsg9+Dosali+DPbrkUGy0VVjUS0EEcHKYJ3MGP53B4P1kc7uvXnZ5hnS3vWT6s1CNBrp X-Received: by 2002:a63:e451:: with SMTP id i17mr9738955pgk.413.1550245267059; Fri, 15 Feb 2019 07:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550245267; cv=none; d=google.com; s=arc-20160816; b=BtvRLcIwj/hQfFFE6/HhHRCnOPZLaxNm4ZTdbSyo2qmX5+nIbQlsjNwMcEVQmU5l2W 5ZlHBE9GbrY2X6Z6j19nBE/cS9hCJXG0AL6V0LM6XO+wbb5hw/MxIiTyjLmB6g+OynW3 z4G8rfiCpf5jqau82CpJP2YZgbcRo/N7FEJRVdoK9LUl8FnMWw/YnvJe7ebU2FKwwPjj CXnNcy5H7iOQ3TefV1d2ft5My2+CYziJVRanMDrjY5vUugUI5Z5hy20wzemwsqyM7xOm L97DUjMwtILW8ub7XmNh2Xg+oAgcNjjPTsu/Mtk5mJzft6fOtApks4zqSQ2NMm5YJWz5 KF1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3e+QONZMBAuj1wOzUioJOjA3FFSTfKVn8CPzZWr0lFQ=; b=X80rz4xDsEvRsWCXZrUTE83Gar3ZTbShXyXagZOVrST9GYWxVgIy5ac7bq1Qasb/HK N05e9+XguqPz4qZgUJ5uUax7HzHxhvxq0eN9D0Ot2iHVU7EPQi52VMJpl90JwwreKNgr P2Bt6ZKIOOKOaEUW+qSSVImHCZcLTcE64B4QNE8EGY1Anz15kHm6BZpibsa2jKEkhk94 9ikwdUYoupRvP+Q89ZP/ZIAcmPwte0VfkJihbuYMQ/xPc6GA4f3fYYBs/5tyelAleIHJ 7Xo3VxTqxWwY5UMCnehDmj4fdM3hiyfvsd7LdFSiDrbmeUXwqqXCmXlLRTPwTM+Sqk+b 98rg== 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 m2si5269614pgq.424.2019.02.15.07.40.50; Fri, 15 Feb 2019 07:41:07 -0800 (PST) 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 S2391998AbfBOJGA (ORCPT + 99 others); Fri, 15 Feb 2019 04:06:00 -0500 Received: from mx2.suse.de ([195.135.220.15]:37662 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387491AbfBOJF7 (ORCPT ); Fri, 15 Feb 2019 04:05:59 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 49F21ABAC; Fri, 15 Feb 2019 09:05:58 +0000 (UTC) Date: Fri, 15 Feb 2019 10:05:56 +0100 From: Petr Mladek To: "chenzefeng (A)" Cc: Jiri Kosina , "hjl.tools@gmail.com" , "jpoimboe@redhat.com" , "sjenning@redhat.com" , "vojtech@suse.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "gregkh@linuxfoundation.org" , "x86@kernel.org" , "live-patching@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: =?utf-8?B?562U5aSNOiBbUEFUQ0g=?= =?utf-8?Q?=5D?= x86: livepatch: Treat R_X86_64_PLT32 as R_X86_64_PC32 Message-ID: <20190215090556.teicmayhnbxjhw7n@pathway.suse.cz> References: <79A62BFA453EFB42B7A4E40AD8F3A2264F2A872D@DGGEMA503-MBX.china.huawei.com> <79A62BFA453EFB42B7A4E40AD8F3A2264F2A889B@DGGEMA503-MBX.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79A62BFA453EFB42B7A4E40AD8F3A2264F2A889B@DGGEMA503-MBX.china.huawei.com> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2019-02-15 08:17:36, chenzefeng (A) wrote: > HI, Jiri Kosina, > > On Fri, 15 Feb 2019, Jiri Kosina wrote: > >On Fri, 15 Feb 2019, chenzefeng (A) wrote: > > >> On x86-64, for 32-bit PC-relacive branches, we can generate PLT32 > >> relocation, instead of PC32 relocation. and R_X86_64_PLT32 can be > >> treated the same as R_X86_64_PC32 since linux kernel doesn't use PLT. > >> > >> In linux 4.4 commit b21ebf2fb4cd ("x86: Treat R_X86_64_PLT32 as > >> R_X86_64_PC32") been fixed for the module loading, but not fixed for > >> livepatch relocation, which will fail to load livepatch with the error > >> message as follow: relocation failed for symbol at > >> >> address> > >> > >> Signed-off-by: chenzefeng > > >What kernel version is this patch based on? We've got rid of x86-specific module loading stub and offloaded all the relocation handling to generic kmod loader long time ago. The livepatch-specific code has been removed in v4.7, see the commit 425595a7fc2096ab46c ("livepatch: reuse module loader code to write relocations"). > The patch is based on kernel version Linux 4.4.174. The patch would make sense only for 4.4 stable kernel and it looks fine for this purpose. Please, send the patch to stable@vger.kernel.org if Greg misses it in this thread. Best Regards, Petr