From: Dave Hansen <dave@sr71.net> To: dave@sr71.net Cc: borntraeger@de.ibm.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH 00/25] x86: Memory Protection Keys Date: Mon, 28 Sep 2015 12:18:17 -0700 [thread overview] Message-ID: <20150928191817.035A64E2@viggo.jf.intel.com> (raw) I have addressed all known issues and review comments. I believe they are ready to be pulled in to the x86 tree. Note that this is also the first time anyone has seen the new 'selftests' code. If there are issues limited to it, I'd prefer to fix those up separately post-merge. Changes from RFCv2 (Thanks Ingo and Thomas for most of these): * few minor compile warnings * changed 'nopku' interaction with cpuid bits. Now, we do not clear the PKU cpuid bit, we just skip enabling it. * changed __pkru_allows_write() to also check access disable bit * removed the unused write_pkru() * made si_pkey a u64 and added some patch description details. Also made it share space in siginfo with MPX and clarified comments. * give some real text for the Processor Trace xsave state * made vma_pkey() less ugly (and much more optimized actually) * added SEGV_PKUERR to copy_siginfo_to_user() * remove page table walk when filling in si_pkey, added some big fat comments about it being inherently racy. * added self test code MM reviewers, if you are going to look at one thing, please look at patch 14 which adds a bunch of additional vma/pte permission checks. This code contains a new system call: mprotect_key(), This needs the usual amount of rigor around new interfaces. Review there would be much appreciated. This code is not runnable to anyone outside of Intel unless they have some special hardware or a fancy simulator. If you are interested in running this for real, please get in touch with me. Hardware is available to a very small but nonzero number of people. This set is also available here (with the new syscall): git://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-pkeys.git pkeys-v006 === diffstat === (note that over half of this is kselftests) Documentation/kernel-parameters.txt | 3 Documentation/x86/protection-keys.txt | 54 + arch/powerpc/include/asm/mman.h | 5 arch/powerpc/include/asm/mmu_context.h | 11 arch/s390/include/asm/mmu_context.h | 11 arch/unicore32/include/asm/mmu_context.h | 11 arch/x86/Kconfig | 15 arch/x86/entry/syscalls/syscall_32.tbl | 1 arch/x86/entry/syscalls/syscall_64.tbl | 1 arch/x86/include/asm/cpufeature.h | 54 + arch/x86/include/asm/disabled-features.h | 12 arch/x86/include/asm/fpu/types.h | 16 arch/x86/include/asm/fpu/xstate.h | 4 arch/x86/include/asm/mmu_context.h | 71 ++ arch/x86/include/asm/pgtable.h | 45 + arch/x86/include/asm/pgtable_types.h | 34 - arch/x86/include/asm/required-features.h | 4 arch/x86/include/asm/special_insns.h | 32 + arch/x86/include/uapi/asm/mman.h | 23 arch/x86/include/uapi/asm/processor-flags.h | 2 arch/x86/kernel/cpu/common.c | 42 + arch/x86/kernel/fpu/xstate.c | 7 arch/x86/kernel/process_64.c | 2 arch/x86/kernel/setup.c | 9 arch/x86/mm/fault.c | 143 +++- arch/x86/mm/gup.c | 37 - drivers/char/agp/frontend.c | 2 drivers/staging/android/ashmem.c | 9 fs/proc/task_mmu.c | 5 include/asm-generic/mm_hooks.h | 11 include/linux/mm.h | 13 include/linux/mman.h | 6 include/uapi/asm-generic/siginfo.h | 17 kernel/signal.c | 4 mm/Kconfig | 11 mm/gup.c | 28 mm/memory.c | 4 mm/mmap.c | 2 mm/mprotect.c | 20 mm/nommu.c | 2 tools/testing/selftests/x86/Makefile | 3 tools/testing/selftests/x86/pkey-helpers.h | 182 +++++ tools/testing/selftests/x86/protection_keys.c | 828 ++++++++++++++++++++++++++ 43 files changed, 1705 insertions(+), 91 deletions(-) Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org
WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <dave@sr71.net> To: dave@sr71.net Cc: borntraeger@de.ibm.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH 00/25] x86: Memory Protection Keys Date: Mon, 28 Sep 2015 12:18:17 -0700 [thread overview] Message-ID: <20150928191817.035A64E2@viggo.jf.intel.com> (raw) I have addressed all known issues and review comments. I believe they are ready to be pulled in to the x86 tree. Note that this is also the first time anyone has seen the new 'selftests' code. If there are issues limited to it, I'd prefer to fix those up separately post-merge. Changes from RFCv2 (Thanks Ingo and Thomas for most of these): * few minor compile warnings * changed 'nopku' interaction with cpuid bits. Now, we do not clear the PKU cpuid bit, we just skip enabling it. * changed __pkru_allows_write() to also check access disable bit * removed the unused write_pkru() * made si_pkey a u64 and added some patch description details. Also made it share space in siginfo with MPX and clarified comments. * give some real text for the Processor Trace xsave state * made vma_pkey() less ugly (and much more optimized actually) * added SEGV_PKUERR to copy_siginfo_to_user() * remove page table walk when filling in si_pkey, added some big fat comments about it being inherently racy. * added self test code MM reviewers, if you are going to look at one thing, please look at patch 14 which adds a bunch of additional vma/pte permission checks. This code contains a new system call: mprotect_key(), This needs the usual amount of rigor around new interfaces. Review there would be much appreciated. This code is not runnable to anyone outside of Intel unless they have some special hardware or a fancy simulator. If you are interested in running this for real, please get in touch with me. Hardware is available to a very small but nonzero number of people. This set is also available here (with the new syscall): git://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-pkeys.git pkeys-v006 === diffstat === (note that over half of this is kselftests) Documentation/kernel-parameters.txt | 3 Documentation/x86/protection-keys.txt | 54 + arch/powerpc/include/asm/mman.h | 5 arch/powerpc/include/asm/mmu_context.h | 11 arch/s390/include/asm/mmu_context.h | 11 arch/unicore32/include/asm/mmu_context.h | 11 arch/x86/Kconfig | 15 arch/x86/entry/syscalls/syscall_32.tbl | 1 arch/x86/entry/syscalls/syscall_64.tbl | 1 arch/x86/include/asm/cpufeature.h | 54 + arch/x86/include/asm/disabled-features.h | 12 arch/x86/include/asm/fpu/types.h | 16 arch/x86/include/asm/fpu/xstate.h | 4 arch/x86/include/asm/mmu_context.h | 71 ++ arch/x86/include/asm/pgtable.h | 45 + arch/x86/include/asm/pgtable_types.h | 34 - arch/x86/include/asm/required-features.h | 4 arch/x86/include/asm/special_insns.h | 32 + arch/x86/include/uapi/asm/mman.h | 23 arch/x86/include/uapi/asm/processor-flags.h | 2 arch/x86/kernel/cpu/common.c | 42 + arch/x86/kernel/fpu/xstate.c | 7 arch/x86/kernel/process_64.c | 2 arch/x86/kernel/setup.c | 9 arch/x86/mm/fault.c | 143 +++- arch/x86/mm/gup.c | 37 - drivers/char/agp/frontend.c | 2 drivers/staging/android/ashmem.c | 9 fs/proc/task_mmu.c | 5 include/asm-generic/mm_hooks.h | 11 include/linux/mm.h | 13 include/linux/mman.h | 6 include/uapi/asm-generic/siginfo.h | 17 kernel/signal.c | 4 mm/Kconfig | 11 mm/gup.c | 28 mm/memory.c | 4 mm/mmap.c | 2 mm/mprotect.c | 20 mm/nommu.c | 2 tools/testing/selftests/x86/Makefile | 3 tools/testing/selftests/x86/pkey-helpers.h | 182 +++++ tools/testing/selftests/x86/protection_keys.c | 828 ++++++++++++++++++++++++++ 43 files changed, 1705 insertions(+), 91 deletions(-) Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2015-09-28 19:25 UTC|newest] Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-09-28 19:18 Dave Hansen [this message] 2015-09-28 19:18 ` [PATCH 00/25] x86: Memory Protection Keys Dave Hansen 2015-09-28 19:18 ` [PATCH 03/25] x86, pkeys: cpuid bit definition Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-01 11:02 ` Thomas Gleixner 2015-10-01 11:02 ` Thomas Gleixner 2015-09-28 19:18 ` [PATCH 02/25] x86, pkeys: Add Kconfig option Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-01 11:02 ` Thomas Gleixner 2015-10-01 11:02 ` Thomas Gleixner 2015-09-28 19:18 ` [PATCH 01/25] x86, fpu: add placeholder for Processor Trace XSAVE state Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-01 11:01 ` Thomas Gleixner 2015-10-01 11:01 ` Thomas Gleixner 2015-09-28 19:18 ` [PATCH 06/25] x86, pkeys: PTE bits for storing protection key Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-01 11:51 ` Thomas Gleixner 2015-10-01 11:51 ` Thomas Gleixner 2015-09-28 19:18 ` [PATCH 04/25] x86, pku: define new CR4 bit Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-01 11:03 ` Thomas Gleixner 2015-10-01 11:03 ` Thomas Gleixner 2015-09-28 19:18 ` [PATCH 05/25] x86, pkey: add PKRU xsave fields and data structure(s) Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-01 11:50 ` Thomas Gleixner 2015-10-01 11:50 ` Thomas Gleixner 2015-10-01 17:17 ` Dave Hansen 2015-10-01 17:17 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 08/25] x86, pkeys: store protection in high VMA flags Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 07/25] x86, pkeys: new page fault error code bit: PF_PK Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-01 11:54 ` Thomas Gleixner 2015-10-01 11:54 ` Thomas Gleixner 2015-10-01 17:19 ` Dave Hansen 2015-10-01 17:19 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 09/25] x86, pkeys: arch-specific protection bits Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 10/25] x86, pkeys: pass VMA down in to fault signal generation code Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 13/25] mm: factor out VMA fault permission checking Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 11/25] x86, pkeys: notify userspace about protection key faults Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 12/25] x86, pkeys: add functions to fetch PKRU Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 14/25] mm: simplify get_user_pages() PTE bit handling Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 15/25] x86, pkeys: check VMAs and PTEs for protection keys Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-10-22 20:57 ` Jerome Glisse 2015-10-22 20:57 ` Jerome Glisse 2015-10-22 21:23 ` Dave Hansen 2015-10-22 21:23 ` Dave Hansen 2015-10-22 22:25 ` Jerome Glisse 2015-10-22 22:25 ` Jerome Glisse 2015-10-23 0:49 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 16/25] x86, pkeys: optimize fault handling in access_error() Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 19/25] x86, pkeys: add Kconfig prompt to existing config option Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 18/25] x86, pkeys: dump PTE pkey in /proc/pid/smaps Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 17/25] x86, pkeys: dump PKRU with other kernel registers Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 20/25] mm, multi-arch: pass a protection key in to calc_vm_flag_bits() Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 23/25] x86, pkeys: actually enable Memory Protection Keys in CPU Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 21/25] mm: implement new mprotect_key() system call Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-29 6:39 ` Michael Ellerman 2015-09-29 6:39 ` Michael Ellerman 2015-09-29 6:39 ` Michael Ellerman 2015-09-29 14:16 ` Dave Hansen 2015-09-29 14:16 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 22/25] x86: wire up " Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 24/25] x86, pkeys: add self-tests Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 19:18 ` [PATCH 25/25] x86, pkeys: Documentation Dave Hansen 2015-09-28 19:18 ` Dave Hansen 2015-09-28 20:34 ` Andi Kleen 2015-09-28 20:34 ` Andi Kleen 2015-09-28 20:41 ` Dave Hansen
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20150928191817.035A64E2@viggo.jf.intel.com \ --to=dave@sr71.net \ --cc=borntraeger@de.ibm.com \ --cc=linux-api@vger.kernel.org \ --cc=linux-arch@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=x86@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.