blob: b5071497b8cbe224af1e09b5ffa7d3c0e7abb4a2 [file] [log] [blame]
Michael Ellerman938f8462017-07-06 15:35:52 -07001/*
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
14static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
15static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
16static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
17static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
18#endif
19
Rick Edgecombed253ca02019-04-25 17:11:34 -070020#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
Dan Williams284ce402018-07-13 21:50:32 -070031#ifndef set_mce_nospec
32static inline int set_mce_nospec(unsigned long pfn)
33{
34 return 0;
35}
36#endif
37
38#ifndef clear_mce_nospec
39static inline int clear_mce_nospec(unsigned long pfn)
40{
41 return 0;
42}
43#endif
44
Christoph Hellwigb7fa0742018-03-19 11:38:22 +010045#ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT
46static inline int set_memory_encrypted(unsigned long addr, int numpages)
47{
48 return 0;
49}
50
51static inline int set_memory_decrypted(unsigned long addr, int numpages)
52{
53 return 0;
54}
55#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
56
Michael Ellerman938f8462017-07-06 15:35:52 -070057#endif /* _LINUX_SET_MEMORY_H_ */