aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-07 13:23:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-07 13:23:33 -0400
commitc90fca951e90ba470a3dc6087667edffcf8db21b (patch)
treeb131279a9290826e78884ee706cc0a4f1d82be4e /include/linux
parentc0ab85267e25e34ce8b7e4429f0ef01fa0795b80 (diff)
parentff5bc793e47b537bf3e904fada585e102c54dd8b (diff)
Merge tag 'powerpc-4.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: "Notable changes: - Support for split PMD page table lock on 64-bit Book3S (Power8/9). - Add support for HAVE_RELIABLE_STACKTRACE, so we properly support live patching again. - Add support for patching barrier_nospec in copy_from_user() and syscall entry. - A couple of fixes for our data breakpoints on Book3S. - A series from Nick optimising TLB/mm handling with the Radix MMU. - Numerous small cleanups to squash sparse/gcc warnings from Mathieu Malaterre. - Several series optimising various parts of the 32-bit code from Christophe Leroy. - Removal of support for two old machines, "SBC834xE" and "C2K" ("GEFanuc,C2K"), which is why the diffstat has so many deletions. And many other small improvements & fixes. There's a few out-of-area changes. Some minor ftrace changes OK'ed by Steve, and a fix to our powernv cpuidle driver. Then there's a series touching mm, x86 and fs/proc/task_mmu.c, which cleans up some details around pkey support. It was ack'ed/reviewed by Ingo & Dave and has been in next for several weeks. Thanks to: Akshay Adiga, Alastair D'Silva, Alexey Kardashevskiy, Al Viro, Andrew Donnellan, Aneesh Kumar K.V, Anju T Sudhakar, Arnd Bergmann, Balbir Singh, Cédric Le Goater, Christophe Leroy, Christophe Lombard, Colin Ian King, Dave Hansen, Fabio Estevam, Finn Thain, Frederic Barrat, Gautham R. Shenoy, Haren Myneni, Hari Bathini, Ingo Molnar, Jonathan Neuschäfer, Josh Poimboeuf, Kamalesh Babulal, Madhavan Srinivasan, Mahesh Salgaonkar, Mark Greer, Mathieu Malaterre, Matthew Wilcox, Michael Neuling, Michal Suchanek, Naveen N. Rao, Nicholas Piggin, Nicolai Stange, Olof Johansson, Paul Gortmaker, Paul Mackerras, Peter Rosin, Pridhiviraj Paidipeddi, Ram Pai, Rashmica Gupta, Ravi Bangoria, Russell Currey, Sam Bobroff, Samuel Mendoza-Jonas, Segher Boessenkool, Shilpasri G Bhat, Simon Guo, Souptick Joarder, Stewart Smith, Thiago Jung Bauermann, Torsten Duwe, Vaibhav Jain, Wei Yongjun, Wolfram Sang, Yisheng Xie, YueHaibing" * tag 'powerpc-4.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (251 commits) powerpc/64s/radix: Fix missing ptesync in flush_cache_vmap cpuidle: powernv: Fix promotion from snooze if next state disabled powerpc: fix build failure by disabling attribute-alias warning in pci_32 ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait() powerpc-opal: fix spelling mistake "Uniterrupted" -> "Uninterrupted" powerpc: fix spelling mistake: "Usupported" -> "Unsupported" powerpc/pkeys: Detach execute_only key on !PROT_EXEC powerpc/powernv: copy/paste - Mask SO bit in CR powerpc: Remove core support for Marvell mv64x60 hostbridges powerpc/boot: Remove core support for Marvell mv64x60 hostbridges powerpc/boot: Remove support for Marvell mv64x60 i2c controller powerpc/boot: Remove support for Marvell MPSC serial controller powerpc/embedded6xx: Remove C2K board support powerpc/lib: optimise PPC32 memcmp powerpc/lib: optimise 32 bits __clear_user() powerpc/time: inline arch_vtime_task_switch() powerpc/Makefile: set -mcpu=860 flag for the 8xx powerpc: Implement csum_ipv6_magic in assembly powerpc/32: Optimise __csum_partial() powerpc/lib: Adjust .balign inside string functions for PPC32 ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h14
-rw-r--r--include/linux/pkeys.h13
2 files changed, 21 insertions, 6 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 611f19dd471d..0495e6f97fae 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -229,15 +229,21 @@ extern unsigned int kobjsize(const void *objp);
229#define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) 229#define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4)
230#endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ 230#endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
231 231
232#if defined(CONFIG_X86) 232#ifdef CONFIG_ARCH_HAS_PKEYS
233# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */
234#if defined (CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS)
235# define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 233# define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
236# define VM_PKEY_BIT0 VM_HIGH_ARCH_0 /* A protection key is a 4-bit value */ 234# define VM_PKEY_BIT0 VM_HIGH_ARCH_0 /* A protection key is a 4-bit value */
237# define VM_PKEY_BIT1 VM_HIGH_ARCH_1 235# define VM_PKEY_BIT1 VM_HIGH_ARCH_1 /* on x86 and 5-bit value on ppc64 */
238# define VM_PKEY_BIT2 VM_HIGH_ARCH_2 236# define VM_PKEY_BIT2 VM_HIGH_ARCH_2
239# define VM_PKEY_BIT3 VM_HIGH_ARCH_3 237# define VM_PKEY_BIT3 VM_HIGH_ARCH_3
238#ifdef CONFIG_PPC
239# define VM_PKEY_BIT4 VM_HIGH_ARCH_4
240#else
241# define VM_PKEY_BIT4 0
240#endif 242#endif
243#endif /* CONFIG_ARCH_HAS_PKEYS */
244
245#if defined(CONFIG_X86)
246# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */
241#elif defined(CONFIG_PPC) 247#elif defined(CONFIG_PPC)
242# define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ 248# define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */
243#elif defined(CONFIG_PARISC) 249#elif defined(CONFIG_PARISC)
diff --git a/include/linux/pkeys.h b/include/linux/pkeys.h
index 0794ca78c379..2955ba976048 100644
--- a/include/linux/pkeys.h
+++ b/include/linux/pkeys.h
@@ -2,8 +2,7 @@
2#ifndef _LINUX_PKEYS_H 2#ifndef _LINUX_PKEYS_H
3#define _LINUX_PKEYS_H 3#define _LINUX_PKEYS_H
4 4
5#include <linux/mm_types.h> 5#include <linux/mm.h>
6#include <asm/mmu_context.h>
7 6
8#ifdef CONFIG_ARCH_HAS_PKEYS 7#ifdef CONFIG_ARCH_HAS_PKEYS
9#include <asm/pkeys.h> 8#include <asm/pkeys.h>
@@ -14,6 +13,11 @@
14#define PKEY_DEDICATED_EXECUTE_ONLY 0 13#define PKEY_DEDICATED_EXECUTE_ONLY 0
15#define ARCH_VM_PKEY_FLAGS 0 14#define ARCH_VM_PKEY_FLAGS 0
16 15
16static inline int vma_pkey(struct vm_area_struct *vma)
17{
18 return 0;
19}
20
17static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) 21static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
18{ 22{
19 return (pkey == 0); 23 return (pkey == 0);
@@ -35,6 +39,11 @@ static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
35 return 0; 39 return 0;
36} 40}
37 41
42static inline bool arch_pkeys_enabled(void)
43{
44 return false;
45}
46
38static inline void copy_init_pkru_to_fpregs(void) 47static inline void copy_init_pkru_to_fpregs(void)
39{ 48{
40} 49}