blob: 86281ac7c305748eb7e9a4ab92c02805bb82027c [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Michael Ellerman938f8462017-07-06 15:35:52 -07002/*
3 * Copyright 2017, Michael Ellerman, IBM Corporation.
Michael Ellerman938f8462017-07-06 15:35:52 -07004 */
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
11static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
12static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
13static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
14static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
15#endif
16
Rick Edgecombed253ca02019-04-25 17:11:34 -070017#ifndef CONFIG_ARCH_HAS_SET_DIRECT_MAP
18static inline int set_direct_map_invalid_noflush(struct page *page)
19{
20 return 0;
21}
22static inline int set_direct_map_default_noflush(struct page *page)
23{
24 return 0;
25}
26#endif
27
Dan Williams284ce402018-07-13 21:50:32 -070028#ifndef set_mce_nospec
29static inline int set_mce_nospec(unsigned long pfn)
30{
31 return 0;
32}
33#endif
34
35#ifndef clear_mce_nospec
36static inline int clear_mce_nospec(unsigned long pfn)
37{
38 return 0;
39}
40#endif
41
Christoph Hellwigb7fa0742018-03-19 11:38:22 +010042#ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT
43static inline int set_memory_encrypted(unsigned long addr, int numpages)
44{
45 return 0;
46}
47
48static inline int set_memory_decrypted(unsigned long addr, int numpages)
49{
50 return 0;
51}
52#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
53
Michael Ellerman938f8462017-07-06 15:35:52 -070054#endif /* _LINUX_SET_MEMORY_H_ */