hypervisor.h 748 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __LINUX_HYPEVISOR_H
  3. #define __LINUX_HYPEVISOR_H
  4. /*
  5. * Generic Hypervisor support
  6. * Juergen Gross <[email protected]>
  7. */
  8. #ifdef CONFIG_X86
  9. #include <asm/jailhouse_para.h>
  10. #include <asm/x86_init.h>
  11. static inline void hypervisor_pin_vcpu(int cpu)
  12. {
  13. x86_platform.hyper.pin_vcpu(cpu);
  14. }
  15. #else /* !CONFIG_X86 */
  16. #include <linux/of.h>
  17. static inline void hypervisor_pin_vcpu(int cpu)
  18. {
  19. }
  20. static inline bool jailhouse_paravirt(void)
  21. {
  22. return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
  23. }
  24. #endif /* !CONFIG_X86 */
  25. static inline bool hypervisor_isolated_pci_functions(void)
  26. {
  27. if (IS_ENABLED(CONFIG_S390))
  28. return true;
  29. return jailhouse_paravirt();
  30. }
  31. #endif /* __LINUX_HYPEVISOR_H */