~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/set_memory.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright 2017, Michael Ellerman, IBM Corporation.
  4  */
  5 #ifndef _LINUX_SET_MEMORY_H_
  6 #define _LINUX_SET_MEMORY_H_
  7 
  8 #ifdef CONFIG_ARCH_HAS_SET_MEMORY
  9 #include <asm/set_memory.h>
 10 #else
 11 static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
 12 static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
 13 static inline int set_memory_x(unsigned long addr,  int numpages) { return 0; }
 14 static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
 15 #endif
 16 
 17 #ifndef set_memory_rox
 18 static inline int set_memory_rox(unsigned long addr, int numpages)
 19 {
 20         int ret = set_memory_ro(addr, numpages);
 21         if (ret)
 22                 return ret;
 23         return set_memory_x(addr, numpages);
 24 }
 25 #endif
 26 
 27 #ifndef CONFIG_ARCH_HAS_SET_DIRECT_MAP
 28 static inline int set_direct_map_invalid_noflush(struct page *page)
 29 {
 30         return 0;
 31 }
 32 static inline int set_direct_map_default_noflush(struct page *page)
 33 {
 34         return 0;
 35 }
 36 
 37 static inline bool kernel_page_present(struct page *page)
 38 {
 39         return true;
 40 }
 41 #else /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */
 42 /*
 43  * Some architectures, e.g. ARM64 can disable direct map modifications at
 44  * boot time. Let them overrive this query.
 45  */
 46 #ifndef can_set_direct_map
 47 static inline bool can_set_direct_map(void)
 48 {
 49         return true;
 50 }
 51 #define can_set_direct_map can_set_direct_map
 52 #endif
 53 #endif /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */
 54 
 55 #ifdef CONFIG_X86_64
 56 int set_mce_nospec(unsigned long pfn);
 57 int clear_mce_nospec(unsigned long pfn);
 58 #else
 59 static inline int set_mce_nospec(unsigned long pfn)
 60 {
 61         return 0;
 62 }
 63 static inline int clear_mce_nospec(unsigned long pfn)
 64 {
 65         return 0;
 66 }
 67 #endif
 68 
 69 #ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT
 70 static inline int set_memory_encrypted(unsigned long addr, int numpages)
 71 {
 72         return 0;
 73 }
 74 
 75 static inline int set_memory_decrypted(unsigned long addr, int numpages)
 76 {
 77         return 0;
 78 }
 79 #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
 80 
 81 #endif /* _LINUX_SET_MEMORY_H_ */
 82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php