===================================================================
@@ -1279,3 +1279,9 @@ int kvm_hv_vapic_msr_read(struct kvm_vcp
return 0;
}
+
+void kvm_lapic_set_eoi(struct kvm_vcpu *vcpu)
+{
+ apic_set_eoi(vcpu->arch.apic);
+}
+EXPORT_SYMBOL_GPL(kvm_lapic_set_eoi);
===================================================================
@@ -52,6 +52,8 @@ int kvm_x2apic_msr_read(struct kvm_vcpu
int kvm_hv_vapic_msr_write(struct kvm_vcpu *vcpu, u32 msr, u64 data);
int kvm_hv_vapic_msr_read(struct kvm_vcpu *vcpu, u32 msr, u64 *data);
+void kvm_lapic_set_eoi(struct kvm_vcpu *vcpu);
+
static inline bool kvm_hv_vapic_assist_page_enabled(struct kvm_vcpu *vcpu)
{
return vcpu->arch.hv_vapic & HV_X64_MSR_APIC_ASSIST_PAGE_ENABLE;
===================================================================
@@ -3395,6 +3395,17 @@ static int handle_wbinvd(struct kvm_vcpu
static int handle_apic_access(struct kvm_vcpu *vcpu)
{
+ unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
+ int access_type, offset;
+
+ access_type = (exit_qualification >> 12) & 0xf;
+ offset = exit_qualification & 0xfff;
+ if (access_type == 1 && offset == APIC_EOI) {
+ kvm_lapic_set_eoi(vcpu);
+ skip_emulated_instruction(vcpu);
+ return 1;
+ }
+
return emulate_instruction(vcpu, 0, 0, 0) == EMULATE_DONE;
}