| 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #if !defined(KVM_X86_OP) || !defined(KVM_X86_OP_OPTIONAL) |
| 3 | BUILD_BUG_ON(1) |
| 4 | #endif |
| 5 | |
| 6 | /* |
| 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 |
| 12 | * a NULL definition. KVM_X86_OP_OPTIONAL_RET0() can be used likewise |
| 13 | * to make a definition optional, but in this case the default will |
| 14 | * be __static_call_return0. |
| 15 | */ |
| 16 | KVM_X86_OP(check_processor_compatibility) |
| 17 | KVM_X86_OP(enable_virtualization_cpu) |
| 18 | KVM_X86_OP(disable_virtualization_cpu) |
| 19 | KVM_X86_OP(hardware_unsetup) |
| 20 | KVM_X86_OP(has_emulated_msr) |
| 21 | KVM_X86_OP(vcpu_after_set_cpuid) |
| 22 | KVM_X86_OP(vm_init) |
| 23 | KVM_X86_OP_OPTIONAL(vm_destroy) |
| 24 | KVM_X86_OP_OPTIONAL(vm_pre_destroy) |
| 25 | KVM_X86_OP_OPTIONAL_RET0(vcpu_precreate) |
| 26 | KVM_X86_OP(vcpu_create) |
| 27 | KVM_X86_OP(vcpu_free) |
| 28 | KVM_X86_OP(vcpu_reset) |
| 29 | KVM_X86_OP(prepare_switch_to_guest) |
| 30 | KVM_X86_OP(vcpu_load) |
| 31 | KVM_X86_OP(vcpu_put) |
| 32 | KVM_X86_OP(update_exception_bitmap) |
| 33 | KVM_X86_OP(get_msr) |
| 34 | KVM_X86_OP(set_msr) |
| 35 | KVM_X86_OP(get_segment_base) |
| 36 | KVM_X86_OP(get_segment) |
| 37 | KVM_X86_OP(get_cpl) |
| 38 | KVM_X86_OP(get_cpl_no_cache) |
| 39 | KVM_X86_OP(set_segment) |
| 40 | KVM_X86_OP(get_cs_db_l_bits) |
| 41 | KVM_X86_OP(is_valid_cr0) |
| 42 | KVM_X86_OP(set_cr0) |
| 43 | KVM_X86_OP_OPTIONAL(post_set_cr3) |
| 44 | KVM_X86_OP(is_valid_cr4) |
| 45 | KVM_X86_OP(set_cr4) |
| 46 | KVM_X86_OP(set_efer) |
| 47 | KVM_X86_OP(get_idt) |
| 48 | KVM_X86_OP(set_idt) |
| 49 | KVM_X86_OP(get_gdt) |
| 50 | KVM_X86_OP(set_gdt) |
| 51 | KVM_X86_OP(sync_dirty_debug_regs) |
| 52 | KVM_X86_OP(set_dr6) |
| 53 | KVM_X86_OP(set_dr7) |
| 54 | KVM_X86_OP(cache_reg) |
| 55 | KVM_X86_OP(get_rflags) |
| 56 | KVM_X86_OP(set_rflags) |
| 57 | KVM_X86_OP(get_if_flag) |
| 58 | KVM_X86_OP(flush_tlb_all) |
| 59 | KVM_X86_OP(flush_tlb_current) |
| 60 | #if IS_ENABLED(CONFIG_HYPERV) |
| 61 | KVM_X86_OP_OPTIONAL(flush_remote_tlbs) |
| 62 | KVM_X86_OP_OPTIONAL(flush_remote_tlbs_range) |
| 63 | #endif |
| 64 | KVM_X86_OP(flush_tlb_gva) |
| 65 | KVM_X86_OP(flush_tlb_guest) |
| 66 | KVM_X86_OP(vcpu_pre_run) |
| 67 | KVM_X86_OP(vcpu_run) |
| 68 | KVM_X86_OP(handle_exit) |
| 69 | KVM_X86_OP(skip_emulated_instruction) |
| 70 | KVM_X86_OP_OPTIONAL(update_emulated_instruction) |
| 71 | KVM_X86_OP(set_interrupt_shadow) |
| 72 | KVM_X86_OP(get_interrupt_shadow) |
| 73 | KVM_X86_OP(patch_hypercall) |
| 74 | KVM_X86_OP(inject_irq) |
| 75 | KVM_X86_OP(inject_nmi) |
| 76 | KVM_X86_OP_OPTIONAL_RET0(is_vnmi_pending) |
| 77 | KVM_X86_OP_OPTIONAL_RET0(set_vnmi_pending) |
| 78 | KVM_X86_OP(inject_exception) |
| 79 | KVM_X86_OP(cancel_injection) |
| 80 | KVM_X86_OP(interrupt_allowed) |
| 81 | KVM_X86_OP(nmi_allowed) |
| 82 | KVM_X86_OP(get_nmi_mask) |
| 83 | KVM_X86_OP(set_nmi_mask) |
| 84 | KVM_X86_OP(enable_nmi_window) |
| 85 | KVM_X86_OP(enable_irq_window) |
| 86 | KVM_X86_OP_OPTIONAL(update_cr8_intercept) |
| 87 | KVM_X86_OP(refresh_apicv_exec_ctrl) |
| 88 | KVM_X86_OP_OPTIONAL(hwapic_isr_update) |
| 89 | KVM_X86_OP_OPTIONAL(load_eoi_exitmap) |
| 90 | KVM_X86_OP_OPTIONAL(set_virtual_apic_mode) |
| 91 | KVM_X86_OP_OPTIONAL(set_apic_access_page_addr) |
| 92 | KVM_X86_OP(deliver_interrupt) |
| 93 | KVM_X86_OP_OPTIONAL(sync_pir_to_irr) |
| 94 | KVM_X86_OP_OPTIONAL_RET0(set_tss_addr) |
| 95 | KVM_X86_OP_OPTIONAL_RET0(set_identity_map_addr) |
| 96 | KVM_X86_OP_OPTIONAL_RET0(get_mt_mask) |
| 97 | KVM_X86_OP(load_mmu_pgd) |
| 98 | KVM_X86_OP_OPTIONAL(link_external_spt) |
| 99 | KVM_X86_OP_OPTIONAL(set_external_spte) |
| 100 | KVM_X86_OP_OPTIONAL(free_external_spt) |
| 101 | KVM_X86_OP_OPTIONAL(remove_external_spte) |
| 102 | KVM_X86_OP(has_wbinvd_exit) |
| 103 | KVM_X86_OP(get_l2_tsc_offset) |
| 104 | KVM_X86_OP(get_l2_tsc_multiplier) |
| 105 | KVM_X86_OP(write_tsc_offset) |
| 106 | KVM_X86_OP(write_tsc_multiplier) |
| 107 | KVM_X86_OP(get_exit_info) |
| 108 | KVM_X86_OP(get_entry_info) |
| 109 | KVM_X86_OP(check_intercept) |
| 110 | KVM_X86_OP(handle_exit_irqoff) |
| 111 | KVM_X86_OP_OPTIONAL(update_cpu_dirty_logging) |
| 112 | KVM_X86_OP_OPTIONAL(vcpu_blocking) |
| 113 | KVM_X86_OP_OPTIONAL(vcpu_unblocking) |
| 114 | KVM_X86_OP_OPTIONAL(pi_update_irte) |
| 115 | KVM_X86_OP_OPTIONAL(pi_start_assignment) |
| 116 | KVM_X86_OP_OPTIONAL(apicv_pre_state_restore) |
| 117 | KVM_X86_OP_OPTIONAL(apicv_post_state_restore) |
| 118 | KVM_X86_OP_OPTIONAL_RET0(dy_apicv_has_pending_interrupt) |
| 119 | KVM_X86_OP_OPTIONAL(protected_apic_has_interrupt) |
| 120 | KVM_X86_OP_OPTIONAL(set_hv_timer) |
| 121 | KVM_X86_OP_OPTIONAL(cancel_hv_timer) |
| 122 | KVM_X86_OP(setup_mce) |
| 123 | #ifdef CONFIG_KVM_SMM |
| 124 | KVM_X86_OP(smi_allowed) |
| 125 | KVM_X86_OP(enter_smm) |
| 126 | KVM_X86_OP(leave_smm) |
| 127 | KVM_X86_OP(enable_smi_window) |
| 128 | #endif |
| 129 | KVM_X86_OP_OPTIONAL(dev_get_attr) |
| 130 | KVM_X86_OP_OPTIONAL(mem_enc_ioctl) |
| 131 | KVM_X86_OP_OPTIONAL(vcpu_mem_enc_ioctl) |
| 132 | KVM_X86_OP_OPTIONAL(mem_enc_register_region) |
| 133 | KVM_X86_OP_OPTIONAL(mem_enc_unregister_region) |
| 134 | KVM_X86_OP_OPTIONAL(vm_copy_enc_context_from) |
| 135 | KVM_X86_OP_OPTIONAL(vm_move_enc_context_from) |
| 136 | KVM_X86_OP_OPTIONAL(guest_memory_reclaimed) |
| 137 | KVM_X86_OP(get_feature_msr) |
| 138 | KVM_X86_OP(check_emulate_instruction) |
| 139 | KVM_X86_OP(apic_init_signal_blocked) |
| 140 | KVM_X86_OP_OPTIONAL(enable_l2_tlb_flush) |
| 141 | KVM_X86_OP_OPTIONAL(migrate_timers) |
| 142 | KVM_X86_OP(msr_filter_changed) |
| 143 | KVM_X86_OP(complete_emulated_msr) |
| 144 | KVM_X86_OP(vcpu_deliver_sipi_vector) |
| 145 | KVM_X86_OP_OPTIONAL_RET0(vcpu_get_apicv_inhibit_reasons); |
| 146 | KVM_X86_OP_OPTIONAL(get_untagged_addr) |
| 147 | KVM_X86_OP_OPTIONAL(alloc_apic_backing_page) |
| 148 | KVM_X86_OP_OPTIONAL_RET0(gmem_prepare) |
| 149 | KVM_X86_OP_OPTIONAL_RET0(private_max_mapping_level) |
| 150 | KVM_X86_OP_OPTIONAL(gmem_invalidate) |
| 151 | |
| 152 | #undef KVM_X86_OP |
| 153 | #undef KVM_X86_OP_OPTIONAL |
| 154 | #undef KVM_X86_OP_OPTIONAL_RET0 |