Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1018625pxb; Wed, 1 Sep 2021 15:26:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgg+j1W7SXjq+1iVZJq5IE7puzinyg4yAFrGhIiotnYGcHvAUIql3ed3b9eYipLM8HWikv X-Received: by 2002:a6b:8e87:: with SMTP id q129mr93148iod.176.1630535201171; Wed, 01 Sep 2021 15:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630535201; cv=none; d=google.com; s=arc-20160816; b=WXNowd+V4Zx5+d55YEcRxh/fYJh5LMtqO+jbM9TghgNIFPoo/R4ADJ3/SPNuxCH3ki ETVPlBKpxLsr6p1znYgf06PZBLK0K9nzhzq87i43vRILkou8vxs0+pAO4gef5nDTmTZw Bw2SKirACSJc5pLMlyuVxwHumizcnX0IsGlFfPjIniCWEY/nLL7USTQsPBt7SGfBZyvo A+0H6oCSMIGbAQCM2AA2T2psVUtnYdaxg9sWIJIkopz1qmpAm54yqi/HvG7IcLSjSFeA DKUD2GFO8F8Bi/UmcF3OhPIk+vavBFkozj96ttmdP2FdCeeM+xzBKQ4CY0+es0HvPgS3 0mnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wkYjLWX8rXhdvLuWE8NESy6EQAHoacFiv3Ea4fPekEs=; b=a8ikoJ8U8PM3FUSq7e4i+Q5Y5lWa7dMVOYrveMqu3PW9wPEvkoyQ/WMVClG4H+eHSJ HCNOO/gguclvL+8/z5J7z4CkqB9DtblGpWyAlB01pWQrcDHT5AYWrX1GmFz+9OzOK1Pg 7aAZBV890I5BN9tKe0cBrpjnVSo+lEYEsgWfWtMlPxIFFsYqfAxZOWyFV3808TdDc2xg eM5NyVdR7UwKw8F8emEoritnzddmZ7v8I+KChCVHg+oth+Q8FFemVJBfm+hFYAJVrdy7 n5YcmDKejk4DqjkAGiVHYNsOJQ+WycTb9pfZ2UdhxTAz5tX/RG9zDMJ4eM1l29TeoFiK cJ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=FYfcFWnL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e11si80965ili.46.2021.09.01.15.26.27; Wed, 01 Sep 2021 15:26:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=FYfcFWnL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346776AbhIASIx (ORCPT + 99 others); Wed, 1 Sep 2021 14:08:53 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38878 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346742AbhIASIw (ORCPT ); Wed, 1 Sep 2021 14:08:52 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 181I3qek107666; Wed, 1 Sep 2021 14:07:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=wkYjLWX8rXhdvLuWE8NESy6EQAHoacFiv3Ea4fPekEs=; b=FYfcFWnLbiqRtoym4DYsZfiQ5vIgw1t7zPfi0ve2ESNWQGnlC+9BX/4ObAaKDVFk8qQy GIBCgT3+bEbvrjKpTyB7IryNsCp6nzD63m5on25qFQNtnv63wDkb83SHfTrB2OSbbV2O EvqJnzxU18j28uosxA+WixgVK2npV22TDz039cMPIdY809ixlUK7lPdnY6tI97kkLbeT JZMDNIucejtBkUker5bsm6UD7oIcHLNClVQpVauOUP4i2QlKz+1OVyF5kGYWaIk0nlSy 1wMK+jcSI6B+Ub7b6BdidWOWA/Rc0Qv/jCgMlnLY7oMNmKG5uWsFOm4t4e9g5dLYJGbV cw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ateffr40f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Sep 2021 14:07:46 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 181I7jjR131768; Wed, 1 Sep 2021 14:07:45 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ateffr3yk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Sep 2021 14:07:45 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 181I3gsm012145; Wed, 1 Sep 2021 18:07:43 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma01fra.de.ibm.com with ESMTP id 3atdxs8bf4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Sep 2021 18:07:43 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 181I7di654919586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Sep 2021 18:07:39 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 000D0AE058; Wed, 1 Sep 2021 18:07:38 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 947A2AE051; Wed, 1 Sep 2021 18:07:38 +0000 (GMT) Received: from osiris (unknown [9.145.33.173]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 1 Sep 2021 18:07:38 +0000 (GMT) Date: Wed, 1 Sep 2021 20:07:37 +0200 From: Heiko Carstens To: Marco Elver Cc: Vasily Gorbik , Christian Borntraeger , Nathan Chancellor , Linus Torvalds , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, qemu-s390x Subject: Re: [PATCH] s390/unwind: use current_frame_address() to unwind current task Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: v-npZZ7suGUKNXWT00l8P8Pk2Mur_NlB X-Proofpoint-GUID: t0sPbzVL_w0oFUWrkLU-SJAVzDU4tuoo X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-09-01_05:2021-09-01,2021-09-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 malwarescore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2108310000 definitions=main-2109010104 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01, 2021 at 07:51:06PM +0200, Marco Elver wrote: > On Wed, 1 Sept 2021 at 16:06, Vasily Gorbik wrote: > > current_stack_pointer() simply returns current value of %r15. If > > current_stack_pointer() caller allocates stack (which is the case in > > unwind code) %r15 points to a stack frame allocated for callees, meaning > > current_stack_pointer() caller (e.g. stack_trace_save) will end up in > > the stacktrace. This is not expected by stack_trace_save*() callers and > > causes problems. > > > > current_frame_address() on the other hand returns function stack frame > > address, which matches %r15 upon function invocation. Using it in > > get_stack_pointer() makes it more aligned with x86 implementation > > (according to BACKTRACE_SELF_TEST output) and meets stack_trace_save*() > > caller's expectations, notably KCSAN. > > > > Also make sure unwind_start is always inlined. > > > > Reported-by: Nathan Chancellor > > Suggested-by: Marco Elver > > Signed-off-by: Vasily Gorbik > > Tested-by: Marco Elver > > Thanks! > > > --- > > arch/s390/include/asm/stacktrace.h | 20 ++++++++++---------- > > arch/s390/include/asm/unwind.h | 8 ++++---- > > 2 files changed, 14 insertions(+), 14 deletions(-) Applied, thanks!