From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3999AC28CF6 for ; Wed, 1 Aug 2018 05:41:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECFEA20844 for ; Wed, 1 Aug 2018 05:41:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECFEA20844 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733212AbeHAHYy (ORCPT ); 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.