Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp448420imm; Tue, 31 Jul 2018 22:42:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdF1TevS8Al2IhUbjLWYik2Olzk85N0RXetNCMKxI8IwcS+wm7vVPGt3igL3bGTvSdoTAhz X-Received: by 2002:a63:2106:: with SMTP id h6-v6mr23240431pgh.161.1533102161173; Tue, 31 Jul 2018 22:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533102161; cv=none; d=google.com; s=arc-20160816; b=XYLKETxSO81Xx5ploZgNANkgHrQRMehQ4C+P98eMlepra+gtIANdnO2xnbAJCsfmV9 zy89/pbA1oAItDsw5TLuYsxpTRinYmd/uLdu1veSQPnLcL28keKjSyR4uWB7/KA0GrcK kXvo1QpJPjW6x6ORbvk4JEu4sSnaviJQHjCMDO4V5aJ+6jbzO1q+tCNRVhHfFyqTy6e4 KHSPq3yNFjByXJCzY+/1QQuLBWabV7X/CNTeowB2BoythLxDiFbrWt0E5mCzeyhiiDXn JyC7XXYdyzh24YZthT+5beNcyY7MdUZIfZD8asKDkMnYElMEdcgnOvMBsMBqxTAsEBql LIrw== 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=3nCbff9ql4pW1nTJZSWaQ+KyfBVgohhpiol7TGBkO6Q=; b=AL+pju9S5NVY8WlRBOV0c4gbLBeeMC22rm1SdposOIInYwzD8Fxnl6+ZZzRd28Q0Yc JFSX1c+JGpR+hUMjqYe460q7KEktG052SjDFP1un0IL7RWmQlvtoEMgWhywKQB4hCd2p dWyKsmfJpty3ysElR2SjrReV075OJReYTXKYsNKyDia9gSwEyZq0UUOcutGMh5LMyRiQ o/uYY9sPq7LK6ZWUf5XMwjbHO+J2kLqaMU7NifavQGTbK97D6Akov1sYMZn5vDeHMOrM /0Q+pxeU/bSS4mcIo0pu7TZsnYsML/Gag6ygkRIMR3KhEQedrIKgV26ZUNwJpO4FHjiK APGg== 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 n16-v6si15714321pgl.596.2018.07.31.22.42.26; Tue, 31 Jul 2018 22:42:41 -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 S1733171AbeHAHYy (ORCPT + 99 others); Wed, 1 Aug 2018 03:24:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59248 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733089AbeHAHYx (ORCPT ); Wed, 1 Aug 2018 03:24:53 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w715dHFR023700 for ; Wed, 1 Aug 2018 01:41:03 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kk6c714cb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Aug 2018 01:41:02 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Aug 2018 06:41:00 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 1 Aug 2018 06:40:54 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w715erL842598422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 1 Aug 2018 05:40:53 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4986242041; Wed, 1 Aug 2018 08:41:05 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 905BC42045; Wed, 1 Aug 2018 08:41:04 +0100 (BST) Received: from mschwideX1 (unknown [9.145.37.237]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 1 Aug 2018 08:41:04 +0100 (BST) Date: Wed, 1 Aug 2018 07:40:51 +0200 From: Martin Schwidefsky To: Nick Desaulniers Cc: heiko.carstens@de.ibm.com, ysato@users.sourceforge.jp, 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: 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: 18080105-0020-0000-0000-000002AF2596 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080105-0021-0000-0000-000020FB49F5 Message-Id: <20180801074051.11fa62b3@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-01_02:,, 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-1806210000 definitions=main-1808010061 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) This is acceptable though, I would not mind if _THIS_IP_ and current_text_addr use a common definition using labels. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.