From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934829AbbJILDs (ORCPT ); Fri, 9 Oct 2015 07:03:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37320 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbbJILDq (ORCPT ); Fri, 9 Oct 2015 07:03:46 -0400 Subject: Re: [PATCH] KVM: x86: don't notify userspace IOAPIC on edge EOI To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org References: <1444329000-8723-1-git-send-email-rkrcmar@redhat.com> <20151008183453.GD4508@potion.brq.redhat.com> Cc: kvm@vger.kernel.org, Steve Rutherford From: Paolo Bonzini Message-ID: <56179F0E.4050801@redhat.com> Date: Fri, 9 Oct 2015 13:03:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151008183453.GD4508@potion.brq.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/2015 20:34, Radim Krčmář wrote: > 2015-10-08 20:30+0200, Radim Krčmář: >> On real hardware, edge-triggered interrupts don't set a bit in TMR, >> which means that IOAPIC isn't notified on EOI. Do the same here. >> >> Staying in guest/kernel mode after edge EOI is what we want for most >> devices. If some bugs could be nicely worked around with edge EOI >> notifications, we should invest in a better interface. >> >> Signed-off-by: Radim Krčmář >> --- >> Completely untested. >> >> diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c >> @@ -389,13 +389,15 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) >> for (i = 0; i < nr_ioapic_pins; ++i) { >> hlist_for_each_entry(entry, &table->map[i], link) { >> u32 dest_id, dest_mode; >> + bool level; >> >> if (entry->type != KVM_IRQ_ROUTING_MSI) >> continue; >> dest_id = (entry->msi.address_lo >> 12) & 0xff; >> dest_mode = (entry->msi.address_lo >> 2) & 0x1; >> - if (kvm_apic_match_dest(vcpu, NULL, 0, dest_id, >> - dest_mode)) { >> + level = entry->msi.data & MSI_DATA_TRIGGER_LEVEL; >> + if (level && kvm_apic_match_dest(vcpu, NULL, 0, > > Describing that result is an overkill -- I'll send v2 if the idea is > accepted. It's okay and it matches the other lines before. I'm applying this too, but I would appreciate Steve's Tested-by before moving it to kvm/next. Paolo