linux/arch/powerpc/kernel
Narayana Murty N 33bc69cf66 powerpc/eeh: Fix missing PE bridge reconfiguration during VFIO EEH recovery
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: 212d16cdca ("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>
Reviewed-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250508062928.146043-1-nnmlinux@linux.ibm.com
2025-06-13 12:30:48 +05:30
..
ptrace seccomp: remove the 'sd' argument from __secure_computing() 2025-02-10 09:26:22 -08:00
syscalls fs: add open_tree_attr() 2025-02-12 12:12:28 +01:00
trace powerpc64/ftrace: fix clobbered r15 during livepatching 2025-04-29 11:03:07 +05:30
vdso powerpc/vdso: Fix build of VDSO32 with pcrel 2025-06-13 12:30:15 +05:30
.gitignore
85xx_entry_mapping.S
Makefile Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
align.c
asm-offsets.c powerpc/vdso: Switch to generic storage implementation 2025-02-21 09:54:02 +01:00
audit.c
audit_32.h
btext.c
cacheinfo.c
cacheinfo.h
compat_audit.c
cpu_setup_6xx.S
cpu_setup_44x.S
cpu_setup_e500.S
cpu_setup_pa6t.S
cpu_setup_power.c
cpu_setup_ppc970.S
cpu_specs.h
cpu_specs_8xx.h
cpu_specs_44x.h
cpu_specs_47x.h
cpu_specs_85xx.h
cpu_specs_book3s_32.h
cpu_specs_book3s_64.h
cpu_specs_e500mc.h
cputable.c
crash_dump.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
dawr.c
dbell.c
dexcr.c
dma-iommu.c powerpc: Remove some Cell leftovers 2025-02-26 21:15:07 +05:30
dma-mask.c
dma-swiotlb.c
dt_cpu_ftrs.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
early_32.c
eeh.c powerpc/eeh: Fix missing PE bridge reconfiguration during VFIO EEH recovery 2025-06-13 12:30:48 +05:30
eeh_cache.c
eeh_driver.c
eeh_event.c
eeh_pe.c
eeh_sysfs.c
entry_32.S
epapr_hcalls.S
epapr_paravirt.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
exceptions-64e.S
exceptions-64s.S powerpc/cell: Remove support for IBM Cell Blades 2025-02-26 21:15:07 +05:30
fadump.c fadump: Use str_yes_no() helper in fadump_show_config() 2025-04-16 22:25:22 +05:30
firmware.c
fpu.S
head_8xx.S powerpc/8xx: Fix kernel DTLB miss on dcbz 2024-10-11 15:53:06 +11:00
head_32.h
head_44x.S
head_64.S
head_85xx.S
head_book3s_32.S
head_booke.h
hw_breakpoint.c
hw_breakpoint_constraints.c
idle.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
idle_6xx.S
idle_64e.S
idle_85xx.S
idle_book3s.S
ima_arch.c
interrupt.c powerpc: enable dynamic preemption 2025-04-16 22:30:22 +05:30
interrupt_64.S
io.c powerpc/io: Use standard barrier macros in io.c 2025-02-26 21:15:09 +05:30
iomap.c
iommu.c powerpc/iommu: Use str_disabled_enabled() helper 2025-05-15 10:05:06 +05:30
irq.c powerpc/irq: use seq_put_decimal_ull_width() for decimal values 2024-11-10 22:33:52 +11:00
irq_64.c
isa-bridge.c
jump_label.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
kdebugfs.c
kgdb.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
kprobes-ftrace.c
kprobes.c powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
kvm.c
kvm_emul.S
l2cr_6xx.S
legacy_serial.c
mce.c
mce_power.c
misc.S
misc_32.S powerpc/32: Replace mulhdu() by mul_u64_u64_shr() 2024-12-10 08:15:30 +05:30
misc_64.S powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
module.c
module_32.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
module_64.c powerpc64/ftrace: fix module loading without patchable function entries 2025-04-15 11:40:54 +05:30
msi.c
note.S
nvram_64.c
optprobes.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
optprobes_head.S
paca.c
pci-common.c
pci-hotplug.c
pci_32.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
pci_64.c
pci_dn.c
pci_of_scan.c
pmc.c
ppc_save_regs.S
proc_powerpc.c powerpc: Replace strcpy() with strscpy() in proc_ppc64_init() 2025-05-15 09:54:54 +05:30
process.c powerpc: Don't use --- in kernel logs 2025-04-29 11:41:38 +05:30
prom.c powerpc/crash: use generic crashkernel reservation 2025-03-16 22:30:48 -07:00
prom_entry_64.S
prom_init.c powerpc/prom_init: Fixup missing #size-cells on PowerBook6,7 2025-03-07 19:08:38 +05:30
prom_init_check.sh
prom_parse.c
reloc_32.S
reloc_64.S
rethook.c
rtas-proc.c
rtas-rtc.c
rtas.c powerpc/pseries: Add a char driver for physical-attestation RTAS 2025-04-17 11:42:30 +05:30
rtas_entry.S
rtas_flash.c
rtas_pci.c
rtasd.c
secure_boot.c powerpc: Use str_enabled_disabled() helper function 2024-11-05 20:48:20 +11:00
security.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
secvar-ops.c
secvar-sysfs.c powerpc/secvar: Constify 'struct bin_attribute' 2025-02-21 09:20:32 +01:00
setup-common.c arch, mm: set max_mapnr when allocating memory map for FLATMEM 2025-03-17 22:06:52 -07:00
setup.h
setup_32.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
setup_64.c powerpc/io: Remove PPC_INDIRECT_MMIO 2025-02-26 21:15:08 +05:30
signal.c
signal.h
signal_32.c
signal_64.c
smp-tbsync.c
smp.c powerpc: Split systemcfg struct definitions out from vdso 2024-11-02 12:37:36 +01:00
stacktrace.c
static_call.c powerpc/static_call: Implement inline static calls 2025-02-26 21:09:43 +05:30
suspend.c
switch.S powerpc: Fix 'intra_function_call not a direct call' warning 2025-03-10 10:00:17 +05:30
swsusp.c
swsusp_32.S
swsusp_64.c
swsusp_85xx.S
swsusp_asm64.S
sys_ppc32.c
syscall.c
syscalls.c
sysfs.c powerpc/machdep: Drop include of dma-mapping.h 2024-10-29 23:01:05 +11:00
systbl.c
tau_6xx.c
time.c powerpc updates for 6.15 2025-03-27 19:39:08 -07:00
tm.S
traps.c powerpc: Rely on generic printing of preemption model 2025-03-17 11:23:39 +01:00
ucall.S
udbg.c powerpc: Remove UDBG_RTAS_CONSOLE 2025-02-26 21:15:09 +05:30
udbg_16550.c powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
uprobes.c
vdso.c powerpc/vdso: Switch to generic storage implementation 2025-02-21 09:54:02 +01:00
vdso32_wrapper.S powerpc/vdso: Mark the vDSO code read-only after init 2024-12-18 13:46:38 +05:30
vdso64_wrapper.S powerpc/vdso: Mark the vDSO code read-only after init 2024-12-18 13:46:38 +05:30
vecemu.c
vector.S
vmlinux.lds.S powerpc/vmlinux: Remove etext, edata and end 2025-02-24 12:26:21 +05:30
watchdog.c powerpc/watchdog: Switch to use hrtimer_setup() 2025-02-18 10:32:31 +01:00