From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7w0B-00068p-Ul for qemu-devel@nongnu.org; Sun, 04 Jan 2015 19:58:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7w03-0005Zu-Di for qemu-devel@nongnu.org; Sun, 04 Jan 2015 19:58:35 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:34102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7w02-0005ZL-Qe for qemu-devel@nongnu.org; Sun, 04 Jan 2015 19:58:27 -0500 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 Jan 2015 10:58:21 +1000 From: Gavin Shan Date: Mon, 5 Jan 2015 11:26:26 +1100 Message-Id: <1420417588-32562-1-git-send-email-gwshan@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v15 0/2] EEH Support for VFIO Devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, agraf@suse.de, Gavin Shan , alex.williamson@redhat.com, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au The series of patches adds support EEH for VFIO PCI devices on sPAPR platform. It requires corresponding host kernel support, which was merged during 3.17 merge window. This patchset has been rebased to Alex Graf's QEMU repository: git://github.com/agraf/qemu.git (branch: ppc-next) The implementations notes are below. Please consider for merging! * RTAS calls are received in spapr_pci.c, sanity check is done there. RTAS handlers handle what they can. If there is something it cannot handle and sPAPRPHBClass::eeh_handler callback is defined, it is called. * sPAPRPHBClass::eeh_handler is only implemented for VFIO now. It does ioctl() to the IOMMU container fd to complete the call. Error codes from that ioctl() are transferred back to the guest. Changelog ========= v12 -> v13: * Rebase to Alex Graf's QEMU repository ("ppc-next" branch). * Drop the patch for header file (vfio.h) changes, which was merged to QEMU repository by commit a9fd1654 ("linux-headers: update to 3.17-rc7"). * Retested on Emulex adapter and EEH errors are recovered successfully. v13 -> v14: * Check if sPAPRPHBState instance is valid before converting it to the corresponding class as pointed by Alex Graf. v14 -> v15: * Dropped unrelated patch making find_phb()/find_dev() public. * Checking RTAS parameter number before accessing RTAS parameter buffer for more safety. * Return hardware error from RTAS call "ibm,set-eeh-option" and "ibm,set-slot-reset" for some cases according to PAPR spec. Gavin Shan (2): sPAPR: Implement EEH RTAS calls sPAPR: Implement sPAPRPHBClass::eeh_handler hw/ppc/spapr_pci.c | 275 ++++++++++++++++++++++++++++++++++++++++++++ hw/ppc/spapr_pci_vfio.c | 56 +++++++++ hw/vfio/common.c | 1 + include/hw/pci-host/spapr.h | 7 ++ include/hw/ppc/spapr.h | 43 ++++++- 5 files changed, 380 insertions(+), 2 deletions(-) -- 1.8.3.2