Received: by 10.192.165.156 with SMTP id m28csp1203503imm; Wed, 11 Apr 2018 14:30:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48J8rOsS4hHGhiCXV+n2D/8ouoyYs57yJAtIiAMbQdHwGnI/mZfOAXEyjhiHNLu6FMzdnED X-Received: by 10.101.102.142 with SMTP id b14mr4724335pgw.52.1523482233577; Wed, 11 Apr 2018 14:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523482233; cv=none; d=google.com; s=arc-20160816; b=Spd1VCQteDXE8xdy5AP8xJPtJ/verYAUkl0S05EiBAV+h1aK0BmvPxgo9Sq10Wm/zR r3F+IRvICv0jfFBs2i0GaUmMRZG9893guoAVpTYwGpPu1efka8I3wSW5CPXPvdNgG1gR b9ZL6sHO6VH9shgihVDspK4onYkclmE/vkyXG3eWSIZLdbnnNg2wT2v9XGXiu9USkWWP vw1hEgPSrJxKHgPTmlt8dTbxkB3ThqhX9QKjx4k7gZ0QYy0NtHv6QORs/gA5TJ2UZlzM rt/hUxmomdORQ2QaqiXmIT57ckH09vTS1CfMaJXOISZQQ7Bubhg+k4k/st9Jf/q/T+lu tSJA== 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=99ApMIKj2iYEmLhBrBlGxG3ptu+bfD6JWwXKDT8MefI=; b=CIJiRSAcq7jvTAsKeDc9CInppKdHLjqFmmBnYjMvGlPBQMcHf5ukvravUz5vsSVe+z JByNz/UBY8Tn9TeyibZCox9AJon/Yo7I9k/cUQRoO7qlLON25Q4wcyf6TGntq4AzOxeW +b4fhJD75q+PBLtmoL0r4ZuFpkxWo1xSelx6mjOiflOjeLzY+rmHGCznROTh7BTBWDm9 ZN1euNAtm1X2iIleFxMlkSpSB4GLBmlUpd02comTmOB4++pyzRLQJ6JohzCGLquQj7Md cQuImxc2DV7LHjrlsOaIsJdb/nwN02w140FF5ceRSnX4767fF/BYikivYYtgqsA+Bg4T EO/Q== 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 t23si1396707pfg.387.2018.04.11.14.29.55; Wed, 11 Apr 2018 14:30:33 -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 S1754092AbeDKSi0 (ORCPT + 99 others); Wed, 11 Apr 2018 14:38:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55340 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754050AbeDKSiW (ORCPT ); Wed, 11 Apr 2018 14:38:22 -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 B428BE91; Wed, 11 Apr 2018 18:38:21 +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 3.18 010/121] s390: move _text symbol to address higher than zero Date: Wed, 11 Apr 2018 20:35:13 +0200 Message-Id: <20180411183456.845765616@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183456.195010921@linuxfoundation.org> References: <20180411183456.195010921@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 3.18-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 @@ -28,8 +28,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