History

x86/mm/cpa: Add set_direct_map_*() functions

Add two new functions set_direct_map_default_noflush() and set_direct_map_invalid_noflush() for setting the direct map alias for the page to its default valid permissions and to an invalid state that cannot be cached in a TLB, respectively. These functions do not flush the TLB. Note, __kernel_map_pages() does something similar but flushes the TLB and doesn't reset the permission bits to default on all architectures. Also add an ARCH config ARCH_HAS_SET_DIRECT_MAP for specifying whether these have an actual implementation or a default empty one.

Rick Edgecombe committed 7 years ago

Commit d253ca01 parent 0a203df5 files · +30 −3Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/set_memory.h+11−0
@@ -17,6 +17,17 @@ static inline int set_memory_x(unsigned long addr, int numpages) { return 0; } · 16 unmodified lines
17static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }17static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
18#endif18#endif
19 19
20#ifndef CONFIG_ARCH_HAS_SET_DIRECT_MAP
21static inline int set_direct_map_invalid_noflush(struct page *page)
22{
23 return 0;
24}
25static inline int set_direct_map_default_noflush(struct page *page)
26{
27 return 0;
28}
29#endif
30
20#ifndef set_mce_nospec31#ifndef set_mce_nospec
21static inline int set_mce_nospec(unsigned long pfn)32static inline int set_mce_nospec(unsigned long pfn)
22{33{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t