blob: 155748460c5d9d0d0f62e8db23d6be9f35f65b39 [file] [log] [blame]
Thomas Gleixnerd5bb9942019-05-23 11:14:51 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Mahesh Salgaonkarfd7bacb2016-05-15 09:44:26 +05302/*
3 * Hypervisor Maintenance Interrupt header file.
4 *
Mahesh Salgaonkarfd7bacb2016-05-15 09:44:26 +05305 * Copyright 2015 IBM Corporation
6 * Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
7 */
8
9#ifndef __ASM_PPC64_HMI_H__
10#define __ASM_PPC64_HMI_H__
11
Paolo Bonzini7c379522016-08-11 15:07:43 +020012#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
Mahesh Salgaonkarfd7bacb2016-05-15 09:44:26 +053013
14#define CORE_TB_RESYNC_REQ_BIT 63
15#define MAX_SUBCORE_PER_CORE 4
16
17/*
18 * sibling_subcore_state structure is used to co-ordinate all threads
19 * during HMI to avoid TB corruption. This structure is allocated once
20 * per each core and shared by all threads on that core.
21 */
22struct sibling_subcore_state {
23 unsigned long flags;
24 u8 in_guest[MAX_SUBCORE_PER_CORE];
25};
26
27extern void wait_for_subcore_guest_exit(void);
28extern void wait_for_tb_resync(void);
29#else
30static inline void wait_for_subcore_guest_exit(void) { }
31static inline void wait_for_tb_resync(void) { }
32#endif
Paul Mackerrasd0757452018-01-17 20:51:13 +110033
34struct pt_regs;
35extern long hmi_handle_debugtrig(struct pt_regs *regs);
36
Mahesh Salgaonkarfd7bacb2016-05-15 09:44:26 +053037#endif /* __ASM_PPC64_HMI_H__ */