hmi.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Hypervisor Maintenance Interrupt header file.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program.
  16. *
  17. * Copyright 2015 IBM Corporation
  18. * Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
  19. */
  20. #ifndef __ASM_PPC64_HMI_H__
  21. #define __ASM_PPC64_HMI_H__
  22. #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
  23. #define CORE_TB_RESYNC_REQ_BIT 63
  24. #define MAX_SUBCORE_PER_CORE 4
  25. /*
  26. * sibling_subcore_state structure is used to co-ordinate all threads
  27. * during HMI to avoid TB corruption. This structure is allocated once
  28. * per each core and shared by all threads on that core.
  29. */
  30. struct sibling_subcore_state {
  31. unsigned long flags;
  32. u8 in_guest[MAX_SUBCORE_PER_CORE];
  33. };
  34. extern void wait_for_subcore_guest_exit(void);
  35. extern void wait_for_tb_resync(void);
  36. #else
  37. static inline void wait_for_subcore_guest_exit(void) { }
  38. static inline void wait_for_tb_resync(void) { }
  39. #endif
  40. #endif /* __ASM_PPC64_HMI_H__ */