[Qemu-devel] [PATCH 3/3] sPAPR: Support RTAS call ibm,errinjct

2015-03-10 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 47 + hw/ppc/spapr_pci_vfio.c | 99 + hw/ppc/spapr_rtas.c | 87 ++- incl

[Qemu-devel] [PATCH 1/3] linux-headers: Sync vfio.h

2015-03-10 Thread Gavin Shan
The patch synchronizes vfio.h with the kernel to support EEH error injection. Signed-off-by: Gavin Shan --- linux-headers/linux/vfio.h | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h

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

2015-03-11 Thread Gavin Shan
On Thu, Mar 12, 2015 at 12:04:59PM +1100, David Gibson wrote: >On Wed, Mar 11, 2015 at 05:11:52PM +1100, 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 b

Re: [Qemu-devel] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset

2015-03-11 Thread Gavin Shan
On Thu, Mar 12, 2015 at 12:48:16PM +1100, David Gibson wrote: >On Wed, Mar 11, 2015 at 05:11:53PM +1100, Gavin Shan wrote: >> When Linux guest recovers from EEH error on the following Emulex >> adapter, the MSIx interrupts are disabled and the INTx emulation >> is enabled.

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

2015-03-15 Thread Gavin Shan
On Fri, Mar 13, 2015 at 03:33:50PM -0600, Alex Williamson wrote: >On Wed, 2015-03-11 at 17:11 +1100, 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 b

Re: [Qemu-devel] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset

2015-03-15 Thread Gavin Shan
On Fri, Mar 13, 2015 at 03:51:27PM -0600, Alex Williamson wrote: >On Wed, 2015-03-11 at 17:11 +1100, Gavin Shan wrote: >> When Linux guest recovers from EEH error on the following Emulex >> adapter, the MSIx interrupts are disabled and the INTx emulation >> is enabled.

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset

2015-03-16 Thread Gavin Shan
On Mon, Mar 16, 2015 at 03:05:32PM +1100, Benjamin Herrenschmidt wrote: >On Mon, 2015-03-16 at 12:04 +1100, Gavin Shan wrote: >> >> >> (2) QEMU sends IOCTL commands to host to disable MSIx and enable INTx. At >> this stage the INTx is still masked. At later poi

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset

2015-03-16 Thread Gavin Shan
On Mon, Mar 16, 2015 at 09:05:27AM -0600, Alex Williamson wrote: >On Tue, 2015-03-17 at 01:34 +1100, Gavin Shan wrote: >> On Mon, Mar 16, 2015 at 03:05:32PM +1100, Benjamin Herrenschmidt wrote: >> >On Mon, 2015-03-16 at 12:04 +1100, Gavin Shan wrote: >> >> >>

[Qemu-devel] [PATCH v2 3/3] sPAPR: Reenable EEH functionality on reboot

2015-03-16 Thread Gavin Shan
ity on PEs on PHB's reset callback, which will clear their frozen states if needed. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci_vfio.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c index 99a1be5..0cd96

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

2015-03-16 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 --- v2: vfio_container_eeh_event() stub for !CONFIG_PCI and separate error message for this function. Dropped vfio_put_group() on NULL group

[Qemu-devel] [PATCH v2 2/3] VFIO: Disable INTx interrupt on EEH reset

2015-03-16 Thread Gavin Shan
oing EEH reset to avoid the issue. Signed-off-by: Gavin Shan --- hw/vfio/pci.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index fca1edc..bfa3d0c 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3340,6 +3340,14 @@ int vfio_container_eeh_event(A

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

2014-05-27 Thread Gavin Shan
n value from ioctl() to RTAS return value insteadly. v6 -> v7: * 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 (

[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

[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 --- 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 f0aa97d..4eda000 100644

[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 --- hw/misc/vfio.c | 17 + include/hw/misc/vfio.h | 1 + 2 files change

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 >

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 >

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

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

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

2014-06-04 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 --- hw/misc/vfio.c | 31

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

2014-06-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 --- hw/ppc/spapr_pci_vfio.c | 54 + 1 file changed, 54 insertions(+) diff --git a/hw/ppc

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

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

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

2014-06-04 Thread Gavin Shan
ng 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):

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

2014-06-04 Thread Gavin Shan
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 ++ inclu

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

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.

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 IOM

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

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

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

[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 --- hw/ppc/spapr_pci_vfio.c | 56 + 1 file changed, 56 insertions(+) diff --git a/hw/ppc

[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 --- linux-headers/linux/vfio.h | 34 ++ 1 file changed, 34 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index f0aa97d

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

2014-06-05 Thread Gavin Shan
call. Error codes from that ioctl() are transferred back to the guest. 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(+)

Re: [Qemu-devel] [PATCH v8 0/7] sPAPR: Support EEH Error Injection

2015-10-01 Thread Gavin Shan
On Tue, Sep 15, 2015 at 08:03:19AM +0200, Thomas Huth wrote: >On 14/09/15 06:14, David Gibson wrote: >> On Mon, Sep 14, 2015 at 11:36:08AM +1000, Gavin Shan wrote: >>> The patchset depends on below Linux upstream commits: >>> >>> commit ed3e81f ("po

[Qemu-devel] [PATCH v4 0/3] sPAPR: EEH fixes

2015-07-01 Thread Gavin Shan
PATCH[2] * Move the whole logic into sPAPR platform in PATCH[3] Gavin Shan (3): sPAPR: Don't enable EEH on emulated PCI devices sPAPR: Reenable EEH functionality on reboot sPAPR: Clear stale MSIx table during EEH reset hw/ppc/spapr_pci.c | 7 ++ hw/pp

[Qemu-devel] [PATCH v4 1/3] sPAPR: Don't enable EEH on emulated PCI devices

2015-07-01 Thread Gavin Shan
There might have emulated PCI devices, together with VFIO PCI devices under one PHB. The EEH capability shouldn't enabled on emulated PCI devices. The patch returns error when enabling EEH capability on emulated PCI devices by RTAS call "ibm,set-eeh-option". Signed-off-by: Gavi

[Qemu-devel] [PATCH v4 2/3] sPAPR: Reenable EEH functionality on reboot

2015-07-01 Thread Gavin Shan
ity on PEs on PHB's reset callback, which will clear their frozen states if needed. Signed-off-by: Gavin Shan Reviewed-by: David Gibson --- v4: Separate function to reenable EEH functionality --- hw/ppc/spapr_pci_vfio.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion

[Qemu-devel] [PATCH v4 3/3] sPAPR: Clear stale MSIx table during EEH reset

2015-07-01 Thread Gavin Shan
. The patch introduces function spapr_phb_vfio_eeh_pre_reset(), which is called by sPAPR when asserting hot or fundamental reset, to clear stale MSIx table for VFIO PCI devices before EEH PE reset so that MSIx table could be restored properly after EEH PE reset. Signed-off-by: Gavin Shan --- v4

[Qemu-devel] [PATCH v2 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-07-31 Thread Gavin Shan
The patch supports RTAS calls "ibm,{open,close}-errinjct" to manupliate the token, which is passed to RTAS call "ibm,errinjct" to indicate the valid context for error injection. Each VM is permitted to have only one token at once and we simply have one random number for that.

[Qemu-devel] [PATCH v2 0/3] sPAPR: Support EEH Error Injection

2015-07-31 Thread Gavin Shan
y for VFIO PCI devices. = Changelog = v1 -> v2: * Rebased to git://github.com/dgibson/qemu.git (branch: spapr-next) * Remove specific PCI error types in hw/ppc/spapr.h. Use those macros asm-powerpc/eeh.h instead. Gavin Shan (3): linux-headers: Add eeh.h sPAPR

[Qemu-devel] [PATCH v2 1/3] linux-headers: Add eeh.h

2015-07-31 Thread Gavin Shan
The header file was introduced by following Linux upstream commits: commit ed3e81f ("powerpc/eeh: Move PE state constants around") commit ec33d36 ("powerpc/eeh: Introduce eeh_pe_inject_err()") Signed-off-by: Gavin Shan --- linux-headers/as

Re: [Qemu-devel] [PATCH v2 0/3] sPAPR: Support EEH Error Injection

2015-08-02 Thread Gavin Shan
On Sat, Aug 01, 2015 at 02:31:30PM +1000, Gavin Shan wrote: It seems my email doesn't work well in some cases. There are 3 patches, but only 2 were sent successfully. Please ignore it and I'll resend the whole patchset. Thanks, Gavin >The patchset depends on below Linux ups

[Qemu-devel] [PATCH RESEND v2 0/3] sPAPR: Support EEH Error Injection

2015-08-02 Thread Gavin Shan
y for VFIO PCI devices. = Changelog = v1 -> v2: * Rebased to git://github.com/dgibson/qemu.git (branch: spapr-next) * Remove specific PCI error types in hw/ppc/spapr.h. Use those macros asm-powerpc/eeh.h instead. Gavin Shan (3): linux-headers: Add eeh.h sPAPR

[Qemu-devel] [PATCH RESEND v2 1/3] linux-headers: Add eeh.h

2015-08-02 Thread Gavin Shan
The header file was introduced by following Linux upstream commits: commit ed3e81f ("powerpc/eeh: Move PE state constants around") commit ec33d36 ("powerpc/eeh: Introduce eeh_pe_inject_err()") Signed-off-by: Gavin Shan --- linux-headers/as

[Qemu-devel] [PATCH RESEND v2 3/3] sPAPR: Support RTAS call ibm, errinjct

2015-08-02 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 42 ++ hw/ppc/spapr_pci_vfio.c | 56 + hw/ppc/spapr_rtas.c | 85 + include/h

[Qemu-devel] [PATCH RESEND v2 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-02 Thread Gavin Shan
The patch supports RTAS calls "ibm,{open,close}-errinjct" to manupliate the token, which is passed to RTAS call "ibm,errinjct" to indicate the valid context for error injection. Each VM is permitted to have only one token at once and we simply have one random number for that.

[Qemu-devel] [PATCH v2 3/3] sPAPR: Support RTAS call ibm,errinjct

2015-08-02 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 42 ++ hw/ppc/spapr_pci_vfio.c | 56 + hw/ppc/spapr_rtas.c | 85 + include/h

Re: [Qemu-devel] [PATCH RESEND v2 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-02 Thread Gavin Shan
On Mon, Aug 03, 2015 at 12:51:09PM +1000, David Gibson wrote: >On Mon, Aug 03, 2015 at 09:23:19AM +1000, Gavin Shan wrote: >> The patch supports RTAS calls "ibm,{open,close}-errinjct" to >> manupliate the token, which is passed to RTAS call "ibm,errinjct" >>

Re: [Qemu-devel] [PATCH RESEND v2 3/3] sPAPR: Support RTAS call ibm, errinjct

2015-08-02 Thread Gavin Shan
On Mon, Aug 03, 2015 at 01:01:50PM +1000, David Gibson wrote: >On Mon, Aug 03, 2015 at 09:23:20AM +1000, Gavin Shan wrote: >> The patch supports RTAS call "ibm,errinjct" to allow injecting >> EEH errors to VFIO PCI devices. The implementation is similiar >> to EEH su

Re: [Qemu-devel] [PATCH RESEND v2 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-04 Thread Gavin Shan
On Tue, Aug 04, 2015 at 02:49:14PM +1000, Alexey Kardashevskiy wrote: >On 08/03/2015 01:32 PM, Gavin Shan wrote: >>On Mon, Aug 03, 2015 at 12:51:09PM +1000, David Gibson wrote: >>>On Mon, Aug 03, 2015 at 09:23:19AM +1000, Gavin Shan wrote: >>>>The patch suppor

Re: [Qemu-devel] [PATCH RESEND v2 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-04 Thread Gavin Shan
On Tue, Aug 04, 2015 at 05:23:30PM +1000, Alexey Kardashevskiy wrote: >On 08/04/2015 05:16 PM, Gavin Shan wrote: >>On Tue, Aug 04, 2015 at 02:49:14PM +1000, Alexey Kardashevskiy wrote: >>>On 08/03/2015 01:32 PM, Gavin Shan wrote: >>>>On Mon, Aug 03, 2015 at 12:51:

[Qemu-devel] [PATCH v3 0/3] sPAPR: Support EEH Error Injection

2015-08-06 Thread Gavin Shan
n be passed to user directly. No need to do conversion. * Corrected error code to RTAS_OUT_CLOSE_ERROR in rtas_ibm_errinjct(). * Don't expose error injection tokens for unsupported types. v1 -> v2: * Rebased to git://github.com/dgibson/qemu.git (branch: spapr-next) * Remove spec

[Qemu-devel] [PATCH v3 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-06 Thread Gavin Shan
The patch supports RTAS calls "ibm,{open,close}-errinjct" to manupliate the token, which is passed to RTAS call "ibm,errinjct" to indicate the valid context for error injection. Each VM is permitted to have only one token at once and we simply have one random number for that.

[Qemu-devel] [PATCH v3 1/3] linux-headers: Add eeh.h

2015-08-06 Thread Gavin Shan
The header file was introduced by following Linux upstream commits: commit ed3e81f ("powerpc/eeh: Move PE state constants around") commit ec33d36 ("powerpc/eeh: Introduce eeh_pe_inject_err()") Signed-off-by: Gavin Shan --- linux-headers/as

[Qemu-devel] [PATCH v3 3/3] sPAPR: Support RTAS call ibm,errinjct

2015-08-06 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 36 + hw/ppc/spapr_pci_vfio.c | 56 + hw/ppc/spapr_rtas.c | 77 + include/h

Re: [Qemu-devel] [PATCH v3 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-09 Thread Gavin Shan
On Sat, Aug 08, 2015 at 02:04:17AM +1000, Alexey Kardashevskiy wrote: >On 08/07/2015 01:33 PM, Gavin Shan wrote: >>The patch supports RTAS calls "ibm,{open,close}-errinjct" to >>manupliate the token, which is passed to RTAS call "ibm,errinjct" >>to indic

[Qemu-devel] [PATCH v4 1/3] linux-headers: Add eeh.h

2015-08-10 Thread Gavin Shan
The header file was introduced by following Linux upstream commits: commit ed3e81f ("powerpc/eeh: Move PE state constants around") commit ec33d36 ("powerpc/eeh: Introduce eeh_pe_inject_err()") Signed-off-by: Gavin Shan --- linux-headers/as

[Qemu-devel] [PATCH v4 0/3] sPAPR: Support EEH Error Injection

2015-08-10 Thread Gavin Shan
* Rebased to git://github.com/dgibson/qemu.git (branch: spapr-next) * Remove specific PCI error types in hw/ppc/spapr.h. Use those macros asm-powerpc/eeh.h instead. Gavin Shan (3): linux-headers: Add eeh.h sPAPR: Support RTAS call ibm, {open, close}-errinjct sPAPR: Support

[Qemu-devel] [PATCH v4 3/3] sPAPR: Support RTAS call ibm,errinjct

2015-08-10 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 36 + hw/ppc/spapr_pci_vfio.c | 56 + hw/ppc/spapr_rtas.c | 77 + include/h

[Qemu-devel] [PATCH v4 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-10 Thread Gavin Shan
The patch supports RTAS calls "ibm,{open,close}-errinjct" to manupliate the token, which is passed to RTAS call "ibm,errinjct" to indicate the valid context for error injection. Each VM is permitted to have only one token at once and we simply have one random number for that.

Re: [Qemu-devel] [PATCH v3 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-10 Thread Gavin Shan
On Mon, Aug 10, 2015 at 10:24:56PM +1000, David Gibson wrote: >On Fri, Aug 07, 2015 at 01:33:32PM +1000, Gavin Shan wrote: >> The patch supports RTAS calls "ibm,{open,close}-errinjct" to >> manupliate the token, which is passed to RTAS call "ibm,errinjct" >>

Re: [Qemu-devel] [PATCH v3 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-12 Thread Gavin Shan
On Tue, Aug 11, 2015 at 11:54:08AM +1000, Alexey Kardashevskiy wrote: >On 08/11/2015 10:57 AM, Gavin Shan wrote: >>On Mon, Aug 10, 2015 at 10:24:56PM +1000, David Gibson wrote: >>>On Fri, Aug 07, 2015 at 01:33:32PM +1000, Gavin Shan wrote: >>>>The patch suppor

Re: [Qemu-devel] [PATCH v4 1/3] linux-headers: Add eeh.h

2015-08-12 Thread Gavin Shan
On Wed, Aug 12, 2015 at 12:00:35PM +1000, Alexey Kardashevskiy wrote: >On 08/11/2015 07:11 PM, Peter Maydell wrote: >>On 10 August 2015 at 08:13, Gavin Shan wrote: >>>The header file was introduced by following Linux upstream commits: >>> >>> commit

Re: [Qemu-devel] [PATCH v4 1/3] linux-headers: Add eeh.h

2015-08-13 Thread Gavin Shan
On Thu, Aug 13, 2015 at 11:42:59AM +1000, David Gibson wrote: >On Thu, Aug 13, 2015 at 11:30:37AM +1000, Gavin Shan wrote: >> On Wed, Aug 12, 2015 at 12:00:35PM +1000, Alexey Kardashevskiy wrote: >> >On 08/11/2015 07:11 PM, Peter Maydell wrote: >> >>On 10 August 20

[Qemu-devel] [PATCH RFC 3/4] sPAPR: Support multiple IOMMU groups in PHB for EEH operations

2015-09-17 Thread Gavin Shan
ernel is required. Also, QEMU need provide the IOMMU group ID to specify the precise target for the EEH operations. This reuses the PE address to carry IOMMU group (PE) ID, which is passed to host kernel to specify the precise target for the EEH operations. Signed-off-by: Gavin Shan --- h

[Qemu-devel] [PATCH RFC 2/4] VFIO: Introduce vfio_get_group_id()

2015-09-17 Thread Gavin Shan
This introduces vfio_get_group_id() to retrieve the group ID from the specified PCI device. The function will be used by subsequent patches to support applying EEH operation on the specified IOMMU group. Signed-off-by: Gavin Shan --- hw/vfio/pci.c | 12 include/hw/vfio

[Qemu-devel] [PATCH RFC 1/4] linux-headers: Sync vfio.h

2015-09-17 Thread Gavin Shan
This synchronizes the Linux header vfio.h because of the changes introduced by below Linux commits: 900facd ("drivers/vfio: Support IOMMU group for EEH operations") 108f78d ("drivers/vfio: Support EEH API revision") Signed-off-by: Gavin Shan --- linux-headers/linux/

[Qemu-devel] [PATCH RFC 4/4] sPAPR: Remove EEH callbacks in sPAPRPHBClass

2015-09-17 Thread Gavin Shan
Currently, the EEH operations implemented in the callbacks in sPAPRPHBClass, which will be dropped soon. This makes those functions corresponding to the EEH callbacks in sPAPRPHBClass public so that they can be called directly. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 44

[Qemu-devel] [PATCH RFC 0/4] sPAPR: Support multiple PEs in one PHB

2015-09-17 Thread Gavin Shan
ary bus ID + 1) previously. After this patchset, it's changed to (IOMMU group ID + 1). The PE adress is passed on every requested EEH operation from guest so that it can be passed to host to affect the target PE only. Gavin Shan (4): linux-headers: Sync vfio.h VFIO: Introduce vfio_get_gro

[Qemu-devel] [PATCH 2/2] sPAPR: Enable EEH on VFIO PCI device only

2015-09-18 Thread Gavin Shan
This checks if the PCI device retrieved from the PCI device address is VFIO PCI device when enabling EEH functionality. If it's not VFIO PCI device, the EEH functonality isn't enabled. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci_vfio.c | 2 +- 1 file changed, 1 insertion(+),

[Qemu-devel] [PATCH 1/2] sPAPR: Revert don't enable EEH on emulated PCI devices

2015-09-18 Thread Gavin Shan
This reverts commit 7cb18007 ("sPAPR: Don't enable EEH on emulated PCI devices") as rtas_ibm_set_eeh_option() isn't the right place to check if there has the corresponding PCI device for the input address, which can be PE address, not PCI device address. Signed-off-by: Gav

Re: [Qemu-devel] [PATCH v4 2/2] spapr: generate DT node names

2015-09-24 Thread Gavin Shan
On Thu, Sep 24, 2015 at 12:27:39PM +0200, Laurent Vivier wrote: >When DT node names for PCI devices are generated by SLOF, >they are generated according to the type of the device >(for instance, ethernet for virtio-net-pci device). > >Node name for hotplugged devices is generated by QEMU. >This pat

[Qemu-devel] [PATCH v8 3/7] scripts: Submit changes while updating linux headers

2015-09-13 Thread Gavin Shan
This submits changes with formatted commit log while updating Linux headers using scripts/update-linux-headers.sh. Signed-off-by: Gavin Shan --- scripts/update-linux-headers.sh | 30 ++ 1 file changed, 30 insertions(+) diff --git a/scripts/update-linux-headers.sh b

[Qemu-devel] [PATCH v8 2/7] scripts: Include arch/powerpc/include/uapi/asm/eeh.h

2015-09-13 Thread Gavin Shan
/eeh: Introduce eeh_pe_inject_err()") Signed-off-by: Gavin Shan Reviewed-by: David Gibson --- scripts/update-linux-headers.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 2fddf2e..18daabe 100755 --- a/scripts/update-li

[Qemu-devel] [PATCH v8 4/7] Synchronize Linux headers from kernel 4.3.0-rc1

2015-09-13 Thread Gavin Shan
Synchronize the Linux headers from kernel version 4.3.0-rc1 (commit 6ff33f3) This commit was created automatically by update-linux-headers.sh. Signed-off-by: Gavin Shan --- include/standard-headers/linux/pci_regs.h| 381 --- include/standard-headers/linux

[Qemu-devel] [PATCH v8 0/7] sPAPR: Support EEH Error Injection

2015-09-13 Thread Gavin Shan
T_CLOSE_ERROR in rtas_ibm_errinjct(). * Don't expose error injection tokens for unsupported types. v2: * Rebased to git://github.com/dgibson/qemu.git (branch: spapr-next) * Remove specific PCI error types in hw/ppc/spapr.h. Use those macros asm-powerpc/eeh.h instead. Gavin Shan (7): s

[Qemu-devel] [PATCH v8 6/7] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-09-13 Thread Gavin Shan
token is resetted in ppc_spapr_reset() when rebooting guest. It's notable that the least bit of the token is reserved to indicate if the token has been opened, meaning the valid token should be always odd. Signed-off-by: Gavin Shan Reviewed-by: David Gibson --- hw/ppc/spapr.c

[Qemu-devel] [PATCH v8 1/7] scripts: Allow include "stdint.h" in virtio headers

2015-09-13 Thread Gavin Shan
of pointer in vring_init()"). Signed-off-by: Gavin Shan Reviewed-by: Thomas Huth Reviewed-by: David Gibson --- scripts/update-linux-headers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index f0e830c..2fddf

[Qemu-devel] [PATCH v8 5/7] Obsolete PCI_MSIX_FLAGS_BIRMASK

2015-09-13 Thread Gavin Shan
: commit 24bc69da ("PCI: Clean up MSI/MSI-X capability #defines") commit 846fc709 ("PCI/AER: Rename PCI_ERR_UNC_TRAIN to PCI_ERR_UNC_UND") Signed-off-by: Gavin Shan Reviewed-by: David Gibson --- hw/i386/kvm/pci-assign.c | 4 ++-- hw/pci/msix.c| 2 +- hw/pci/pcie_aer

[Qemu-devel] [PATCH v8 7/7] sPAPR: Support RTAS call ibm,errinjct

2015-09-13 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan Reviewed-by: David Gibson --- hw/ppc/spapr_pci.c | 30 ++ hw/ppc/spapr_pci_vfio.c | 32 +++ hw/ppc/spapr_rtas.c | 77 +

[Qemu-devel] [PATCH v5 4/4] sPAPR: Support RTAS call ibm,errinjct

2015-08-17 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 36 + hw/ppc/spapr_pci_vfio.c | 56 + hw/ppc/spapr_rtas.c | 77 + include/h

[Qemu-devel] [PATCH v5 1/4] scripts: Include arch/powerpc/include/uapi/asm/eeh.h

2015-08-17 Thread Gavin Shan
This includes linux/arch/powerpc/include/uapi/asm/eeh.h while updating linux header files. The specific header file, introduced by Linux upstream commit ed3e81f ("powerpc/eeh: Move PE state constants around"), is used by EEH on sPAPR platform. Signed-off-by: Gavin Shan --- scripts/up

[Qemu-devel] [PATCH v5 2/4] linux-headers: Add eeh.h

2015-08-18 Thread Gavin Shan
The header file was introduced by following Linux upstream commits: commit ed3e81f ("powerpc/eeh: Move PE state constants around") commit ec33d36 ("powerpc/eeh: Introduce eeh_pe_inject_err()") Signed-off-by: Gavin Shan --- I didn't include all changes

[Qemu-devel] [PATCH v5 3/4] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-18 Thread Gavin Shan
The patch supports RTAS calls "ibm,{open,close}-errinjct" to manupliate the token, which is passed to RTAS call "ibm,errinjct" to indicate the valid context for error injection. Each VM is permitted to have only one token at once and we simply have one random number for that.

[Qemu-devel] [PATCH v5 0/4] sPAPR: Support EEH Error Injection

2015-08-18 Thread Gavin Shan
t_error() can be passed to user directly. No need to do conversion. * Corrected error code to RTAS_OUT_CLOSE_ERROR in rtas_ibm_errinjct(). * Don't expose error injection tokens for unsupported types. v2: * Rebased to git://github.com/dgibson/qemu.git (branch: spapr-next) * Remove spe

Re: [Qemu-devel] [PATCH v5 2/4] linux-headers: Add eeh.h

2015-08-18 Thread Gavin Shan
On Tue, Aug 18, 2015 at 03:53:25PM -0700, David Gibson wrote: >On Tue, Aug 18, 2015 at 01:26:39PM +0100, Peter Maydell wrote: >> On 18 August 2015 at 02:47, Gavin Shan wrote: >> > The header file was introduced by following Linux upstream commits: >> > >> >

Re: [Qemu-devel] [PATCH v5 3/4] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-18 Thread Gavin Shan
On Tue, Aug 18, 2015 at 10:32:13AM -0700, Thomas Huth wrote: >On 17/08/15 18:47, Gavin Shan wrote: >> The patch supports RTAS calls "ibm,{open,close}-errinjct" to >> manupliate the token, which is passed to RTAS call "ibm,errinjct" >> to indicate the vali

Re: [Qemu-devel] [PATCH v5 4/4] sPAPR: Support RTAS call ibm, errinjct

2015-08-18 Thread Gavin Shan
On Tue, Aug 18, 2015 at 11:04:59AM -0700, Thomas Huth wrote: >On 17/08/15 18:47, Gavin Shan wrote: >> The patch supports RTAS call "ibm,errinjct" to allow injecting >> EEH errors to VFIO PCI devices. The implementation is similiar >> to EEH support for VFIO P

Re: [Qemu-devel] [PATCH v5 3/4] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-20 Thread Gavin Shan
On Wed, Aug 19, 2015 at 09:15:26AM -0700, Thomas Huth wrote: >On 18/08/15 18:15, David Gibson wrote: >> On Wed, Aug 19, 2015 at 09:52:00AM +1000, Gavin Shan wrote: >>> On Tue, Aug 18, 2015 at 10:32:13AM -0700, Thomas Huth wrote: >>>> On 17/08/15 18:47, Gavin Shan w

Re: [Qemu-devel] [PATCH v5 4/4] sPAPR: Support RTAS call ibm, errinjct

2015-08-20 Thread Gavin Shan
On Wed, Aug 19, 2015 at 08:48:20AM -0700, Thomas Huth wrote: >On 18/08/15 17:26, Gavin Shan wrote: >> On Tue, Aug 18, 2015 at 11:04:59AM -0700, Thomas Huth wrote: >>> On 17/08/15 18:47, Gavin Shan wrote: >>>> The patch supports RTAS call "ibm,errinjct" to

[Qemu-devel] [PATCH v6 6/8] sPAPR: Introduce rtas_ldq()

2015-08-24 Thread Gavin Shan
This introduces rtas_ldq() to load 64-bits parameter from continuous two 4-bytes memory chunk of RTAS parameter buffer, to simplify the code. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 20 ++-- include/hw/ppc/spapr.h | 5 + 2 files changed, 15 insertions(+), 10

Re: [Qemu-devel] [PATCH v4 1/3] linux-headers: Add eeh.h

2015-08-24 Thread Gavin Shan
On Tue, Aug 11, 2015 at 10:11:03AM +0100, Peter Maydell wrote: >On 10 August 2015 at 08:13, Gavin Shan wrote: >> The header file was introduced by following Linux upstream commits: >> >> commit ed3e81f ("powerpc/eeh: Move PE state constants around") >

[Qemu-devel] [PATCH v6 2/8] scripts: Include arch/powerpc/include/uapi/asm/eeh.h

2015-08-24 Thread Gavin Shan
/eeh: Introduce eeh_pe_inject_err()") Signed-off-by: Gavin Shan --- scripts/update-linux-headers.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 2fddf2e..18daabe 100755 --- a/scripts/update-linux-headers.sh +++ b/

Re: [Qemu-devel] [PATCH v4 1/3] linux-headers: Add eeh.h

2015-08-24 Thread Gavin Shan
On Mon, Aug 24, 2015 at 05:23:15PM +1000, Gavin Shan wrote: >On Tue, Aug 11, 2015 at 10:11:03AM +0100, Peter Maydell wrote: >>On 10 August 2015 at 08:13, Gavin Shan wrote: >>> The header file was introduced by following Linux upstream commits: >>> >>> c

[Qemu-devel] [PATCH v6 4/8] Sync Linux headers from kernel 4.2.0-rc8

2015-08-24 Thread Gavin Shan
c13dcf9 Linux 4.2-rc8 Signed-off-by: Gavin Shan --- include/standard-headers/linux/pci_regs.h| 381 --- include/standard-headers/linux/virtio_ring.h | 3 +- linux-headers/asm-powerpc/eeh.h | 56 linux-headers/asm-x86/hyperv.h | 2

[Qemu-devel] [PATCH v6 3/8] scripts: Submit changes while updating linux headers

2015-08-24 Thread Gavin Shan
This submits changes with formatted commit log while updating Linux headers using scripts/update-linux-headers.sh. Signed-off-by: Gavin Shan --- scripts/update-linux-headers.sh | 21 + 1 file changed, 21 insertions(+) diff --git a/scripts/update-linux-headers.sh b/scripts

[Qemu-devel] [PATCH v6 8/8] sPAPR: Support RTAS call ibm,errinjct

2015-08-24 Thread Gavin Shan
container IOCTL command to be handled by the host. Signed-off-by: Gavin Shan --- hw/ppc/spapr_pci.c | 36 + hw/ppc/spapr_pci_vfio.c | 35 + hw/ppc/spapr_rtas.c | 77 + include/hw/pci-host/sp

[Qemu-devel] [PATCH v6 0/8] sPAPR: Support EEH Error Injection

2015-08-24 Thread Gavin Shan
from sPAPRPHBClass::eeh_inject_error() can be passed to user directly. No need to do conversion. * Corrected error code to RTAS_OUT_CLOSE_ERROR in rtas_ibm_errinjct(). * Don't expose error injection tokens for unsupported types. v2: * Rebased to git://github.com/dgibson/qemu.git

[Qemu-devel] [PATCH v6 1/8] scripts: Allow include "stdint.h" in virtio headers

2015-08-24 Thread Gavin Shan
of pointer in vring_init()"). Signed-off-by: Gavin Shan --- scripts/update-linux-headers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index f0e830c..2fddf2e 100755 --- a/scripts/update-linux-headers.sh +++ b/s

[Qemu-devel] [PATCH v6 7/8] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-24 Thread Gavin Shan
t's notable that the least bit of the token is reserved to indicate if the token has been opened, meaning the valid token should be always odd. Signed-off-by: Gavin Shan --- hw/ppc/spapr.c | 6 - hw/ppc/spapr_rtas.c| 60 ++ in

[Qemu-devel] [PATCH v6 5/8] Obsolete PCI_MSIX_FLAGS_BIRMASK

2015-08-24 Thread Gavin Shan
: commit 24bc69da ("PCI: Clean up MSI/MSI-X capability #defines") commit 846fc709 ("PCI/AER: Rename PCI_ERR_UNC_TRAIN to PCI_ERR_UNC_UND") Signed-off-by: Gavin Shan --- hw/i386/kvm/pci-assign.c | 4 ++-- hw/pci/msix.c| 2 +- hw/pci/pcie_aer.c| 2 +- hw/s390x

<    1   2   3   4   5   6   7   8   9   10   >