Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5708598img; Wed, 27 Mar 2019 13:41:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPn2Jdrl1scST3gHTyzU5R/GB0w3z9fCAC0S5zKtsKFCjiH7ZO4nCFfaO0kj+eMrkJeiq8 X-Received: by 2002:aa7:8615:: with SMTP id p21mr13956911pfn.98.1553719269266; Wed, 27 Mar 2019 13:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553719269; cv=none; d=google.com; s=arc-20160816; b=Qm+WFwFFl9eD6Igr5405/lTsDg68wkw3zvQtSEee/Q2UGR0rDbiV0GusFiPZY/vjBZ VC21jIg5wCEcs4PvVeT03ur1pgW0yxARRu7u4G3Xg2yvi5cWwhYck+/2wIbhN/fcpXCd j68cvDBAH9LHB2MiEaoBcrLkn+aVc5e6u74QpFkLnFfYcVOYiNOa4UGb/FnYTElEsct+ /pIC2rIN0lVPqxONDrYxQ5cWOd3EP9mv5jDnMAjrnkcld54068GMaWZLAFYiOFXMRUSx ovpEAdb4lDdSEPJ4PYeYJDV6JbMsv21DuoRNJ8YlN8narDo2yu/x8dSe+Yq49ikfPqHY nOVA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Su9RseQdKSewV9YmXza7lnUC3L3ZKBLunvImfxCavtI=; b=uzHAt+mz59OBDOlOkT0LNjMwQ91F8HZ49diIkXocxdj0WXK2rGQeqUOGtTxbTj0idq yThjXLsO8W254KxtCLurNeATZ+S7G3woq7kgmFK2bsDK49AMu51HjwVHB8fWxHfDqFuU 8vmSELijrV5hDldrYMqpGY+Bi/et5GItDfOvA9+RRyX6WzYrZuQ3BlszpZp/UeHoZPJS MSOdepKyE8RE7PhssdoZLA697VeYuQcXFFiwNFNnTsf+hyEjU9y44wo099B8vXkHrxPF 0KrDXG7ZM0s1deNs8TTgUIelgwfKz6SOQs9rIknD9pplNV+tf7sgZy9QGHyEnQD4nYM2 YRjQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si18830180pgr.372.2019.03.27.13.40.53; Wed, 27 Mar 2019 13:41:09 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730646AbfC0Uil (ORCPT + 99 others); Wed, 27 Mar 2019 16:38:41 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:44746 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726275AbfC0Uik (ORCPT ); Wed, 27 Mar 2019 16:38:40 -0400 Received: by mail-qt1-f196.google.com with SMTP id w5so20501249qtb.11 for ; Wed, 27 Mar 2019 13:38:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Su9RseQdKSewV9YmXza7lnUC3L3ZKBLunvImfxCavtI=; b=tzs61PM3JbnR1tmJF181pTEPyW6Xt8jjfYjcwLQdoeHdFjeYj6/pKDy+1Bk3hHO+T0 90lFx1PpOqVbKaOefH49Z1Yxed7BcMJ3jgbHtbnnkrOci/JX7rc62NcPe41kKFEz3v7W 2qllYoHK19kHS0XcsydtB4AlxJRqNQ9GQx4+HkuF1p3uNIJ7YFWrKcR5IALlH/wiFciK XclowjDBbAsQrF/hXxCdAgEbBUz5xt8C1Z8R6keZOtODDMw882q+6sIRiof3hUMwgjqn oc+UoxxsD3WSYtXDP8HuFMFuih27vjd0Lw0+oEhkhp/vhUv6Gj8HylyHdOUwfCV/vN/q tHlQ== X-Gm-Message-State: APjAAAXahV8QI9MimeCn8UBNx/EwlJfK6lolcJn8DbLBOF1xhySOlMgx awzSaMku750gR1voEur0lSoivg== X-Received: by 2002:ac8:1b38:: with SMTP id y53mr32277602qtj.130.1553719119566; Wed, 27 Mar 2019 13:38:39 -0700 (PDT) Received: from [10.150.73.190] (178.sub-174-227-146.myvzw.com. [174.227.146.178]) by smtp.gmail.com with ESMTPSA id s17sm14863491qtc.15.2019.03.27.13.38.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 13:38:38 -0700 (PDT) Subject: Re: [PATCH 1/4] glibc: Perform rseq(2) registration at C startup and thread creation (v7) To: Martin Schwidefsky , Mathieu Desnoyers Cc: 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 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> From: Carlos O'Donell Message-ID: <4021516e-6a1e-166d-a4f6-e961e6f94cc4@redhat.com> Date: Wed, 27 Mar 2019 16:38:32 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <20190327101608.77b0de6f@mschwideX1> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- Cheers, Carlos.