From: Ganesh G R <ganeshgr@linux.ibm.com>
To: Narayana Murty N <nnmlinux@linux.ibm.com>,
mahesh@linux.ibm.com, maddy@linux.ibm.com, mpe@ellerman.id.au,
linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org, oohall@gmail.com,
npiggin@gmail.com, christophe.leroy@csgroup.eu,
naveen@kernel.org, gwshan@linux.vnet.ibm.com,
benh@kernel.crashing.org, agraf@suse.de, vaibhav@linux.ibm.com
Subject: Re: [PATCH v1] powerpc/eeh: Fix missing PE bridge reconfiguration during VFIO EEH recovery
Date: Wed, 14 May 2025 18:39:47 +0530 [thread overview]
Message-ID: <9b936f0c-14d0-4601-927e-89fc0b7016b6@linux.ibm.com> (raw)
In-Reply-To: <20250508062928.146043-1-nnmlinux@linux.ibm.com>
On 5/8/25 11:59 AM, Narayana Murty N wrote:
> VFIO EEH recovery for PCI passthrough devices fails on PowerNV and pseries
> platforms due to missing host-side PE bridge reconfiguration. In the
> current implementation, eeh_pe_configure() only performs RTAS or OPAL-based
> bridge reconfiguration for native host devices, but skips it entirely for
> PEs managed through VFIO in guest passthrough scenarios.
>
> This leads to incomplete EEH recovery when a PCI error affects a
> passthrough device assigned to a QEMU/KVM guest. Although VFIO triggers the
> EEH recovery flow through VFIO_EEH_PE_ENABLE ioctl, the platform-specific
> bridge reconfiguration step is silently bypassed. As a result, the PE's
> config space is not fully restored, causing subsequent config space access
> failures or EEH freeze-on-access errors inside the guest.
>
> This patch fixes the issue by ensuring that eeh_pe_configure() always
> invokes the platform's configure_bridge() callback (e.g.,
> pseries_eeh_phb_configure_bridge) even for VFIO-managed PEs. This ensures
> that RTAS or OPAL calls to reconfigure the PE bridge are correctly issued
> on the host side, restoring the PE's configuration space after an EEH
> event.
>
> This fix is essential for reliable EEH recovery in QEMU/KVM guests using
> VFIO PCI passthrough on PowerNV and pseries systems.
>
> Tested with:
> - QEMU/KVM guest using VFIO passthrough (IBM Power9,(lpar)Power11 host)
> - Injected EEH errors with pseries EEH errinjct tool on host, recovery
> verified on qemu guest.
> - Verified successful config space access and CAP_EXP DevCtl restoration
> after recovery
>
> Fixes: 212d16cdca2d ("powerpc/eeh: EEH support for VFIO PCI device")
> Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
> Reviewed-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
> arch/powerpc/kernel/eeh.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
> index 83fe99861eb1..ca7f7bb2b478 100644
> --- a/arch/powerpc/kernel/eeh.c
> +++ b/arch/powerpc/kernel/eeh.c
> @@ -1509,6 +1509,8 @@ int eeh_pe_configure(struct eeh_pe *pe)
> /* Invalid PE ? */
> if (!pe)
> return -ENODEV;
> + else
> + ret = eeh_ops->configure_bridge(pe);
>
> return ret;
> }
> --
> 2.48.1
>
Looks good to me.
Reviewed-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
next prev parent reply other threads:[~2025-05-14 13:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 6:29 Narayana Murty N
2025-05-14 13:09 ` Ganesh G R [this message]
2025-06-15 2:39 ` Madhavan Srinivasan
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=9b936f0c-14d0-4601-927e-89fc0b7016b6@linux.ibm.com \
--to=ganeshgr@linux.ibm.com \
--cc=agraf@suse.de \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@csgroup.eu \
--cc=gwshan@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=nnmlinux@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=vaibhav@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®