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