Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3143317imm; Sun, 5 Aug 2018 22:26:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfz3XXBWmmqJjWQMj5yhIcblBcIIcducPzq2XH2z4YCEegUTYs/UPYmyiRo4LchJ+fGDcI8 X-Received: by 2002:a63:6d0a:: with SMTP id i10-v6mr13236344pgc.215.1533533170640; Sun, 05 Aug 2018 22:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533533170; cv=none; d=google.com; s=arc-20160816; b=EjZBch76Iaf/7zfD79zyfk5HZrB+ToHmARbeBdyDl6Q/pzNoE5BBvY94YBZCYeQxVO VTM4ySfPVBZULyLeATXcd8ketRInQAIF33kOkpv0uRgMbRSHcG8E/3x+aPuImLry8GIv zeZIrE2NhmK0+macCaWl1ZTN+mWxBFzwqLpDA++0Fu9KbXVuQnNaBFjcrBhby86G8NTO n3Mq+efPohR2rue5OKk8V0ndEZwNIu/LAVBav1a6wlLtq+ijaWKp192b8q5r2qACeKQt lVQsWMZHqS1HZf/vHHTWM38GzIhkCLOz1C0rfV0+sbVNvSpvSYitwWPbAxMXWdRPBlhM 8jOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :mime-version:references:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=YZOeYqfj7Aqt0kwFyNZeRPzNZpI8LW43SOt78IG9Zhk=; b=pJjoutA2Qnxq34IYEKIm+AYUOAM6FnhM0+UcKbZkJCLSqNfU26ZY6eFbLS2FPoRrpD dc3zqxF+QWC/bPkOJZpT1RPeWd9fKtSpMNeQi9Z4kE+WFDkMqTaNh073oFseNjuDSOEQ M8f0sJt1930tF25QZHMNXMiAxJrwU6f139irJcAwzCPOWUciDpwM5LGznvyWPX2cms+S kKKzZD5wRKeBSuyj4kDbl/2Ha7maPEyteqsvnS1mh/ObWzrXuKcjP+zd4wk/zHu/YPId OoT/VtrZVNG50Yu2ZHIFwv+binZJ4FA6mrh29ry2/7KuF/IQEYFSfKCbJDAk8iOA0GVU xe4A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15-v6si10350212pgf.403.2018.08.05.22.25.55; Sun, 05 Aug 2018 22:26:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727285AbeHFHc2 (ORCPT + 99 others); Mon, 6 Aug 2018 03:32:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47648 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbeHFHc2 (ORCPT ); Mon, 6 Aug 2018 03:32:28 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w765OGsZ002140 for ; Mon, 6 Aug 2018 01:25:05 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kpanj0qwu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Aug 2018 01:25:05 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Aug 2018 06:25:02 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 6 Aug 2018 06:24:57 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w765OuhY16187532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 6 Aug 2018 05:24:56 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 93C6611C054; Mon, 6 Aug 2018 08:25:04 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D320311C04C; Mon, 6 Aug 2018 08:25:03 +0100 (BST) Received: from mschwideX1 (unknown [9.145.57.226]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 6 Aug 2018 08:25:03 +0100 (BST) Date: Mon, 6 Aug 2018 07:24:54 +0200 From: Martin Schwidefsky To: Nick Desaulniers Cc: heiko.carstens@de.ibm.com, Yoshinori Sato , dalias@libc.org, tony.luck@intel.com, fenghua.yu@intel.com, msalter@redhat.com, jacquiot.aurelien@gmail.com, "David S. Miller" , Thomas Gleixner , mingo@redhat.com, Pirama Arumuga Nainar , Greg Hackmann , Mark Salyzyn , LKML , linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-ia64@vger.kernel.org, linux-c6x-dev@linux-c6x.org, sparclinux@vger.kernel.org Subject: Re: Getting the instruction pointer on a per arch basis In-Reply-To: References: <20180801074051.11fa62b3@mschwideX1> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18080605-0012-0000-0000-000002956BD4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080605-0013-0000-0000-000020C770D6 Message-Id: <20180806072454.6efb5973@mschwideX1> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-06_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808060061 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 1 Aug 2018 11:21:13 -0700 Nick Desaulniers wrote: > On Tue, Jul 31, 2018 at 10:41 PM Martin Schwidefsky > wrote: > > > > On Tue, 31 Jul 2018 16:09:06 -0700 > > Nick Desaulniers wrote: > > > > > + More maintainers and lists for visibility > > > > > > On Tue, Jul 31, 2018 at 3:32 PM Nick Desaulniers > > > wrote: > > > > > > > > I'm currently looking into cleaning up the code duplication between > > > > current_text_addr() and _THIS_IP_, virtually every implementation of > > > > current_text_addr() and _THIS_IP_ itself are basically: > > > > > > > > #define _THIS_IP_ ({ __label__ _l; _l: &&_l; }) > > > > > > > > For a few arch's, they have inline assembly instead (for > > > > current_text_addr()). Examples: > > > > * s390 > > > > * sh > > > > * ia64 > > > > * x86 (um and 32b) > > > > * c6x > > > > * sparc > > > > > > > > I have a patch that cuts down on the duplication, but I don't > > > > understand why the few arch specific implementations are necessary. I > > > > could reduce the duplication further if it's ok to just use the > > > > statement expression. > > > > > > > > Does anyone know why this is the case? > > > > For s390 it is just that we did not know about the label trick when we > > introduced the define. The inline has an advantage though, the code > > generated with the label trick is using a LARL instruction which is > > 4 bytes, the inline assembly uses a BASR which is 2 bytes. > > > > If I use the label method in current_text_addr() the size of vmlinux > > increases by a small amount: > > > > add/remove: 33/13 grow/shrink: 101/48 up/down: 11941/-8887 (3054) > > Thanks for the measurements. Was this output produced by a utility? Yes, ./scripts/bloat-o-meter > > This is acceptable though, I would not mind if _THIS_IP_ and > > current_text_addr use a common definition using labels. > > Thank you for this feedback Martin, I appreciate it. Patches soon. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.