xref: /openbmc/qemu/target/i386/kvm/hyperv-stub.c (revision d0bf492f)
1 /*
2  * Stubs for CONFIG_HYPERV=n
3  *
4  * Copyright (c) 2015-2018 Virtuozzo International GmbH.
5  *
6  * This work is licensed under the terms of the GNU GPL, version 2 or later.
7  * See the COPYING file in the top-level directory.
8  */
9 
10 #include "qemu/osdep.h"
11 #include "hyperv.h"
12 
13 #ifdef CONFIG_KVM
14 int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
15 {
16     switch (exit->type) {
17     case KVM_EXIT_HYPERV_SYNIC:
18         if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
19             return -1;
20         }
21 
22         /*
23          * Tracking the changes in the MSRs is unnecessary as there are no
24          * users for them beside save/load, which is handled nicely by the
25          * generic MSR save/load code
26          */
27         return 0;
28     case KVM_EXIT_HYPERV_HCALL:
29         exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE;
30         return 0;
31     case KVM_EXIT_HYPERV_SYNDBG:
32         if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNDBG)) {
33             return -1;
34         }
35 
36         return 0;
37     default:
38         return -1;
39     }
40 }
41 #endif
42 
43 int hyperv_x86_synic_add(X86CPU *cpu)
44 {
45     return -ENOSYS;
46 }
47 
48 void hyperv_x86_synic_reset(X86CPU *cpu)
49 {
50 }
51 
52 void hyperv_x86_synic_update(X86CPU *cpu)
53 {
54 }
55