mbox series

[0/8] PCI/MSI, x86: Cure a couple of inconsistencies

Message ID 20210721191126.274946280@linutronix.de (mailing list archive)
Headers show
Series PCI/MSI, x86: Cure a couple of inconsistencies | expand

Message

Thomas Gleixner July 21, 2021, 7:11 p.m. UTC
A recent discussion about the PCI/MSI management for virtio unearthed a
violation of the MSI-X specification vs. writing the MSI-X message: under
certain circumstances the entry is written without being masked.

While looking at that and the related violation of the x86 non-remapped
interrupt affinity mechanism a few other issues were discovered by
inspection.

The following series addresses these.

Note this does not fix the virtio issue, but while staring at the above
problems I came up with a plan to address this. I'm still trying to
convince myself that I can get away without sprinkling locking all over the
place, so don't hold your breath that this will materialize tomorrow.

The series is also available from git:

    git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/msi

Thanks,

	tglx
---
 arch/x86/kernel/apic/io_apic.c |    6 +-
 arch/x86/kernel/apic/msi.c     |   11 +++-
 arch/x86/kernel/hpet.c         |    2 
 drivers/pci/msi.c              |   98 +++++++++++++++++++++++++++--------------
 include/linux/irq.h            |    2 
 kernel/irq/chip.c              |    5 +-
 6 files changed, 85 insertions(+), 39 deletions(-)

Comments

Ashok Raj July 21, 2021, 9:10 p.m. UTC | #1
On Wed, Jul 21, 2021 at 09:11:26PM +0200, Thomas Gleixner wrote:
> A recent discussion about the PCI/MSI management for virtio unearthed a

nit:
virtio or VFIO? :-)

> violation of the MSI-X specification vs. writing the MSI-X message: under
> certain circumstances the entry is written without being masked.
> 
> While looking at that and the related violation of the x86 non-remapped
> interrupt affinity mechanism a few other issues were discovered by
> inspection.

Cheers,
Ashok
Thomas Gleixner July 21, 2021, 10:39 p.m. UTC | #2
On Wed, Jul 21 2021 at 14:10, Ashok Raj wrote:

> On Wed, Jul 21, 2021 at 09:11:26PM +0200, Thomas Gleixner wrote:
>> A recent discussion about the PCI/MSI management for virtio unearthed a
>
> nit:
> virtio or VFIO? :-)

VFIO of course.
Marc Zyngier July 22, 2021, 3:17 p.m. UTC | #3
On Wed, 21 Jul 2021 20:11:26 +0100,
Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> A recent discussion about the PCI/MSI management for virtio unearthed a
> violation of the MSI-X specification vs. writing the MSI-X message: under
> certain circumstances the entry is written without being masked.
> 
> While looking at that and the related violation of the x86 non-remapped
> interrupt affinity mechanism a few other issues were discovered by
> inspection.
> 
> The following series addresses these.
> 
> Note this does not fix the virtio issue, but while staring at the above
> problems I came up with a plan to address this. I'm still trying to
> convince myself that I can get away without sprinkling locking all over the
> place, so don't hold your breath that this will materialize tomorrow.
> 
> The series is also available from git:
> 
>     git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/msi
> 
> Thanks,
> 
> 	tglx
> ---
>  arch/x86/kernel/apic/io_apic.c |    6 +-
>  arch/x86/kernel/apic/msi.c     |   11 +++-
>  arch/x86/kernel/hpet.c         |    2 
>  drivers/pci/msi.c              |   98 +++++++++++++++++++++++++++--------------
>  include/linux/irq.h            |    2 
>  kernel/irq/chip.c              |    5 +-
>  6 files changed, 85 insertions(+), 39 deletions(-)

The couple of nits I mentioned notwithstanding, this looks good to me.
I've taken it for a short ride on an arm64 box (both bare metal and
guests), and nothing exploded. Must be good!

Reviewed-by: Marc Zyngier <maz@kernel.org>

	M.
Bjorn Helgaas July 22, 2021, 9:43 p.m. UTC | #4
On Wed, Jul 21, 2021 at 09:11:26PM +0200, Thomas Gleixner wrote:
> A recent discussion about the PCI/MSI management for virtio unearthed a
> violation of the MSI-X specification vs. writing the MSI-X message: under
> certain circumstances the entry is written without being masked.
> 
> While looking at that and the related violation of the x86 non-remapped
> interrupt affinity mechanism a few other issues were discovered by
> inspection.
> 
> The following series addresses these.
> 
> Note this does not fix the virtio issue, but while staring at the above
> problems I came up with a plan to address this. I'm still trying to
> convince myself that I can get away without sprinkling locking all over the
> place, so don't hold your breath that this will materialize tomorrow.
> 
> The series is also available from git:
> 
>     git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/msi
> 
> Thanks,
> 
> 	tglx
> ---
>  arch/x86/kernel/apic/io_apic.c |    6 +-
>  arch/x86/kernel/apic/msi.c     |   11 +++-
>  arch/x86/kernel/hpet.c         |    2 
>  drivers/pci/msi.c              |   98 +++++++++++++++++++++++++++--------------
>  include/linux/irq.h            |    2 
>  kernel/irq/chip.c              |    5 +-
>  6 files changed, 85 insertions(+), 39 deletions(-)

Acked-by: Bjorn Helgaas <bhelgaas@google.com> for the PCI pieces.

I'm happy to take the whole series via PCI, given an x86 ack.  Or you
can merge with my ack.
Thomas Gleixner July 27, 2021, 8:38 p.m. UTC | #5
Bjorn,

On Thu, Jul 22 2021 at 16:43, Bjorn Helgaas wrote:
> On Wed, Jul 21, 2021 at 09:11:26PM +0200, Thomas Gleixner wrote:
>> A recent discussion about the PCI/MSI management for virtio unearthed a
>> violation of the MSI-X specification vs. writing the MSI-X message: under
>> certain circumstances the entry is written without being masked.
>> 
>> While looking at that and the related violation of the x86 non-remapped
>> interrupt affinity mechanism a few other issues were discovered by
>> inspection.
>> 
>> The following series addresses these.
>> 
>> Note this does not fix the virtio issue, but while staring at the above
>> problems I came up with a plan to address this. I'm still trying to
>> convince myself that I can get away without sprinkling locking all over the
>> place, so don't hold your breath that this will materialize tomorrow.
>> 
>> The series is also available from git:
>> 
>>     git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/msi
>> 
>> Thanks,
>> 
>> 	tglx
>> ---
>>  arch/x86/kernel/apic/io_apic.c |    6 +-
>>  arch/x86/kernel/apic/msi.c     |   11 +++-
>>  arch/x86/kernel/hpet.c         |    2 
>>  drivers/pci/msi.c              |   98 +++++++++++++++++++++++++++--------------
>>  include/linux/irq.h            |    2 
>>  kernel/irq/chip.c              |    5 +-
>>  6 files changed, 85 insertions(+), 39 deletions(-)
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com> for the PCI pieces.
>
> I'm happy to take the whole series via PCI, given an x86 ack.  Or you
> can merge with my ack.

Let me repost it first with the various review comments fixed. I'm also
having a fix for the VFIO muck in the pipeline which will be based on
this and also requires changes to the irq core. Let me think about the
best way to get this routed.

Thanks,

        tglx