From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsiVy-00072R-8O for qemu-devel@nongnu.org; Thu, 05 Jun 2014 21:00:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsiVo-0006DF-5I for qemu-devel@nongnu.org; Thu, 05 Jun 2014 21:00:14 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:57789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsiVn-00068q-Dc for qemu-devel@nongnu.org; Thu, 05 Jun 2014 21:00:04 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jun 2014 10:59:58 +1000 Date: Fri, 6 Jun 2014 10:59:56 +1000 From: Gavin Shan Message-ID: <20140606005956.GA18053@shangw> References: <1401951221-32613-1-git-send-email-gwshan@linux.vnet.ibm.com> <1401951221-32613-2-git-send-email-gwshan@linux.vnet.ibm.com> <53905DEA.3050804@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53905DEA.3050804@suse.de> Subject: Re: [Qemu-devel] [PATCH v8 1/4] sPAPR: Implement EEH RTAS calls Reply-To: Gavin Shan List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: aik@ozlabs.ru, Gavin Shan , qemu-devel@nongnu.org, alex.williamson@redhat.com, qemu-ppc@nongnu.org, qiudayu@linux.vnet.ibm.com On Thu, Jun 05, 2014 at 02:09:14PM +0200, Alexander Graf wrote: > >On 05.06.14 08:53, Gavin Shan wrote: >>The emulation for EEH RTAS requests from guest isn't covered >>by QEMU yet and the patch implements them. >> >>The patch defines constants used by EEH RTAS calls and adds >>callback sPAPRPHBClass::eeh_handler, which is going to be used >>this way: >> >>1. RTAS calls are received in spapr_pci.c, sanity check is done >> there. >>2. RTAS handlers handle what they can. If there is something it >> cannot handle and sPAPRPHBClass::eeh_handler callback is defined, >> it is called. >>3. 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. >> >>This adds 6 RTAS handlers, all defined in SPAPR specification: >> >>1) ibm,set-eeh-option: disables/enables EEH on a device, removes PE from >>stopped state; >>2) ibm,get-config-addr-info2 - returns fabric configuration address (upper >>PCI bridge or PHB if there is no bridge); >>3) ibm,read-slot-reset-state2 - retrieve PE state; >>4) ibm,set-slot-reset - issue PE reset; >>5) ibm,configure-pe - configure PCI bridges in the affected PE; >>6) ibm,slot-error-detail - retrieve EEH error log; >> >>All calls use fabric configuration address (a.k.a. PE address) as a target >>address except ibm,get-config-addr-info2 and one case (enable EEH on the >>specified PCI function) for ibm,set-eeh-option. >> >>Signed-off-by: Gavin Shan >>--- >> hw/ppc/spapr_pci.c | 248 ++++++++++++++++++++++++++++++++++++++++++++ >> include/hw/pci-host/spapr.h | 7 ++ >> include/hw/ppc/spapr.h | 33 ++++++ >> 3 files changed, 288 insertions(+) >> >>diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c >>index a9f307a..423e4ff 100644 >>--- a/hw/ppc/spapr_pci.c >>+++ b/hw/ppc/spapr_pci.c >>@@ -422,6 +422,241 @@ static void rtas_ibm_query_interrupt_source_number(PowerPCCPU *cpu, >> rtas_st(rets, 2, 1);/* 0 == level; 1 == edge */ >> } >>+static int rtas_finish_eeh_request(sPAPRPHBState *sphb, >>+ uint32_t req, uint32_t opt, >>+ target_ulong rets) > >The only thing I dislike about this patch is the name of this >function. It doesn't finish the eeh request - it actually does it :). > Ok. I'll change it to rtas_handle_eeh_request() :-) Thanks, Gavin > >Alex >