]> Git Repo - J-linux.git/blob - arch/powerpc/include/asm/svm.h
powerpc/64: Include cache.h directly in paca.h
[J-linux.git] / arch / powerpc / include / asm / svm.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * SVM helper functions
4  *
5  * Copyright 2018 Anshuman Khandual, IBM Corporation.
6  */
7
8 #ifndef _ASM_POWERPC_SVM_H
9 #define _ASM_POWERPC_SVM_H
10
11 #ifdef CONFIG_PPC_SVM
12
13 #include <asm/reg.h>
14
15 static inline bool is_secure_guest(void)
16 {
17         return mfmsr() & MSR_S;
18 }
19
20 void __init svm_swiotlb_init(void);
21
22 void dtl_cache_ctor(void *addr);
23 #define get_dtl_cache_ctor()    (is_secure_guest() ? dtl_cache_ctor : NULL)
24
25 #else /* CONFIG_PPC_SVM */
26
27 static inline bool is_secure_guest(void)
28 {
29         return false;
30 }
31
32 static inline void svm_swiotlb_init(void) {}
33
34 #define get_dtl_cache_ctor() NULL
35
36 #endif /* CONFIG_PPC_SVM */
37 #endif /* _ASM_POWERPC_SVM_H */
This page took 0.030642 seconds and 4 git commands to generate.