1 /*
2  * Copyright 2017, Michael Ellerman, IBM Corporation.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License version
6  * 2 as published by the Free Software Foundation;
7  */
8 #ifndef _LINUX_SET_MEMORY_H_
9 #define _LINUX_SET_MEMORY_H_
10 
11 #ifdef CONFIG_ARCH_HAS_SET_MEMORY
12 #include <asm/set_memory.h>
13 #else
set_memory_ro(unsigned long addr,int numpages)14 static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
set_memory_rw(unsigned long addr,int numpages)15 static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
set_memory_x(unsigned long addr,int numpages)16 static inline int set_memory_x(unsigned long addr,  int numpages) { return 0; }
set_memory_nx(unsigned long addr,int numpages)17 static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
18 #endif
19 
20 #ifndef set_mce_nospec
set_mce_nospec(unsigned long pfn,bool unmap)21 static inline int set_mce_nospec(unsigned long pfn, bool unmap)
22 {
23 	return 0;
24 }
25 #endif
26 
27 #ifndef clear_mce_nospec
clear_mce_nospec(unsigned long pfn)28 static inline int clear_mce_nospec(unsigned long pfn)
29 {
30 	return 0;
31 }
32 #endif
33 
34 #ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT
set_memory_encrypted(unsigned long addr,int numpages)35 static inline int set_memory_encrypted(unsigned long addr, int numpages)
36 {
37 	return 0;
38 }
39 
set_memory_decrypted(unsigned long addr,int numpages)40 static inline int set_memory_decrypted(unsigned long addr, int numpages)
41 {
42 	return 0;
43 }
44 #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
45 
46 #endif /* _LINUX_SET_MEMORY_H_ */
47