Re: [Qemu-devel] about kvmclock QOM

2012-03-14 Thread Gavin Shan
What you are looking for is the parent property which gets set up by [...adding a child property to some object. Many devices are not yet wired up as such...] You mean that current device object should have one parent property? Its parent device should have one child property pointing to

Re: [Qemu-devel] [PATCH v10 3/3] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-06-15 Thread Gavin Shan
On Wed, Jun 11, 2014 at 07:37:48PM -0600, Alex Williamson wrote: On Thu, 2014-06-12 at 10:02 +1000, Gavin Shan wrote: On Wed, Jun 11, 2014 at 02:26:51PM -0600, Alex Williamson wrote: On Tue, 2014-06-10 at 12:03 +1000, Gavin Shan wrote: The patch implements sPAPRPHBClass::eeh_handler so

[Qemu-devel] [PATCH v1 3/3] sPAPR: Export RTAS property ibm, errinjct-tokens

2014-06-22 Thread Gavin Shan
The patch exports RTAS property ibm,errinjct-tokens, which is defined in PAPR spec and used to indicate various error types we can inject. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/hw/ppc

[Qemu-devel] [PATCH v1 0/3] Support PCI Error Injection

2014-06-22 Thread Gavin Shan
corresponding kernel changes as follows. Please comments, thanks! http://patchwork.ozlabs.org/patch/362637/ http://patchwork.ozlabs.org/patch/362638/ http://patchwork.ozlabs.org/patch/362639/ Gavin Shan (3): sPAPR: Implement PCI error injection RTAS calls sPAPR: Implement sPAPRPHBClass

[Qemu-devel] [PATCH v1 2/3] sPAPR: Implement sPAPRPHBClass::format_errinjct_cmd

2014-06-22 Thread Gavin Shan
The patch implements sPAPRPHBClass::format_errinjct_cmd to do the address translation (BUID+PE number to IOMMU group ID) and then come up with the formatted string for PCI error injection. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 19 +++ 1

[Qemu-devel] [PATCH v1 1/3] sPAPR: Implement PCI error injection RTAS calls

2014-06-22 Thread Gavin Shan
/sys/firmware/opal/errinjct to do error injection. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_rtas.c | 198 include/hw/pci-host/spapr.h | 11 +++ include/hw/ppc/spapr.h | 35 3 files changed, 244

Re: [Qemu-devel] [PATCH v1 1/3] sPAPR: Implement PCI error injection RTAS calls

2014-06-23 Thread Gavin Shan
On Mon, Jun 23, 2014 at 11:13:45PM +0200, Alexander Graf wrote: Am 23.06.2014 um 23:03 schrieb Benjamin Herrenschmidt b...@kernel.crashing.org: On Mon, 2014-06-23 at 18:18 +0200, Alexander Graf wrote: Device emulation code shouldn't even remotely have an idea what host it's running on.

Re: [Qemu-devel] [PATCH v1 1/3] sPAPR: Implement PCI error injection RTAS calls

2014-06-23 Thread Gavin Shan
On Mon, Jun 23, 2014 at 06:18:37PM +0200, Alexander Graf wrote: On 23.06.14 04:22, Gavin Shan wrote: The patch implements PCI error injection RTAS calls for sPAPR platform, which are defined PAPR spec as follows. Those RTAS calls are expected to be invoked in strict sequence of ibm,open-errinjct

Re: [Qemu-devel] [PATCH v10 1/3] sPAPR: Implement EEH RTAS calls

2014-06-24 Thread Gavin Shan
On Tue, Jun 24, 2014 at 04:43:23PM +0200, Alexander Graf wrote: On 10.06.14 04:03, 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

[Qemu-devel] [PATCH v11 3/3] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-06-25 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 56 + 1 file changed, 56 insertions(+) diff

[Qemu-devel] [PATCH v11 0/3] EEH Support for VFIO PCI Devices

2014-06-25 Thread Gavin Shan
(...). Gavin Shan (3): sPAPR: Implement EEH RTAS calls headers: Update kernel header sPAPR: Implement sPAPRPHBClass::eeh_handler hw/ppc/spapr_pci.c | 240 hw/ppc/spapr_pci_vfio.c | 56 +++ include/hw/pci-host/spapr.h | 7

[Qemu-devel] [PATCH v11 2/3] headers: Update kernel header

2014-06-25 Thread Gavin Shan
This updates kernel header (vfio.h) for EEH support on VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- linux-headers/linux/vfio.h | 34 ++ 1 file changed, 34 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux

[Qemu-devel] [PATCH v11 1/3] sPAPR: Implement EEH RTAS calls

2014-06-25 Thread Gavin Shan
. Error codes from that ioctl() are transferred back to the guest. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 240 include/hw/pci-host/spapr.h | 7 ++ include/hw/ppc/spapr.h | 33 ++ 3 files changed

Re: [Qemu-devel] [PATCH v11 1/3] sPAPR: Implement EEH RTAS calls

2014-06-26 Thread Gavin Shan
On Thu, Jun 26, 2014 at 12:30:16PM +0200, Alexander Graf wrote: On 26.06.14 03:35, 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

Re: [Qemu-devel] [PATCH v11 1/3] sPAPR: Implement EEH RTAS calls

2014-06-27 Thread Gavin Shan
On Thu, Jun 26, 2014 at 12:46:50PM +0200, Alexander Graf wrote: On 26.06.14 12:43, Gavin Shan wrote: On Thu, Jun 26, 2014 at 12:30:16PM +0200, Alexander Graf wrote: On 26.06.14 03:35, Gavin Shan wrote: The emulation for EEH RTAS requests from guest isn't covered by QEMU yet and the patch

[Qemu-devel] [PATCH v7 0/3] EEH Support for VFIO devices on sPAPR

2014-05-27 Thread Gavin Shan
: * All ioctl commands go to VFIO container fd instead of PCI device fd. * QEMU figures out the PE address directly. * Rely on sPAPRVFIOPHBState, which is one-to-one mapping with IOMMU group. Gavin Shan (3): headers: Sync with Linux header VFIO: Helper function to retrieve

[Qemu-devel] [PATCH v7 3/3] sPAPR: EEH support for VFIO PCI device

2014-05-27 Thread Gavin Shan
address is equal to IOMMU group ID. It can be used to distinguish sPAPRVFIOPHBState from sPAPRPHBState. As we're going to support EEH functonality for VFIO PCI devices, we simply return error if the EEH RTAS call is routed to non-VFIO PHB whose PE address is 0x. Signed-off-by: Gavin Shan

[Qemu-devel] [PATCH v7 1/3] headers: Sync with Linux header

2014-05-27 Thread Gavin Shan
The patch synchronizes with linux header (vfio.h). Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- linux-headers/linux/vfio.h | 66 ++ 1 file changed, 66 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index

[Qemu-devel] [PATCH v7 2/3] VFIO: Helper function to retrieve container fd

2014-05-27 Thread Gavin Shan
The patch adds function vfio_get_container_fd_by_group_id() to retrieve the container's fd of the specified VFIO group. The fd will be used by subsequent patches. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 17 + include/hw/misc/vfio.h | 1

Re: [Qemu-devel] [PATCH v7 2/3] VFIO: Helper function to retrieve container fd

2014-05-27 Thread Gavin Shan
On Tue, May 27, 2014 at 08:16:47AM -0600, Alex Williamson wrote: On Tue, 2014-05-27 at 18:51 +1000, Gavin Shan wrote: The patch adds function vfio_get_container_fd_by_group_id() to retrieve the container's fd of the specified VFIO group. The fd will be used by subsequent patches. Signed-off

Re: [Qemu-devel] [PATCH v7 2/3] VFIO: Helper function to retrieve container fd

2014-05-27 Thread Gavin Shan
On Tue, May 27, 2014 at 08:16:47AM -0600, Alex Williamson wrote: On Tue, 2014-05-27 at 18:51 +1000, Gavin Shan wrote: The patch adds function vfio_get_container_fd_by_group_id() to retrieve the container's fd of the specified VFIO group. The fd will be used by subsequent patches. Signed-off

Re: [Qemu-devel] [PATCH v7 3/3] sPAPR: EEH support for VFIO PCI device

2014-05-27 Thread Gavin Shan
On Wed, May 28, 2014 at 12:41:37AM +0200, Alexander Graf wrote: On 28.05.14 00:27, Benjamin Herrenschmidt wrote: On Wed, 2014-05-28 at 00:22 +0200, Alexander Graf wrote: .../... In any case, the above isn't the problem, we register rtas functions called rtas_ibm_*, that's fine. They're called

Re: [Qemu-devel] [PATCH v7 3/3] sPAPR: EEH support for VFIO PCI device

2014-05-28 Thread Gavin Shan
On Wed, May 28, 2014 at 01:24:15PM +0200, Alexander Graf wrote: On 28.05.14 06:12, Gavin Shan wrote: On Wed, May 28, 2014 at 12:41:37AM +0200, Alexander Graf wrote: On 28.05.14 00:27, Benjamin Herrenschmidt wrote: On Wed, 2014-05-28 at 00:22 +0200, Alexander Graf wrote: .../... In any case

[Qemu-devel] [PATCH v8 3/4] VFIO: Introduce helper vfio_pci_container_ioctl()

2014-06-05 Thread Gavin Shan
The patch introduces helper function vfio_pci_container_ioctl() to pass ioctl commands to the specified VFIO container that is identified by IOMMU group id. On sPAPR platform, each container only has one IOMMU group. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c

[Qemu-devel] [PATCH v8 4/4] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-06-05 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 54 + 1 file changed, 54 insertions(+) diff

[Qemu-devel] [PATCH v8 2/4] headers: Update kernel header

2014-06-05 Thread Gavin Shan
This updates kernel header (vfio.h) for EEH support on VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- linux-headers/linux/vfio.h | 35 +++ 1 file changed, 35 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux

[Qemu-devel] [PATCH v8 0/4] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
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. Gavin Shan (4): sPAPR

[Qemu-devel] [PATCH v8 1/4] sPAPR: Implement EEH RTAS calls

2014-06-05 Thread Gavin Shan
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 gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 248 include/hw/pci-host

Re: [Qemu-devel] [PATCH v8 1/4] sPAPR: Implement EEH RTAS calls

2014-06-05 Thread Gavin Shan
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

Re: [Qemu-devel] [PATCH v8 3/4] VFIO: Introduce helper vfio_pci_container_ioctl()

2014-06-05 Thread Gavin Shan
On Thu, Jun 05, 2014 at 02:11:21PM +0200, Alexander Graf wrote: On 05.06.14 08:53, Gavin Shan wrote: The patch introduces helper function vfio_pci_container_ioctl() to pass ioctl commands to the specified VFIO container that is identified by IOMMU group id. On sPAPR platform, each container only

Re: [Qemu-devel] [PATCH v8 3/4] VFIO: Introduce helper vfio_pci_container_ioctl()

2014-06-05 Thread Gavin Shan
On Thu, Jun 05, 2014 at 12:27:23PM -0600, Alex Williamson wrote: On Thu, 2014-06-05 at 16:53 +1000, Gavin Shan wrote: The patch introduces helper function vfio_pci_container_ioctl() to pass ioctl commands to the specified VFIO container that is identified by IOMMU group id. On sPAPR platform

Re: [Qemu-devel] [PATCH v7 2/4] vfio: Add vfio_container_spapr_get_info()

2014-06-05 Thread Gavin Shan
On Fri, Jun 06, 2014 at 09:40:56AM +1000, Alexey Kardashevskiy wrote: On 06/06/2014 05:27 AM, Alex Williamson wrote: On Thu, 2014-06-05 at 15:49 +1000, Alexey Kardashevskiy wrote: To perform DMA mapping via TCE table correctly, the guest must know where DMA window is located on the PCI bus. A

[Qemu-devel] [PATCH v9 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
- v9: * Update kernel header (vfio.h) according to changes applied to kerenl. * Rename rtas_finish_eeh_request() to rtas_handle_eeh_request(). * vfio_pci_container_ioctl() moved to Alexey's VFIO patchset. Gavin Shan (3): sPAPR: Implement EEH RTAS calls headers: Update

[Qemu-devel] [PATCH v9 3/3] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-06-05 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 56 + 1 file changed, 56 insertions(+) diff

[Qemu-devel] [PATCH v9 2/3] headers: Update kernel header

2014-06-05 Thread Gavin Shan
This updates kernel header (vfio.h) for EEH support on VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- linux-headers/linux/vfio.h | 34 ++ 1 file changed, 34 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux

[Qemu-devel] [PATCH v9 1/3] sPAPR: Implement EEH RTAS calls

2014-06-05 Thread Gavin Shan
. Error codes from that ioctl() are transferred back to the guest. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 248 include/hw/pci-host/spapr.h | 7 ++ include/hw/ppc/spapr.h | 33 ++ 3 files changed

[Qemu-devel] [PATCH v10 0/3] EEH Support for VFIO PCI Device

2014-06-09 Thread Gavin Shan
Gavin Shan (3): sPAPR: Implement EEH RTAS calls headers: Update kernel header sPAPR: Implement sPAPRPHBClass::eeh_handler hw/ppc/spapr_pci.c | 248 hw/ppc/spapr_pci_vfio.c | 56 ++ include/hw/pci-host/spapr.h | 7

[Qemu-devel] [PATCH v10 1/3] sPAPR: Implement EEH RTAS calls

2014-06-09 Thread Gavin Shan
. Error codes from that ioctl() are transferred back to the guest. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 248 include/hw/pci-host/spapr.h | 7 ++ include/hw/ppc/spapr.h | 33 ++ 3 files changed

[Qemu-devel] [PATCH v10 2/3] headers: Update kernel header

2014-06-09 Thread Gavin Shan
This updates kernel header (vfio.h) for EEH support on VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- linux-headers/linux/vfio.h | 34 ++ 1 file changed, 34 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux

[Qemu-devel] [PATCH v10 3/3] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-06-09 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 56 + 1 file changed, 56 insertions(+) diff

Re: [Qemu-devel] [PATCH v10 3/3] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-06-11 Thread Gavin Shan
On Wed, Jun 11, 2014 at 02:26:51PM -0600, Alex Williamson wrote: On Tue, 2014-06-10 at 12:03 +1000, Gavin Shan wrote: The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com

[Qemu-devel] [PATCH] sPAPR/IOMMU: Fix TCE entry permission

2014-07-14 Thread Gavin Shan
The permission of TCE entry should exclude physical base address. Otherwise, unmapping TCE entry can be interpreted to mapping TCE entry wrongly for VFIO devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 2 +- hw/ppc/spapr_iommu.c | 4 ++-- 2 files changed

[Qemu-devel] [PATCH v12 2/4] sPAPR: Implement EEH RTAS calls

2014-07-15 Thread Gavin Shan
the call. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 246 include/hw/pci-host/spapr.h | 7

[Qemu-devel] [PATCH v12 0/4] EEH Support for VFIO Devices

2014-07-15 Thread Gavin Shan
find_phb()/find_dev() public Gavin Shan (3): sPAPR: Implement EEH RTAS calls headers: Update kernel header sPAPR: Implement sPAPRPHBClass::eeh_handler hw/misc/vfio.c | 1 + hw/ppc/spapr_pci.c | 268 ++-- hw/ppc/spapr_pci_vfio.c

[Qemu-devel] [PATCH v12 1/4] spapr_pci: Make find_phb()/find_dev() public

2014-07-15 Thread Gavin Shan
From: Alexey Kardashevskiy a...@ozlabs.ru This makes find_phb()/find_dev() public and changed its names to spapr_pci_find_phb()/spapr_pci_find_dev() as they are going to be used from other parts of QEMU such as VFIO DDW (dynamic DMA window) or VFIO PCI error injection or VFIO EEH handling - in

[Qemu-devel] [PATCH v12 3/4] headers: Update kernel header

2014-07-15 Thread Gavin Shan
This updates kernel header (vfio.h) for EEH support on VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- linux-headers/linux/vfio.h | 34 ++ 1 file changed, 34 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux

[Qemu-devel] [PATCH v12 4/4] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-07-15 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 1 + hw/ppc/spapr_pci_vfio.c | 56 + 2

Re: [Qemu-devel] [PATCH v12 2/4] sPAPR: Implement EEH RTAS calls

2014-07-15 Thread Gavin Shan
On Wed, Jul 16, 2014 at 11:06:21AM +1000, Alexey Kardashevskiy wrote: On 07/16/2014 10:20 AM, 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

Re: [Qemu-devel] [PATCH v12 3/4] headers: Update kernel header

2014-07-15 Thread Gavin Shan
On Wed, Jul 16, 2014 at 11:09:44AM +1000, Alexey Kardashevskiy wrote: On 07/16/2014 10:20 AM, Gavin Shan wrote: This updates kernel header (vfio.h) for EEH support on VFIO PCI devices. Has this reached kernel upstream? The way linux headers update normally happens is you have to run scripts

Re: [Qemu-devel] [PATCH v12 3/4] headers: Update kernel header

2014-07-15 Thread Gavin Shan
On Wed, Jul 16, 2014 at 11:32:13AM +1000, Alexey Kardashevskiy wrote: On 07/16/2014 11:16 AM, Gavin Shan wrote: On Wed, Jul 16, 2014 at 11:09:44AM +1000, Alexey Kardashevskiy wrote: On 07/16/2014 10:20 AM, Gavin Shan wrote: This updates kernel header (vfio.h) for EEH support on VFIO PCI

[Qemu-devel] [RFC PATCH 1/2] VFIO: Drop vfio_container_do_ioctl()

2014-08-20 Thread Gavin Shan
The patch drops vfio_container_do_ioctl() and merges its logic to parent function call vfio_container_ioctl() so that the subsequent patches can reused the found VFIO group in vfio_container_ioctl(). Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 33

[Qemu-devel] [RFC PATCH 2/2] VFIO: Clear stale MSIx table during EEH reset

2014-08-20 Thread Gavin Shan
. The patch clears stale MSIx table before EEH PE reset so that MSIx table could be restored properly after EEH PE reset. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 24 1 file changed, 24 insertions(+) diff --git a/hw/misc/vfio.c b/hw/misc

[Qemu-devel] [RFC PATCH 0/2] Fix MSIx lost after PE reset

2014-08-20 Thread Gavin Shan
ppc-next branch + the patchset supporting EEH for guest, which can be checked out from below link: g...@github.com:gwshan/qemu.git (branch: eeh) Gavin Shan (2): VFIO: Drop vfio_container_do_ioctl() VFIO: Clear stale MSIx table during EEH reset hw/misc/vfio.c | 57

Re: [Qemu-devel] [RFC PATCH 0/2] Fix MSIx lost after PE reset

2014-08-25 Thread Gavin Shan
On Wed, Aug 20, 2014 at 07:52:06PM +1000, Gavin Shan wrote: The 2 patches fix MSIx lost after PE reset. Otherwise, the MSIx entries can't be restored successfully after PE reset and the EEH recovery fails on broadcom tg3 adapter (as tested) in guest. Note: The patchset EEH support for guest isn't

Re: [Qemu-devel] [RFC PATCH 2/2] VFIO: Clear stale MSIx table during EEH reset

2014-08-27 Thread Gavin Shan
On Tue, Aug 26, 2014 at 02:25:47PM -0600, Alex Williamson wrote: On Wed, 2014-08-20 at 19:52 +1000, Gavin Shan wrote: The PCI device MSIx table is cleaned out in hardware after EEH PE reset. However, we still hold the stale MSIx entries in QEMU, which should be cleared accordingly. Otherwise

[Qemu-devel] [RFC PATCH v2 1/2] VFIO: Drop vfio_container_do_ioctl()

2014-08-31 Thread Gavin Shan
The patch drops vfio_container_do_ioctl() and merges its logic to parent function call vfio_container_ioctl() so that the subsequent patches can reused the found VFIO group in vfio_container_ioctl(). Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 33

[Qemu-devel] [RFC PATCH v2 0/2] Fix MSIx lost after PE reset

2014-08-31 Thread Gavin Shan
ppc-next branch + the patchset supporting EEH for guest, which can be checked out from below link: g...@github.com:gwshan/qemu.git (branch: eeh) Gavin Shan (2): VFIO: Drop vfio_container_do_ioctl() VFIO: Clear stale MSIx table during EEH reset hw/misc/vfio.c | 65

[Qemu-devel] [RFC PATCH v2 2/2] VFIO: Clear stale MSIx table during EEH reset

2014-08-31 Thread Gavin Shan
. The patch clears stale MSIx table before EEH PE reset so that MSIx table could be restored properly after EEH PE reset. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/hw

Re: [Qemu-devel] [RFC PATCH v2 2/2] VFIO: Clear stale MSIx table during EEH reset

2014-09-02 Thread Gavin Shan
On Tue, Sep 02, 2014 at 02:10:42PM -0600, Alex Williamson wrote: On Mon, 2014-09-01 at 10:53 +1000, Gavin Shan wrote: The PCI device MSIx table is cleaned out in hardware after EEH PE reset. However, we still hold the stale MSIx entries in QEMU, which should be cleared accordingly. Otherwise

[Qemu-devel] [RFC PATCH v3 0/2] Fix MSIx lost after PE reset

2014-09-07 Thread Gavin Shan
HERE *** Gavin Shan (2): VFIO: Drop vfio_container_do_ioctl() VFIO: Clear stale interrupt vectors during reset hw/misc/vfio.c | 99 +- 1 file changed, 70 insertions(+), 29 deletions(-) -- 1.8.3.2

[Qemu-devel] [RFC PATCH v3 2/2] VFIO: Clear stale interrupt vectors during reset

2014-09-07 Thread Gavin Shan
) vectors. Otherwise, we will potentially lose chance to restore MSI or MSIx vectors when reenabling MSI or MSIx interrupts after reset. The patch clears stale MSI or MSIx vectors before machine/EEH reset so that MSI or MSIx vectors could be restored properly after EEH PE reset. Signed-off-by: Gavin

[Qemu-devel] [RFC PATCH v3 1/2] VFIO: Drop vfio_container_do_ioctl()

2014-09-07 Thread Gavin Shan
The patch drops vfio_container_do_ioctl() and merges its logic to parent function call vfio_container_ioctl() so that the subsequent patches can reused the found VFIO group in vfio_container_ioctl(). Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 33

Re: [Qemu-devel] [RFC PATCH v3 0/2] Fix MSIx lost after PE reset

2014-09-07 Thread Gavin Shan
On Mon, Sep 08, 2014 at 02:52:38PM +1000, Gavin Shan wrote: The 2 patches fix MSIx lost after PE reset. Otherwise, the MSIx entries can't be restored successfully after PE reset and the EEH recovery fails on broadcom tg3 adapter (as tested) in guest. The reset path (restarting machine) has

[Qemu-devel] [PATCH v13 1/3] spapr_pci: Make find_phb()/find_dev() public

2014-12-14 Thread Gavin Shan
- in all these cases there are RTAS calls which are addressed to BUID+config_addr in IEEE1275 format. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 22 +++--- include/hw/pci-host/spapr.h | 4

[Qemu-devel] [PATCH v13 2/3] sPAPR: Implement EEH RTAS calls

2014-12-14 Thread Gavin Shan
the call. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 246 include/hw/pci-host/spapr.h | 7

[Qemu-devel] [PATCH v13 3/3] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-12-14 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 1 + hw/ppc/spapr_pci_vfio.c | 56 + 2

[Qemu-devel] [PATCH v13 0/3] EEH Support for VFIO Devices

2014-12-14 Thread Gavin Shan
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. Alexey Kardashevskiy (1): spapr_pci: Make find_phb()/find_dev() public Gavin Shan (2): sPAPR: Implement EEH RTAS calls

Re: [Qemu-devel] [PATCH v13 2/3] sPAPR: Implement EEH RTAS calls

2014-12-15 Thread Gavin Shan
On Mon, Dec 15, 2014 at 03:52:17PM +0100, Alexander Graf wrote: On 15.12.14 01:15, 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

Re: [Qemu-devel] [PATCH v13 2/3] sPAPR: Implement EEH RTAS calls

2014-12-15 Thread Gavin Shan
On Tue, Dec 16, 2014 at 12:13:03AM +0100, Alexander Graf wrote: On 16.12.14 00:08, Gavin Shan wrote: On Mon, Dec 15, 2014 at 03:52:17PM +0100, Alexander Graf wrote: On 15.12.14 01:15, Gavin Shan wrote: The emulation for EEH RTAS requests from guest isn't covered by QEMU yet and the patch

Re: [Qemu-devel] [PATCH v13 2/3] sPAPR: Implement EEH RTAS calls

2014-12-15 Thread Gavin Shan
On Tue, Dec 16, 2014 at 01:08:52AM +0100, Alexander Graf wrote: On 16.12.14 00:29, Gavin Shan wrote: On Tue, Dec 16, 2014 at 12:13:03AM +0100, Alexander Graf wrote: On 16.12.14 00:08, Gavin Shan wrote: On Mon, Dec 15, 2014 at 03:52:17PM +0100, Alexander Graf wrote: On 15.12.14 01:15, Gavin

[Qemu-devel] [PATCH v14 0/3] EEH Support for VFIO Devices

2014-12-15 Thread Gavin Shan
as pointed by Alex Graf. Alexey Kardashevskiy (1): spapr_pci: Make find_phb()/find_dev() public Gavin Shan (2): sPAPR: Implement EEH RTAS calls sPAPR: Implement sPAPRPHBClass::eeh_handler hw/misc/vfio.c | 1 + hw/ppc/spapr_pci.c | 283

[Qemu-devel] [PATCH v14 1/3] spapr_pci: Make find_phb()/find_dev() public

2014-12-15 Thread Gavin Shan
- in all these cases there are RTAS calls which are addressed to BUID+config_addr in IEEE1275 format. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 22 +++--- include/hw/pci-host/spapr.h | 4

[Qemu-devel] [PATCH v14 2/3] sPAPR: Implement EEH RTAS calls

2014-12-15 Thread Gavin Shan
the call. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 261 include/hw/pci-host/spapr.h | 7

[Qemu-devel] [PATCH v14 3/3] sPAPR: Implement sPAPRPHBClass::eeh_handler

2014-12-15 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/misc/vfio.c | 1 + hw/ppc/spapr_pci_vfio.c | 56 + 2

Re: [Qemu-devel] [PATCH v13 2/3] sPAPR: Implement EEH RTAS calls

2014-12-24 Thread Gavin Shan
On Tue, Dec 23, 2014 at 03:22:06PM +1100, David Gibson wrote: On Mon, Dec 15, 2014 at 11:15:07AM +1100, 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

Re: [Qemu-devel] [PATCH v13 1/3] spapr_pci: Make find_phb()/find_dev() public

2014-12-24 Thread Gavin Shan
On Tue, Dec 23, 2014 at 03:24:58PM +1100, David Gibson wrote: On Mon, Dec 15, 2014 at 11:15:06AM +1100, Gavin Shan wrote: From: Alexey Kardashevskiy a...@ozlabs.ru This makes find_phb()/find_dev() public and changed its names to spapr_pci_find_phb()/spapr_pci_find_dev() as they are going

[Qemu-devel] [PATCH v16 1/2] sPAPR: Implement EEH RTAS calls

2015-02-03 Thread Gavin Shan
the call. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 310 include/hw/pci-host/spapr.h | 7 + include

[Qemu-devel] [PATCH v16 0/2] EEH Support for VFIO Devices

2015-02-03 Thread Gavin Shan
to spc Gavin Shan (2): sPAPR: Implement EEH RTAS calls sPAPR: Implement sPAPRPHBClass::eeh_handler hw/ppc/spapr_pci.c | 310 hw/ppc/spapr_pci_vfio.c | 58 + hw/vfio/common.c| 1 + include/hw/pci-host/spapr.h | 7

[Qemu-devel] [PATCH v16 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handler

2015-02-03 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 58 + hw/vfio/common.c| 1 + 2

Re: [Qemu-devel] [PATCH v16 1/2] sPAPR: Implement EEH RTAS calls

2015-02-05 Thread Gavin Shan
On Fri, Feb 06, 2015 at 11:58:25AM +1100, David Gibson wrote: On Thu, Feb 05, 2015 at 04:50:06PM +1100, Gavin Shan wrote: On Thu, Feb 05, 2015 at 02:19:49PM +1100, David Gibson wrote: On Wed, Feb 04, 2015 at 01:27:35PM +1100, Gavin Shan wrote: The emulation for EEH RTAS requests from guest

Re: [Qemu-devel] [PATCH v15 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handler

2015-01-14 Thread Gavin Shan
On Wed, Jan 14, 2015 at 12:41:59PM +1100, David Gibson wrote: On Mon, Jan 05, 2015 at 11:26:28AM +1100, Gavin Shan wrote: The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws

Re: [Qemu-devel] [PATCH v15 1/2] sPAPR: Implement EEH RTAS calls

2015-01-14 Thread Gavin Shan
On Wed, Jan 14, 2015 at 12:39:35PM +1100, David Gibson wrote: On Mon, Jan 05, 2015 at 11:26:27AM +1100, 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

Re: [Qemu-devel] [PATCH v15 1/2] sPAPR: Implement EEH RTAS calls

2015-01-14 Thread Gavin Shan
On Thu, Jan 15, 2015 at 12:33:59PM +1100, David Gibson wrote: On Thu, Jan 15, 2015 at 11:14:36AM +1100, Gavin Shan wrote: On Wed, Jan 14, 2015 at 12:39:35PM +1100, David Gibson wrote: On Mon, Jan 05, 2015 at 11:26:27AM +1100, Gavin Shan wrote: The emulation for EEH RTAS requests from guest

[Qemu-devel] [PATCH v17 1/2] sPAPR: Implement EEH RTAS calls

2015-02-10 Thread Gavin Shan
() to the IOMMU container fd to complete the calls. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 295

[Qemu-devel] [PATCH v17 2/2] sPAPR: Implement sPAPRPHBClass EEH callbacks

2015-02-10 Thread Gavin Shan
The patch implements sPAPRPHBClass EEH callbacks so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 98 + hw/vfio/common.c| 1 + 2

[Qemu-devel] [PATCH v17 0/2] EEH Support for VFIO Devices

2015-02-10 Thread Gavin Shan
* Return RTAS_OUT_PARAM_ERROR for invalid number of arguments to function rtas_ibm_slot_error_detail(), which is inconsistent with PAPR spec Gavin Shan (2): sPAPR: Implement EEH RTAS calls sPAPR: Implement sPAPRPHBClass EEH callbacks hw/ppc/spapr_pci.c | 295

Re: [Qemu-devel] [PATCH v18 1/2] sPAPR: Implement EEH RTAS calls

2015-02-19 Thread Gavin Shan
On Mon, Feb 16, 2015 at 04:32:09PM +1100, Gavin Shan wrote: On Mon, Feb 16, 2015 at 12:52:48PM +1100, David Gibson wrote: On Mon, Feb 16, 2015 at 10:16:01AM +1100, Gavin Shan wrote: The emulation for EEH RTAS requests from guest isn't covered by QEMU yet and the patch implements them

Re: [Qemu-devel] [Qemu-ppc] [PATCH v18 1/2] sPAPR: Implement EEH RTAS calls

2015-02-19 Thread Gavin Shan
On Fri, Feb 20, 2015 at 10:40:53AM +1100, David Gibson wrote: On Fri, Feb 20, 2015 at 09:50:45AM +1100, Gavin Shan wrote: On Wed, Feb 18, 2015 at 07:28:29PM -0600, Michael Roth wrote: Quoting Gavin Shan (2015-02-15 23:32:09) On Mon, Feb 16, 2015 at 12:52:48PM +1100, David Gibson wrote

[Qemu-devel] [PATCH v19 1/2] sPAPR: Implement EEH RTAS calls

2015-02-19 Thread Gavin Shan
() to the IOMMU container fd to complete the calls. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com Reviewed-by: David Gibson da...@gibson.dropbear.id.au --- hw/ppc/spapr_pci.c

[Qemu-devel] [PATCH v19 0/2] EEH Support for VFIO Devices

2015-02-19 Thread Gavin Shan
). * 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

[Qemu-devel] [PATCH v19 2/2] sPAPR: Implement sPAPRPHBClass EEH callbacks

2015-02-19 Thread Gavin Shan
The patch implements sPAPRPHBClass EEH callbacks so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com Reviewed-by: David Gibson da...@gibson.dropbear.id.au --- hw/ppc/spapr_pci_vfio.c | 115

Re: [Qemu-devel] [PATCH v17 1/2] sPAPR: Implement EEH RTAS calls

2015-02-11 Thread Gavin Shan
On Thu, Feb 12, 2015 at 04:15:01PM +1100, David Gibson wrote: On Wed, Feb 11, 2015 at 02:13:59PM +1100, 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

[Qemu-devel] [PATCH v18 1/2] sPAPR: Implement EEH RTAS calls

2015-02-15 Thread Gavin Shan
() to the IOMMU container fd to complete the calls. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 281

[Qemu-devel] [PATCH v18 2/2] sPAPR: Implement sPAPRPHBClass EEH callbacks

2015-02-15 Thread Gavin Shan
The patch implements sPAPRPHBClass EEH callbacks so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 98 + hw/vfio/common.c| 1 + 2

[Qemu-devel] [PATCH v18 0/2] EEH Support for VFIO Devices

2015-02-15 Thread Gavin Shan
: 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 | 281 hw/ppc/spapr_pci_vfio.c

Re: [Qemu-devel] [PATCH v18 1/2] sPAPR: Implement EEH RTAS calls

2015-02-15 Thread Gavin Shan
On Mon, Feb 16, 2015 at 12:52:48PM +1100, David Gibson wrote: On Mon, Feb 16, 2015 at 10:16:01AM +1100, 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

Re: [Qemu-devel] [PATCH v16 1/2] sPAPR: Implement EEH RTAS calls

2015-02-04 Thread Gavin Shan
On Thu, Feb 05, 2015 at 02:19:49PM +1100, David Gibson wrote: On Wed, Feb 04, 2015 at 01:27:35PM +1100, 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

Re: [Qemu-devel] [PATCH v16 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handler

2015-02-04 Thread Gavin Shan
On Thu, Feb 05, 2015 at 02:26:16PM +1100, David Gibson wrote: On Wed, Feb 04, 2015 at 01:27:36PM +1100, Gavin Shan wrote: The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws

[Qemu-devel] [PATCH v15 1/2] sPAPR: Implement EEH RTAS calls

2015-01-04 Thread Gavin Shan
the call. Error codes from that ioctl() are transferred back to the guest. [aik: defined RTAS tokens for EEH RTAS calls] Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci.c | 275 include/hw/pci-host/spapr.h | 7

[Qemu-devel] [PATCH v15 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handler

2015-01-04 Thread Gavin Shan
The patch implements sPAPRPHBClass::eeh_handler so that the EEH RTAS requests can be routed to VFIO for further handling. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- hw/ppc/spapr_pci_vfio.c | 56 + hw/vfio/common.c| 1 + 2

  1   2   3   4   5   6   7   8   9   10   >