From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSZyq-0004bc-VQ for qemu-devel@nongnu.org; Mon, 02 Mar 2015 18:42:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSZyl-0007Ci-S0 for qemu-devel@nongnu.org; Mon, 02 Mar 2015 18:42:32 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:58787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSZyl-0007BW-4B for qemu-devel@nongnu.org; Mon, 02 Mar 2015 18:42:27 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Mar 2015 09:42:21 +1000 Date: Tue, 3 Mar 2015 10:41:19 +1100 From: Gavin Shan Message-ID: <20150302234119.GA7422@shangw> References: <1424408333-26548-1-git-send-email-gwshan@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424408333-26548-1-git-send-email-gwshan@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v19 0/2] EEH Support for VFIO Devices Reply-To: Gavin Shan List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gavin Shan Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, alex.williamson@redhat.com, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au On Fri, Feb 20, 2015 at 03:58:51PM +1100, Gavin Shan wrote: agraf, could you help taking a look on this when you have available time? Thanks, Gavin >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 callback is defined, it is called. >* sPAPRPHBClass EEH callbacks are 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 >========= >v18 -> v19: > * Check the validity of PCI device address in sPAPRPHBClass::eeh_set_option() > when enabling EEH functionality. >v17 -> v18: > * Check options in sPAPRPHBClass callbacks for RTAS call "ibm,set-eeh-option" > and "ibm,set-slot-reset". > * Return RTAS_OUT_PARAM_ERROR on errors and RTAS_OUT_NO_ERRORS_FOUND on success > as we don't have error log yet. >v16 -> v17: > * Split sPAPRPHBClass::eeh_handler() to multiple callbacks according to David > Gibson's suggestion > * Make comments for the form of PE address more precise and merge the condition > checking on the option in rtas_ibm_get_config_addr_info2() to improve code > readability > * Return RTAS_OUT_PARAM_ERROR for invalid number of arguments to function > rtas_ibm_slot_error_detail(), which is inconsistent with PAPR spec >v15 -> v16: > * Drop rtas_handle_eeh_request() and merge the logic to its callers so that > more accurate return values can be returned for RTAS calls in the callers > * Always return 1 ("No error log") for RTAS call "ibm,slot-error-detail" and > correct wrong return values for other RTAS calls according to David Gibson's > suggestions. > * Make fall-through more obvious for case of negative return value from > sPAPRPHBClass::eeh_handler() > * Clear the argument buffer passed to ioctl() > * Rename sPAPRPHBClass variable from "info" to "spc" >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. >v13 -> v14: > * Check if sPAPRPHBState instance is valid before converting it to the > corresponding class as pointed by Alex Graf. >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. > >Gavin Shan (2): > sPAPR: Implement EEH RTAS calls > sPAPR: Implement sPAPRPHBClass EEH callbacks > > hw/ppc/spapr_pci.c | 271 ++++++++++++++++++++++++++++++++++++++++++++ > hw/ppc/spapr_pci_vfio.c | 115 +++++++++++++++++++ > hw/vfio/common.c | 1 + > include/hw/pci-host/spapr.h | 4 + > include/hw/ppc/spapr.h | 43 ++++++- > 5 files changed, 432 insertions(+), 2 deletions(-) > >-- >1.8.3.2 >