blob: a4a619cebb441b71d62ca9598bb51ff2e83f9582 [file] [log] [blame]
Peter Maydell1d31f662012-07-26 15:35:13 +01001/*
2 * QEMU KVM support -- x86 specific functions.
3 *
4 * Copyright (c) 2012 Linaro Limited
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
11#ifndef QEMU_KVM_I386_H
12#define QEMU_KVM_I386_H
13
Paolo Bonzini9c17d612012-12-17 18:20:04 +010014#include "sysemu/kvm.h"
Jan Kiszkab139bd32012-08-27 08:28:40 +020015
Paolo Bonzini15eafc22015-12-17 17:16:08 +010016#define kvm_apic_in_kernel() (kvm_irqchip_in_kernel())
17
Thomas Huth20999352017-06-26 07:22:53 +020018#ifdef CONFIG_KVM
19
20#define kvm_pit_in_kernel() \
21 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
22#define kvm_pic_in_kernel() \
23 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
24#define kvm_ioapic_in_kernel() \
25 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
26
27#else
28
29#define kvm_pit_in_kernel() 0
30#define kvm_pic_in_kernel() 0
31#define kvm_ioapic_in_kernel() 0
32
Thomas Huth20999352017-06-26 07:22:53 +020033#endif /* CONFIG_KVM */
34
Paolo Bonzini355023f2015-06-18 18:30:52 +020035bool kvm_has_smm(void);
Vitaly Kuznetsov8700a982020-09-22 17:19:34 +020036bool kvm_has_adjust_clock(void);
Marcelo Tosatti6053a862016-11-21 08:50:04 -020037bool kvm_has_adjust_clock_stable(void);
Liran Alon79a197a2019-07-06 00:06:36 +030038bool kvm_has_exception_payload(void);
Liang Li0fd7e092015-11-05 11:51:03 +080039void kvm_synchronize_all_tsc(void);
Paolo Bonzini50a2c6e2013-03-20 13:11:56 +010040void kvm_arch_reset_vcpu(X86CPU *cs);
Paolo Bonzinie0723c42013-03-08 19:21:50 +010041void kvm_arch_do_init_vcpu(X86CPU *cs);
Peter Maydell1d31f662012-07-26 15:35:13 +010042
Dr. David Alan Gilbertf8d9ccf2016-09-22 14:49:17 +020043void kvm_put_apicbase(X86CPU *cpu, uint64_t value);
44
Radim Krčmářfb506e72016-10-10 17:28:47 +020045bool kvm_enable_x2apic(void);
Igor Mammedove391c002016-10-19 14:05:38 +020046bool kvm_has_x2apic_api(void);
Paolo Bonzinie1e43812020-06-30 09:49:27 -040047bool kvm_has_waitpkg(void);
Roman Kagane9688fa2018-07-02 16:41:56 +030048
49bool kvm_hv_vpindex_settable(void);
Paolo Bonzini420ae1f2020-01-20 19:21:42 +010050
Peter Maydell1d31f662012-07-26 15:35:13 +010051#endif