Re: [Qemu-devel] [PATCH v3] vfio : add aer process

2016-08-18 Thread Zhou Jie
ping On 2016/8/15 10:53, Zhou Jie wrote: ping On 2016/8/2 11:57, Zhou Jie wrote: During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie

Re: [Qemu-devel] [PATCH v3] vfio : add aer process

2016-08-14 Thread Zhou Jie
ping On 2016/8/2 11:57, Zhou Jie wrote: During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- v2-v3: 1

[Qemu-devel] [PATCH v3] vfio : add aer process

2016-08-01 Thread Zhou Jie
During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- v2-v3: 1. Call init_completion() in vfio_pci_probe

Re: [Qemu-devel] [PATCH v2 2/2] vfio : add aer process

2016-08-01 Thread Zhou Jie
Hi, Alex Clearly this has only been tested for a single instance of an AER error event and resume per device. Are the things you're intending to block actually blocked for subsequent events? Note how complete_all() fills the done field to let all current and future waiters go through and

Re: [Qemu-devel] [PATCH v2 2/2] vfio : add aer process

2016-07-31 Thread Zhou Jie
Hi, Alex On 2016/7/30 1:12, Alex Williamson wrote: On Tue, 19 Jul 2016 15:32:43 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: From: Chen Fan <chen.fan.f...@cn.fujitsu.com> During aer err occurs and resume do following to protect device from being accessed. 1. Make config spa

Re: [Qemu-devel] [PATCH v2 1/2] vfio : resume notifier

2016-07-31 Thread Zhou Jie
Hi, Alex On 2016/7/30 1:11, Alex Williamson wrote: On Tue, 19 Jul 2016 15:52:45 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: From: Chen Fan <chen.fan.f...@cn.fujitsu.com> An empty commit log is unacceptable for all but the most trivial patches. There's also no sign-off o

Re: [Qemu-devel] [PATCH v2 0/2] vfio: add aer process

2016-07-25 Thread Zhou Jie
ping On 2016/7/19 16:13, Zhou Jie wrote: From: Chen Fan <chen.fan.f...@cn.fujitsu.com> v1-v2: 1. Add aer process to vfio driver. Chen Fan (2): vfio : add aer process vfio : resume notifier drivers/vfio/pci/vfio_pci.c | 58 - driver

[Qemu-devel] [PATCH v2 0/2] vfio: add aer process

2016-07-19 Thread Zhou Jie
From: Chen Fan v1-v2: 1. Add aer process to vfio driver. Chen Fan (2): vfio : add aer process vfio : resume notifier drivers/vfio/pci/vfio_pci.c | 58 - drivers/vfio/pci/vfio_pci_intrs.c | 18

[Qemu-devel] [PATCH v2 1/2] vfio : resume notifier

2016-07-19 Thread Zhou Jie
From: Chen Fan --- drivers/vfio/pci/vfio_pci.c | 28 +++- drivers/vfio/pci/vfio_pci_intrs.c | 18 ++ drivers/vfio/pci/vfio_pci_private.h | 1 + include/uapi/linux/vfio.h | 1 + 4 files changed, 47

[Qemu-devel] [PATCH v9 10/11] vfio: Add waiting for host aer error progress

2016-07-19 Thread Zhou Jie
gether and unplug of the device to prevent it from further interacting with the VM. 4. Reset bus. Signed-off-by: Chen Fan <chen.fan.f...@cn.fujitsu.com> Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- hw/vfio/pci.c | 51 +

[Qemu-devel] [PATCH v9 04/11] vfio: refine function vfio_pci_host_match

2016-07-19 Thread Zhou Jie
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 11c895c..21fd801 100644 --- a/hw/vfio/pci.c +++

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

2016-07-19 Thread Zhou Jie
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

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

2016-07-19 Thread Zhou Jie
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 ++

[Qemu-devel] [PATCH v9 03/11] vfio: add aer support for vfio device

2016-07-19 Thread Zhou Jie
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 | 75

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

2016-07-19 Thread Zhou Jie
From: Chen Fan When assigning a vfio device with AER enabled, we must check whether the device supports a host bus reset (ie. hot reset) as this may be used by the guest OS in order to recover the device from an AER error. QEMU must therefore have the ability to

[Qemu-devel] [PATCH v9 08/11] vfio: vote the function 0 to do host bus reset when aer occurred

2016-07-19 Thread Zhou Jie
From: Chen Fan Due to all devices assigned to VM on the same way as host if enable aer, so we can easily do the hot reset by selecting the function #0 to do the hot reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++

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

2016-07-19 Thread Zhou Jie
From: Chen Fan when function 0 is hot-added, we can check the vfio device whether support hot bus reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/vfio/pci.c

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

2016-07-19 Thread Zhou Jie
From: Chen Fan v8-v9: 1. Don't use resume notification. Host vfio driver will process aer. Poll the vfio_device_info to assure host reset completely. v7-v8: 1. Use bitmap to record error and resume notification. v6-v7: 1. Stall any access to

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

2016-07-19 Thread Zhou Jie
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

[Qemu-devel] [PATCH v9 06/11] pci: add a pci_function_is_valid callback to check function if valid

2016-07-19 Thread Zhou Jie
From: Chen Fan PCI hotplug requires that function 0 is added last to close the slot. Since vfio supporting AER, we require that the VM bus contains the same set of devices as the host bus to support AER, we can perform an AER validation test whenever a function 0

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

2016-07-19 Thread Zhou Jie
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

[Qemu-devel] [PATCH v2 2/2] vfio : add aer process

2016-07-19 Thread Zhou Jie
From: Chen Fan <chen.fan.f...@cn.fujitsu.com> During aer err occurs and resume do following to protect device from being accessed. 1. Make config space read only. 2. Disable INTx/MSI Interrupt. 3. Do nothing for bar regions. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> ---

[Qemu-devel] [PATCH v2 1/2] vfio : resume notifier

2016-07-19 Thread Zhou Jie
From: root --- drivers/vfio/pci/vfio_pci.c | 28 +++- drivers/vfio/pci/vfio_pci_intrs.c | 18 ++ drivers/vfio/pci/vfio_pci_private.h | 1 + include/uapi/linux/vfio.h | 1 + 4 files changed, 47 insertions(+), 1

[Qemu-devel] [PATCH v2 0/2] vfio: add aer process

2016-07-19 Thread Zhou Jie
From: Chen Fan v1-v2: 1. Add aer process to vfio driver. Chen Fan (1): vfio : add aer process root (1): vfio : resume notifier drivers/vfio/pci/vfio_pci.c | 58 - drivers/vfio/pci/vfio_pci_intrs.c | 18

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-12 Thread Zhou Jie
in "struct vfio_pci_device" 6. vfio_fops Add poll function I would still suggest that the name "workable_state" is quite vague. Something like aer_error_in_progress is much more specific. Thanks, OK, I will alter the name. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-12 Thread Zhou Jie
truct vfio_pci_device" teardown the interrupt 5. vfio_pci_aer_resume Set workable_state to true in "struct vfio_pci_device" 6. vfio_fops Add poll function Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-11 Thread Zhou Jie
resume, }; User tear-down the interrupts in ixgbevf_io_error_detected function. And up the interrupts in ixgbevf_io_resume. Guest OS driver will do both tear-down the interrupts and re-establish them. Because it don't know what host vfio driver has done. I disable the interrupts to pretend them interfere with device reset. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-09 Thread Zhou Jie
Hi Alex, The variable clearly isn't visible to the user, so the user can know whether the kernel supports this feature, but not whether the feature is currently active. Perhaps there's no way to avoid races completely, but don't you expect that if we define that certain operations are blocked

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-07 Thread Zhou Jie
Tx and MSI 3. aer driver reset the device 4. Restore INTx and MSI 5. user process the aer event Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-05 Thread Zhou Jie
aer event Maybe reset the device and reinitialization What I do is make sure the following points. 1. Host can reset the device between step 2 and 4. 2. The user settings is the same at step 1 and 5. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-04 Thread Zhou Jie
ping On 2016/7/3 12:00, Zhou Jie wrote: Hi Alex, On 2016/6/30 9:45, Zhou Jie wrote: Hi Alex, On 2016/6/30 2:22, Alex Williamson wrote: On Wed, 29 Jun 2016 16:54:05 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: Hi Alex, And yet we have struct pci_dev.broken_intx_masking and w

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-02 Thread Zhou Jie
Hi Alex, On 2016/6/30 9:45, Zhou Jie wrote: Hi Alex, On 2016/6/30 2:22, Alex Williamson wrote: On Wed, 29 Jun 2016 16:54:05 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: Hi Alex, And yet we have struct pci_dev.broken_intx_masking and we test for working DisIN

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-29 Thread Zhou Jie
Hi Alex, On 2016/6/30 2:22, Alex Williamson wrote: On Wed, 29 Jun 2016 16:54:05 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: Hi Alex, And yet we have struct pci_dev.broken_intx_masking and we test for working DisINTx via pci_intx_mask_supported() rather than simply looking for

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-29 Thread Zhou Jie
e happened in interrupt handler. I think block is not a good choice. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-27 Thread Zhou Jie
Hi Alex, On 2016/6/28 11:58, Alex Williamson wrote: On Tue, 28 Jun 2016 11:26:33 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: Hi Alex, The INTx/MSI part needs further definition for the user. Are we actually completely tearing down interrupts with the expectation that th

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-27 Thread Zhou Jie
ke a reasonable approach, but I can't guarantee we won't find new issues along the way. For instance we'll need to test how -EAGAIN returns interact with existing QEMU and maybe decided whether there are cases that are better handled by doing an interruptible wait. Thanks, I will dig into it. Sincerely Zhou Jie

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-24 Thread Zhou Jie
Hi Alex, We should never depend on the guest driver to behave in a certain way, but we need to prioritize what that actually means. vfio in the kernel has a responsibility first and foremost to the host kernel. User owned devices cannot be allowed to exploit or interfere with the host

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-22 Thread Zhou Jie
Hi Alex, On 2016/6/22 13:45, Zhou Jie wrote: Hi Alex, In vfio I have some questions. 1. How can I disable the access by mmap? We can disable all access to vfio fd by returning a EAGAIN error if user try to access it during the reset period until the host reset finished

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-21 Thread Zhou Jie
Hi Alex, In vfio I have some questions. 1. How can I disable the access by mmap? We can disable all access to vfio fd by returning a EAGAIN error if user try to access it during the reset period until the host reset finished. But about the bar region which is maped by

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-21 Thread Zhou Jie
Hi Alex, Hi Alex, on kernel side, I think if we don't trust the user behaviors, we should disable the access of vfio-pci interface once vfio-pci driver got the error_detected, we should disable all access to vfio fd regardless whether the vfio-pci was assigned to a VM, we also can

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-20 Thread Zhou Jie
will not interact with the VM. Sincerely Zhou jie Alex . -- 周潔 Dept 1 No. 6 Wenzhu Road, Nanjing, 210012, China TEL:+86+25-86630566-8557 FUJITSU INTERNAL:7998-8557 E-Mail:zhoujie2...@cn.fujitsu.com

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-20 Thread Zhou Jie
ping On 2016/6/12 10:38, Zhou Jie wrote: Hi, Alex It seems like we have a number of questions open in the thread with MST from the previous version, particularly whether we should actually drop the resume notifier and block the reset in the kernel. The concern being that it's not very well

Re: [Qemu-devel] [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2016-06-11 Thread Zhou Jie
Hi, Alex On 2016/6/9 23:39, Alexander Duyck wrote: On Thu, Jun 9, 2016 at 3:14 AM, Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: TO Alex TO Michael In your solution you add a emulate PCI bridge to act as a bridge between direct assigned devices and the host bridge. Do you mean p

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-06-11 Thread Zhou Jie
notification? Sincerely Zhou Jie

Re: [Qemu-devel] [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2016-06-09 Thread Zhou Jie
. And no devices unaffected by the bus reset, be configured on the same virtual bus. http://lists.nongnu.org/archive/html/qemu-devel/2016-05/msg02989.html Sincerely, Zhou Jie On 2016/6/7 0:04, Alex Duyck wrote: On Mon, Jun 6, 2016 at 2:18 AM, Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: H

Re: [Qemu-devel] [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2016-06-06 Thread Zhou Jie
r live migration? Sincerely, Zhou Jie So 1.- host tells guest to start tracking memory writes 2.- guest acks 3.- migration starts 4.- most memory is migrated 5.- host tells guest to eject device 6.- guest acks 7.- stop vm and migrate rest of state Sounds about right. The only way this differs fro

[Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-05-26 Thread Zhou Jie
guest directed bus reset altogether and unplug of the device to prevent it from further interacting with the VM. 5. After get the resume notification reset bus. Signed-off-by: Chen Fan <chen.fan.f...@cn.fujitsu.com> Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- v7-&

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-25 Thread Zhou Jie
{ >> /* We failed */ >> } else { >> /* Proceed with reset */ >> } >> >> Does QEMU have enough concurrency to do this? Thanks,On 2016/5/25 In my test, it can not work. vfio_aer_resume_notifier_handler is invoked after vfio_pci_reset. It is useless to wait in vfio_p

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-25 Thread Zhou Jie
access to the vga device region. 3. vfio_pci_read_config and vfio_pci_write_config For stalling any access to the device config space. What will happen if I don't stall any access to the device? Sincerely, Zhou Jie

Re: [Qemu-devel] [patch v6 11/12] vfio: register aer resume notification handler for aer resume

2016-05-24 Thread Zhou Jie
So I needn't disable access to the device between being notified that the error occurred and being notified to resume. This will make code simpler. Am I right? On 2016/5/24 18:49, Michael S. Tsirkin wrote: On Tue, Apr 26, 2016 at 08:48:15AM -0600, Alex Williamson wrote: I think that means

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Zhou Jie
On 2016/5/19 10:18, Alex Williamson wrote: On Thu, 19 May 2016 09:49:00 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: On 2016/5/19 2:26, Alex Williamson wrote: On Wed, 18 May 2016 11:31:09 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: From: Chen Fan <chen.fan.f...

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Zhou Jie
On 2016/5/19 10:18, Alex Williamson wrote: On Thu, 19 May 2016 09:49:00 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: On 2016/5/19 2:26, Alex Williamson wrote: On Wed, 18 May 2016 11:31:09 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: From: Chen Fan <chen.fan.f...

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Zhou Jie
On 2016/5/19 2:26, Alex Williamson wrote: On Wed, 18 May 2016 11:31:09 +0800 Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: From: Chen Fan <chen.fan.f...@cn.fujitsu.com> For supporting aer recovery, host and guest would run the same aer recovery code, that would do the seconda

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

2016-05-17 Thread Zhou Jie
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

[Qemu-devel] [PATCH 09/12] vfio: vote the function 0 to do host bus reset when aer occurred

2016-05-17 Thread Zhou Jie
From: Chen Fan Due to all devices assigned to VM on the same way as host if enable aer, so we can easily do the hot reset by selecting the function #0 to do the hot reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++

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

2016-05-17 Thread Zhou Jie
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 | 83

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

2016-05-17 Thread Zhou Jie
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 ++

[Qemu-devel] [PATCH 05/12] vfio: refine function vfio_pci_host_match

2016-05-17 Thread Zhou Jie
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 0516d94..5b23a86 100644 --- a/hw/vfio/pci.c +++

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

2016-05-17 Thread Zhou Jie
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

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

2016-05-17 Thread Zhou Jie
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

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

2016-05-17 Thread Zhou Jie
From: Chen Fan When assigning a vfio device with AER enabled, we must check whether the device supports a host bus reset (ie. hot reset) as this may be used by the guest OS in order to recover the device from an AER error. QEMU must therefore have the ability to

[Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-17 Thread Zhou Jie
n from the host after some timeout, we would abort the guest directed bus reset altogether and unplug of the device to prevent it from further interacting with the VM. 6. After get the resume notification reset bus. Signed-off-by: Chen Fan <chen.fan.f...@cn.fujitsu.com> Signed-

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

2016-05-17 Thread Zhou Jie
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

[Qemu-devel] [PATCH 08/12] vfio: add check aer functionality for hotplug device

2016-05-17 Thread Zhou Jie
From: Chen Fan when function 0 is hot-added, we can check the vfio device whether support hot bus reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/vfio/pci.c

[Qemu-devel] [PATCH v7 00/12] vfio-pci: pass the aer error to guest

2016-05-17 Thread Zhou Jie
From: Chen Fan v6-v7: 1. Stall any access to the device until resume is signaled. Do guest directed bus reset after receive resume notification. If don't get the resume notification after some timeout unplug the device. 2. fix the patches 11/12 as

[Qemu-devel] [PATCH 07/12] pci: add a pci_function_is_valid callback to check function if valid

2016-05-17 Thread Zhou Jie
From: Chen Fan PCI hotplug requires that function 0 is added last to close the slot. Since vfio supporting AER, we require that the VM bus contains the same set of devices as the host bus to support AER, we can perform an AER validation test whenever a function 0

Re: [Qemu-devel] [patch v6 11/12] vfio: register aer resume notification handler for aer resume

2016-05-10 Thread Zhou Jie
reset. Because the host did bus reset already. But as you said we shouldn't necessarily design the API that strictly around the current behavior of the Linux AER handler. Sincerely, Zhou Jie On 2016/5/7 0:39, Alex Williamson wrote: On Fri, 6 May 2016 09:38:41 +0800 Chen Fan

[Qemu-devel] [PATCH v4] block: always compile-check debug prints

2016-04-28 Thread Zhou Jie
Files with conditional debug statements should ensure that the printf is always compiled. This prevents bitrot of the format string of the debug statement. And switch debug output to stderr. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> Reviewed-by: Eric Blake <ebl...@redhat.co

[Qemu-devel] [PATCH v3] block: always compile-check debug prints

2016-04-28 Thread Zhou Jie
Files with conditional debug statements should ensure that the printf is always compiled. This prevents bitrot of the format string of the debug statement. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- v1 -> v2: * Keep t

[Qemu-devel] [PATCH v2] block: always compile-check debug prints

2016-04-28 Thread Zhou Jie
Files with conditional debug statements should ensure that the printf is always compiled. This prevents bitrot of the format string of the debug statement. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- block/curl.c | 10 -- block/sheepdog.c | 13 - 2

[Qemu-devel] [PATCH] block: always compile-check debug prints

2016-04-28 Thread Zhou Jie
Files with conditional debug statements should ensure that the printf is always compiled. This prevents bitrot of the format string of the debug statement. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- block/curl.c | 13 +++-- block/sheepdog.c | 13 ++--- 2

Re: [Qemu-devel] [PATCH v2] hw/net/opencores_eth: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
On 2016/4/27 10:46, Max Filippov wrote: Hi Zhou, On Wed, Apr 27, 2016 at 10:18:56AM +0800, Zhou Jie wrote: When I committed another patch which named as "hw/net/virtio-net: Allocating Large sized arrays to heap" . Christian Borntraeger said that 16k is usually perf

Re: [Qemu-devel] [PATCH v2] hw/net/opencores_eth: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
Although the size is 65536 bytes here, I think open_eth_start_xmit is in a hot path. So, it is OK, if you think that this patch should not be applied. Sincerely, Zhou Jie On 2016/4/27 10:07, Zhou Jie wrote: open_eth_start_xmit has a huge stack usage of 65536 bytes approx. Moving la

[Qemu-devel] [PATCH v2] hw/net/opencores_eth: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
open_eth_start_xmit has a huge stack usage of 65536 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- hw/net/opencores_eth.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/

Re: [Qemu-devel] [PATCH] hw/net/opencores_eth: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
On 2016/4/26 12:12, Max Filippov wrote: Hi Zhou, On Tue, Apr 26, 2016 at 6:35 AM, Zhou Jie <zhoujie2...@cn.fujitsu.com> wrote: open_eth_start_xmit has a huge stack usage of 65536 bytes approx. Moving large arrays to heap to reduce stack usage. It's an exception, not the rule when full

Re: [Qemu-devel] [PATCH] hw/net/virtio-net: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
On 2016/4/26 20:42, Michael S. Tsirkin wrote: On Tue, Apr 26, 2016 at 04:05:24PM +0800, Zhou Jie wrote: virtio_net_flush_tx has a huge stack usage of 16392 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> I don't thin

Re: [Qemu-devel] [PATCH] hw/net/virtio-net: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
On 2016/4/26 16:49, Christian Borntraeger wrote: On 04/26/2016 10:05 AM, Zhou Jie wrote: virtio_net_flush_tx has a huge stack usage of 16392 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- hw/net/virtio-net.

Re: [Qemu-devel] [PATCH] net/tap: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
On 2016/4/26 15:45, Christian Borntraeger wrote: On 04/26/2016 03:26 AM, Zhou Jie wrote: net_init_tap has a huge stack usage of 8192 bytes approx. Moving large arrays to heap to reduce stack usage. I am wondering. Why is 8k a problem for a user space program? For 64bit machine it will be 16k

[Qemu-devel] [PATCH] hw/net/virtio-net: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
virtio_net_flush_tx has a huge stack usage of 16392 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- hw/net/virtio-net.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/net/

[Qemu-devel] [PATCH] hw/arm/nseries: Allocating Large sized arrays to heap

2016-04-26 Thread Zhou Jie
n8x0_init has a huge stack usage of 65536 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- hw/arm/nseries.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c

[Qemu-devel] [PATCH] hw/net/opencores_eth: Allocating Large sized arrays to heap

2016-04-25 Thread Zhou Jie
open_eth_start_xmit has a huge stack usage of 65536 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- hw/net/opencores_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/net/opencores_eth.

[Qemu-devel] [PATCH] net/tap: Allocating Large sized arrays to heap

2016-04-25 Thread Zhou Jie
net_init_tap has a huge stack usage of 8192 bytes approx. Moving large arrays to heap to reduce stack usage. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- net/tap.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/tap.c b/net/tap.c index 740e8a2..4

[Qemu-devel] [PATCH] Added negative check for get_image_size()

2016-04-24 Thread Zhou Jie
This patch adds check for negative return value from get_image_size(), where it is missing. It avoids unnecessary two function calls. Signed-off-by: Zhou Jie <zhoujie2...@cn.fujitsu.com> --- hw/ppc/spapr.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/s