Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp983801yba; Mon, 1 Apr 2019 23:08:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3NNHMHV1iKRizVSONBVs6z+z/+4gzifT33IxLptkgNw5BdRsJ66jevjkhq/w5AKkbIdPJ X-Received: by 2002:a65:5acc:: with SMTP id d12mr65336366pgt.337.1554185281669; Mon, 01 Apr 2019 23:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554185281; cv=none; d=google.com; s=arc-20160816; b=UtpaSgKdGmVlPLQfp+TVrQGnUEppCDqnajrYdEFb1LknDLgMStwbCLlerU0+Nkcwhh le/nf0+aiXyVbNsHZeYsYVquwT4CDBM+SyTIEGxN7jKmsr9HrNU6fjwOgXI3QHHRIEas 84o9rIwtn+/7rYII4K58iukyeYH6oDaRHOfm7pLGloZDHuL5WY+Z7CzoHPXS1tHyXMzK xF2A6KDpwPLU23uE17XC/LjeEfGCt8cEYQ1Z0JQa0b49/XehArOrlBD02Dc9edRJmaiX WiRPM7b59uqQ4BDTI9YyNLrYBQcrxj45kE6+hNUnmYNjVvW9mu9CRVBg64E4bReZKf34 P4WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=E4KsmZj6FbNzIi3xiNLp/MpQxo5Co/6PqtfOjuFJnA0=; b=M4/K07p7FhO5xwcjInk+9ypJeNpwm4wnhAObXWQp/6Vaa0J9hjJHmPZWs/BgZoi/WY Ed/27CNRXMaNxEAYfsWe6XM/8fhyJFKlFC92zTqFXhEQP0dn+69AteQl6nYyn3khiQ5o 8vWj7nQLbp8Fkd3FfppVEmS1NC5wtOGNuHG060nzYR5all4rSPE1iEa1ahC2qILBn2Np xWUY8Jjl/1I2mLdp6JWeDjcbD3JQ0B2Ol+hC9uxjLDnf1qwKs7ehSEG3GH2wl4JsFjx0 OH6i+4dJlkatKLH1/oGRae81LEBX13UMx8fFFQ2CyXjSX/nF/5A0GtsTwLsIVjYLsRMx UodA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cn16si11004461plb.174.2019.04.01.23.07.46; Mon, 01 Apr 2019 23:08:01 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728710AbfDBGCx (ORCPT + 99 others); Tue, 2 Apr 2019 02:02:53 -0400 Received: from ozlabs.org ([203.11.71.1]:58861 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727677AbfDBGCx (ORCPT ); Tue, 2 Apr 2019 02:02:53 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 44YJXQ3TgGz9sTS; Tue, 2 Apr 2019 17:02:46 +1100 (AEDT) From: Michael Ellerman To: Mathieu Desnoyers , Carlos O'Donell , Paul Burton , Will Deacon , Boqun Feng , Heiko Carstens , Vasily Gorbik , Martin Schwidefsky , Russell King , Benjamin Herrenschmidt , Paul Mackerras Cc: 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: <1965431879.7576.1553529272844.JavaMail.zimbra@efficios.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> Date: Tue, 02 Apr 2019 17:02:40 +1100 Message-ID: <87lg0tosfz.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Desnoyers writes: > Hi Carlos, > > ----- On Mar 22, 2019, at 4:09 PM, Carlos O'Donell codonell@redhat.com wrote: ... > > [...] >>> +++ b/sysdeps/unix/sysv/linux/powerpc/bits/rseq.h > [...] >>> +/* Signature required before each abort handler code. */ >>> +#define RSEQ_SIG 0x53053053 >> >> Why isn't this an opcode specific to power? > > On powerpc 32/64, the abort is placed in a __rseq_failure executable section: > > #define RSEQ_ASM_DEFINE_ABORT(label, abort_label) \ > ".pushsection __rseq_failure, \"ax\"\n\t" \ > ".long " __rseq_str(RSEQ_SIG) "\n\t" \ > __rseq_str(label) ":\n\t" \ > "b %l[" __rseq_str(abort_label) "]\n\t" \ > ".popsection\n\t" > > That section only contains snippets of those trampolines. Arguably, it would be > good if disassemblers could find valid instructions there. Boqun Feng could perhaps > shed some light on this signature choice ? Now would be a good time to decide > once and for all whether a valid instruction would be a better choice. I'm a bit vague on what we're trying to do here. But it seems like you want some sort of "eye catcher" prior to the branch? That value is a valid instruction on current CPUs (rlwimi. r5,r24,6,1,9), and even if it wasn't it could become one in future. If you change it to 0x8053530 that is both a valid instruction and is a nop (conditional trap immediate but with no conditions set). cheers