^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Hypervisor Maintenance Interrupt header file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright 2015 IBM Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef __ASM_PPC64_HMI_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define __ASM_PPC64_HMI_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define CORE_TB_RESYNC_REQ_BIT 63
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define MAX_SUBCORE_PER_CORE 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * sibling_subcore_state structure is used to co-ordinate all threads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * during HMI to avoid TB corruption. This structure is allocated once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * per each core and shared by all threads on that core.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct sibling_subcore_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) u8 in_guest[MAX_SUBCORE_PER_CORE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) extern void wait_for_subcore_guest_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) extern void wait_for_tb_resync(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) static inline void wait_for_subcore_guest_exit(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) static inline void wait_for_tb_resync(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct pt_regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) extern long hmi_handle_debugtrig(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #endif /* __ASM_PPC64_HMI_H__ */