Received: by 10.223.176.46 with SMTP id f43csp3254959wra; Mon, 22 Jan 2018 10:53:53 -0800 (PST) X-Google-Smtp-Source: AH8x225FKBk7HuH9fjon5VMJoSWAgyyXtwlz/QD+P6VlhTy23Jl/UHFyQyuozSbV+QecMivtrD1m X-Received: by 10.107.131.207 with SMTP id n76mr9998413ioi.268.1516647233055; Mon, 22 Jan 2018 10:53:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516647233; cv=none; d=google.com; s=arc-20160816; b=elPW/iOPbGQ6hayXpmysgIRxYQ+eSPKSWLrtnpmDdiGZS33vE380mKVuw0FR+yZKOU cBUfnXeoHUsx9TL9PaMwOdmkWpP7fCNEebm5r5an32QoRH4npEqOhLR6uM0TKGqcvaa4 G6XoEhm8lbKkqenGBYetMSU2Te7EOY2E3GAysB+8jVx/hMItj5EPz5JzLur0gkD6ISNd UkZNUnG+Kik9VtYkx4/PCFbGlbIeRJqeNPtYKl9FS//7l3P1+py4eJy7Vhycf4AXSrQY caSxYc8jQWkTadZleDrKlElb4jQk7triLczgKalYXJ/dd/0LseHUk8nkOCoqos33rbhT 2mgg== 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=QSmQHeScKssplZUDoL1cm7C7J4IL+T3V86dB7Pxime0=; b=i22EtAb04v17kk64C8+LgJOSjHNJUlNew1cUy4lKP9QMF/gV52KJQV9Dn2oRSMnXOS c5se6VoNDEyPJJ8bOsWv1CO9/sF0k4cyzCrxB3qn24J9j5lm6fJjLWvk7u4reiBo3lc8 TPrM3dA79+ltcFhPjHz85QfLTNYg82rsoALWwl7WN9wRep6nJ0BUj3Vg5rjMY2/IGehQ zzU9EbVxAtW7/9Qf69HFb1GwkuoA7Qk4uchcZZ9USlYXoPM9Ke8FlT7S3/pZUp0txQYw 1dUKBZnX6qLqHwngbewRCmdUDb1LcGy0g7PCKJOuHuTP4FINIMN01uMzMMPICHAbdpy8 hkUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ayg7H5/M; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c187si6763171ith.149.2018.01.22.10.53.39; Mon, 22 Jan 2018 10:53:53 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=ayg7H5/M; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751254AbeAVSws (ORCPT + 99 others); Mon, 22 Jan 2018 13:52:48 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:37785 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbeAVSwq (ORCPT ); Mon, 22 Jan 2018 13:52:46 -0500 Received: by mail-qt0-f195.google.com with SMTP id d54so23483920qtd.4; Mon, 22 Jan 2018 10:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=QSmQHeScKssplZUDoL1cm7C7J4IL+T3V86dB7Pxime0=; b=ayg7H5/MfKqEoCVLBJU2JJuQja49TZtLoGeRh/uoLhXBL1kn4Y1NyAkorhf5LuxH7Q 6zpeTpD3i8k/An20dgModN77l7ut8RfPLUisvLQ9lZcZ9Xr3caLD+7PjVI1Vfz37hOuI 5eb5O7W3KJhrKbA/jQi/kvV8kWDIqyH52nKpWupA/KgIdFe2ZK6U4FA81r44uawVQGof 2lL4uCmS5wDzwqZpbZiKFRh1OFY5o4lqLpxGP8b1QNoSO7/oMswK4A6m58VH05YFx4Nc kqoeJyfpEddE56GfI8MYTExJg/B+PehoW4pcK1LsHjdHugRbbpubPAinxcjhQOBZy/WY 8rvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=QSmQHeScKssplZUDoL1cm7C7J4IL+T3V86dB7Pxime0=; b=hreWwFODzWjxe4OBIPdNqQ+Ox15bJKbR92uh33CvdjIDh3g1SdXbb5OhTka8kAyLbs 3ANJ1ExNoPmPTetpo6k8/Mko96qj8ZQdvA8ztyQn9APw5QGq/O/XYxm+xJBNhZMGjl3M t0SBBfX2I6EVO6rCiZw0cO8dTUVtOR3EIgKkbniL34nv+I7m/uakFWmnur06WJHU1PmF 4yQe+o5MA1BIQNksiK5d5oeK6VPrrEqAKBqRXqcpkL0YpNDGL+uv5P6bx7sMC23n/sQS 7HRYsjXvxds4vzn92GIJA8apbMIfndaya5DsuUCi4fNmhrtQrCpET11RxRr0LlJRzJLm UR6w== X-Gm-Message-State: AKwxytcNM+CoHIc9OFoQNGIDBkJfx1mC4O++Ab5gyi5KDVcZ9YzNQZfx UcYuv+wK4ogkOEHYQWeTfX8= X-Received: by 10.55.198.14 with SMTP id b14mr11417087qkj.144.1516647165118; Mon, 22 Jan 2018 10:52:45 -0800 (PST) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id o20sm10790061qkl.14.2018.01.22.10.52.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 10:52:37 -0800 (PST) From: Ram Pai To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, akpm@linux-foundation.org, dave.hansen@intel.com, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, linuxram@us.ibm.com, arnd@arndb.de Subject: [PATCH v10 00/24] selftests, powerpc, x86 : Memory Protection Keys Date: Mon, 22 Jan 2018 10:51:53 -0800 Message-Id: <1516647137-11174-1-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Memory protection keys enable applications to protect its address space from inadvertent access from itself. This feature is now enabled on powerpc architecture. The patches move the selftests to arch neutral directory and enhances them. Verified for correctness on powerpc and on x86 architectures(using EC2 ubuntu VM instances). Ram Pai (21): selftests/x86: Move protecton key selftest to arch neutral directory selftests/vm: rename all references to pkru to a generic name selftests/vm: move generic definitions to header file selftests/vm: typecast the pkey register selftests/vm: generic function to handle shadow key register selftests/vm: fix the wrong assert in pkey_disable_set() selftests/vm: fixed bugs in pkey_disable_clear() selftests/vm: clear the bits in shadow reg when a pkey is freed. selftests/vm: fix alloc_random_pkey() to make it really random selftests/vm: introduce two arch independent abstraction selftests/vm: pkey register should match shadow pkey selftests/vm: generic cleanup selftests/vm: powerpc implementation for generic abstraction selftests/vm: clear the bits in shadow reg when a pkey is freed. selftests/vm: powerpc implementation to check support for pkey selftests/vm: fix an assertion in test_pkey_alloc_exhaust() selftests/vm: associate key on a mapped page and detect access violation selftests/vm: associate key on a mapped page and detect write violation selftests/vm: detect write violation on a mapped access-denied-key page selftests/vm: testcases must restore pkey-permissions selftests/vm: sub-page allocator Thiago Jung Bauermann (3): selftests/vm: Fix deadlock in protection_keys.c selftests/powerpc: Add ptrace tests for Protection Key register selftests/powerpc: Add core file test for Protection Key register tools/testing/selftests/powerpc/include/reg.h | 1 + tools/testing/selftests/powerpc/ptrace/Makefile | 5 +- tools/testing/selftests/powerpc/ptrace/core-pkey.c | 438 ++++++ .../testing/selftests/powerpc/ptrace/ptrace-pkey.c | 443 ++++++ tools/testing/selftests/vm/Makefile | 1 + tools/testing/selftests/vm/pkey-helpers.h | 419 ++++++ tools/testing/selftests/vm/protection_keys.c | 1471 ++++++++++++++++++++ tools/testing/selftests/x86/Makefile | 2 +- tools/testing/selftests/x86/pkey-helpers.h | 223 --- tools/testing/selftests/x86/protection_keys.c | 1407 ------------------- 10 files changed, 2778 insertions(+), 1632 deletions(-) create mode 100644 tools/testing/selftests/powerpc/ptrace/core-pkey.c create mode 100644 tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c create mode 100644 tools/testing/selftests/vm/pkey-helpers.h create mode 100644 tools/testing/selftests/vm/protection_keys.c delete mode 100644 tools/testing/selftests/x86/pkey-helpers.h delete mode 100644 tools/testing/selftests/x86/protection_keys.c