From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Subject: Re: [PATCH 2/2] Device assignment: Fix MSI IRQ affinity setting Date: Fri, 25 May 2012 01:19:22 +0200 (CEST) Message-ID: References: <1337878924-39069-1-git-send-email-richard@nod.at> <1337878924-39069-2-git-send-email-richard@nod.at> <1337883627.4714.32.camel@ul30vt> <4FBEADCB.2010900@siemens.com> <20120524221757.GF31110@redhat.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Jan Kiszka , Alex Williamson , Richard Weinberger , kvm@vger.kernel.org, avi@redhat.com, Marcelo Tosatti , Bjorn Helgaas To: "Michael S. Tsirkin" Return-path: Received: from www.linutronix.de ([62.245.132.108]:59220 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395Ab2EXXTZ (ORCPT ); Thu, 24 May 2012 19:19:25 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 25 May 2012, Thomas Gleixner wrote: > On Fri, 25 May 2012, Michael S. Tsirkin wrote: > > On Thu, May 24, 2012 at 06:53:15PM -0300, Jan Kiszka wrote: > > > On 2012-05-24 18:39, Thomas Gleixner wrote: > > > > On Thu, 24 May 2012, Alex Williamson wrote: > > > >> On Thu, 2012-05-24 at 18:02 +0100, Richard Weinberger wrote: > > > >>> + if (address == msi_start + PCI_MSI_DATA_32) > > > >>> + handle_cfg_write_msi(pci_dev, assigned_dev); > > > >> > > > >> Why didn't we just use range_covers_byte(address, len, pci_dev->msi_cap > > > >> + PCI_MSI_DATA_32) to start with? But how does this handle the enable > > > >> bit? > > > > > > > > The problem with the current implementation is that it only changes > > > > the routing if the msi entry goes from masked to unmasked state. > > > > > > > > Linux does not mask the entries on affinity changes and never did, > > > > neither for MSI nor for MSI-X. > > > > > > > > I know it's probably not according to the spec, but we can't fix that > > > > retroactively. > > > > > > For MSI, this is allowed. For MSI-X, this would clearly be a Linux bug, > > > waiting for hardware to dislike this spec violation. > > > > > > However, if this is the current behavior of such a prominent guest, I > > > guess we have to stop optimizing the QEMU MSI-X code that it only > > > updates routings on mask changes. Possibly other OSes get this wrong too... > > > > Very strange, a clear spec violation. I'll have to dig in the source to > > verify this. > > Stop digging. MSI-X is correct. This was based off an older version of qemu-kvm, where the routing for MSI-X was broken for other reasons. But that seems to be fixed now. I use the age excuse :) Thanks, tglx