linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 00/22] EEH Support for VFIO PCI devices on PowerKVM guest
@ 2014-05-05  1:27 Gavin Shan
  2014-05-05  1:27 ` [PATCH 01/22] powerpc: Introduce CONFIG_KVM_EEH Gavin Shan
                   ` (22 more replies)
  0 siblings, 23 replies; 28+ messages in thread
From: Gavin Shan @ 2014-05-05  1:27 UTC (permalink / raw)
  To: linuxppc-dev, kvm, kvm-ppc; +Cc: aik, alex.williamson, qiudayu, Gavin Shan

The series of patches intends to support EEH for PCI devices, which have been
passed through to PowerKVM based guest via VFIO. The implementation is
straightforward based on the issues or problems we have to resolve to support
EEH for PowerKVM based guest.

- Emulation for EEH RTAS requests. Thanksfully, we already have infrastructure
  to emulate XICS. Without introducing new mechanism, we just extend that
  existing infrastructure to support EEH RTAS emulation. EEH RTAS requests
  initiated from guest are posted to host where the requests get handled or
  delivered to underly firmware for further handling. For that, the host kerenl
  has to maintain the PCI address (host domain/bus/slot/function to guest's
  PHB BUID/bus/slot/function) mapping via KVM VFIO device. The address mapping
  will be built when initializing VFIO device in QEMU and destroied when the
  VFIO device in QEMU is going to offline, or VM is destroy.

- The infrastructure for error injection is introduced. The emulation for the
  related RTAS services is similar to what we do for EEH/XICS RTAS requests.
  For now, we just support PCI error injection. We need extend it for injecting
  other types of errors in future.

The series of patches requires corresponding firmware changes from Mike Qiu to
support error injection and QEMU changes to support EEH for guest. It also needs
QEMU changes to support it. QEMU patchset will be sent separately.

I usually use command line (not virsh) to start PowerKVM based guests on Firebird-L
machine with different types of PCI devices assigend (passed through) to guest.
Following cases have been tested. The EEH error can be injected by utility "errinjct"
running on guest successfully and we can recover from the EEH error successfully.

Testing on P7
=============

- Emulex adapter
- USB (OHCI) PCI adapter

Testing on P8
=============

- MLX4 adapter (Partially)
- USB (xHCI) PCI adapter

-----

arch/powerpc/include/asm/book3s_errinjct.h     |  97 ++++++++++++++++++++++++
arch/powerpc/include/asm/eeh.h                 |  78 ++++++++++++++++++++
arch/powerpc/include/asm/kvm_ppc.h             |   7 ++
arch/powerpc/include/asm/opal.h                |  65 ++++++++++++++++
arch/powerpc/kernel/eeh.c                      |   8 ++
arch/powerpc/kernel/eeh_pe.c                   | 297 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
arch/powerpc/kvm/Kconfig                       |  17 +++++
arch/powerpc/kvm/Makefile                      |   6 ++
arch/powerpc/kvm/book3s_errinjct.c             | 329 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
arch/powerpc/kvm/book3s_hv.c                   |   2 +
arch/powerpc/kvm/book3s_rtas.c                 |  67 +++++++++++++++++
arch/powerpc/platforms/powernv/Makefile        |   2 +
arch/powerpc/platforms/powernv/eeh-ioda.c      |   3 +-
arch/powerpc/platforms/powernv/eeh-rtas.c      | 551 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
arch/powerpc/platforms/powernv/errinjct.c      | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++++
arch/powerpc/platforms/powernv/opal-wrappers.S |   1 +
include/linux/kvm_host.h                       |  21 ++++++
include/uapi/linux/kvm.h                       |  10 +++
virt/kvm/vfio.c                                |  60 ++++++++++++++-
19 files changed, 1834 insertions(+), 2 deletions(-)
create mode 100644 arch/powerpc/include/asm/book3s_errinjct.h
create mode 100644 arch/powerpc/kvm/book3s_errinjct.c
create mode 100644 arch/powerpc/platforms/powernv/eeh-rtas.c
create mode 100644 arch/powerpc/platforms/powernv/errinjct.c

Thanks,
Gavin

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2014-05-06  7:15 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-05  1:27 [PATCH RFC 00/22] EEH Support for VFIO PCI devices on PowerKVM guest Gavin Shan
2014-05-05  1:27 ` [PATCH 01/22] powerpc: Introduce CONFIG_KVM_EEH Gavin Shan
2014-05-05  1:27 ` [PATCH 02/22] powerpc/eeh: Info to trace passed devices Gavin Shan
2014-05-05  1:27 ` [PATCH 03/22] powerpc/eeh: Search EEH device by guest address Gavin Shan
2014-05-05  1:27 ` [PATCH 04/22] powerpc/eeh: Search EEH PE " Gavin Shan
2014-05-05  1:27 ` [PATCH 05/22] powerpc/eeh: Release VFIO dev on VM destruction Gavin Shan
2014-05-05  1:27 ` [PATCH 06/22] powerpc/eeh: Function for address mapping Gavin Shan
2014-05-05  1:27 ` [PATCH 07/22] powerpc/eeh: Function to tear down " Gavin Shan
2014-05-05  1:27 ` [PATCH 08/22] kvm: Address mapping for VFIO device Gavin Shan
2014-05-05  1:27 ` [PATCH 09/22] powerpc/powernv: EEH RTAS emulation backend Gavin Shan
2014-05-05  1:27 ` [PATCH 10/22] powerpc/eeh: Introduce kvmppc_eeh_format_addr() Gavin Shan
2014-05-05  1:28 ` [PATCH 11/22] powerpc/eeh: Emulate RTAS call ibm,set-eeh-option Gavin Shan
2014-05-05  1:28 ` [PATCH 12/22] powerpc/eeh: Emulate RTAS call ibm,set-slot-reset Gavin Shan
2014-05-05  1:28 ` [PATCH 13/22] powerpc/eeh: Emulate RTAS call ibm, read-slot-reset-state2 Gavin Shan
2014-05-05  1:28 ` [PATCH 14/22] powerpc/eeh: Emulate RTAS call ibm, get-config-addr-info2 Gavin Shan
2014-05-05  1:28 ` [PATCH 15/22] powerpc/eeh: Emulate RTAS call ibm,slot-error-detail Gavin Shan
2014-05-05  1:28 ` [PATCH 16/22] powerpc/eeh: Emulate RTAS call ibm,configure-pe Gavin Shan
2014-05-05  1:28 ` [PATCH 17/22] powerpc/kvm: Connect EEH RTAS emulation backend Gavin Shan
2014-05-05  1:28 ` [PATCH 18/22] powerpc/eeh: Avoid event on passed PE Gavin Shan
2014-05-05  1:28 ` [PATCH 19/22] powerpc: Introduce CONFIG_KVM_ERRINJCT Gavin Shan
2014-05-05  1:28 ` [PATCH 20/22] powerpc/kvm: Infrastructure for error injection Gavin Shan
2014-05-05  1:28 ` [PATCH 21/22] powerpc/powernv: Sync OPAL header file with firmware Gavin Shan
2014-05-05  1:28 ` [PATCH 22/22] powerpc/powernv: Support PCI error injection Gavin Shan
2014-05-05 11:56 ` [PATCH RFC 00/22] EEH Support for VFIO PCI devices on PowerKVM guest Alexander Graf
2014-05-05 14:00   ` Alex Williamson
2014-05-06  4:26     ` Gavin Shan
2014-05-06  6:56       ` Alexander Graf
2014-05-06  7:14         ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).