Peter Maydell | 1d31f66 | 2012-07-26 15:35:13 +0100 | [diff] [blame] | 1 | /* |
| 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 Bonzini | 9c17d61 | 2012-12-17 18:20:04 +0100 | [diff] [blame] | 14 | #include "sysemu/kvm.h" |
Jan Kiszka | b139bd3 | 2012-08-27 08:28:40 +0200 | [diff] [blame] | 15 | |
Paolo Bonzini | 15eafc2 | 2015-12-17 17:16:08 +0100 | [diff] [blame] | 16 | #define kvm_apic_in_kernel() (kvm_irqchip_in_kernel()) |
| 17 | |
Thomas Huth | 2099935 | 2017-06-26 07:22:53 +0200 | [diff] [blame] | 18 | #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 Huth | 2099935 | 2017-06-26 07:22:53 +0200 | [diff] [blame] | 33 | #endif /* CONFIG_KVM */ |
| 34 | |
Paolo Bonzini | 355023f | 2015-06-18 18:30:52 +0200 | [diff] [blame] | 35 | bool kvm_has_smm(void); |
Vitaly Kuznetsov | 8700a98 | 2020-09-22 17:19:34 +0200 | [diff] [blame] | 36 | bool kvm_has_adjust_clock(void); |
Marcelo Tosatti | 6053a86 | 2016-11-21 08:50:04 -0200 | [diff] [blame] | 37 | bool kvm_has_adjust_clock_stable(void); |
Liran Alon | 79a197a | 2019-07-06 00:06:36 +0300 | [diff] [blame] | 38 | bool kvm_has_exception_payload(void); |
Liang Li | 0fd7e09 | 2015-11-05 11:51:03 +0800 | [diff] [blame] | 39 | void kvm_synchronize_all_tsc(void); |
Paolo Bonzini | 50a2c6e | 2013-03-20 13:11:56 +0100 | [diff] [blame] | 40 | void kvm_arch_reset_vcpu(X86CPU *cs); |
Paolo Bonzini | e0723c4 | 2013-03-08 19:21:50 +0100 | [diff] [blame] | 41 | void kvm_arch_do_init_vcpu(X86CPU *cs); |
Peter Maydell | 1d31f66 | 2012-07-26 15:35:13 +0100 | [diff] [blame] | 42 | |
Dr. David Alan Gilbert | f8d9ccf | 2016-09-22 14:49:17 +0200 | [diff] [blame] | 43 | void kvm_put_apicbase(X86CPU *cpu, uint64_t value); |
| 44 | |
Radim Krčmář | fb506e7 | 2016-10-10 17:28:47 +0200 | [diff] [blame] | 45 | bool kvm_enable_x2apic(void); |
Igor Mammedov | e391c00 | 2016-10-19 14:05:38 +0200 | [diff] [blame] | 46 | bool kvm_has_x2apic_api(void); |
Paolo Bonzini | e1e4381 | 2020-06-30 09:49:27 -0400 | [diff] [blame] | 47 | bool kvm_has_waitpkg(void); |
Roman Kagan | e9688fa | 2018-07-02 16:41:56 +0300 | [diff] [blame] | 48 | |
| 49 | bool kvm_hv_vpindex_settable(void); |
Paolo Bonzini | 420ae1f | 2020-01-20 19:21:42 +0100 | [diff] [blame] | 50 | |
Peter Maydell | 1d31f66 | 2012-07-26 15:35:13 +0100 | [diff] [blame] | 51 | #endif |