Received: by 10.192.165.156 with SMTP id m28csp1073943imm; Wed, 11 Apr 2018 11:57:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx48e1yb2Q0rj3H3Tq5gIgGCAfdtNhs2IIJ1ESPWYbIcli/AEXCU2TqfUGsWG1O+4ltrAne5+ X-Received: by 2002:a17:902:43a4:: with SMTP id j33-v6mr6458673pld.260.1523473026973; Wed, 11 Apr 2018 11:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523473026; cv=none; d=google.com; s=arc-20160816; b=cKw/mAbc9OJJ6FCID2hAyLgB4zSlPe2c5qZlDDMMhgFlWobwuZ6yjas+Kum7IJ/Kjc FfwXj7L+2IVzdy5nvrQafRQFNTOJHMp+ekX+mMCD+/wbl52mFdqlP8ygWctz2RmAYy+t C1ZkLnLheSQhxU9nKz6DeDX5vLxijzEPNKB4js4py2mTS29HABkJUyTqPko3PrG9BQBL YK6hzNMeYmxBsuyC21GKRT7UlFRqc28sldUsw1bgwcQ0+JVVWpSUmd3RQBD0ijP4alkd 9We14CF1AfET6FBYQ6j2t8deio4cuAQeOFg2Cgz/q7JWTbLt23p47RiV98IoSbl9pmCw 2QXg== 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=vVaB6iEOWtGearkxD6y0pvrDBH+UXrW7qyNmjsCZeKE=; b=ON2F3Hd+rd378FAfKWDH5evkL0/gK1w3BLnNcycidAHQilXClFuuNDBrcodZ/4pcN+ WoxRoX6O6UcoGucovDPe3Pj7gGZjr57aWIO9BGGy5u35dAR+oONQG81lRbdOHXIeM0a+ pxpwH82ov1dXmx3dATPFQBmVq365mjGYz5HwUZqqQsRtpnhrJ7q87T8bJLe7tlHfRKRP E0SWgDt9WP+Sb1PssrtT7SKkqaJUWVLYpaS8db2xXpkEQyFUrGQxSTmavOMYD/tILb0W n8n6V2PM6/HPtMI4y61NnjL/in9rl66DZm4DtjCvYlUS194+bMdmGXdO0ODMpmoPV6Ra 2rUw== 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 t137si1108663pgb.288.2018.04.11.11.56.30; Wed, 11 Apr 2018 11:57:06 -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 S933283AbeDKSxa (ORCPT + 99 others); Wed, 11 Apr 2018 14:53:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33790 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932401AbeDKSx1 (ORCPT ); Wed, 11 Apr 2018 14:53:27 -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 F3182E70; Wed, 11 Apr 2018 18:53:26 +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.9 023/310] s390: move _text symbol to address higher than zero Date: Wed, 11 Apr 2018 20:32:42 +0200 Message-Id: <20180411183623.292064200@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-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 @@ -31,8 +31,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 CPUIDLE_TEXT