Merge tag 'pci-v6.16-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
[linux-2.6-block.git] / arch / x86 / include / asm / kvm-x86-ops.h
CommitLineData
9af5471b 1/* SPDX-License-Identifier: GPL-2.0 */
e4fc23ba 2#if !defined(KVM_X86_OP) || !defined(KVM_X86_OP_OPTIONAL)
9af5471b
JB
3BUILD_BUG_ON(1)
4#endif
5
6/*
e4fc23ba
PB
7 * KVM_X86_OP() and KVM_X86_OP_OPTIONAL() are used to help generate
8 * both DECLARE/DEFINE_STATIC_CALL() invocations and
9 * "static_call_update()" calls.
10 *
11 * KVM_X86_OP_OPTIONAL() can be used for those functions that can have
f4854bf7 12 * a NULL definition. KVM_X86_OP_OPTIONAL_RET0() can be used likewise
5be2226f
PB
13 * to make a definition optional, but in this case the default will
14 * be __static_call_return0.
9af5471b 15 */
d83420c2 16KVM_X86_OP(check_processor_compatibility)
0617a769
SC
17KVM_X86_OP(enable_virtualization_cpu)
18KVM_X86_OP(disable_virtualization_cpu)
e4fc23ba 19KVM_X86_OP(hardware_unsetup)
9af5471b
JB
20KVM_X86_OP(has_emulated_msr)
21KVM_X86_OP(vcpu_after_set_cpuid)
22KVM_X86_OP(vm_init)
e4fc23ba 23KVM_X86_OP_OPTIONAL(vm_destroy)
8d032b68 24KVM_X86_OP_OPTIONAL(vm_pre_destroy)
d588bb9b 25KVM_X86_OP_OPTIONAL_RET0(vcpu_precreate)
9af5471b
JB
26KVM_X86_OP(vcpu_create)
27KVM_X86_OP(vcpu_free)
28KVM_X86_OP(vcpu_reset)
e27bc044 29KVM_X86_OP(prepare_switch_to_guest)
9af5471b
JB
30KVM_X86_OP(vcpu_load)
31KVM_X86_OP(vcpu_put)
32KVM_X86_OP(update_exception_bitmap)
33KVM_X86_OP(get_msr)
34KVM_X86_OP(set_msr)
35KVM_X86_OP(get_segment_base)
36KVM_X86_OP(get_segment)
37KVM_X86_OP(get_cpl)
f0e7012c 38KVM_X86_OP(get_cpl_no_cache)
9af5471b 39KVM_X86_OP(set_segment)
e4fc23ba 40KVM_X86_OP(get_cs_db_l_bits)
26a0652c 41KVM_X86_OP(is_valid_cr0)
9af5471b 42KVM_X86_OP(set_cr0)
e4fc23ba 43KVM_X86_OP_OPTIONAL(post_set_cr3)
9af5471b
JB
44KVM_X86_OP(is_valid_cr4)
45KVM_X86_OP(set_cr4)
46KVM_X86_OP(set_efer)
47KVM_X86_OP(get_idt)
48KVM_X86_OP(set_idt)
49KVM_X86_OP(get_gdt)
50KVM_X86_OP(set_gdt)
51KVM_X86_OP(sync_dirty_debug_regs)
c2fee09f 52KVM_X86_OP(set_dr6)
9af5471b
JB
53KVM_X86_OP(set_dr7)
54KVM_X86_OP(cache_reg)
55KVM_X86_OP(get_rflags)
56KVM_X86_OP(set_rflags)
c5063551 57KVM_X86_OP(get_if_flag)
e27bc044
SC
58KVM_X86_OP(flush_tlb_all)
59KVM_X86_OP(flush_tlb_current)
0277022a 60#if IS_ENABLED(CONFIG_HYPERV)
8a1300ff
SC
61KVM_X86_OP_OPTIONAL(flush_remote_tlbs)
62KVM_X86_OP_OPTIONAL(flush_remote_tlbs_range)
0277022a 63#endif
e27bc044
SC
64KVM_X86_OP(flush_tlb_gva)
65KVM_X86_OP(flush_tlb_guest)
fc4fad79 66KVM_X86_OP(vcpu_pre_run)
e27bc044 67KVM_X86_OP(vcpu_run)
e4fc23ba
PB
68KVM_X86_OP(handle_exit)
69KVM_X86_OP(skip_emulated_instruction)
70KVM_X86_OP_OPTIONAL(update_emulated_instruction)
9af5471b
JB
71KVM_X86_OP(set_interrupt_shadow)
72KVM_X86_OP(get_interrupt_shadow)
73KVM_X86_OP(patch_hypercall)
e27bc044
SC
74KVM_X86_OP(inject_irq)
75KVM_X86_OP(inject_nmi)
fa4c027a
SS
76KVM_X86_OP_OPTIONAL_RET0(is_vnmi_pending)
77KVM_X86_OP_OPTIONAL_RET0(set_vnmi_pending)
6ad75c5c 78KVM_X86_OP(inject_exception)
9af5471b
JB
79KVM_X86_OP(cancel_injection)
80KVM_X86_OP(interrupt_allowed)
81KVM_X86_OP(nmi_allowed)
82KVM_X86_OP(get_nmi_mask)
83KVM_X86_OP(set_nmi_mask)
84KVM_X86_OP(enable_nmi_window)
85KVM_X86_OP(enable_irq_window)
e4fc23ba 86KVM_X86_OP_OPTIONAL(update_cr8_intercept)
9af5471b 87KVM_X86_OP(refresh_apicv_exec_ctrl)
abb6d479 88KVM_X86_OP_OPTIONAL(hwapic_isr_update)
abb6d479
PB
89KVM_X86_OP_OPTIONAL(load_eoi_exitmap)
90KVM_X86_OP_OPTIONAL(set_virtual_apic_mode)
e4fc23ba 91KVM_X86_OP_OPTIONAL(set_apic_access_page_addr)
57dfd7b5 92KVM_X86_OP(deliver_interrupt)
e4fc23ba 93KVM_X86_OP_OPTIONAL(sync_pir_to_irr)
5be2226f
PB
94KVM_X86_OP_OPTIONAL_RET0(set_tss_addr)
95KVM_X86_OP_OPTIONAL_RET0(set_identity_map_addr)
ba28401b 96KVM_X86_OP_OPTIONAL_RET0(get_mt_mask)
9af5471b 97KVM_X86_OP(load_mmu_pgd)
77ac7079
IY
98KVM_X86_OP_OPTIONAL(link_external_spt)
99KVM_X86_OP_OPTIONAL(set_external_spte)
94faba89
IY
100KVM_X86_OP_OPTIONAL(free_external_spt)
101KVM_X86_OP_OPTIONAL(remove_external_spte)
e4fc23ba 102KVM_X86_OP(has_wbinvd_exit)
307a94c7
IS
103KVM_X86_OP(get_l2_tsc_offset)
104KVM_X86_OP(get_l2_tsc_multiplier)
edcfe540 105KVM_X86_OP(write_tsc_offset)
1ab9287a 106KVM_X86_OP(write_tsc_multiplier)
9af5471b 107KVM_X86_OP(get_exit_info)
3e633e7e 108KVM_X86_OP(get_entry_info)
9af5471b
JB
109KVM_X86_OP(check_intercept)
110KVM_X86_OP(handle_exit_irqoff)
e4fc23ba
PB
111KVM_X86_OP_OPTIONAL(update_cpu_dirty_logging)
112KVM_X86_OP_OPTIONAL(vcpu_blocking)
113KVM_X86_OP_OPTIONAL(vcpu_unblocking)
114KVM_X86_OP_OPTIONAL(pi_update_irte)
115KVM_X86_OP_OPTIONAL(pi_start_assignment)
9cfec6d0 116KVM_X86_OP_OPTIONAL(apicv_pre_state_restore)
abb6d479 117KVM_X86_OP_OPTIONAL(apicv_post_state_restore)
5be2226f 118KVM_X86_OP_OPTIONAL_RET0(dy_apicv_has_pending_interrupt)
90cfe144 119KVM_X86_OP_OPTIONAL(protected_apic_has_interrupt)
e4fc23ba
PB
120KVM_X86_OP_OPTIONAL(set_hv_timer)
121KVM_X86_OP_OPTIONAL(cancel_hv_timer)
9af5471b 122KVM_X86_OP(setup_mce)
31e83e21 123#ifdef CONFIG_KVM_SMM
9af5471b 124KVM_X86_OP(smi_allowed)
ecc513e5
SC
125KVM_X86_OP(enter_smm)
126KVM_X86_OP(leave_smm)
9af5471b 127KVM_X86_OP(enable_smi_window)
31e83e21 128#endif
546d714b 129KVM_X86_OP_OPTIONAL(dev_get_attr)
f2d79933 130KVM_X86_OP_OPTIONAL(mem_enc_ioctl)
a50f673f 131KVM_X86_OP_OPTIONAL(vcpu_mem_enc_ioctl)
e4fc23ba
PB
132KVM_X86_OP_OPTIONAL(mem_enc_register_region)
133KVM_X86_OP_OPTIONAL(mem_enc_unregister_region)
134KVM_X86_OP_OPTIONAL(vm_copy_enc_context_from)
135KVM_X86_OP_OPTIONAL(vm_move_enc_context_from)
683412cc 136KVM_X86_OP_OPTIONAL(guest_memory_reclaimed)
b848f24b 137KVM_X86_OP(get_feature_msr)
aeb904f6 138KVM_X86_OP(check_emulate_instruction)
9af5471b 139KVM_X86_OP(apic_init_signal_blocked)
b83237ad 140KVM_X86_OP_OPTIONAL(enable_l2_tlb_flush)
e4fc23ba 141KVM_X86_OP_OPTIONAL(migrate_timers)
9af5471b 142KVM_X86_OP(msr_filter_changed)
e4fc23ba 143KVM_X86_OP(complete_emulated_msr)
a0941a64 144KVM_X86_OP(vcpu_deliver_sipi_vector)
d5fa597e 145KVM_X86_OP_OPTIONAL_RET0(vcpu_get_apicv_inhibit_reasons);
37a41847 146KVM_X86_OP_OPTIONAL(get_untagged_addr)
75253db4 147KVM_X86_OP_OPTIONAL(alloc_apic_backing_page)
3bb2531e 148KVM_X86_OP_OPTIONAL_RET0(gmem_prepare)
f32fb328 149KVM_X86_OP_OPTIONAL_RET0(private_max_mapping_level)
a90764f0 150KVM_X86_OP_OPTIONAL(gmem_invalidate)
9af5471b
JB
151
152#undef KVM_X86_OP
e4fc23ba 153#undef KVM_X86_OP_OPTIONAL
5be2226f 154#undef KVM_X86_OP_OPTIONAL_RET0