Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp354617img; Thu, 28 Mar 2019 00:51:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsNhqICqU8hpfVc24618c15HpMYodXbP2EgtWGwzteL6DZVgBb85b0L35wcGQm1hQEw6rP X-Received: by 2002:a65:410a:: with SMTP id w10mr38436580pgp.206.1553759463853; Thu, 28 Mar 2019 00:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553759463; cv=none; d=google.com; s=arc-20160816; b=QDoV6IlsJI70SYwAzGUr9absoUVR6n6KhmacTLd4Gf48FqoWRFf2ua1hOTn6QWG/YO 1/qcAYgxGpoAPYgZtgTBZH6N2AHtmAhPWklES1dEVfj/iXeLZv8pCNSstLbY84dj/IiM 5t46Q+FTYisEVHPDhqNFr6w1PS3tcCjJCeQ2RKMuy2hCf3WvtOxs/77rcDK0+JlxwTKO BgIbM4S/VyfMejyOTrtoa08CtCdbJDIF13OCl2+DVvSMTtDgQm2A5MpaIDFaP+dy+Qj5 LhafM/F0XkTA5Duj60XrowBN9qaqQhvHM9gAv79xPB2CBHoWf5cwgd2MkRgtp/S/WizO WoDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from:date; bh=jLwtBuJgbHqFT6ULwkDBucDFwQxNeqZHdePLJ7e/1Kk=; b=a42dAG/DnUVDkQkx7tO7qyHT8tbU1MUMOIMmNK1z1fJdFhO5+Nbul/QpdJJR7fHwqg G9pV6ztCDoXUMm3psxKLGpzgkhAv0Ww/cEDr3BjeWSuikIbp3EkKyBQcD4uLF4puSiwy PZq4X0hy+GaU8O17vuxBStNBAidRbhTJiTtwiIVkF0fMQPfadUylZU4LvJJi+UG/+yuH T0B7KvqV7Alq8DxaM7ZjnWsOV2heOBDTQIZv7Jd3PzNN4mQPgeAgA6IO+fkkJYY6dIGn 6LjEvhKj/Zu5GeSlFPYYp4QEJp570rrOWAIgvqH/+7cCmgN2fRo1AGHb74cHqSYX2+7a cr0w== 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 i3si21156831plt.120.2019.03.28.00.50.48; Thu, 28 Mar 2019 00:51:03 -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 S1726252AbfC1HuI (ORCPT + 99 others); Thu, 28 Mar 2019 03:50:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32904 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725779AbfC1HuH (ORCPT ); Thu, 28 Mar 2019 03:50:07 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2S7nvBO048834 for ; Thu, 28 Mar 2019 03:50:06 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rgq2wqjp7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 28 Mar 2019 03:50:05 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Mar 2019 07:49:59 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 28 Mar 2019 07:49:51 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2S7noY654722630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Mar 2019 07:49:50 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB9BA4203F; Thu, 28 Mar 2019 07:49:50 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EAF6942041; Thu, 28 Mar 2019 07:49:49 +0000 (GMT) Received: from mschwideX1 (unknown [9.145.176.227]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 28 Mar 2019 07:49:49 +0000 (GMT) Date: Thu, 28 Mar 2019 08:49:48 +0100 From: Martin Schwidefsky To: "Carlos O'Donell" Cc: Mathieu Desnoyers , Paul Burton , Will Deacon , Boqun Feng , Heiko Carstens , Vasily Gorbik , Russell King , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , carlos , Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Dave Watson , Paul Turner , Rich Felker , linux-kernel , linux-api Subject: Re: [PATCH 1/4] glibc: Perform rseq(2) registration at C startup and thread creation (v7) In-Reply-To: <4021516e-6a1e-166d-a4f6-e961e6f94cc4@redhat.com> References: <20190212194253.1951-1-mathieu.desnoyers@efficios.com> <20190212194253.1951-2-mathieu.desnoyers@efficios.com> <5166fbe9-cfe0-8554-abc7-4fc844cf2765@redhat.com> <1965431879.7576.1553529272844.JavaMail.zimbra@efficios.com> <20190327101608.77b0de6f@mschwideX1> <4021516e-6a1e-166d-a4f6-e961e6f94cc4@redhat.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19032807-4275-0000-0000-000003205DBC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19032807-4276-0000-0000-0000382EFA53 Message-Id: <20190328084948.6486fa67@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-28_05:,, 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=913 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903280059 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Mar 2019 16:38:32 -0400 "Carlos O'Donell" wrote: > On 3/27/19 5:16 AM, Martin Schwidefsky wrote: > > On Mon, 25 Mar 2019 11:54:32 -0400 (EDT) > > Mathieu Desnoyers wrote: > > > >>>> +++ b/sysdeps/unix/sysv/linux/s390/bits/rseq.h > >> [...] > >>>> + > >>>> +/* Signature required before each abort handler code. */ > >>>> +#define RSEQ_SIG 0x53053053 > >>> > >>> Why not a s390 specific value here? > >> > >> s390 also has the abort handler in a __rseq_failure section: > >> > >> #define RSEQ_ASM_DEFINE_ABORT(label, teardown, abort_label) \ > >> ".pushsection __rseq_failure, \"ax\"\n\t" \ > >> ".long " __rseq_str(RSEQ_SIG) "\n\t" \ > >> __rseq_str(label) ":\n\t" \ > >> teardown \ > >> "j %l[" __rseq_str(abort_label) "]\n\t" \ > >> ".popsection\n\t" > >> > >> Same question applies as powerpc: since disassemblers will try to decode > >> that instruction, would it be better to define it as a valid one ? > >> > >> [...] > > > > A 4-byte sequence starting with 0x53 is decoded as a "diebr" instruction. > > And please replace that "j %l[...]" with a "jg %l[...]", the branch target > > range of the "j" instruction is 64K, not enough for the general case. > > Why was this particular operated selected? > > So on s390 the RSEQ_SIG will show up as an unexpected "divide to integer" > instruction that can't be reached by any control flow? > > Can we use a NOP with a unique value in an immediate operand? > > The goal being to have something that won't confuse during a debug > session, or that the debugger can ignore (like constant pools on Arm) I was looking at the wrong table in regard to opcode 0x53. The pattern 0x53...... is not a known instruction as far as the disassembler is concerned. As Mathieu pointed out "diebr" is actually 0xb353.... Sorry about the confusion. But why do we need this value in the first place if it can not be reached? -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.