kvm_para.h 752 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. *
  4. * Copyright IBM Corp. 2008
  5. *
  6. * Authors: Hollis Blanchard <[email protected]>
  7. */
  8. #ifndef __POWERPC_KVM_PARA_H__
  9. #define __POWERPC_KVM_PARA_H__
  10. #include <asm/kvm_guest.h>
  11. #include <uapi/asm/kvm_para.h>
  12. static inline int kvm_para_available(void)
  13. {
  14. return IS_ENABLED(CONFIG_KVM_GUEST) && is_kvm_guest();
  15. }
  16. static inline unsigned int kvm_arch_para_features(void)
  17. {
  18. unsigned long r;
  19. if (!kvm_para_available())
  20. return 0;
  21. if(epapr_hypercall0_1(KVM_HCALL_TOKEN(KVM_HC_FEATURES), &r))
  22. return 0;
  23. return r;
  24. }
  25. static inline unsigned int kvm_arch_para_hints(void)
  26. {
  27. return 0;
  28. }
  29. static inline bool kvm_check_and_clear_guest_paused(void)
  30. {
  31. return false;
  32. }
  33. #endif /* __POWERPC_KVM_PARA_H__ */