1 /*
2  * vm_event.h: architecture specific vm_event handling routines
3  *
4  * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com)
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __ASM_X86_VM_EVENT_H__
20 #define __ASM_X86_VM_EVENT_H__
21 
22 #include <xen/sched.h>
23 
24 /*
25  * Should we emulate the next matching instruction on VCPU resume
26  * after a vm_event?
27  */
28 struct arch_vm_event {
29     uint32_t emulate_flags;
30     union {
31         struct vm_event_emul_read_data read;
32         struct vm_event_emul_insn_data insn;
33     } emul;
34     struct monitor_write_data write_data;
35     struct vm_event_regs_x86 gprs;
36     bool set_gprs;
37 };
38 
39 int vm_event_init_domain(struct domain *d);
40 
41 void vm_event_cleanup_domain(struct domain *d);
42 
43 void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v,
44                                 vm_event_response_t *rsp);
45 
46 void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp);
47 
48 void vm_event_emulate_check(struct vcpu *v, vm_event_response_t *rsp);
49 
50 #endif /* __ASM_X86_VM_EVENT_H__ */
51