Received: by 10.192.165.148 with SMTP id m20csp527808imm; Fri, 20 Apr 2018 10:37:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx49lGqkMnm2SUxrI9fQE+IXzn++YwMMl6G7BPQBJ3l0X9gj8QOQr2QhlQEqiz8Ycm3qFtsZ3 X-Received: by 10.101.89.5 with SMTP id f5mr9197507pgu.428.1524245822625; Fri, 20 Apr 2018 10:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524245822; cv=none; d=google.com; s=arc-20160816; b=Cdvh8nkEHZEksCRHm4C63IjEhi93ajNGm9ceps3jDMqumUo2Vu8VL9jJvt6NxOKgYg S6iMSRh1cPHheSWj59bBkrpNkVALd+EpbsoMFnY1pKwTQ4QdDNP2InROcG+yYO3ruKHZ UW3ktx0JCdWLGNY8X2raDr21PmGLyGIWYDC+qlwKDhPHaAz/5NlRl+MpUMHNrrWo04h5 p5YRwYsw+1OPL7Yx7yJRkFb6F+CvFGbBHVva92dK8bU5IFjgmCiPwOrGHt6l1F3EzXVw KsPkccNLdWloJv35dfcpwm9uD0FdMHIQDpwoUiw+wau1A5QIaEjC+Zlr2wgTUwlURgKg yQSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=0dE6V++mi6CMeOaZGKFPjDZsTzurcvaHup+qlbP4hoM=; b=j8war8PjqATsNmrFB/C5ShWA0xn11T4ROYdr1EIwbndcgmD40xryrpRaihrImYe4OT P28yskMkhWlg3sx74o/C1Xnsk8XNi1W10d1qTP6YzPUSG3e9KM7dImxjlGQd0p6JwLy9 xFPA6HPV0EUrehxnX4MqzqEHW5+9seagISWI4KfaaLttdYba4hf+TuE2q+44olRT7092 NiL94RcOXBFKq2eZgyPJZ7PrD5DYTxmmPKD1ZiKvBPmxFuvGi7GZiZcT1mLG628x/ZBI 4jF237KFZuIK792G8RBZHMo24zeDG48/dUjHnC4031ymksWH+LHga4WeD1EL+DfNHmEV RzkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=kFgsisFD; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si5193454pgr.443.2018.04.20.10.36.47; Fri, 20 Apr 2018 10:37:02 -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=@oracle.com header.s=corp-2017-10-26 header.b=kFgsisFD; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521AbeDTRfC (ORCPT + 99 others); Fri, 20 Apr 2018 13:35:02 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:33414 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752715AbeDTReQ (ORCPT ); Fri, 20 Apr 2018 13:34:16 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3KHUrL7117293; Fri, 20 Apr 2018 17:34:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2017-10-26; bh=0dE6V++mi6CMeOaZGKFPjDZsTzurcvaHup+qlbP4hoM=; b=kFgsisFDDFBTCOfxxasCO5JI18dDxaxCYAIJ4QMiYwn+S2G6sHEBXX/89SrVfYp6Z+Kk b0IrQQbI3peTyQeSChcn/0TbhR6sKHH+Bk3A4GC9FNdd1cFn7VtKIGVWQ/vR5HuAesNo EcRx2TMcNykThZKJ+FJY9bK43wIrr+h5JGfoatxhWS+x8p/jAz+shPU0I78RVS8nd0WD atj6grZyzd+utWveYjjvVFb6QFBoM/5O1aCA1dN1RUbymYZDbxL2uVNlPHyWPe5uvq6e bXf9U426AfySzAwyschO/TKyAvYOWbYuKcZzMSKvQroCJuoUH3qo5mt1efyiLGwBoCCz Pw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2hdrxp5pma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Apr 2018 17:34:07 +0000 Received: from brm-t84-02.us.oracle.com (brm-t84-02.us.oracle.com [10.80.150.81]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3KHY63E015039; Fri, 20 Apr 2018 17:34:06 GMT From: Tom Hromatka To: davem@davemloft.net Cc: sparclinux@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, tom.hromatka@oracle.com, shuah@kernel.org, linux-kselftest@vger.kernel.org, allen.pais@oracle.com, khalid.aziz@oracle.com, shannon.nelson@oracle.com, anthony.yznaga@oracle.com Subject: [PATCH v2 0/2] sparc64: Add privileged ADI driver Date: Fri, 20 Apr 2018 11:34:04 -0600 Message-Id: <20180420173406.485815-1-tom.hromatka@oracle.com> X-Mailer: git-send-email 2.15.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8869 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=593 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804200175 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ADI is a feature supported on SPARC M7 and newer processors to allow hardware to catch rogue accesses to memory. ADI is supported for data fetches only and not instruction fetches. An app can enable ADI on its data pages, set version tags on them and use versioned addresses to access the data pages. Upper bits of the address contain the version tag. On M7 processors, upper four bits (bits 63-60) contain the version tag. If a rogue app attempts to access ADI enabled data pages, its access is blocked and processor generates an exception. Please see Documentation/sparc/adi.txt for further details. This patchset implements a char driver to read/write ADI versions from privileged user space processes. Intended consumers are makedumpfile and crash. v2: * Simplified copyright headers * Updated copyright headers to use GPL v3 or later * Completely reworked sparc64 selftests Makefiles. Used the android selftests Makefiles as an example * Added run.sh and drivers_test.sh to the sparc64 selftest directory. Used bpf/test_kmod.sh and the android selftests as examples * Minor cleanups in the selftest adi-test.c * Added calls to ksft_test_*() in the adi-test.c Tom Hromatka (2): char: sparc64: Add privileged ADI driver selftests: sparc64: char: Selftest for privileged ADI driver drivers/char/Kconfig | 12 + drivers/char/Makefile | 1 + drivers/char/adi.c | 251 +++++++ tools/testing/selftests/Makefile | 1 + tools/testing/selftests/sparc64/Makefile | 46 ++ tools/testing/selftests/sparc64/drivers/.gitignore | 1 + tools/testing/selftests/sparc64/drivers/Makefile | 15 + tools/testing/selftests/sparc64/drivers/adi-test.c | 732 +++++++++++++++++++++ .../selftests/sparc64/drivers/drivers_test.sh | 30 + tools/testing/selftests/sparc64/run.sh | 3 + 10 files changed, 1092 insertions(+) create mode 100644 drivers/char/adi.c create mode 100644 tools/testing/selftests/sparc64/Makefile create mode 100644 tools/testing/selftests/sparc64/drivers/.gitignore create mode 100644 tools/testing/selftests/sparc64/drivers/Makefile create mode 100644 tools/testing/selftests/sparc64/drivers/adi-test.c create mode 100755 tools/testing/selftests/sparc64/drivers/drivers_test.sh create mode 100755 tools/testing/selftests/sparc64/run.sh -- 2.15.0