[Qemu-devel] [patch v3 9/9] vfio: add 'aer' property to expose aercap

2016-03-14 Thread Cao jin
From: Chen Fan add 'aer' property to let user able to decide whether expose the aer capability. by default we should disable aer feature, because it needs configuration restrictions. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/pci.c b

[Qemu-devel] [patch v3 8/9] vfio-pci: pass the aer error to guest

2016-03-14 Thread Cao jin
From: Chen Fan when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, resulting in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and let the guest driver recover from the err

[Qemu-devel] [patch v3 3/9] vfio: add pcie extended capability support

2016-03-14 Thread Cao jin
From: Chen Fan For vfio pcie device, we could expose the extended capability on PCIE bus. due to add a new pcie capability at the tail of the chain, in order to avoid config space overwritten, we introduce a copy config for parsing extended caps. and rebuild the pcie extended config space. Signe

[Qemu-devel] [patch v3 0/9] vfio-pci: pass the aer error to guest, part2

2016-03-14 Thread Cao jin
From: Chen Fan v2-v3: 1. fix patch 4/9, 5/9 as Alex sugguestion. 2. patches 5/9 ~ 8/9 are made to force limiting that all vfio functions are combined in the same way as on the host. v1-v2: 1. limit all devices on same bus in guest are on same bus in host in patch 5/11. 2. patc

[Qemu-devel] [patch v3 1/9] vfio: extract vfio_get_hot_reset_info as a single function

2016-03-14 Thread Cao jin
From: Chen Fan the function is used to get affected devices by bus reset. so here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 66 +++ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/h

[Qemu-devel] [patch v3 2/9] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2016-03-14 Thread Cao jin
From: Chen Fan squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c ind

[Qemu-devel] [patch v3 4/9] vfio: add aer support for vfio device

2016-03-14 Thread Cao jin
From: Chen Fan Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 85 --- hw/vfio/pci.h | 3 +++ 2 fil

Re: [Qemu-devel] [PATCH] correct comment of MemoryHotplugState

2016-03-13 Thread Cao jin
Hi, Is anyone gonna take this one? On 03/03/2016 09:59 PM, Igor Mammedov wrote: On Thu, 3 Mar 2016 17:24:12 +0800 Cao jin wrote: correct comment and remove an unused macro. commit adcb4ee6 already correct its type Signed-off-by: Cao jin Reviewed-by: Igor Mammedov -- Yours

[Qemu-devel] [PATCH] ich9lpc: fix typo

2016-03-07 Thread Cao jin
change some "rbca" to "rcrb"(root complex register block) while the other to "rcba"(root complex base address). Bonus: add more comments and fix some indentation. Signed-off-by: Cao jin --- hw/isa/lpc_ich9.c | 35 ++- inclu

[Qemu-devel] [PATCH v2 11/11] vfio: add 'aer' property to expose aercap

2016-03-06 Thread Cao jin
From: Chen Fan add 'aer' property to let user able to decide whether expose the aer capability. by default we should disable aer feature, because it needs configuration restrictions. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/pci.c b

[Qemu-devel] [PATCH v2 02/11] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2016-03-06 Thread Cao jin
From: Chen Fan squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c ind

[Qemu-devel] [PATCH v2 09/11] vfio: vote a device to do host bus reset

2016-03-06 Thread Cao jin
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 57 + hw/vfio/pci.h | 1 + 2 files changed, 58 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 24848c9..8e902d2 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -

[Qemu-devel] [PATCH v2 08/11] pci: introduce pci bus pre reset

2016-03-06 Thread Cao jin
From: Chen Fan in order to distinguish a hot reset with a normal reset. we add this pre reset call back to notice that we should do a hot reset for all devices. Signed-off-by: Chen Fan --- hw/core/qdev.c | 4 ++-- hw/pci/pci.c | 11 +++ hw/pci/pci_bridge.c |

[Qemu-devel] [PATCH v2 03/11] vfio: add pcie extended capability support

2016-03-06 Thread Cao jin
From: Chen Fan For vfio pcie device, we could expose the extended capability on PCIE bus. due to add a new pcie capability at the tail of the chain, in order to avoid config space overwritten, we introduce a copy config for parsing extended caps. and rebuild the pcie extended config space. Signe

[Qemu-devel] [PATCH v2 06/11] pci: add a is_valid_func callback to check device if complete

2016-03-06 Thread Cao jin
From: Chen Fan Signed-off-by: Chen Fan --- hw/pci/pci.c | 39 +++ include/hw/pci/pci.h | 1 + 2 files changed, 40 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index d940f79..72650c5 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1836,6 +

[Qemu-devel] [PATCH v2 01/11] vfio: extract vfio_get_hot_reset_info as a single function

2016-03-06 Thread Cao jin
From: Chen Fan the function is used to get affected devices by bus reset. so here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 66 +++ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/h

[Qemu-devel] [PATCH v2 07/11] vfio: add check aer functionality for hotplug device

2016-03-06 Thread Cao jin
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 0898e34..24848c9 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3034,6 +3034,20 @@ post_reset: vfio_pci_post_reset(vdev); }

[Qemu-devel] [PATCH v2 05/11] vfio: add check host bus reset is support or not

2016-03-06 Thread Cao jin
From: Chen Fan when boot up a VM that assigning vfio devices with aer enabled, we must check the vfio device whether support host bus reset. because when one error occur. OS driver always recover the device by do a bus reset, in order to recover the vfio device, qemu must to do a host bus reset t

[Qemu-devel] [PATCH v2 10/11] vfio-pci: pass the aer error to guest

2016-03-06 Thread Cao jin
From: Chen Fan when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, resulting in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and let the guest driver recover from the err

[Qemu-devel] [PATCH v2 04/11] vfio: add aer support for vfio device

2016-03-06 Thread Cao jin
From: Chen Fan Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 81 --- hw/vfio/pci.h | 3 +++ 2 fil

[Qemu-devel] [PATCH v2 Resend 00/11] vfio-pci: pass the aer error to guest, part2

2016-03-06 Thread Cao jin
From: Chen Fan v1-v2: 1. limit all devices on same bus in guest are on same bus in host in patch 5/11. 2. patch 05/11 ~ 09/11 has been changed. Chen Fan (11): vfio: extract vfio_get_hot_reset_info as a single function vfio: squeeze out vfio_pci_do_hot_reset for support bus reset vfi

Re: [Qemu-devel] [PATCH] correct comment of MemoryHotplugState

2016-03-04 Thread Cao jin
On 03/03/2016 09:59 PM, Igor Mammedov wrote: On Thu, 3 Mar 2016 17:24:12 +0800 Cao jin wrote: correct comment and remove an unused macro. commit adcb4ee6 already correct its type Signed-off-by: Cao jin Reviewed-by: Igor Mammedov --- Btw, in pc_memory_init(), I don`t see in which

[Qemu-devel] [PATCH] correct comment of MemoryHotplugState

2016-03-03 Thread Cao jin
correct comment and remove an unused macro. commit adcb4ee6 already correct its type Signed-off-by: Cao jin --- Btw, in pc_memory_init(), I don`t see in which condition, the following code will be executed: if ((pcms->hotplug_memory.base + hotplug_mem_size) < hotplug_me

Re: [Qemu-devel] [PATCH RFC v2 1/2] Add param Error** to msi_init() & modify the callers

2016-03-02 Thread Cao jin
arcel for additional PCI expertise. Cao jin writes: msi_init() is a supporting function in PCI device initialization, in order to convert .init() to .realize(), it should be modified first. "Supporting function" doesn't imply "should use Error to report errors". HACKIN

[Qemu-devel] [PATCH] pxb: cleanup

2016-03-01 Thread Cao jin
Signed-off-by: Cao jin --- BTW: this doc seems little out of date, since pxb has already support Q35. docs/pci_expander_bridge.txt| 6 +++--- hw/pci-bridge/pci_expander_bridge.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pci_expander_bridge.txt b/docs

[Qemu-devel] [PATCH v4 0/2] doc/memory: cleanup

2016-02-28 Thread Cao jin
see each commit message Cao jin (2): doc/memory: fix inconsistency between code and doc doc/memory: remove the stray extra '-' docs/memory.txt | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.1.0

[Qemu-devel] [PATCH v4 2/2] doc/memory: remove the stray extra '-'

2016-02-28 Thread Cao jin
Signed-off-by: Cao jin Reviewed-by: Peter Maydell --- docs/memory.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/memory.txt b/docs/memory.txt index 746d794..cd6657f 100644 --- a/docs/memory.txt +++ b/docs/memory.txt @@ -185,8 +185,8 @@ an MMIO region mapped at

[Qemu-devel] [PATCH v4 1/2] doc/memory: fix inconsistency between code and doc

2016-02-28 Thread Cao jin
change ".valid.aligned" to ".valid.unaligned", and also modify its description, make the text parallel to the existing .impl.unaligned doc. Signed-off-by: Cao jin --- docs/memory.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/memory.txt b/d

Re: [Qemu-devel] [PATCH v3 1/2] doc/memory: fix typo

2016-02-28 Thread Cao jin
On 02/26/2016 07:36 PM, Peter Maydell wrote: On 26 February 2016 at 11:29, Cao jin wrote: Needs to be a semicolon before the "if". Either "something something. If foo" or "something something; if foo" are correct as punctuation. Since we're aiming to

[Qemu-devel] [PATCH v3 1/2] doc/memory: fix typo

2016-02-26 Thread Cao jin
Fix typo while also modify its description, make the text parallel to the existing .impl.unaligned doc. Signed-off-by: Cao jin --- docs/memory.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/memory.txt b/docs/memory.txt index 8745f76..306280e 100644 --- a/docs

[Qemu-devel] [PATCH v3 0/2] doc/memory: cleanup

2016-02-26 Thread Cao jin
see each commit message Cao jin (2): doc/memory: fix typo doc/memory: remove the stray extra '-' docs/memory.txt | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.1.0

[Qemu-devel] [PATCH v3 2/2] doc/memory: remove the stray extra '-'

2016-02-26 Thread Cao jin
Signed-off-by: Cao jin --- docs/memory.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/memory.txt b/docs/memory.txt index 306280e..d5c216c 100644 --- a/docs/memory.txt +++ b/docs/memory.txt @@ -185,8 +185,8 @@ an MMIO region mapped at 0x0, size 0x6000, priority 2

Re: [Qemu-devel] [PATCH v2] doc/memory.txt: fix typo

2016-02-26 Thread Cao jin
On 02/26/2016 07:03 PM, Peter Maydell wrote: On 26 February 2016 at 10:59, Cao jin wrote: diff --git a/docs/memory.txt b/docs/memory.txt index 8745f76..8aee3d6 100644 --- a/docs/memory.txt +++ b/docs/memory.txt @@ -186,15 +186,15 @@ of its own subregions: D of size 0x1000 at offset 0 and

[Qemu-devel] [PATCH v2] doc/memory.txt: fix typo

2016-02-26 Thread Cao jin
and also modify its description, make the text parallel to the existing .impl.unaligned doc. bonus: slightly modified the diagram, make it prettier. Signed-off-by: Cao jin --- docs/memory.txt | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs

Re: [Qemu-devel] [PATCH] doc/memory.txt: fix typo

2016-02-25 Thread Cao jin
On 02/25/2016 10:24 PM, Peter Maydell wrote: On 25 February 2016 at 13:30, Cao jin wrote: You're certainly right that the documentation as it stands is wrong. I don't think this is a simple typo though. Probably what happened was that when the API was being designed it started o

Re: [Qemu-devel] [PATCH] doc/memory.txt: fix typo

2016-02-25 Thread Cao jin
On 02/25/2016 06:00 PM, Peter Maydell wrote: On 25 February 2016 at 09:32, Cao jin wrote: diff --git a/docs/memory.txt b/docs/memory.txt index 8745f76..1a3ad622 100644 --- a/docs/memory.txt +++ b/docs/memory.txt @@ -297,7 +297,7 @@ various constraints can be supplied to control how these

Re: [Qemu-devel] [PATCH] doc/memory.txt: fix typo

2016-02-25 Thread Cao jin
On 02/25/2016 06:00 PM, Peter Maydell wrote: On 25 February 2016 at 09:32, Cao jin wrote: to match structure MemoryRegionOps definition Signed-off-by: Cao jin --- And there seems are some out of date content in this file, like "cpu_register_io_memory()" mentioned in the last line

[Qemu-devel] [PATCH] doc/memory.txt: fix typo

2016-02-25 Thread Cao jin
to match structure MemoryRegionOps definition Signed-off-by: Cao jin --- And there seems are some out of date content in this file, like "cpu_register_io_memory()" mentioned in the last line, which is removed several years ago in commit 97161e177. I am sure how to modify it, So

Re: [Qemu-devel] [PATCH] loader: fix potential memory leak

2016-02-25 Thread Cao jin
sorry, It just came to me that I forgot to cc qemu-trivial On 02/24/2016 05:12 PM, Cao jin wrote: Signed-off-by: Cao jin --- hw/core/loader.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/core/loader.c b/hw/core/loader.c index 3a57415..24fea65 100644 --- a/hw/core/loader.c

[Qemu-devel] [PATCH] loader: fix potential memory leak

2016-02-24 Thread Cao jin
Signed-off-by: Cao jin --- hw/core/loader.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/core/loader.c b/hw/core/loader.c index 3a57415..24fea65 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -827,10 +827,16 @@ int rom_add_file(const char *file, const char *fw_dir, err

Re: [Qemu-devel] [PATCH] topology.h: cleanup

2016-02-23 Thread Cao jin
On 02/24/2016 05:16 AM, Eduardo Habkost wrote: On Tue, Feb 23, 2016 at 02:51:11PM +0800, Cao jin wrote: remove useless parameter of several functions Signed-off-by: Cao jin I believe this makes the API much easier to be misused. Currently you can safely use (smp_cores, smp_threads) every

[Qemu-devel] [PATCH] topology.h: cleanup

2016-02-22 Thread Cao jin
remove useless parameter of several functions Signed-off-by: Cao jin --- include/hw/i386/topology.h | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/hw/i386/topology.h b/include/hw/i386/topology.h index 148cc1b..d0f473c 100644 --- a/include/hw/i386

[Qemu-devel] [PATCH v2 08/11] pci: introduce pci bus pre reset

2016-02-19 Thread Cao jin
From: Chen Fan in order to distinguish a hot reset with a normal reset. we add this pre reset call back to notice that we should do a hot reset for all devices. Signed-off-by: Chen Fan --- hw/core/qdev.c | 4 ++-- hw/pci/pci.c | 11 +++ hw/pci/pci_bridge.c |

[Qemu-devel] [PATCH v2 07/11] vfio: add check aer functionality for hotplug device

2016-02-19 Thread Cao jin
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 0898e34..24848c9 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3034,6 +3034,20 @@ post_reset: vfio_pci_post_reset(vdev); }

[Qemu-devel] [PATCH v2 05/11] vfio: add check host bus reset is support or not

2016-02-19 Thread Cao jin
From: Chen Fan when boot up a VM that assigning vfio devices with aer enabled, we must check the vfio device whether support host bus reset. because when one error occur. OS driver always recover the device by do a bus reset, in order to recover the vfio device, qemu must to do a host bus reset t

[Qemu-devel] [PATCH v2 04/11] vfio: add aer support for vfio device

2016-02-19 Thread Cao jin
From: Chen Fan Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 81 --- hw/vfio/pci.h | 3 +++ 2 fil

[Qemu-devel] [PATCH v2 06/11] pci: add a is_valid_func callback to check device if complete

2016-02-19 Thread Cao jin
From: Chen Fan Signed-off-by: Chen Fan --- hw/pci/pci.c | 39 +++ include/hw/pci/pci.h | 1 + 2 files changed, 40 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index d940f79..72650c5 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1836,6 +

[Qemu-devel] [PATCH v2 02/11] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2016-02-19 Thread Cao jin
From: Chen Fan squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c ind

[Qemu-devel] [PATCH v2 03/11] vfio: add pcie extended capability support

2016-02-19 Thread Cao jin
From: Chen Fan For vfio pcie device, we could expose the extended capability on PCIE bus. due to add a new pcie capability at the tail of the chain, in order to avoid config space overwritten, we introduce a copy config for parsing extended caps. and rebuild the pcie extended config space. Signe

[Qemu-devel] [PATCH v2 09/11] vfio: vote a device to do host bus reset

2016-02-19 Thread Cao jin
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 57 + hw/vfio/pci.h | 1 + 2 files changed, 58 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 24848c9..8e902d2 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -

[Qemu-devel] [PATCH v2 00/11] vfio-pci: pass the aer error to guest, part2

2016-02-19 Thread Cao jin
From: Chen Fan v1-v2: 1. limit all devices on same bus in guest are on same bus in host in patch 5/11. 2. patch 05/11 ~ 09/11 has been changed. Chen Fan (11): vfio: extract vfio_get_hot_reset_info as a single function vfio: squeeze out vfio_pci_do_hot_reset for support bus reset vfi

[Qemu-devel] [PATCH v2 01/11] vfio: extract vfio_get_hot_reset_info as a single function

2016-02-19 Thread Cao jin
From: Chen Fan the function is used to get affected devices by bus reset. so here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 66 +++ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/h

[Qemu-devel] [PATCH] remove comment for nonexistent structure member

2016-02-18 Thread Cao jin
Signed-off-by: Cao jin --- include/sysemu/hostmem.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 1ce4394..82cc6c5 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -45,7 +45,6 @@ struct HostMemoryBackendClass

[Qemu-devel] [PATCH 08/10] vfio: introduce last reset sequence id

2016-02-17 Thread Cao jin
From: Chen Fan avoid multi-reset host bus, we introduce sequence id to specify which bus is resetting. and if one of the dependent devices has done a reset. the others should skip. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++ hw/vfio/pci.h | 3 +++ 2 files changed, 17 insert

[Qemu-devel] [PATCH 07/10] pci: introduce pci bus pre reset

2016-02-17 Thread Cao jin
From: Chen Fan avoid repeat bus reset, here introduce a sequence ID for each time bus hot reset, so each vfio device could know whether they've already been reset for that sequence ID. Signed-off-by: Chen Fan --- hw/core/qdev.c | 4 ++-- hw/pci/pci.c | 25 +++

[Qemu-devel] [PATCH 04/10] vfio: add aer support for vfio device

2016-02-17 Thread Cao jin
From: Chen Fan Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 81 --- hw/vfio/pci.h | 3 +++ 2 fil

[Qemu-devel] [PATCH 03/10] vfio: add pcie extended capability support

2016-02-17 Thread Cao jin
From: Chen Fan For vfio pcie device, we could expose the extended capability on PCIE bus. due to add a new pcie capability at the tail of the chain, in order to avoid config space overwritten, we introduce a copy config for parsing extended caps. and rebuild the pcie extended config space. Signe

[Qemu-devel] [PATCH 06/10] add check reset mechanism when hotplug vfio device

2016-02-17 Thread Cao jin
From: Chen Fan Since we support multi-function hotplug, the function 0 indicates the closure of the slot, so we have the chance to do the check. Signed-off-by: Chen Fan --- hw/pci/pci.c | 29 + hw/vfio/pci.c| 19 +++ hw/vfio/p

[Qemu-devel] [PATCH 02/10] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2016-02-17 Thread Cao jin
From: Chen Fan squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c ind

[Qemu-devel] [PATCH 09/10] vfio-pci: pass the aer error to guest

2016-02-17 Thread Cao jin
From: Chen Fan when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, resulting in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and let the guest driver recover from the err

[Qemu-devel] [PATCH 05/10] vfio: add check host bus reset is support or not

2016-02-17 Thread Cao jin
From: Chen Fan when boot up a VM that assigning vfio devices with aer enabled, we must check the vfio device whether support host bus reset. because when one error occur. OS driver always recover the device by do a bus reset, in order to recover the vfio device, qemu must to do a host bus reset t

[Qemu-devel] [PATCH 01/10] vfio: extract vfio_get_hot_reset_info as a single function

2016-02-17 Thread Cao jin
From: Chen Fan the function is used to get affected devices by bus reset. so here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 66 +++ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/h

[Qemu-devel] [PATCH 00/10] vfio-pci: pass the aer error to guest, part2

2016-02-17 Thread Cao jin
From: Chen Fan this is the part 2 of supporting vfio device with aer enabled, the part 1 has been sent out. the code based on v16 series patchset. v16 -> this: main code changed on the 7/10 and 8/10 patches. others patches only fix some trivial comments or codes sugguested by Marcel. Chen

Re: [Qemu-devel] [PATCH 0/2] pci core function cleanup

2016-02-04 Thread Cao jin
And this one got reviewed-by too, could it be accepted? On 01/27/2016 06:29 PM, Cao jin wrote: See each commit message says please. Cao jin (2): pci core: function pci_host_bus_register() cleanup pci core: function pci_bus_init() cleanup hw/pci/pci.c | 13 + 1 file

Re: [Qemu-devel] [PATCH v4 0/2] change type of pci_bridge_initfn()

2016-02-04 Thread Cao jin
Hi mst, the series has got reviewed-by for a long while, could it be accepted now? On 01/15/2016 10:23 AM, Cao jin wrote: v4 changelog: 1. fix apb bridge build fail as Marcel find. Test: 1. Compiled on all arch(configure without param) 2. make check passed 3. Hacked to test dec bridge

[Qemu-devel] [PATCH 3/4] aer: impove pcie_aer_init to support vfio device

2016-02-03 Thread Cao jin
From: Chen Fan pcie_aer_init was used to emulate an aer capability for pcie device, but for vfio device, the aer config space size is mutable and is not always equal to PCI_ERR_SIZEOF(0x48). it depends on where the TLP Prefix register required, so here we add a size argument. Signed-off-by: Chen

[Qemu-devel] [PATCH 4/4] pcie_aer: expose pcie_aer_msg() interface

2016-02-03 Thread Cao jin
From: Chen Fan For vfio device, we need to propagate the aer error to Guest OS. we use the pcie_aer_msg() to send aer error to guest. Signed-off-by: Chen Fan Reviewed-by: Michael S. Tsirkin --- hw/pci/pcie_aer.c | 2 +- include/hw/pci/pcie_aer.h | 1 + 2 files changed, 2 insertions(+)

[Qemu-devel] [PATCH 1/4] pcie: modify the capability size assert

2016-02-03 Thread Cao jin
From: Chen Fan Device's Offset and size can reach PCIE_CONFIG_SPACE_SIZE, fix the corresponding assert. Signed-off-by: Chen Fan Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin --- hw/pci/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pcie.c

[Qemu-devel] [PATCH 0/4] vfio-pci: pass the aer error to guest, part1

2016-02-03 Thread Cao jin
From: Chen Fan this patchset are splited out from my aer series patches, this part of aer patches is harmless, and have been reviewed-by. In order to avoid blocking it to merge, so I send it out independently as part1. the part2 is under discussion. Thanks Chen Fan (4): pcie: modify the capabi

[Qemu-devel] [PATCH 2/4] vfio: make the 4 bytes aligned for capability size

2016-02-03 Thread Cao jin
From: Chen Fan this function search the capability from the end, the last size should 0x100 - pos, not 0xff - pos. Signed-off-by: Chen Fan Reviewed-by: Marcel Apfelbaum --- hw/vfio/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

Re: [Qemu-devel] [PATCH] Fix inconsistency between comment and variable name

2016-02-03 Thread Cao jin
On 02/03/2016 05:35 PM, Markus Armbruster wrote: Michael Tokarev writes: 03.02.2016 06:19, Cao jin wrote: Signed-off-by: Cao jin --- include/hw/qdev-core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index abcdee8

Re: [Qemu-devel] [PATCH] Fix inconsistency between comment and variable name

2016-02-03 Thread Cao jin
On 02/03/2016 05:35 PM, Markus Armbruster wrote: Michael Tokarev writes: 03.02.2016 06:19, Cao jin wrote: Signed-off-by: Cao jin --- include/hw/qdev-core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index abcdee8

[Qemu-devel] [PATCH] Fix inconsistency between comment and variable name

2016-02-02 Thread Cao jin
Signed-off-by: Cao jin --- include/hw/qdev-core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index abcdee8..42fa5db 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -221,7 +221,7 @@ typedef struct

[Qemu-devel] [PATCH v2 2/2] Passthru CCID card: QOMify

2016-02-02 Thread Cao jin
Signed-off-by: Cao jin --- hw/usb/ccid-card-passthru.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 9f49c05..858e78e 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c

[Qemu-devel] [PATCH v2 0/2] CCID QOMify

2016-02-02 Thread Cao jin
v2 changelog 1. move macro definition to its home .c file Cao jin (2): Emulated CCID card: QOMify Passthru CCID card: QOMify hw/usb/ccid-card-emulated.c | 23 +-- hw/usb/ccid-card-passthru.c | 14 -- 2 files changed, 21 insertions(+), 16 deletions

[Qemu-devel] [PATCH v2 1/2] Emulated CCID card: QOMify

2016-02-02 Thread Cao jin
Signed-off-by: Cao jin --- hw/usb/ccid-card-emulated.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 869a63c..fe9ec5c 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card

Re: [Qemu-devel] [PATCH 1/2] Emulated CCID card: QOMify

2016-02-02 Thread Cao jin
On 02/02/2016 04:30 PM, Michael Tokarev wrote: 02.02.2016 11:25, Cao jin wrote: On 02/02/2016 04:15 PM, Michael Tokarev wrote: Why did you move the type definition from .c to .h file? It is only referenced in .c, no? [] Yes, that type definition is referred only in .c for now, but we are

Re: [Qemu-devel] [PATCH 1/2] Emulated CCID card: QOMify

2016-02-02 Thread Cao jin
On 02/02/2016 04:15 PM, Michael Tokarev wrote: 01.02.2016 09:53, Cao jin wrote: Signed-off-by: Cao jin --- hw/usb/ccid-card-emulated.c | 20 +--- hw/usb/ccid.h | 4 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hw/usb/ccid-card

Re: [Qemu-devel] [PATCH 0/2] CCID QOMify

2016-02-02 Thread Cao jin
Hi mjt, I guess these two are suitable for trivial too;) but I forget to cc trivial at first... On 02/01/2016 02:53 PM, Cao jin wrote: As each commit says Cao jin (2): Emulated CCID card: QOMify Passthru CCID card: QOMify hw/usb/ccid-card-emulated.c | 20

Re: [Qemu-devel] [PATCH v2] ES1370: QOMify

2016-02-02 Thread Cao jin
Thanks mjt:) On 02/02/2016 04:00 PM, Michael Tokarev wrote: Sorry I replied to the wrong email. I actually applied this one :) /mjt -- Yours Sincerely, Cao jin

[Qemu-devel] [PATCH v2] ES1370: QOMify

2016-01-31 Thread Cao jin
Signed-off-by: Cao jin --- v1 missed "pci_create_simple" modification. hw/audio/es1370.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 592578b..f26fea3 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c

[Qemu-devel] [PATCH] ES1370: QOMify

2016-01-31 Thread Cao jin
Signed-off-by: Cao jin --- hw/audio/es1370.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 592578b..089dd0e 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -288,6 +288,10 @@ struct chan_bits

[Qemu-devel] [PATCH 2/2] Passthru CCID card: QOMify

2016-01-31 Thread Cao jin
Signed-off-by: Cao jin --- hw/usb/ccid-card-passthru.c | 10 -- hw/usb/ccid.h | 4 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 9f49c05..cbb7c80 100644 --- a/hw/usb/ccid-card-passthru.c

[Qemu-devel] [PATCH 1/2] Emulated CCID card: QOMify

2016-01-31 Thread Cao jin
Signed-off-by: Cao jin --- hw/usb/ccid-card-emulated.c | 20 +--- hw/usb/ccid.h | 4 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 869a63c..0b05260 100644 --- a/hw/usb/ccid-card

[Qemu-devel] [PATCH 0/2] CCID QOMify

2016-01-31 Thread Cao jin
As each commit says Cao jin (2): Emulated CCID card: QOMify Passthru CCID card: QOMify hw/usb/ccid-card-emulated.c | 20 +--- hw/usb/ccid-card-passthru.c | 10 -- hw/usb/ccid.h | 8 3 files changed, 21 insertions(+), 17 deletions(-) -- 2.1.0

[Qemu-devel] [PATCH 1/2] pci core: function pci_host_bus_register() cleanup

2016-01-27 Thread Cao jin
remove unused param, and rename the other to a meaningful one. Signed-off-by: Cao jin --- hw/pci/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 168b9cc..2a6fb98 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -277,9 +277,9

[Qemu-devel] [PATCH 0/2] pci core function cleanup

2016-01-27 Thread Cao jin
See each commit message says please. Cao jin (2): pci core: function pci_host_bus_register() cleanup pci core: function pci_bus_init() cleanup hw/pci/pci.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.1.0

[Qemu-devel] [PATCH 2/2] pci core: function pci_bus_init() cleanup

2016-01-27 Thread Cao jin
remove unused param Signed-off-by: Cao jin --- hw/pci/pci.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2a6fb98..b7c2681 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -330,7 +330,6 @@ const char *pci_root_bus_path(PCIDevice *dev

[Qemu-devel] [PATCH] Xen: fix converity warning of xen_pt_config_init()

2016-01-25 Thread Cao jin
emu_regs is a pointer, ARRAY_SIZE doesn't return what we expect. Since the remaining message is enough for debugging, so just remove it. Also tweaked the message a little. Signed-off-by: Cao jin --- hw/xen/xen_pt_config_init.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

Re: [Qemu-devel] [PULL 10/11] Add Error **errp for xen_pt_config_init()

2016-01-23 Thread Cao jin
Or any better idea? Paolo -- Yours Sincerely, Cao jin

Re: [Qemu-devel] [PATCH v6 0/6] Xen PCI passthru: Convert to realize()

2016-01-21 Thread Cao jin
On 01/21/2016 11:41 PM, Stefano Stabellini wrote: Hi Cao, I appreciate the reminder, but it looks like Eric hasn't reviewed patch 3/5. Am I wrong? Seems I made a little mistake:-[ Already see your pull request, Thank you:) And thanks for Eric`s review:) -- Yours Sincerely, Cao jin

Re: [Qemu-devel] [PATCH v2] xen-pvdevice: convert to realize()

2016-01-21 Thread Cao jin
Hi Stefano, just want to make sure: is this picked up? On 12/22/2015 07:51 PM, Stefano Stabellini wrote: On Tue, 22 Dec 2015, Cao jin wrote: Signed-off-by: Cao jin Acked-by: Stefano Stabellini hw/i386/xen/xen_pvdevice.c | 12 ++-- 1 file changed, 6 insertions(+), 6

Re: [Qemu-devel] [PATCH v6 0/6] Xen PCI passthru: Convert to realize()

2016-01-21 Thread Cao jin
Hi Stefano, Just FYI: The series have been reviewed by Eric, I guess it could be picked up;) On 01/17/2016 08:13 PM, Cao jin wrote: v6 changelog: 1. split modification of xen_host_pci_sysfs_path() into a separate new patch as 1/6 shows. 2. 'bug' fix of qemu_strtoul(), in

Re: [Qemu-devel] [PATCH v16 09/14] add check reset mechanism when hotplug vfio device

2016-01-18 Thread Cao jin
On 01/18/2016 07:03 PM, Marcel Apfelbaum wrote: On 01/12/2016 04:43 AM, Cao jin wrote: From: Chen Fan Since we support multi-function hotplug. the function 0 indicate I think you wanted , instead of ., also I would suggest "..., function 0 indicates..." the closure of the s

Re: [Qemu-devel] [PATCH v6 0/6] Xen PCI passthru: Convert to realize()

2016-01-18 Thread Cao jin
Seems I forgot to CC Eric, but I checked my command line history, I do include Eric...weird On 01/17/2016 08:13 PM, Cao jin wrote: v6 changelog: 1. split modification of xen_host_pci_sysfs_path() into a separate new patch as 1/6 shows. 2. 'bug' fix of qemu_strtoul(), in patch 2

[Qemu-devel] [PATCH v6 5/6] Add Error **errp for xen_pt_config_init()

2016-01-17 Thread Cao jin
To catch the error message. Also modify the caller Signed-off-by: Cao jin Reviewed-by: Eric Blake --- hw/xen/xen_pt.c | 8 --- hw/xen/xen_pt.h | 2 +- hw/xen/xen_pt_config_init.c | 51 - 3 files changed, 33 insertions

[Qemu-devel] [PATCH v6 1/6] Change xen_host_pci_sysfs_path() to return void

2016-01-17 Thread Cao jin
And assert the snprintf() error, because user can do nothing in case of snprintf() fail. Signed-off-by: Cao jin --- hw/xen/xen-host-pci-device.c | 35 +++ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen

[Qemu-devel] [PATCH v6 6/6] Xen PCI passthru: convert to realize()

2016-01-17 Thread Cao jin
Signed-off-by: Cao jin Reviewed-by: Eric Blake --- hw/xen/xen_pt.c | 53 - 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 9eef3df..d33221b 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen

[Qemu-devel] [PATCH v6 0/6] Xen PCI passthru: Convert to realize()

2016-01-17 Thread Cao jin
v6 changelog: 1. split modification of xen_host_pci_sysfs_path() into a separate new patch as 1/6 shows. 2. 'bug' fix of qemu_strtoul(), in patch 2/6 & 3/6 3. Grammar fix in patch 4/6 4. 'msg' --> 'message' in commit message. Cao jin (6): Change xen_host_

[Qemu-devel] [PATCH v6 4/6] Add Error **errp for xen_pt_setup_vga()

2016-01-17 Thread Cao jin
To catch the error message. Also modify the caller Signed-off-by: Cao jin Reviewed-by: Eric Blake --- hw/xen/xen_pt.c | 7 +-- hw/xen/xen_pt.h | 3 ++- hw/xen/xen_pt_graphics.c | 11 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hw/xen

<    1   2   3   4   5   6   7   8   9   >