From patchwork Wed Apr 24 15:25:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1090207 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44q4FY49Snz9s5c for ; Thu, 25 Apr 2019 01:37:37 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="tmS/Zbxu"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44q4FY37jtzDqXG for ; Thu, 25 Apr 2019 01:37:37 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=efficios.com (client-ip=167.114.142.138; helo=mail.efficios.com; envelope-from=mathieu.desnoyers@efficios.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="tmS/Zbxu"; dkim-atps=neutral X-Greylist: delayed 549 seconds by postgrey-1.36 at bilbo; Thu, 25 Apr 2019 01:35:03 AEST Received: from mail.efficios.com (mail.efficios.com [167.114.142.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44q4Bb3s84zDqSZ for ; Thu, 25 Apr 2019 01:35:03 +1000 (AEST) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 5393A1D91F4; Wed, 24 Apr 2019 11:25:42 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id B8pzYMaloWiC; Wed, 24 Apr 2019 11:25:41 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id AB1DB1D91E6; Wed, 24 Apr 2019 11:25:41 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com AB1DB1D91E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1556119541; bh=wPddiBdShBppXNiDLwqz7lNkyC8NrgYYgntI0yfX9Z0=; h=From:To:Date:Message-Id; b=tmS/ZbxuL7ei/mhwDZhmwkI4wjM5IqnIQELAJFcGBGCJvIsB2ZUGG0HGBc4MUFTgp /C5XP2TGYWgsxLiidsEDrSec8gaN3sE1VQtmYHOhBL5Ifj9amUtQPLyXhHG/YEgsnP VSIcMSwuJuR0a9baitflWCWM9J8+6vNYnWBum3NJCxeTF2NPA7kZTGdQIiIZ899Y7X jjGyTQFPuajZpdFsaf13sh61IEPKyS92ytvIMJDVK6m0yuq8FiUhXJotWjuzsjmEBi 7aKEZVKcxvp9GDxK20eFlxf0ZgJPAKuUxP7MMSTigq+Pq3e1c8LCNzquEKlkKYHIF4 mOHsQmfOmz91w== 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 XgDReCUcN929; Wed, 24 Apr 2019 11:25:41 -0400 (EDT) Received: from thinkos.internal.efficios.com (192-222-157-41.qc.cable.ebox.net [192.222.157.41]) by mail.efficios.com (Postfix) with ESMTPSA id 31B981D91BE; Wed, 24 Apr 2019 11:25:39 -0400 (EDT) From: Mathieu Desnoyers To: Peter Zijlstra , "Paul E . McKenney" , Boqun Feng Subject: [RFC PATCH for 5.2 09/10] rseq/selftests: powerpc code signature: generate valid instructions Date: Wed, 24 Apr 2019 11:25:01 -0400 Message-Id: <20190424152502.14246-10-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190424152502.14246-1-mathieu.desnoyers@efficios.com> References: <20190424152502.14246-1-mathieu.desnoyers@efficios.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joel Fernandes , Catalin Marinas , Dave Watson , Will Deacon , Andi Kleen , Paul Mackerras , "H . Peter Anvin" , Chris Lameter , Shuah Khan , Russell King , Ingo Molnar , Michael Kerrisk , Paul Turner , Alan Modra , Josh Triplett , Steven Rostedt , Ben Maurer , Mathieu Desnoyers , Thomas Gleixner , linux-api@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Andrew Morton , Linus Torvalds Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Use "twui" as the guard instruction for the restartable sequence abort handler. Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Alan Modra CC: linuxppc-dev@lists.ozlabs.org --- tools/testing/selftests/rseq/rseq-ppc.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rseq/rseq-ppc.h b/tools/testing/selftests/rseq/rseq-ppc.h index 9df18487fa9f..76be90196fe4 100644 --- a/tools/testing/selftests/rseq/rseq-ppc.h +++ b/tools/testing/selftests/rseq/rseq-ppc.h @@ -6,7 +6,15 @@ * (C) Copyright 2016-2018 - Boqun Feng */ -#define RSEQ_SIG 0x53053053 +/* + * RSEQ_SIG is used with the following trap instruction: + * + * powerpc-be: 0f e5 00 0b twui r5,11 + * powerpc64-le: 0b 00 e5 0f twui r5,11 + * powerpc64-be: 0f e5 00 0b twui r5,11 + */ + +#define RSEQ_SIG 0x0fe5000b #define rseq_smp_mb() __asm__ __volatile__ ("sync" ::: "memory", "cc") #define rseq_smp_lwsync() __asm__ __volatile__ ("lwsync" ::: "memory", "cc")