From patchwork Sat May 20 04:29:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 764941 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wVBns4Pnwz9sNF for ; Sat, 20 May 2017 14:31:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jS0rOBe1"; 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 3wVBns39FlzDqhH for ; Sat, 20 May 2017 14:31:29 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jS0rOBe1"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wVBmK3MVKzDqdg for ; Sat, 20 May 2017 14:30:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jS0rOBe1"; dkim-atps=neutral Received: by mail-pf0-x241.google.com with SMTP id f27so11417841pfe.0 for ; Fri, 19 May 2017 21:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dnXdBFnbBsX2Bo5LgSfCN2RcSlKbz/Nj3I03DxAdlNw=; b=jS0rOBe1cEcVrQlf6JxY2CdYp1kTUI40dSyCrJSRkuVf2j+XflFB4cNM1nbJrYosKQ 5ei0iTf8gM1EPR6QHAXhgNnXKZMk+knDHznfJO/p37G+JbUaFvNdGWpor/wLiAYVc1ln Hq3jgAIhr0ypQaA2yWRrKnP6MWb0kPP84hjAYdkuE/CGRwifcZm6P3tNMQ5hyL7X5X7B RVvLmK2+btKymZ2jt9yv+PLT6Sob35RnsqifnNvg0rEaUQNHpZiSkr5Cd/Q2ONjXA1Ny 9RFcPUbtkVKqST3iNERQhUYuIAlcT9fi81upLtarnziBy9/yF2D/hmJzlY30W+6O6Rnu kAVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dnXdBFnbBsX2Bo5LgSfCN2RcSlKbz/Nj3I03DxAdlNw=; b=FrVUXmUYQYrTBtTcgMup47KbTKSaiDyuJkQM+I6ewWDrgcMuNnHMf0kTI1PeoEuIHv qqPgam6FJACJ9/f+kpUoG9aD65nUTTAgbv1r+B8FPCOID1fVmwyWyRsU/68hlIkw0nxK UanJrzVDPbfF3MTZGO7CrsZIQBbYobUwECgkaWxG86WrniTm3DE/KDFoJX6Q9I4A7Xuq GuSN+qSa0QBzPg2WzMiPTK+KTZ8Z9Hit0RofFJRvlCjy0x4NXmiWWq+UmLz7QYJdjbg7 IoAGbEbTo4oBKG+CshebNXe+Q1z+8fz8ypK/Lzv2ULyDod8EclVNJ9mHhwGJ8A+hhHrw vrSQ== X-Gm-Message-State: AODbwcBNv3uZt5fw++G4eVKgCMxsJA8B/TuWY4lZ05R5gSi5SJKIj0it WMIUM32TDMYjTg== X-Received: by 10.84.174.197 with SMTP id r63mr15366855plb.67.1495254607209; Fri, 19 May 2017 21:30:07 -0700 (PDT) Received: from roar.au.ibm.com (138.26.218.139.dynamic.dsl.dv.iprimus.net.au. [139.218.26.138]) by smtp.gmail.com with ESMTPSA id a87sm16239100pfj.50.2017.05.19.21.30.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 21:30:06 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions Date: Sat, 20 May 2017 14:29:49 +1000 Message-Id: <20170520042949.29359-1-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: benh@ozlabs.au.ibm.com, tuliom@linux.vnet.ibm.com, Steve Munroe , Nicholas Piggin , Bill Schmidt , Peter Bergner , Michael Neuling Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Providing "scv" support to userspace requires kernel support, so it must be advertised as independently to the base ISA 3 instruction set. The darn instruction relies on firmware enablement, so it has been decided to split this out from the core ISA 3 feature as well. Signed-off-by: Nicholas Piggin Acked-by: Benjamin Herrenschmidt --- These uapi changes have been agreed by powerpc toolchain and firmware teams. I believe this completes our anticipated requirements for user feature advertisement for ISA v3.0B. arch/powerpc/include/uapi/asm/cputable.h | 2 ++ arch/powerpc/kernel/cputable.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/uapi/asm/cputable.h b/arch/powerpc/include/uapi/asm/cputable.h index 3e7ce86d5c13..4d877144f377 100644 --- a/arch/powerpc/include/uapi/asm/cputable.h +++ b/arch/powerpc/include/uapi/asm/cputable.h @@ -46,6 +46,8 @@ #define PPC_FEATURE2_HTM_NOSC 0x01000000 #define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.00 */ #define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float 128-bit */ +#define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */ +#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */ /* * IMPORTANT! diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 9b3e88b1a9c8..6f849832a669 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c @@ -124,7 +124,8 @@ extern void __restore_cpu_e6500(void); #define COMMON_USER_POWER9 COMMON_USER_POWER8 #define COMMON_USER2_POWER9 (COMMON_USER2_POWER8 | \ PPC_FEATURE2_ARCH_3_00 | \ - PPC_FEATURE2_HAS_IEEE128) + PPC_FEATURE2_HAS_IEEE128 | \ + PPC_FEATURE2_DARN ) #ifdef CONFIG_PPC_BOOK3E_64 #define COMMON_USER_BOOKE (COMMON_USER_PPC64 | PPC_FEATURE_BOOKE)