2020-09-23 11:31:11 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef __KVM_X86_VMX_POSTED_INTR_H
|
|
|
|
#define __KVM_X86_VMX_POSTED_INTR_H
|
2024-06-07 10:26:04 -07:00
|
|
|
|
2024-12-17 08:05:40 +01:00
|
|
|
#include <linux/bitmap.h>
|
2025-06-11 15:45:06 -07:00
|
|
|
#include <linux/find.h>
|
|
|
|
#include <linux/kvm_host.h>
|
|
|
|
|
2024-04-23 10:41:03 -07:00
|
|
|
#include <asm/posted_intr.h>
|
2020-09-23 11:31:11 -07:00
|
|
|
|
|
|
|
void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu);
|
|
|
|
void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu);
|
|
|
|
void pi_wakeup_handler(void);
|
2020-10-24 04:08:37 -04:00
|
|
|
void __init pi_init_cpu(int cpu);
|
2025-03-18 00:35:07 -06:00
|
|
|
void pi_apicv_pre_state_restore(struct kvm_vcpu *vcpu);
|
2020-09-23 11:31:11 -07:00
|
|
|
bool pi_has_pending_interrupt(struct kvm_vcpu *vcpu);
|
2025-06-11 15:45:06 -07:00
|
|
|
int vmx_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm,
|
|
|
|
unsigned int host_irq, uint32_t guest_irq,
|
2025-06-11 15:45:31 -07:00
|
|
|
struct kvm_vcpu *vcpu, u32 vector);
|
2025-06-11 15:45:56 -07:00
|
|
|
void vmx_pi_start_bypass(struct kvm *kvm);
|
2020-09-23 11:31:11 -07:00
|
|
|
|
2024-06-07 10:26:04 -07:00
|
|
|
static inline int pi_find_highest_vector(struct pi_desc *pi_desc)
|
|
|
|
{
|
|
|
|
int vec;
|
|
|
|
|
2025-04-01 09:34:43 -07:00
|
|
|
vec = find_last_bit(pi_desc->pir, 256);
|
2024-06-07 10:26:04 -07:00
|
|
|
return vec < 256 ? vec : -1;
|
|
|
|
}
|
|
|
|
|
2020-10-24 04:08:37 -04:00
|
|
|
#endif /* __KVM_X86_VMX_POSTED_INTR_H */
|