Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * SVM helper functions
0004  *
0005  * Copyright 2018 Anshuman Khandual, IBM Corporation.
0006  */
0007 
0008 #ifndef _ASM_POWERPC_SVM_H
0009 #define _ASM_POWERPC_SVM_H
0010 
0011 #ifdef CONFIG_PPC_SVM
0012 
0013 #include <asm/reg.h>
0014 
0015 static inline bool is_secure_guest(void)
0016 {
0017     return mfmsr() & MSR_S;
0018 }
0019 
0020 void dtl_cache_ctor(void *addr);
0021 #define get_dtl_cache_ctor()    (is_secure_guest() ? dtl_cache_ctor : NULL)
0022 
0023 #else /* CONFIG_PPC_SVM */
0024 
0025 static inline bool is_secure_guest(void)
0026 {
0027     return false;
0028 }
0029 
0030 #define get_dtl_cache_ctor() NULL
0031 
0032 #endif /* CONFIG_PPC_SVM */
0033 #endif /* _ASM_POWERPC_SVM_H */