Skip to content

Commit 16e880b

Browse files
vittyvksean-jc
authored andcommitted
KVM: x86: Introduce helper to check if auto-EOI is set in Hyper-V SynIC
As a preparation to making Hyper-V emulation optional, create a dedicated kvm_hv_synic_auto_eoi_set() helper to avoid extra ifdefs in lapic.c No functional change intended. Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Tested-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Link: https://lore.kernel.org/r/20231205103630.1391318-5-vkuznets@redhat.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 50a82b0 commit 16e880b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

arch/x86/kvm/hyperv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ int kvm_hv_synic_set_irq(struct kvm *kvm, u32 vcpu_id, u32 sint);
105105
void kvm_hv_synic_send_eoi(struct kvm_vcpu *vcpu, int vector);
106106
int kvm_hv_activate_synic(struct kvm_vcpu *vcpu, bool dont_zero_synic_pages);
107107

108+
static inline bool kvm_hv_synic_auto_eoi_set(struct kvm_vcpu *vcpu, int vector)
109+
{
110+
return to_hv_vcpu(vcpu) &&
111+
test_bit(vector, to_hv_synic(vcpu)->auto_eoi_bitmap);
112+
}
113+
108114
void kvm_hv_vcpu_uninit(struct kvm_vcpu *vcpu);
109115

110116
bool kvm_hv_assist_page_enabled(struct kvm_vcpu *vcpu);

arch/x86/kvm/lapic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2905,7 +2905,7 @@ int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu)
29052905
*/
29062906

29072907
apic_clear_irr(vector, apic);
2908-
if (to_hv_vcpu(vcpu) && test_bit(vector, to_hv_synic(vcpu)->auto_eoi_bitmap)) {
2908+
if (kvm_hv_synic_auto_eoi_set(vcpu, vector)) {
29092909
/*
29102910
* For auto-EOI interrupts, there might be another pending
29112911
* interrupt above PPR, so check whether to raise another

0 commit comments

Comments
 (0)