svm.h 591 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * SVM helper functions
  4. *
  5. * Copyright 2018 Anshuman Khandual, IBM Corporation.
  6. */
  7. #ifndef _ASM_POWERPC_SVM_H
  8. #define _ASM_POWERPC_SVM_H
  9. #ifdef CONFIG_PPC_SVM
  10. #include <asm/reg.h>
  11. static inline bool is_secure_guest(void)
  12. {
  13. return mfmsr() & MSR_S;
  14. }
  15. void dtl_cache_ctor(void *addr);
  16. #define get_dtl_cache_ctor() (is_secure_guest() ? dtl_cache_ctor : NULL)
  17. #else /* CONFIG_PPC_SVM */
  18. static inline bool is_secure_guest(void)
  19. {
  20. return false;
  21. }
  22. #define get_dtl_cache_ctor() NULL
  23. #endif /* CONFIG_PPC_SVM */
  24. #endif /* _ASM_POWERPC_SVM_H */