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