Received: by 10.192.165.156 with SMTP id m28csp1180874imm; Wed, 11 Apr 2018 14:02:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/z2i+aALDoJ4MOGsXaqf3C2arBelJEk6/uR1ZzJ4Y4eNk+vuKw3DJE8kpgGYVNOaEa1vai X-Received: by 10.99.117.93 with SMTP id f29mr4489203pgn.197.1523480537405; Wed, 11 Apr 2018 14:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523480537; cv=none; d=google.com; s=arc-20160816; b=SOvlp7tt34/jqx546nJJg4ouDqyGKoAxOiE12QBbGRntbfMrcm2v6vB+Z70UFnLxex TtLvLLCB0zlDRgJ0OAvDFwU0J8QNdBLKcu46e8U85xq8WkMX63lGrLFuXWvZfo2ZJDen 0mpENLDp1vtleKFC8WP3KoCYnBWdJctS/UkaSfjKB/hZurlM1/ZrgSt60ljYPVWWDfHZ 9zAJ+QmH/Jx941w9tvumXfckqulYXj4oes8LgP7/uzVy1nQfq47lC1ZsYOhAilKTfaaI HbsAlqaYO/G1NnKKDCXn1SsrXbhUXXuvxgL3WVMeTTdenKyrysYMa+id5LRih4W5F20i Z1Qw== 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 :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hdXQY8ww96WCd7Xir/6cpSAHqtGcCsxRMJCN2Iq1ddQ=; b=Q0eBJsNTsjhHplxw6fu7C+niUPIklcwWyz/bMECw52od7qXN5lc3ki9INCYHIBU7CJ ONbSbiY8HH80shSXBwvg7vAcpHF8hoLwjMYhDlzEn1QTeyp85vJLvQf3dOlFuFtDUETp 46KHDuiy4UyezdjCGRCO1OgGu5Dw9f3SzyKGbLWEhGht1GHkUDFsqaxpJRXa9X9oK6OC wBzNq9FEpsEJEw+RtaTLGEzk2ZJc9ZilMk0+v5Ek5erFsKG+9oSBhzkS4IAi08lEkeSL /NGYGln3bCrE+jEOJOcWsI/oiU+QJBiizzRg4Qe9J9Qwwnlfp9B0hQd/rh6uSC7JPTRd 5wMA== 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 d1-v6si1874789plr.410.2018.04.11.14.01.31; Wed, 11 Apr 2018 14:02:17 -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 S1755553AbeDKU6z (ORCPT + 99 others); Wed, 11 Apr 2018 16:58:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57822 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932154AbeDKSoE (ORCPT ); Wed, 11 Apr 2018 14:44:04 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 52B6DE61; Wed, 11 Apr 2018 18:44:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zvonko Kosic , Heiko Carstens , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.4 017/190] s390: move _text symbol to address higher than zero Date: Wed, 11 Apr 2018 20:34:23 +0200 Message-Id: <20180411183551.083889059@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiko Carstens [ Upstream commit d04a4c76f71dd5335f8e499b59617382d84e2b8d ] The perf tool assumes that kernel symbols are never present at address zero. In fact it assumes if functions that map symbols to addresses return zero, that the symbol was not found. Given that s390's _text symbol historically is located at address zero this yields at least a couple of false errors and warnings in one of perf's test cases about not present symbols ("perf test 1"). To fix this simply move the _text symbol to address 0x200, just behind the initial psw and channel program located at the beginning of the kernel image. This is now hard coded within the linker script. I tried a nicer solution which moves the initial psw and channel program into an own section. However that would move the symbols within the "real" head.text section to different addresses, since the ".org" statements within head.S are relative to the head.text section. If there is a new section in front, everything else will be moved. Alternatively I could have adjusted all ".org" statements. But this current solution seems to be the easiest one, since nobody really cares where the _text symbol is actually located. Reported-by: Zvonko Kosic Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/vmlinux.lds.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -21,8 +21,14 @@ SECTIONS { . = 0x00000000; .text : { - _text = .; /* Text and read-only data */ + /* Text and read-only data */ HEAD_TEXT + /* + * E.g. perf doesn't like symbols starting at address zero, + * therefore skip the initial PSW and channel program located + * at address zero and let _text start at 0x200. + */ + _text = 0x200; TEXT_TEXT SCHED_TEXT LOCK_TEXT