Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5678477img; Wed, 27 Mar 2019 13:02:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzunMn0sWze9x7a6daexB8A+qg64nC+VFA0hxXQVgs0hP5IEASpxEbR4VGcIDLxPypKR3C2 X-Received: by 2002:a65:6098:: with SMTP id t24mr36661600pgu.57.1553716954685; Wed, 27 Mar 2019 13:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553716954; cv=none; d=google.com; s=arc-20160816; b=w76LOdUws/Ob9Fd2/VnqAbS7MGDGo1JrbFsSm7Rix9JZxYrOjY0+SAmxN6vzdaLyv7 /mUq0X5baAxyQxNtRKorGemXWRuR8xrTtGD0/q5QLxRR4hE+Q6ZBjqugkMujq+vVQDee 2a9zIWRY4M+XlQzW8hI/rGMBO6zdFJt9gEkGnVFdKQ023mwhnT/62KwD/S+sHAyzsqQH jij14FSS1LTPKGd6TDJFX82OQZxgz5U4sGYnj+7Dwf+b5CqRBYoioGmo7rfdC1DUp4j5 VkAeGaXNdqpK/oRtowanq1JJJTDyO5H282pJLYMMCKrK6qDsawm5mWmcA+PqviDbYJ81 evjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=MMOGQL6I6bsjOhtezbnnfKPd6j/W5+XUqNTRZO0bJYo=; b=EmS9OBERoWMUYm200barXO9TA7+3XBgalhyIHzhjW514QF0J+i/cylAonG6QicrYNH f0XPgiFTOL9cG+9Ab1hrAWYMt1QpojTV2FKFV0KVj/bFmgXLEkGTq1NXAZESWYdEwCXU r1orZS9cfjdUuBneIzsMwnHmi0Ij8UBzNwHo/c+cnrR+j7035qMQAX2YdMw7hJ3k4OAd aI+WnlpoeoasCJVIficw9VXOuZkX5yKX5PNvK5YAT3CbS4DIHpBDurzco9MiZD7HVPUu 0LKjVP/6ihRT9FPkUlV0S9Ga2GODEWbXEvamcDxnsp1UxF0YVJB+RHCRSGaVcJlJlqCN l8JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b="bi/Oc/HU"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cs12si21041627plb.127.2019.03.27.13.02.18; Wed, 27 Mar 2019 13:02:34 -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; dkim=pass header.i=@efficios.com header.s=default header.b="bi/Oc/HU"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729216AbfC0UBi (ORCPT + 99 others); Wed, 27 Mar 2019 16:01:38 -0400 Received: from mail.efficios.com ([167.114.142.138]:35910 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbfC0UBi (ORCPT ); Wed, 27 Mar 2019 16:01:38 -0400 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id C9F761CF5DE; Wed, 27 Mar 2019 16:01:36 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id VxIsyfO898Rq; Wed, 27 Mar 2019 16:01:36 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 436AA1CF5D7; Wed, 27 Mar 2019 16:01:36 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 436AA1CF5D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1553716896; bh=MMOGQL6I6bsjOhtezbnnfKPd6j/W5+XUqNTRZO0bJYo=; h=Date:From:To:Message-ID:MIME-Version; b=bi/Oc/HU317Z5GRYrIQe0opRL23JrrDyYgRZ19TSLQRETYJNXKPgsPJLq7D4a2bKR T4h4oeZZ+JdJAgiwhFVwXkOjGUS5yVq+xHzp9UJ3v6iKqlzGIhx0uePG028eU7Rgfn JNQe6DEJqelFPKpX3ti7I4xUze8WjlXC5SoHIDOXzFEvOAZQ9Q4ci33wi+9Urm3+Tj 2bqD5Dd47zCFhx2CeS16Mg01wsAmpsR0bmVY3WoFcynWgaNGY5MEvO7QpO1dYn7qfd IeNUcVrfh9AvsqUb89bSIPIibadnsTrNIZILGyDyHFyQDMZlftaajlpfQP4HTtTLTs ThUVYagbn3LgA== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id 5PFW4YnyG9ta; Wed, 27 Mar 2019 16:01:36 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id 1D28B1CF5CC; Wed, 27 Mar 2019 16:01:36 -0400 (EDT) Date: Wed, 27 Mar 2019 16:01:35 -0400 (EDT) From: Mathieu Desnoyers To: schwidefsky Cc: Carlos O'Donell , Paul Burton , Will Deacon , Boqun Feng , heiko carstens , gor , "Russell King, ARM Linux" , 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 Message-ID: <1545235218.11875.1553716895944.JavaMail.zimbra@efficios.com> In-Reply-To: <20190327101608.77b0de6f@mschwideX1> 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> Subject: Re: [PATCH 1/4] glibc: Perform rseq(2) registration at C startup and thread creation (v7) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.11_GA_3780 (ZimbraWebClient - FF65 (Linux)/8.8.11_GA_3787) Thread-Topic: glibc: Perform rseq(2) registration at C startup and thread creation (v7) Thread-Index: DXzEBM8ConRa/Mr9YLYm+xN5T4ziFg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Mar 27, 2019, at 5:16 AM, schwidefsky schwidefsky@de.ibm.com 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. Based on the z/Architecture reference summary, it appears that the DIEBR instruction's opcode is B353. So I suspect that just starting with 0x53 is not sufficient to make it a valid opcode in the instruction set. Is it something we should care about ? > 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. I'll also need to use "jg" for RSEQ_ASM_DEFINE_CMPFAIL: #define RSEQ_ASM_DEFINE_CMPFAIL(label, teardown, cmpfail_label) \ ".pushsection __rseq_failure, \"ax\"\n\t" \ __rseq_str(label) ":\n\t" \ teardown \ "jg %l[" __rseq_str(cmpfail_label) "]\n\t" \ ".popsection\n\t" I'll prepare a fix for Linux selftests, and I already pushed a fix within my librseq repository. Thanks for pointing it out! Mathieu > > -- > blue skies, > Martin. > > "Reality continues to ruin my life." - Calvin. -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com