Re: [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism

2021-02-23 Thread Jiahui Cen
Hi Stefan, On 2021/2/23 17:40, Stefan Hajnoczi wrote: > On Fri, Feb 05, 2021 at 06:13:06PM +0800, Jiahui Cen wrote: >> This patch series propose to extend the werror=/rerror= mechanism to add >> a 'retry' feature. It can automatically retry failed I/O requests on error

Re: [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism

2021-02-09 Thread Jiahui Cen
Kindly ping. Any comments and reviews are wellcome :) Thanks, Jiahui On 2021/2/5 18:13, Jiahui Cen wrote: > A VM in the cloud environment may use a virutal disk as the backend storage, > and there are usually filesystems on the virtual block device. When backend > storage is tempora

[PATCH v5 5/9] block-backend: Add timeout support for retry

2021-02-05 Thread Jiahui Cen
Retry should only be triggered when timeout is not reached, so let's check timeout before retry. Device should also reset retry_start_time after successful retry. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 25 +++- include/s

[PATCH v5 9/9] scsi-disk: Add support for retry on errors

2021-02-05 Thread Jiahui Cen
Mark failed requests as to be retried and implement retry_request_cb to handle these requests. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- hw/scsi/scsi-disk.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index

[PATCH v5 3/9] block-backend: Add device specific retry callback

2021-02-05 Thread Jiahui Cen
Add retry_request_cb in BlockDevOps to do device specific retry action. Backend's timer would be registered only when the backend is set 'retry' on errors and the device supports retry action. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend

[PATCH v5 8/9] scsi-bus: Refactor the code that retries requests

2021-02-05 Thread Jiahui Cen
Move the code that retries requests from scsi_dma_restart_bh() to its own, non-static, function. This will allow us to call it from the retry_request_cb() of scsi-disk in a future patch. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- hw/scsi/scsi-bus.c | 16

[PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism

2021-02-05 Thread Jiahui Cen
* Rebase to fix compile problems. * Fix incorrect remove of rehandle list. * Provide rehandle pause interface. REF: https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg06560.html Jiahui Cen (9): qapi/block-core: Add retry option for error action block-backend: Introduce retry timer block-ba

[PATCH v5 2/9] block-backend: Introduce retry timer

2021-02-05 Thread Jiahui Cen
Add a timer to regularly trigger retry on errors. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 21 1 file changed, 21 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index e493f17515..3a9d55cbe3 100644 --- a/block

[PATCH v5 6/9] block: Add error retry param setting

2021-02-05 Thread Jiahui Cen
Add "retry_interval" and "retry_timeout" parameter for drive and device option. These parameter are valid only when werror/rerror=retry. eg. --drive file=image,rerror=retry,retry_interval=1000,retry_timeout=5000 Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- b

[PATCH v5 1/9] qapi/block-core: Add retry option for error action

2021-02-05 Thread Jiahui Cen
Add a new error action 'retry' to support retry on errors. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- blockdev.c | 2 ++ qapi/block-core.json | 9 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index b250b9b959..

[PATCH v5 4/9] block-backend: Enable retry action on errors

2021-02-05 Thread Jiahui Cen
Enable retry action when backend's retry timer is available. It would trigger the timer to do device specific retry action. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/block-backend.c b/

[PATCH v5 7/9] virtio_blk: Add support for retry on errors

2021-02-05 Thread Jiahui Cen
Insert failed requests into device's list for later retry and handle queued requests to implement retry_request_cb. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- hw/block/virtio-blk.c | 21 +--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/hw/

[PATCH v5 3/8] acpi: Add addr offset in build_crs

2021-01-14 Thread Jiahui Cen
d bus number into build_crs. Acked-by: Igor Mammedov Signed-off-by: Jiahui Cen --- hw/acpi/aml-build.c | 18 ++ hw/i386/acpi-build.c| 3 ++- hw/pci-host/gpex-acpi.c | 3 ++- include/hw/acpi/aml-build.h | 4 +++- 4 files changed, 17 insertions(+), 11 deletions(-)

[PATCH v5 5/8] acpi/gpex: Exclude pxb's resources from PCI0

2021-01-14 Thread Jiahui Cen
Exclude the resources of extra root bridges from PCI0's _CRS. Otherwise, the resource windows would overlap in guest, and the IO resource window would fail to be registered. Acked-by: Igor Mammedov Signed-off-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 64 +--- 1 file ch

[PATCH v5 8/8] acpi: Update _DSM method in expected files

2021-01-14 Thread Jiahui Cen
}) } + +If ((Arg2 == 0x05)) +{ + Return (Zero) +} } Return (Buffer (One) Acked-by: Igor Mammedov Signed-off-by: Jiahui Cen --- tests/data/acpi/microvm/DSDT.pcie

[PATCH v5 7/8] acpi: Enable pxb unit-test for ARM virt machine

2021-01-14 Thread Jiahui Cen
No matter whether the pxb is enabled or not, the CONFIG_PXB macro in test would keep undefined. And since pxb is now enabled for ARM Virt machine by default, let's enable pxb unit-test by removing the CONFIG_PXB. Acked-by: Igor Mammedov Signed-off-by: Jiahui Cen --- tests/qtest/bios-t

[PATCH v5 6/8] Kconfig: Compile PXB for ARM_VIRT

2021-01-14 Thread Jiahui Cen
PXB is now supported on ARM, so let's compile for arm_virt machine. Acked-by: Igor Mammedov Signed-off-by: Jiahui Cen --- hw/pci-bridge/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-bridge/Kconfig b/hw/pci-bridge/Kconfig index a51ec716f5..f8df4315ba 1

[PATCH v5 1/8] acpi: Allow DSDT acpi table changes

2021-01-14 Thread Jiahui Cen
Acked-by: Igor Mammedov Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test-allowed-diff.h | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..42418e58e7 100644 --- a/tests

[PATCH v5 4/8] acpi/gpex: Inform os to keep firmware resource map

2021-01-14 Thread Jiahui Cen
ff-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index 11b3db8f71..cb13e75d2f 100644 --- a/hw/pci-host/gpex-acpi.c +++ b/hw/pci-host/gpex-acpi.c @@ -112,10 +1

[PATCH v5 0/8] acpi: Some fixes for pxb support for ARM virt machine

2021-01-14 Thread Jiahui Cen
e.kernel.org/qemu-devel/20201217132926.4812-1-cenjia...@huawei.com/ [3]: https://lore.kernel.org/qemu-devel/dca69f55-dfd1-3f97-dc3f-13eeedec5...@huawei.com/ Acked-by: Igor Mammedov Signed-off-by: Jiahui Cen Jiahui Cen (8): acpi: Allow DSDT acpi table changes acpi: Fix unmatched expected DSD

[PATCH v5 2/8] acpi: Fix unmatched expected DSDT.pxb file

2021-01-14 Thread Jiahui Cen
,, , AddressRangeMemory, TypeStatic) +}) Name (SUPP, Zero) Name (CTRL, Zero) Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities Fixes: fe1127da11 ("unit-test: Add the binary file and clear diff.h") Acked-by: Igor Ma

Re: [PATCH v4 2/8] acpi: Fix unmatched expected DSDT.pxb file

2021-01-13 Thread Jiahui Cen
Hi Michael, On 2021/1/13 22:00, Michael S. Tsirkin wrote: > On Thu, Jan 07, 2021 at 07:40:37PM +0800, Jiahui Cen wrote: >> Commit fe1127da11 ("unit-test: Add the binary file and clear diff.h") does >> not >> use the up-to-date expected file for pxb for ARM virt.

Re: [PATCH v4 0/8] acpi: Some fixes for pxb support for ARM virt machine

2021-01-12 Thread Jiahui Cen
Kindly ping... Thanks, Jiahui On 2021/1/7 19:40, Jiahui Cen wrote: > This patch series adds some fixes for ARM virt machine pxb support. > 1. Pass addr offset for IO, MMIO and bus number when builing crs, because > the addr_trans is needed to describe an addr resource. [1] > 2. Inf

[PATCH v4 8/8] acpi: Update _DSM method in expected files

2021-01-07 Thread Jiahui Cen
ne) { - 0x01 // . + 0x21 // ! }) } + +If ((Arg2 == 0x05)) + { +Return (Zero) +

[PATCH v4 5/8] acpi/gpex: Exclude pxb's resources from PCI0

2021-01-07 Thread Jiahui Cen
Exclude the resources of extra root bridges from PCI0's _CRS. Otherwise, the resource windows would overlap in guest, and the IO resource window would fail to be registered. Signed-off-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 64 +--- 1 file changed, 43 insertions(+

[PATCH v4 4/8] acpi/gpex: Inform os to keep firmware resource map

2021-01-07 Thread Jiahui Cen
ze is 0x410 as assigned by EDK2, the allocation would fail. The diffences could result in resource assignment failure. Using _DSM #5 method to inform guest os not to ignore the PCI configuration that firmware has done at boot time could handle the differences. Signed-off-by: Jiahui Cen --- h

[PATCH v4 3/8] acpi: Add addr offset in build_crs

2021-01-07 Thread Jiahui Cen
d bus number into build_crs. Signed-off-by: Jiahui Cen --- hw/acpi/aml-build.c | 18 ++ hw/i386/acpi-build.c| 3 ++- hw/pci-host/gpex-acpi.c | 3 ++- include/hw/acpi/aml-build.h | 4 +++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/hw/acp

[PATCH v4 7/8] acpi: Enable pxb unit-test for ARM virt machine

2021-01-07 Thread Jiahui Cen
No matter whether the pxb is enabled or not, the CONFIG_PXB macro in test would keep undefined. And since pxb is now enabled for ARM Virt machine by default, let's enable pxb unit-test by removing the CONFIG_PXB. Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test.c | 4 1

[PATCH v4 2/8] acpi: Fix unmatched expected DSDT.pxb file

2021-01-07 Thread Jiahui Cen
0x0080, // Length +,, , AddressRangeMemory, TypeStatic) +}) Name (SUPP, Zero) Name (CTRL, Zero) Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities Fixes: fe1127da11 ("unit-test

[PATCH v4 6/8] Kconfig: Compile PXB for ARM_VIRT

2021-01-07 Thread Jiahui Cen
PXB is now supported on ARM, so let's compile for arm_virt machine. Signed-off-by: Jiahui Cen --- hw/pci-bridge/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-bridge/Kconfig b/hw/pci-bridge/Kconfig index a51ec716f5..f8df4315ba 100644 --- a/hw/pci-b

[PATCH v4 1/8] acpi: Allow DSDT acpi table changes

2021-01-07 Thread Jiahui Cen
Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test-allowed-diff.h | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..42418e58e7 100644 --- a/tests/qtest/bios-tables-test

[PATCH v4 0/8] acpi: Some fixes for pxb support for ARM virt machine

2021-01-07 Thread Jiahui Cen
m/ [3]: https://lore.kernel.org/qemu-devel/dca69f55-dfd1-3f97-dc3f-13eeedec5...@huawei.com/ Jiahui Cen (8): acpi: Allow DSDT acpi table changes acpi: Fix unmatched expected DSDT.pxb file acpi: Add addr offset in build_crs acpi/gpex: Inform os to keep firmware resource map acpi/gpex: Exclude pxb's

Re: [PATCH v3 3/8] acpi/gpex: Inform os to keep firmware resource map

2021-01-06 Thread Jiahui Cen
On 2021/1/6 21:29, Igor Mammedov wrote: > On Tue, 5 Jan 2021 09:53:49 +0800 > Jiahui Cen wrote: > >> On 2021/1/5 8:35, Igor Mammedov wrote: >>> On Wed, 30 Dec 2020 16:22:08 -0500 >>> "Michael S. Tsirkin" wrote: >>> >>>&g

Ping: [PATCH v4 0/7] block: Add retry for werror=/rerror= mechanism

2021-01-05 Thread Jiahui Cen
Hi Kevin, What do you think of these patches? Thanks, Jiahui On 2020/12/15 20:30, Jiahui Cen wrote: > A VM in the cloud environment may use a virutal disk as the backend storage, > and there are usually filesystems on the virtual block device. When backend > storage is temporarily down

Re: [PATCH v3 3/8] acpi/gpex: Inform os to keep firmware resource map

2021-01-04 Thread Jiahui Cen
On 2021/1/5 8:35, Igor Mammedov wrote: > On Wed, 30 Dec 2020 16:22:08 -0500 > "Michael S. Tsirkin" wrote: > >> On Tue, Dec 29, 2020 at 02:41:42PM +0100, Igor Mammedov wrote: >>> On Wed, 23 Dec 2020 17:08:31 +0800 >>> Jiahui Cen wrote: >>>

Re: [PATCH v3 3/8] acpi/gpex: Inform os to keep firmware resource map

2020-12-31 Thread Jiahui Cen
On 2020/12/31 5:22, Michael S. Tsirkin wrote: > On Tue, Dec 29, 2020 at 02:41:42PM +0100, Igor Mammedov wrote: >> On Wed, 23 Dec 2020 17:08:31 +0800 >> Jiahui Cen wrote: >> >>> There may be some differences in pci resource assignment between guest os >>>

Re: [PATCH v3 6/8] Kconfig: Enable PXB for ARM_VIRT by default

2020-12-30 Thread Jiahui Cen
On 2020/12/29 21:50, Igor Mammedov wrote: > On Wed, 23 Dec 2020 17:08:34 +0800 > Jiahui Cen wrote: > subj > s/by default// > s/enable/compile/ > >> PXB is now supported on ARM, so let's enable it by default. > s/it by default/for arm_virt machine/ > s/enab

Re: [PATCH v3 5/8] acpi/gpex: Append pxb devs in ascending order

2020-12-30 Thread Jiahui Cen
On 2020/12/31 5:17, Michael S. Tsirkin wrote: > On Tue, Dec 29, 2020 at 02:47:35PM +0100, Igor Mammedov wrote: >> On Wed, 23 Dec 2020 17:08:33 +0800 >> Jiahui Cen wrote: >> >>> The overlap check of IO resource window would fail when Linux kernel >>> regis

Re: [PATCH v3 3/8] acpi/gpex: Inform os to keep firmware resource map

2020-12-30 Thread Jiahui Cen
On 2020/12/29 21:41, Igor Mammedov wrote: > On Wed, 23 Dec 2020 17:08:31 +0800 > Jiahui Cen wrote: > >> There may be some differences in pci resource assignment between guest os >> and firmware. >> >> Eg. A Bridge with Bus [d2] >> -+-[:d2]---01.0

Re: [PATCH v3 2/8] acpi: Add addr offset in build_crs

2020-12-30 Thread Jiahui Cen
On 2020/12/29 21:36, Igor Mammedov wrote: > On Wed, 23 Dec 2020 17:08:30 +0800 > Jiahui Cen wrote: > >> AML needs Address Translation offset to describe how a bridge translates >> addresses accross the bridge when using an address descriptor, and >> especially on

[PATCH v3 5/8] acpi/gpex: Append pxb devs in ascending order

2020-12-23 Thread Jiahui Cen
/20201218062335.5320-1-cenjia...@huawei.com/ Signed-off-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index 4bf1e94309..95a7a0f12b 100644 --- a/hw/pci-host/gpex-acpi.c

[PATCH v3 8/8] acpi: Update addr_trans and _DSM in expected files

2020-12-23 Thread Jiahui Cen
0x00401FFF, // Range Maximum -0x, // Translation Offset -0x1000, // Length -,, , AddressRangeMemory, TypeStatic) -}) -} } Device (\_SB.GED)

[PATCH v3 7/8] acpi: Enable pxb unit-test for ARM virt machine

2020-12-23 Thread Jiahui Cen
No matter whether the pxb is enabled or not, the CONFIG_PXB macro in test would keep undefined. And since pxb is now enabled for ARM Virt machine by default, let's enable pxb unit-test by removing the CONFIG_PXB. Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test.c | 4 1

[PATCH v3 0/8] acpi: Some fixes for pxb support for ARM virt machine

2020-12-23 Thread Jiahui Cen
.@huawei.com/ [3]: https://lore.kernel.org/lkml/20201218062335.5320-1-cenjia...@huawei.com/ Jiahui Cen (8): acpi: Allow DSDT acpi table changes acpi: Add addr offset in build_crs acpi/gpex: Inform os to keep firmware resource map acpi/gpex: Exclude pxb's resources from PCI0 acpi/gpe

[PATCH v3 1/8] acpi: Allow DSDT acpi table changes

2020-12-23 Thread Jiahui Cen
Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test-allowed-diff.h | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..42418e58e7 100644 --- a/tests/qtest/bios-tables-test

[PATCH v3 2/8] acpi: Add addr offset in build_crs

2020-12-23 Thread Jiahui Cen
d bus number into build_crs. Signed-off-by: Jiahui Cen --- hw/acpi/aml-build.c | 18 ++ hw/i386/acpi-build.c| 3 ++- hw/pci-host/gpex-acpi.c | 3 ++- include/hw/acpi/aml-build.h | 4 +++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/hw/acp

[PATCH v3 4/8] acpi/gpex: Exclude pxb's resources from PCI0

2020-12-23 Thread Jiahui Cen
Exclude the resources of extra root bridges from PCI0's _CRS. Otherwise, the resource windows would overlap in guest, and the IO resource window would fail to be registered. Signed-off-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 64 +--- 1 file changed, 43 insertions(+

[PATCH v3 3/8] acpi/gpex: Inform os to keep firmware resource map

2020-12-23 Thread Jiahui Cen
ze is 0x410 as assigned by EDK2, the allocation would fail. The diffences could result in resource assignment failure. Using _DSM #5 method to inform guest os not to ignore the PCI configuration that firmware has done at boot time could handle the differences. Signed-off-by: Jiahui Cen --- h

[PATCH v3 6/8] Kconfig: Enable PXB for ARM_VIRT by default

2020-12-23 Thread Jiahui Cen
PXB is now supported on ARM, so let's enable it by default. Signed-off-by: Jiahui Cen --- hw/pci-bridge/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-bridge/Kconfig b/hw/pci-bridge/Kconfig index a51ec716f5..f8df4315ba 100644 --- a/hw/pci-bridge/Kconfig

[PATCH v2 6/6] acpi: Update addr_trans and _DSM in expected files

2020-12-21 Thread Jiahui Cen
@ -3058,9 +3030,14 @@ { Return (Buffer (One) { - 0x01 /* . */ + 0x21 /* ! */ }) } + +If (Arg2 == 0x05

[PATCH v2 2/6] acpi: Add addr offset in build_crs

2020-12-21 Thread Jiahui Cen
d bus number into build_crs. Signed-off-by: Jiahui Cen --- hw/acpi/aml-build.c | 18 ++ hw/i386/acpi-build.c| 3 ++- hw/pci-host/gpex-acpi.c | 3 ++- include/hw/acpi/aml-build.h | 4 +++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/hw/acp

[PATCH v2 1/6] acpi: Allow DSDT acpi table changes

2020-12-21 Thread Jiahui Cen
Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test-allowed-diff.h | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..42418e58e7 100644 --- a/tests/qtest/bios-tables-test

[PATCH v2 5/6] acpi: Enable pxb unit-test for ARM virt machine

2020-12-21 Thread Jiahui Cen
No matter whether the pxb is enabled or not, the CONFIG_PXB macro in test would keep undefined. And since pxb is now enabled for ARM Virt machine by default, let's enable pxb unit-test by removing the CONFIG_PXB. Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test.c | 4 1

[PATCH v2 0/6] acpi: Some fixes for pxb support for ARM virt machine

2020-12-21 Thread Jiahui Cen
tps://lore.kernel.org/qemu-devel/20201217132926.4812-1-cenjia...@huawei.com/ Jiahui Cen (6): acpi: Allow DSDT acpi table changes acpi: Add addr offset in build_crs acpi/gpex: Inform os to keep firmware resource map Kconfig: Enable PXB for ARM_VIRT by default acpi: Enable pxb unit-test for

[PATCH v2 3/6] acpi/gpex: Inform os to keep firmware resource map

2020-12-21 Thread Jiahui Cen
ze is 0x410 as assigned by EDK2, the allocation would fail. The diffences could result in resource assignment failure. Using _DSM #5 method to inform guest os not to ignore the PCI configuration that firmware has done at boot time could handle the differences. Signed-off-by: Jiahui Cen --- h

[PATCH v2 4/6] Kconfig: Enable PXB for ARM_VIRT by default

2020-12-21 Thread Jiahui Cen
PXB is now supported on ARM, so let's enable it by default. Signed-off-by: Jiahui Cen --- hw/pci-bridge/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-bridge/Kconfig b/hw/pci-bridge/Kconfig index a51ec716f5..f8df4315ba 100644 --- a/hw/pci-bridge/Kconfig

Re: [PATCH v4 0/7] block: Add retry for werror=/rerror= mechanism

2020-12-20 Thread Jiahui Cen
Kindly ping... On 2020/12/15 20:30, Jiahui Cen wrote: > A VM in the cloud environment may use a virutal disk as the backend storage, > and there are usually filesystems on the virtual block device. When backend > storage is temporarily down, any I/O issued to the virtual block device >

Re: [PATCH] acpi/gpex: Inform os to keep firmware resource map

2020-12-20 Thread Jiahui Cen
Hi Michael, On 2020/12/20 3:06, Michael S. Tsirkin wrote: > On Fri, Dec 18, 2020 at 01:56:29PM +0800, Jiahui Cen wrote: >> Hi Michael, >> >> On 2020/12/18 4:04, Michael S. Tsirkin wrote: >>> On Thu, Dec 17, 2020 at 09:29:26PM +0800, Jiahui Cen wrote: >>>

Re: [PATCH] acpi: Add addr_trans in build_crs

2020-12-17 Thread Jiahui Cen
Hi Michael, On 2020/12/18 2:32, Michael S. Tsirkin wrote: > On Thu, Dec 17, 2020 at 09:27:47PM +0800, Jiahui Cen wrote: >> AML needs Address Translation offset to describe how a bridge translates >> addresses accross the bridge when using an address descriptor, and >> e

Re: [PATCH] acpi/gpex: Inform os to keep firmware resource map

2020-12-17 Thread Jiahui Cen
Hi Michael, On 2020/12/18 2:29, Michael S. Tsirkin wrote: > On Thu, Dec 17, 2020 at 09:29:26PM +0800, Jiahui Cen wrote: >> There may be some differences in pci resource assignment between guest os >> and firmware. >> >> Eg. A Bridge with Bus [d2] >>

Re: [PATCH] acpi/gpex: Inform os to keep firmware resource map

2020-12-17 Thread Jiahui Cen
Hi Michael, On 2020/12/18 4:04, Michael S. Tsirkin wrote: > On Thu, Dec 17, 2020 at 09:29:26PM +0800, Jiahui Cen wrote: >> There may be some differences in pci resource assignment between guest os >> and firmware. >> >> Eg. A Bridge with Bus [d2] >>

Re: [PATCH] acpi/gpex: Inform os to keep firmware resource map

2020-12-17 Thread Jiahui Cen
+Laszlo On 2020/12/17 21:29, Jiahui Cen wrote: > There may be some differences in pci resource assignment between guest os > and firmware. > > Eg. A Bridge with Bus [d2] > -+-[:d2]---01.0-[d3]01.0 > > where [d2:01.00] is a pcie-pci-bridge with BAR0 (

[PATCH] acpi/gpex: Inform os to keep firmware resource map

2020-12-17 Thread Jiahui Cen
differences. Signed-off-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index 071aa11b5c..2b490f3379 100644 --- a/hw/pci-host/gpex-acpi.c +++ b/hw/pci-host/gpex-acpi.c

[PATCH] acpi: Add addr_trans in build_crs

2020-12-17 Thread Jiahui Cen
into build_crs. Signed-off-by: Jiahui Cen --- hw/acpi/aml-build.c | 15 --- hw/i386/acpi-build.c| 3 ++- hw/pci-host/gpex-acpi.c | 3 ++- include/hw/acpi/aml-build.h | 4 +++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/acpi/aml-build.c

[PATCH v4 2/7] block-backend: Introduce retry timer

2020-12-15 Thread Jiahui Cen
Add a timer to regularly trigger retry on errors. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 21 1 file changed, 21 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index ce78d30794..fe775ea298 100644 --- a/block

[PATCH v4 4/7] block-backend: Enable retry action on errors

2020-12-15 Thread Jiahui Cen
Enable retry action when backend's retry timer is available. It would trigger the timer to do device specific retry action. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/block-backend.c b/

[PATCH v4 3/7] block-backend: Add device specific retry callback

2020-12-15 Thread Jiahui Cen
Add retry_request_cb in BlockDevOps to do device specific retry action. Backend's timer would be registered only when the backend is set 'retry' on errors and the device supports retry action. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend

[PATCH v4 6/7] block: Add error retry param setting

2020-12-15 Thread Jiahui Cen
Add "retry_interval" and "retry_timeout" parameter for drive and device option. These parameter are valid only when werror/rerror=retry. eg. --drive file=image,rerror=retry,retry_interval=1000,retry_timeout=5000 Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- b

[PATCH v4 5/7] block-backend: Add timeout support for retry

2020-12-15 Thread Jiahui Cen
Retry should only be triggered when timeout is not reached, so let's check timeout before retry. Device should also reset retry_start_time after successful retry. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 25 +++- include/s

[PATCH v4 1/7] qapi/block-core: Add retry option for error action

2020-12-15 Thread Jiahui Cen
Add a new error action 'retry' to support retry on errors. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- blockdev.c | 2 ++ qapi/block-core.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 412354b4b6..

[PATCH v4 7/7] virtio_blk: Add support for retry on errors

2020-12-15 Thread Jiahui Cen
Insert failed requests into device's list for later retry and handle queued requests to implement retry_request_cb. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- hw/block/virtio-blk.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/

[PATCH v4 0/7] block: Add retry for werror=/rerror= mechanism

2020-12-15 Thread Jiahui Cen
g/archive/html/qemu-devel/2020-10/msg06560.html Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang Jiahui Cen (7): qapi/block-core: Add retry option for error action block-backend: Introduce retry timer block-backend: Add device specific retry callback block-backend: Enable retry actio

Re: [PATCH v10 0/9] pci_expander_brdige:acpi: Support pxb-pcie for ARM

2020-12-02 Thread Jiahui Cen
Hi Michael, On 2020/12/2 17:53, Michael S. Tsirkin wrote: > On Thu, Nov 19, 2020 at 09:48:32AM +0800, Jiahui Cen wrote: >> Changes with v9 >> v9->v10: >> Refactor patch2 to drop useless macros and variables. >> Split patch2 into two patches. > > I tagged this

[PATCH v10 7/9] unit-test: The files changed.

2020-11-18 Thread Jiahui Cen
// Range Maximum 0x, // Translation Offset -0x0100, // Length + 0x0080, // Length Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 f

[PATCH v10 2/9] fw_cfg: Refactor extra pci roots addition

2020-11-18 Thread Jiahui Cen
. Signed-off-by: Jiahui Cen Signed-off-by: Yubo Miao --- hw/i386/pc.c | 18 +-- hw/nvram/fw_cfg.c | 23 include/hw/nvram/fw_cfg.h | 9 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index

[PATCH v10 8/9] unit-test: Add testcase for pxb

2020-11-18 Thread Jiahui Cen
From: Yubo Miao Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test.c | 58 ++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bios-tables

[PATCH v10 4/9] acpi: Extract crs build form acpi_build.c

2020-11-18 Thread Jiahui Cen
obtained from the config via two APIs: pci_bridge_get_base and pci_bridge_get_limit Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/acpi/aml-build.c | 285 +++ hw/i386/acpi-build.c| 293 include/hw/acpi/aml-build.h | 22 ++ 3 files

[PATCH v10 0/9] pci_expander_brdige:acpi: Support pxb-pcie for ARM

2020-11-18 Thread Jiahui Cen
s. This series of patches make arm to support PXB-PCIE. Users can configure pxb-pcie with certain numa, Example command is: -device pxb-pcie,id=pci.7,bus_nr=128,numa_node=0,bus=pcie.0,addr=0x9 Jiahui Cen (2): fw_cfg: Refactor extra pci roots addition hw/arm/virt: Write extra pci roots i

[PATCH v10 9/9] unit-test: Add the binary file and clear diff.h

2020-11-18 Thread Jiahui Cen
From: Yubo Miao Add the binary file DSDT.pxb and clear bios-tables-test-allowed-diff.h Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- tests/data/acpi/virt/DSDT.pxb | Bin 0 -> 7802 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 delet

[PATCH v10 1/9] acpi/gpex: Extract two APIs from acpi_dsdt_add_pci

2020-11-18 Thread Jiahui Cen
DSDT. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 112 +++- 1 file changed, 63 insertions(+), 49 deletions(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index dbb350a837..32a9f2796d 100644 --- a/hw/pci-host/gpex-acpi.c

[PATCH v10 6/9] acpi: Align the size to 128k

2020-11-18 Thread Jiahui Cen
-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/arm/virt-acpi-build.c | 25 1 file changed, 25 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e0bed9037c..711cf2069f 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c

[PATCH v10 5/9] acpi/gpex: Build tables for pxb

2020-11-18 Thread Jiahui Cen
of devices behind it. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/arm/virt-acpi-build.c | 6 ++- hw/pci-host/gpex-acpi.c| 54 include/hw/pci-host/gpex.h | 1 + 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw

[PATCH v10 3/9] hw/arm/virt: Write extra pci roots into fw_cfg

2020-11-18 Thread Jiahui Cen
Add bus property to virt machine for primary PCI root bus and use it to add extra pci roots behind it. Signed-off-by: Jiahui Cen Signed-off-by: Yubo Miao --- hw/arm/virt.c | 7 +-- include/hw/arm/virt.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/arm

Re: [PATCH v9 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-11-04 Thread Jiahui Cen
Hi Phil, On 2020/11/5 5:11, Philippe Mathieu-Daudé wrote: > Hi Laszlo, > > On 11/4/20 9:05 PM, Laszlo Ersek wrote: >> +Phil, +Gerd >> >> On 11/04/20 20:54, Laszlo Ersek wrote: >>> +Marcel >>> >>> On 11/03/20 13:01, Jiahui Cen wrote: >>

Re: [PATCH v9 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-11-04 Thread Jiahui Cen
On 2020/11/5 4:05, Laszlo Ersek wrote: > +Phil, +Gerd > > On 11/04/20 20:54, Laszlo Ersek wrote: >> +Marcel >> >> On 11/03/20 13:01, Jiahui Cen wrote: >>> From: Yubo Miao >>> >>> Write the extra roots into the fw_cfg, therefore the uefi

[PATCH v9 4/8] acpi: Refactor the source of host bridge and build tables for pxb

2020-11-03 Thread Jiahui Cen
of devices behind it. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/arm/virt-acpi-build.c | 5 +- hw/pci-host/gpex-acpi.c | 129 --- 2 files changed, 111 insertions(+), 23 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi

[PATCH v9 7/8] unit-test: Add testcase for pxb

2020-11-03 Thread Jiahui Cen
From: Yubo Miao Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test.c | 58 ++ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/qtest

[PATCH v9 6/8] unit-test: The files changed.

2020-11-03 Thread Jiahui Cen
// Range Maximum 0x, // Translation Offset -0x0100, // Length + 0x0080, // Length Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 f

[PATCH v9 1/8] acpi: Extract two APIs from acpi_dsdt_add_pci

2020-11-03 Thread Jiahui Cen
DSDT. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/pci-host/gpex-acpi.c | 118 +++- 1 file changed, 67 insertions(+), 51 deletions(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index dbb350a837..86ddb52cbd 100644 --- a/hw/pci

[PATCH v9 8/8] unit-test: Add the binary file and clear diff.h

2020-11-03 Thread Jiahui Cen
From: Yubo Miao Add the binary file DSDT.pxb and clear bios-tables-test-allowed-diff.h Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- tests/data/acpi/virt/DSDT.pxb | Bin 0 -> 7802 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 delet

[PATCH v9 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-11-03 Thread Jiahui Cen
From: Yubo Miao Write the extra roots into the fw_cfg, therefore the uefi could get the extra roots. Only if the uefi knows there are extra roots, the config space of devices behind the root could be obtained. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/arm/virt.c

[PATCH v9 0/8] pci_expander_brdige:acpi: Support pxb-pcie for ARM

2020-11-03 Thread Jiahui Cen
Changes with v8 v8->v9: Rebase to master Changes with v7 v7->v8: Fix the error:no member named 'fw_cfg' in 'struct PCMachineState' Changes with v6 v6->v7: Refactor fw_cfg_write_extra_pci_roots Add API PCI_GET_PCIE_HOST_STATE Fix typos Changes with v5 v5->v6: stat crs_range_insert in aml_build.h

[PATCH v9 3/8] acpi: Extract crs build form acpi_build.c

2020-11-03 Thread Jiahui Cen
obtained from the config via two APIs: pci_bridge_get_base and pci_bridge_get_limit Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/acpi/aml-build.c | 273 + hw/i386/acpi-build.c| 293 include/hw/acpi/aml

[PATCH v9 5/8] acpi: Align the size to 128k

2020-11-03 Thread Jiahui Cen
-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- hw/arm/virt-acpi-build.c | 25 + 1 file changed, 25 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index fd9c2007c0..7f57ab6938 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi

[PATCH v3 9/9] docs: add a doc about I/O hang

2020-10-22 Thread Jiahui Cen
Give some details about the I/O hang and how to use it. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- docs/io-hang.rst | 45 + 1 file changed, 45 insertions(+) create mode 100644 docs/io-hang.rst diff --git a/docs/io-hang.rst b/docs/io

[PATCH v3 8/9] qapi: add I/O hang and I/O hang timeout qapi event

2020-10-22 Thread Jiahui Cen
Sometimes hypervisor management tools like libvirt may need to monitor I/O hang events. Let's report I/O hang and I/O hang timeout event via qapi. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 3 +++ qapi/block-core.json | 26

[PATCH v3 5/9] block-backend: enable I/O hang when timeout is set

2020-10-22 Thread Jiahui Cen
Setting a non-zero timeout of I/O hang indicates I/O hang is enabled for the block backend. And when the block backend is going to be deleted, we should disable I/O hang. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 40

[PATCH v3 7/9] qemu-option: add I/O hang timeout option

2020-10-22 Thread Jiahui Cen
I/O hang timeout should be different under different situations. So it is better to provide an option for user to determine I/O hang timeout for each block device. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- blockdev.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a

[PATCH v3 4/9] block-backend: add I/O rehandle pause/unpause

2020-10-22 Thread Jiahui Cen
: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 60 +++--- include/sysemu/block-backend.h | 2 ++ 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 90fcc678b5..c16d95a2c9 100644

[PATCH v3 6/9] virtio-blk: pause I/O hang when resetting

2020-10-22 Thread Jiahui Cen
When resetting virtio-blk, we have to drain all AIOs but do not care about the results. So it is necessary to disable I/O hang before resetting virtio-blk, and enable it after resetting. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- hw/block/virtio-blk.c | 8 1 file changed

  1   2   >