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

TOMOYO Linux Cross Reference
Linux/arch/x86/include/asm/set_memory.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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 */
  2 #ifndef _ASM_X86_SET_MEMORY_H
  3 #define _ASM_X86_SET_MEMORY_H
  4 
  5 #include <linux/mm.h>
  6 #include <asm/page.h>
  7 #include <asm-generic/set_memory.h>
  8 
  9 #define set_memory_rox set_memory_rox
 10 int set_memory_rox(unsigned long addr, int numpages);
 11 
 12 /*
 13  * The set_memory_* API can be used to change various attributes of a virtual
 14  * address range. The attributes include:
 15  * Cacheability  : UnCached, WriteCombining, WriteThrough, WriteBack
 16  * Executability : eXecutable, NoteXecutable
 17  * Read/Write    : ReadOnly, ReadWrite
 18  * Presence      : NotPresent
 19  * Encryption    : Encrypted, Decrypted
 20  *
 21  * Within a category, the attributes are mutually exclusive.
 22  *
 23  * The implementation of this API will take care of various aspects that
 24  * are associated with changing such attributes, such as:
 25  * - Flushing TLBs
 26  * - Flushing CPU caches
 27  * - Making sure aliases of the memory behind the mapping don't violate
 28  *   coherency rules as defined by the CPU in the system.
 29  *
 30  * What this API does not do:
 31  * - Provide exclusion between various callers - including callers that
 32  *   operation on other mappings of the same physical page
 33  * - Restore default attributes when a page is freed
 34  * - Guarantee that mappings other than the requested one are
 35  *   in any state, other than that these do not violate rules for
 36  *   the CPU you have. Do not depend on any effects on other mappings,
 37  *   CPUs other than the one you have may have more relaxed rules.
 38  * The caller is required to take care of these.
 39  */
 40 
 41 int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot);
 42 int _set_memory_uc(unsigned long addr, int numpages);
 43 int _set_memory_wc(unsigned long addr, int numpages);
 44 int _set_memory_wt(unsigned long addr, int numpages);
 45 int _set_memory_wb(unsigned long addr, int numpages);
 46 int set_memory_uc(unsigned long addr, int numpages);
 47 int set_memory_wc(unsigned long addr, int numpages);
 48 int set_memory_wb(unsigned long addr, int numpages);
 49 int set_memory_np(unsigned long addr, int numpages);
 50 int set_memory_p(unsigned long addr, int numpages);
 51 int set_memory_4k(unsigned long addr, int numpages);
 52 
 53 bool set_memory_enc_stop_conversion(void);
 54 int set_memory_encrypted(unsigned long addr, int numpages);
 55 int set_memory_decrypted(unsigned long addr, int numpages);
 56 
 57 int set_memory_np_noalias(unsigned long addr, int numpages);
 58 int set_memory_nonglobal(unsigned long addr, int numpages);
 59 int set_memory_global(unsigned long addr, int numpages);
 60 
 61 int set_pages_array_uc(struct page **pages, int addrinarray);
 62 int set_pages_array_wc(struct page **pages, int addrinarray);
 63 int set_pages_array_wb(struct page **pages, int addrinarray);
 64 
 65 /*
 66  * For legacy compatibility with the old APIs, a few functions
 67  * are provided that work on a "struct page".
 68  * These functions operate ONLY on the 1:1 kernel mapping of the
 69  * memory that the struct page represents, and internally just
 70  * call the set_memory_* function. See the description of the
 71  * set_memory_* function for more details on conventions.
 72  *
 73  * These APIs should be considered *deprecated* and are likely going to
 74  * be removed in the future.
 75  * The reason for this is the implicit operation on the 1:1 mapping only,
 76  * making this not a generally useful API.
 77  *
 78  * Specifically, many users of the old APIs had a virtual address,
 79  * called virt_to_page() or vmalloc_to_page() on that address to
 80  * get a struct page* that the old API required.
 81  * To convert these cases, use set_memory_*() on the original
 82  * virtual address, do not use these functions.
 83  */
 84 
 85 int set_pages_uc(struct page *page, int numpages);
 86 int set_pages_wb(struct page *page, int numpages);
 87 int set_pages_ro(struct page *page, int numpages);
 88 int set_pages_rw(struct page *page, int numpages);
 89 
 90 int set_direct_map_invalid_noflush(struct page *page);
 91 int set_direct_map_default_noflush(struct page *page);
 92 bool kernel_page_present(struct page *page);
 93 
 94 extern int kernel_set_to_readonly;
 95 
 96 #endif /* _ASM_X86_SET_MEMORY_H */
 97 

~ [ 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