All of lore.kernel.org
 help / color / mirror / Atom feed
From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, sbhat@linux.ibm.com,
	mahesh@linux.ibm.com, sourabhjain@linux.ibm.com
Cc: npiggin@gmail.com, harshpb@linux.ibm.com, amachhiw@linux.ibm.com,
	adityag@linux.ibm.com, hbathini@linux.ibm.com,
	shivangu@linux.ibm.com, anushree.mathur@linux.vnet.ibm.com
Subject: [PATCH 0/2] ppc/spapr: Fix MSI-X shadow and BAR mmap handling during EEH PE reset
Date: Wed,  2 Sep 2026 17:17:56 +0530	[thread overview]
Message-ID: <20260902114758.85160-1-nnmlinux@linux.ibm.com> (raw)

This series fixes two independent but related problems in the sPAPR
EEH PE reset path for VFIO pass-through devices.

Patch 1 fixes a regression in MSI-X interrupt delivery after EEH
recovery.  The previous code called msix_reset() during PE pre-reset,
which wiped the MSI-X table shadow.  On pSeries the shadow is
populated via ibm,change-msi -> spapr_msi_setmsg() -> msix_set_message()
and is not necessarily rebuilt before the guest re-enables MSI-X.
vfio_msix_enable() -> vfio_msix_vector_do_use() re-arms KVM irqfd
routes from the existing shadow, so wiping it breaks interrupt delivery.
The fix clears only MSI-X Enable using the cached config shadow and
dispatches through pci_host_config_write_common() so that
vfio_msix_disable() tears down vectors cleanly without touching the
shadow table.

Patch 2 closes a race between the synchronous PE reset ioctl and QEMU's
direct-mapped BAR mmap windows.  While the hardware is held in PCI reset
the device BARs are inaccessible.  Any guest MMIO fault that is serviced
through an active mmap during this window can produce an indeterminate
result.  The fix disables all BAR mmaps before issuing the reset ioctl
and re-enables them after VFIO_EEH_PE_CONFIGURE succeeds.  Any pending
INTx mmap re-enable timer is also cancelled to prevent the timer from
re-arming the mmap window before configure completes.

without patch:
<snip>
[   21.549925][  T251] EEH: Beginning: 'resume'
[   21.550086][  T251] PCI 0001:00:01.0#0001: EEH: Invoking tg3->resume()
[   21.605321][  T251] PCI 0001:00:01.0#0001: EEH: tg3 driver reports: 'none'
[   21.605462][  T251] EEH: Finished:'resume'
[   21.605552][  T251] EEH: Recovery successful.
</snip>
<snip>
# ethtool enP1p0s1 |grep Link 
        Link detected: no
</snip>

with patch:
<snip>
[ 5696.920423][  T250] EEH: Beginning: 'resume'
[ 5696.920497][  T250] PCI 0001:00:01.0#0001: EEH: Invoking tg3->resume()
[ 5696.975922][  T250] PCI 0001:00:01.0#0001: EEH: tg3 driver reports: 'none'
[ 5696.976165][  T250] EEH: Finished:'resume'
[ 5696.976298][  T250] EEH: Recovery successful.
[ 5700.086095][   C28] tg3 0001:00:01.0 enP1p0s1: Link is up at 1000 Mbps, full duplex
[ 5700.086330][   C28] tg3 0001:00:01.0 enP1p0s1: Flow control is on for TX and on for RX
</snip>
<snip>
# ethtool enP1p0s1 |grep Link 
        Link detected: yes
</snip>


Narayana Murty N (2):
  ppc/spapr: Preserve MSI-X shadow across EEH PE reset
  ppc/spapr: Temporarily disable VFIO BAR mmap during EEH PE reset

 hw/ppc/spapr_pci_vfio.c | 122 ++++++++++++++++++++++++++++++++--------
 1 file changed, 100 insertions(+), 22 deletions(-)

-- 
2.54.0


             reply	other threads:[~2026-09-02 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 11:47 Narayana Murty N [this message]
2026-09-02 11:47 ` [PATCH v1 1/2] ppc/spapr: Preserve MSI-X shadow across EEH PE reset Narayana Murty N
2026-09-02 11:47 ` [PATCH v1 2/2] ppc/spapr: Temporarily disable VFIO BAR mmap during " Narayana Murty N

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=20260902114758.85160-1-nnmlinux@linux.ibm.com \
    --to=nnmlinux@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=amachhiw@linux.ibm.com \
    --cc=anushree.mathur@linux.vnet.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=hbathini@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sbhat@linux.ibm.com \
    --cc=shivangu@linux.ibm.com \
    --cc=sourabhjain@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.