Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Michael Roth <michael.roth@amd.com>
To: "Aithal, Srikanth" <sraithal@amd.com>
Cc: <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<bhelgaas@google.com>, <sfr@canb.auug.org.au>,
	<syzkaller-bugs@googlegroups.com>, <linux-next@vger.kernel.org>,
	"Roger Pau Monne" <roger.pau@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [syzbot] [pci?] linux-next test error: general protection fault in msix_capability_init
Date: Tue, 25 Mar 2025 17:37:52 -0500	[thread overview]
Message-ID: <20250325223752.f5tjazbpbblgppyz@amd.com> (raw)

Also able to reproduce this trace on every boot with a basic KVM guest on an
EPYC Milan system using next-20250325 for both host/guest.

A bisect of commits to drivers/pci/msi seems to indicate the following commit
is the source of the regression:

  commit d9f2164238d814d119e8c979a3579d1199e271bb
  Author: Roger Pau Monne <roger.pau@citrix.com>
  Date:   Wed Feb 19 10:20:57 2025 +0100
  
      PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag
      
      Setting pci_msi_ignore_mask inhibits the toggling of the mask bit for both
      MSI and MSI-X entries globally, regardless of the IRQ chip they are using.
      Only Xen sets the pci_msi_ignore_mask when routing physical interrupts over
      event channels, to prevent PCI code from attempting to toggle the maskbit,
      as it's Xen that controls the bit.
      
      However, the pci_msi_ignore_mask being global will affect devices that use
      MSI interrupts but are not routing those interrupts over event channels
      (not using the Xen pIRQ chip).  One example is devices behind a VMD PCI
      bridge.  In that scenario the VMD bridge configures MSI(-X) using the
      normal IRQ chip (the pIRQ one in the Xen case), and devices behind the
      bridge configure the MSI entries using indexes into the VMD bridge MSI
      table.  The VMD bridge then demultiplexes such interrupts and delivers to
      the destination device(s).  Having pci_msi_ignore_mask set in that scenario
      prevents (un)masking of MSI entries for devices behind the VMD bridge.
      
      Move the signaling of no entry masking into the MSI domain flags, as that
      allows setting it on a per-domain basis.  Set it for the Xen MSI domain
      that uses the pIRQ chip, while leaving it unset for the rest of the
      cases.
      
      Remove pci_msi_ignore_mask at once, since it was only used by Xen code, and
      with Xen dropping usage the variable is unneeded.
      
      This fixes using devices behind a VMD bridge on Xen PV hardware domains.
      
      Albeit Devices behind a VMD bridge are not known to Xen, that doesn't mean
      Linux cannot use them.  By inhibiting the usage of
      VMD_FEAT_CAN_BYPASS_MSI_REMAP and the removal of the pci_msi_ignore_mask
      bodge devices behind a VMD bridge do work fine when use from a Linux Xen
      hardware domain.  That's the whole point of the series.
      
      Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
      Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
      Acked-by: Juergen Gross <jgross@suse.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com>
      Message-ID: <20250219092059.90850-4-roger.pau@citrix.com>
      Signed-off-by: Juergen Gross <jgross@suse.com>

Thanks,

Mike

             reply	other threads:[~2025-03-25 22:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25 22:37 Michael Roth [this message]
2025-03-26  9:25 ` [syzbot] [pci?] linux-next test error: general protection fault in msix_capability_init Roger Pau Monné
  -- strict thread matches above, loose matches on Subject: below --
2025-03-24 23:58 syzbot
2025-03-25  3:55 ` Aithal, Srikanth
2025-03-25  4:33   ` Aithal, Srikanth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250325223752.f5tjazbpbblgppyz@amd.com \
    --to=michael.roth@amd.com \
    --cc=423b87d8-2ae3-48af-b368-657f1fbab88d@amd.com \
    --cc=bhelgaas@google.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=roger.pau@citrix.com \
    --cc=sfr@canb.auug.org.au \
    --cc=sraithal@amd.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox