Received: by 10.223.185.116 with SMTP id b49csp1378348wrg; Wed, 21 Feb 2018 17:57:20 -0800 (PST) X-Google-Smtp-Source: AH8x225zRNt6j5QjqKkJB6jnqbPMC/BgvP5/9TtcngLtueFGMsSvE6IE3dfJtQHDFRDsCrVy++iU X-Received: by 2002:a17:902:2f03:: with SMTP id s3-v6mr5081023plb.112.1519264640404; Wed, 21 Feb 2018 17:57:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519264640; cv=none; d=google.com; s=arc-20160816; b=jWVQ1w0GFgfu+TaQ+qfoO60zOLErd7jZUo2E6MQncuCsa8bqqjemDQsZ5JOGRukDGL VXKJg2/P9CwppNMdiNOcV5LvuzqnGQBobEHDz4S8gWND4Zd478/AKWe60LH1IMz68tE6 3Nyc03Et9xOZsgbKEEWmVHCWPDxVjbzRsD+ZvcwcS2L4mQJFVyCBwdyrKcA8DSG0/+g2 M2LvFx63hYcQnhX9wl3jCxBadkww3aMsDrnHMtq22bmxYF4fOR6t2xYpY3wV7WLONQht 1z9ZviXB2V00JX2skMSqBLL/CIse3mUtCOEZMdbkvUz3yqmTFmt6qBkGcwP2kjUxzW57 hZQw== 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=3mDn0Dx+K800KI/NeVsGK5CdWhnXarNnHklAjekKr/U=; b=hoG8aWIG7a+kNPUAyhYBevcP/tcZH8DCHYFEob8XwSwRF99Ec786JTfTcRLtiNCvfz 4CPP1UDT75YIJxZ79bahQfVlKrMMUzJeQxBpYL7Pp6SyHP/sZ51PLTo/yGXxaYpScQoj OrHLggYsz7qVuUfzvlpzXfb65FXepwYC3Ff+LnpqenXBI/Uo0yZUbBXHeR5fF60B3yuI xpNgd2k7HpzbmAfU95WdDOU31iPjjNFcpFS8zDQInhh7z6QCr0fyIYQNTA59E9rHaF0y QkFa+dh/HErURXoSured2JSZGXx6aBCtoXNI3IX2+GkOgWBbIAIJgAoCNpXFFIN0dlOD T9MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KIoV3kOE; 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 15-v6si701637pld.387.2018.02.21.17.57.05; Wed, 21 Feb 2018 17:57:20 -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=KIoV3kOE; 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 S1751843AbeBVB4R (ORCPT + 99 others); Wed, 21 Feb 2018 20:56:17 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:37310 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798AbeBVB4O (ORCPT ); Wed, 21 Feb 2018 20:56:14 -0500 Received: by mail-qk0-f196.google.com with SMTP id y137so4626804qka.4; Wed, 21 Feb 2018 17:56:13 -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=3mDn0Dx+K800KI/NeVsGK5CdWhnXarNnHklAjekKr/U=; b=KIoV3kOE1fNNlMQiHa92wCTqfU+zEUN5zFI2QO+26W33VZUJ84T3F5wbcEJaKfTpy4 P7cUm8KvTM5mxo8C5DB63JW3G291jR3fuexSBkkTD20GKXvp/X1481R9ggcsNN9AAtAW QQzIH+rdX3VOBsb118whDRbceWdrnlj4JUFbEox9g8CA8J/6g3korpFwW5EC0VCHSE6U UZqVuuXKDRzE/rMs8h1hbiK1jE+5HBdackQYey6R6N/dMTYN7GA7FNF7nTCTlYY2XO0P 7wJJZSVA8YEG3+fwG8vHrIIVXFq8KOhqk8MR1HNmfrNe5+yMAcUzr1S3inxK0ssDlE/q 2NtA== 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=3mDn0Dx+K800KI/NeVsGK5CdWhnXarNnHklAjekKr/U=; b=j0lUbpL+FDkGt9UugEmu7l3L4QYmY9ZGQaEdayFR2s/eivkZTen+wGkXU92oi1u9Ob ynWwr0vu3gSiBtSncYPafjepQBAh97aGLXBofJRApa+tUPYW8FKqlyxgAiXufeT8+9Pe 796DJ9O/Imk9lUrsjvelBhe+dxAI0PWrCfSmCol/JDLe3R7787syV++w/KGLySQkQiBn 6IGTLW6EaLDJyBFYkGSVk9E3w4ks8sBnzPBfQvko+AdXEuM6YqJi3qP903tz0bzJEqpU qwZRVyFhebemjB4Ux/YbOW3UpMS2y9XWzuJJYxutYnmjU9zHCOO2Xo6s5YtSwPZc3lmT BCYw== X-Gm-Message-State: APf1xPBTiPE90oFBxUhFSwyxyo5HrmEN22aefj9GqQlG2c+IUIYRr1dG vf5b7qaB2Ua50QSLIYyeQT0= X-Received: by 10.55.132.194 with SMTP id g185mr8416454qkd.353.1519264573065; Wed, 21 Feb 2018 17:56:13 -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 n29sm14182630qtf.18.2018.02.21.17.56.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 17:56:12 -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 v12 00/22] selftests, powerpc, x86 : Memory Protection Keys Date: Wed, 21 Feb 2018 17:55:19 -0800 Message-Id: <1519264541-7621-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 enables an application to protect its address space from inadvertent access by its own code. This feature is now enabled on powerpc architecture and integrated in 4.16-rc1. The patches move the selftests to arch neutral directory and enhance their test coverage. Test ---- Verified for correctness on powerpc and on x86 architectures(using EC2 ubuntu VM instance). History: ------- version 12: (1) fixed the offset of pkey field in the siginfo structure for x86_64 and powerpc. And tries to use the actual field if the headers have it defined. version 11: (1) fixed a deadlock in the ptrace testcase. version 10 and prior: (1) moved the testcase to arch neutral directory (2) split the changes into incremental patches. 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 (1): selftests/vm: Fix deadlock in protection_keys.c tools/testing/selftests/vm/Makefile | 1 + tools/testing/selftests/vm/pkey-helpers.h | 434 ++++++++ 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 ----------------------- 6 files changed, 1907 insertions(+), 1631 deletions(-) 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