]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - include/linux/set_memory.h
Merge tag 'staging-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[mirror_ubuntu-jammy-kernel.git] / include / linux / set_memory.h
CommitLineData
d2912cb1 1/* SPDX-License-Identifier: GPL-2.0-only */
938f8464
ME
2/*
3 * Copyright 2017, Michael Ellerman, IBM Corporation.
938f8464
ME
4 */
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
d253ca0c
RE
17#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}
32a0de88
MR
26
27static inline bool kernel_page_present(struct page *page)
28{
29 return true;
30}
d253ca0c
RE
31#endif
32
284ce401 33#ifndef set_mce_nospec
17fae129 34static inline int set_mce_nospec(unsigned long pfn, bool unmap)
284ce401
DW
35{
36 return 0;
37}
38#endif
39
40#ifndef clear_mce_nospec
41static inline int clear_mce_nospec(unsigned long pfn)
42{
43 return 0;
44}
45#endif
46
b7fa0746
CH
47#ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT
48static inline int set_memory_encrypted(unsigned long addr, int numpages)
49{
50 return 0;
51}
52
53static inline int set_memory_decrypted(unsigned long addr, int numpages)
54{
55 return 0;
56}
57#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
58
938f8464 59#endif /* _LINUX_SET_MEMORY_H_ */