Re: [PATCH v5 13/24] target/riscv: Use extracts for sraiw and srliw

2021-08-24 Thread Bin Meng
On Tue, Aug 24, 2021 at 4:05 AM Richard Henderson wrote: > > These operations can be done in one instruction on some hosts. > > Signed-off-by: Richard Henderson > --- > target/riscv/insn_trans/trans_rvi.c.inc | 14 -- > 1 file changed, 12 insertions(+), 2 deletions(-) > Reviewed-by:

Re: [RFC PATCH v2 0/5] physmem: Have flaview API check bus permission from MemTxAttrs argument

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:26 AM, Alexander Bulekov wrote: > On 210823 1650, Peter Xu wrote: >> On Mon, Aug 23, 2021 at 08:10:50PM +0100, Peter Maydell wrote: >>> On Mon, 23 Aug 2021 at 17:42, Philippe Mathieu-Daudé >>> wrote: This series aim to kill a recent class of bug, the infamous "DMA ree

[qemu-web PATCH] Update the information about the required version of macOS

2021-08-24 Thread Thomas Huth
The versions that we specify for macOS are way too old already. Let's rephrase this without specific version numbers, pointing the users to the latest version instead. Signed-off-by: Thomas Huth --- _download/macos.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_downl

Re: [PATCH v7 05/15] machine: Improve the error reporting of smp parsing

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 6:51 AM, wangyanan (Y) wrote: > On 2021/8/23 21:17, Philippe Mathieu-Daudé wrote: >> On 8/23/21 2:27 PM, Yanan Wang wrote: >>> We have two requirements for a valid SMP configuration: >>> the product of "sockets * cores * threads" must represent all the >>> possible cpus, i.e., max_cpus,

Re: [PATCH 1/2] hw/arm/virt: Rename default_bus_bypass_iommu

2021-08-24 Thread Markus Armbruster
Did this series fall through the cracks for 6.1? Jean-Philippe Brucker writes: > Since commit d8fb7d0969d5 ("vl: switch -M parsing to keyval"), machine > parameter definitions cannot use underscores, because keyval_dashify() > transforms them to dashes and the parser doesn't find the parameter.

[PATCH v4 0/4] hw/arm/smmuv3: Support non PCI/PCIe devices

2021-08-24 Thread Li, Chunming
The current SMMU v3 model only support PCI/PCIe devices, so we update it for non-PCI/PCIe devices. . Add independent IOMMU memory regions for non-PCI/PCIe devices . Add SID value property setting for non-PCI/PCIe devices . Add PL330 DMA controller into "virt" machine and connect with SMMU v3

[PATCH v4 1/4] hw/arm/smmuv3: Support non PCI/PCIe device connect with SMMU v3

2021-08-24 Thread Li, Chunming
. Add sid-map property to store non PCI/PCIe devices SID . Create IOMMU memory regions for non PCI/PCIe devices based on their SID . Update SID getting strategy for PCI/PCIe and non PCI/PCIe devices Signed-off-by: Li, Chunming --- hw/arm/smmuv3.c | 46 +

[PATCH v4 4/4] hw/arm/virt: Add PL330 DMA controller and connect with SMMU v3

2021-08-24 Thread Li, Chunming
Add PL330 DMA controller to test SMMU v3 connection and function. The default SID for PL330 is 1 but we test other values, it works well. Signed-off-by: Li, Chunming --- hw/arm/virt.c | 92 ++- include/hw/arm/virt.h | 1 + 2 files changed, 92 inse

[PATCH v4 3/4] hw/arm/virt: Update SMMU v3 creation to support non PCI/PCIe device connection

2021-08-24 Thread Li, Chunming
. Add "smmuv3_sidmap" to set non PCI/PCIe devices SID value . Pass non PCI/PCIe devices SID value to SMMU v3 model creation . Store SMMU v3 device in virtual machine then non PCI/PCIe can get its memory region later Signed-off-by: Li, Chunming --- hw/arm/virt.c | 18 ++

[PATCH v4 2/4] hw/arm/smmuv3: Update implementation of CFGI commands based on device SID

2021-08-24 Thread Li, Chunming
Replace "smmuv3_flush_config" with "g_hash_table_foreach_remove" based on devices SID. "smmu_iommu_mr" function can't get MR according to SID for non PCI/PCIe devices. Signed-off-by: Li, Chunming --- hw/arm/smmuv3.c | 35 ++- include/hw/arm/smmu-comm

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Markus Armbruster
Eduardo Habkost writes: > +Markus > > On Thu, Aug 19, 2021 at 07:15:46PM +0200, Philippe Mathieu-Daudé wrote: >> Do not ignore eventual error if we failed at setting the 'host' >> property of the TYPE_XHCI model. >> >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> hw/usb/hcd-xhci-pci.c | 2 +

RE: [PATCH] hw/arm/smmuv3: Support non-PCI/PCIe devices connection

2021-08-24 Thread Li, Chunming
> -Original Message- > From: Peter Maydell [mailto:peter.mayd...@linaro.org] > Sent: Friday, August 20, 2021 5:15 PM > To: Li, Chunming > Cc: eric.au...@redhat.com; qemu-...@nongnu.org; qemu-devel@nongnu.org; > Wen, Jianxian; Liu, Renwei > Subject: Re: [PATCH] hw/arm/smmuv3: Support non-P

Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/23/21 9:46 PM, Gautam Bhat wrote: > On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell > wrote: >> On Sun, 22 Aug 2021 at 15:37, Gautam Bhat wrote: >>> >>> Hi, >>> >>> I am to implement a very simple microcontroller for my understanding >>> of Qemu development. This microcontroller runs its cod

Re: [PATCH v2 1/5] qemu/qarray.h: introduce QArray

2021-08-24 Thread Markus Armbruster
Christian Schoenebeck writes: > Implements deep auto free of arrays while retaining common C-style > squared bracket access. > > Signed-off-by: Christian Schoenebeck You provide some motivation for this, but only in your cover letter: Patches 1 and 2 introduce include/qemu/qarray.h which i

Re: [PATCH v7 05/15] machine: Improve the error reporting of smp parsing

2021-08-24 Thread wangyanan (Y)
On 2021/8/24 15:29, Philippe Mathieu-Daudé wrote: On 8/24/21 6:51 AM, wangyanan (Y) wrote: On 2021/8/23 21:17, Philippe Mathieu-Daudé wrote: On 8/23/21 2:27 PM, Yanan Wang wrote: We have two requirements for a valid SMP configuration: the product of "sockets * cores * threads" must represent

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 10:13 AM, Markus Armbruster wrote: > Eduardo Habkost writes: > >> +Markus >> >> On Thu, Aug 19, 2021 at 07:15:46PM +0200, Philippe Mathieu-Daudé wrote: >>> Do not ignore eventual error if we failed at setting the 'host' >>> property of the TYPE_XHCI model. >>> >>> Signed-off-by: Philip

Re: [PATCH] MAINTAINERS: add fuzzing reviewer

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 8:26 AM, Qiuhao Li wrote: > To keep me cc-ed when something changes. Suggested by Alexander. > > https://lists.gnu.org/archive/html/qemu-devel/2021-08/msg03631.html > > Signed-off-by: Qiuhao Li > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Philippe Mathieu

Re: [PATCH] softmmu/physmem: Improve guest memory allocation failure error message

2021-08-24 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > On 23.08.21 12:34, Philippe Mathieu-Daudé wrote: > > On 8/23/21 12:24 PM, David Hildenbrand wrote: > > > On 23.08.21 12:12, Philippe Mathieu-Daudé wrote: > > > > On 8/23/21 11:29 AM, David Hildenbrand wrote: > > > > > On 23.08.21 11:23, Peter Maydell

[PATCH v8 00/34] block: publish backup-top filter

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Hi all! v8: 06: add Hanna's r-b 07: keep is_fleecing detection in _new() function 08,17,18: add Hanna's r-b 19: wording, s/6.1/6.2/, add Markus's a-b 25: new 29: add John's r-b 34: new Patches without r-b: 07, 25, 34 Vladimir Sementsov-Ogievskiy (34): block: introduce bdrv_replace_child_bs()

[PATCH v8 06/34] block-copy: move detecting fleecing scheme to block-copy

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We want to simplify initialization interface of copy-before-write filter as we are going to make it public. So, let's detect fleecing scheme exactly in block-copy code, to not pass this information through extra levels. Why not just set BDRV_REQ_SERIALISING unconditionally: because we are going to

[PATCH v8 08/34] block/backup: set copy_range and compress after filter insertion

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter, so it would be initialized through options. Still we don't want to publish compress and copy-range options, as 1. Modern way to enable compression is to use compress filter. 2. For copy-range it's unclean how to make proper interface: - it's has

[PATCH v8 01/34] block: introduce bdrv_replace_child_bs()

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Add function to transactionally replace bs inside BdrvChild. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block.h | 2 ++ block.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/include/block/block.h b/

[PATCH v8 02/34] block: introduce blk_replace_bs

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Add function to change bs inside blk. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/sysemu/block-backend.h | 1 + block/block-backend.c | 8 2 files changed, 9 insertions(+) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-ba

[PATCH v8 07/34] block/block-copy: introduce block_copy_set_copy_opts()

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We'll need a possibility to set compress and use_copy_range options after initialization of the state. So make corresponding part of block_copy_state_new() separate and public. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 3 +++ block/block-copy.c | 49 ++

[PATCH v8 13/34] block/copy-before-write: bdrv_cbw_append(): replace child at last

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Refactor the function to replace child at last. Thus we don't need to revert it and code is simplified. block-copy state initialization being done before replacing the child doesn't need any drained section. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-befo

[PATCH v8 26/34] iotests/222: fix pylint and mypy complains

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Here: - long line - move to new interface of vm.qmp() (direct passing dict), to avoid mypy false-positive, as it thinks that unpacked dict is a positional argument. - extra parenthesis - handle event_wait possible None value Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max R

[PATCH v8 04/34] qdev: allow setting drive property for realized device

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We need an ability to insert filters above top block node, attached to block device. It can't be achieved with blockdev-reopen command. So, we want do it with help of qom-set. Intended usage: Assume there is a node A that is attached to some guest device. 1. blockdev-add to create a filter node

[PATCH v8 03/34] qdev-properties: PropertyInfo: add realized_set_allowed field

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Add field, so property can declare support for setting the property when device is realized. To be used in the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c| 6 +++--- 2 files changed, 4

[PATCH v8 15/34] block/copy-before-write: cbw_init(): rename variables

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
One more step closer to real .bdrv_open() handler: use more usual names for bs being initialized and its state. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-)

[PATCH v8 24/34] python/qemu/machine: QEMUMachine: improve qmp() method

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We often call qmp() with unpacking dict, like qmp('foo', **{...}). mypy don't really like it, it thinks that passed unpacked dict is a positional argument and complains that it type should be bool (because second argument of qmp() is conv_keys: bool). Allow passing dict directly, simplifying inter

[PATCH v8 09/34] block/backup: move cluster size calculation to block-copy

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
The main consumer of cluster-size is block-copy. Let's calculate it here instead of passing through backup-top. We are going to publish copy-before-write filter soon, so it will be created through options. But we don't want for now to make explicit option for cluster-size, let's continue to calcul

[PATCH v8 11/34] block/copy-before-write: drop extra bdrv_unref on failure path

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
bdrv_attach_child() do bdrv_unref() on failure, so we shouldn't do it by hand here. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 2a5

[PATCH v8 12/34] block/copy-before-write: use file child instead of backing

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter, and there no public backing-child-based filter in Qemu. No reason to create a precedent, so let's refactor copy-before-write filter instead. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 39 ++

[PATCH v8 27/34] iotests/222: constantly use single quotes for strings

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
The file use both single and double quotes for strings. Let's be consistent. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/222 | 68 +- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/qemu-

[PATCH v8 05/34] block: rename backup-top to copy-before-write

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We are going to convert backup_top to full featured public filter, which can be used in separate of backup job. Start from renaming from "how it used" to "what it does". While updating comments in 283 iotest, drop and rephrase also things about ".active", as this field is now dropped, and filter d

[PATCH v8 14/34] block/copy-before-write: introduce cbw_init()

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Move part of bdrv_cbw_append() to new function cbw_open(). It's an intermediate step for adding normal .bdrv_open() handler to the filter. With this commit no logic is changed, but we have a function which will be turned into .bdrv_open() handler in future commit. Signed-off-by: Vladimir Sementsov

[PATCH v8 28/34] iotests: move 222 to tests/image-fleecing

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Give a good name to test file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/{222 => tests/image-fleecing} | 0 tests/qemu-iotests/{222.out => tests/image-fleecing.out} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/qemu-i

[PATCH v8 17/34] block/copy-before-write: bdrv_cbw_append(): drop unused compress arg

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/copy-before-write.h | 1 - block/backup.c| 2 +- block/copy-before-write.c | 7 +++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h

[PATCH v8 10/34] block/copy-before-write: relax permission requirements when no parents

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter. So, user should be able to create it with blockdev-add first, specifying both filtered and target children. And then do blockdev-reopen, to actually insert the filter where needed. Currently, filter unshares write permission unconditionally on sour

[PATCH v8 16/34] block/copy-before-write: cbw_init(): use file child after attaching

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
In the next commit we'll get rid of source argument of cbw_init(). Prepare to it now, to make next commit simpler: move the code block that uses source below attaching the child and use bs->file->bs instead of source variable. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --

[PATCH v8 18/34] block/copy-before-write: cbw_init(): use options

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
One more step closer to .bdrv_open(): use options instead of plain arguments. Move to bdrv_open_child() calls, native for drive open handlers. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/copy-before-write.c | 29 +++-- 1 file changed, 1

[PATCH v8 31/34] iotests/image-fleecing: rename tgt_node

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Actually target of backup(sync=None) is not a final backup target: image fleecing is intended to be used with external tool, which will copy data from fleecing node to some real backup target. Also, we are going to add a test case for "push backup with fleecing", where instead of exporting fleecin

[PATCH v8 21/34] block/copy-before-write: make public block driver

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Finally, copy-before-write gets own .bdrv_open and .bdrv_close handlers, block_init() call and becomes available through bdrv_open(). To achieve this: - cbw_init gets unused flags argument and becomes cbw_open - block_copy_state_free() call moved to new cbw_close() - in bdrv_cbw_append: - o

[PATCH v8 23/34] python/qemu/machine.py: refactor _qemu_args()

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
- use shorter construction - don't create new dict if not needed - drop extra unpacking key-val arguments - drop extra default values Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- python/qemu/machine/machine.py | 18 -- 1 file

[PATCH v8 29/34] iotests.py: hmp_qemu_io: support qdev

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- tests/qemu-iotests/iotests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 89663dac06..77efcb0927 100644

Re: [PATCH] MAINTAINERS: add fuzzing reviewer

2021-08-24 Thread Alexander Bulekov
On 210824 1426, Qiuhao Li wrote: > To keep me cc-ed when something changes. Suggested by Alexander. > > https://lists.gnu.org/archive/html/qemu-devel/2021-08/msg03631.html > > Signed-off-by: Qiuhao Li Reviewed-by: Alexander Bulekov

[PATCH v8 19/34] block/copy-before-write: initialize block-copy bitmap

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter to be used in separate of backup. Future step would support bitmap for the filter. But let's start from full set bitmap. We have to modify backup, as bitmap is first initialized by copy-before-write filter, and then backup modifies it. Signed-off-b

[PATCH v8 30/34] iotests/image-fleecing: proper source device

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Define scsi device to operate with it by qom-set in further patch. Give a new node-name to source block node, to not look like device name. Job now don't want to work without giving explicit id, so, let's call it "fleecing". Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --

[PATCH v8 25/34] python:QEMUMachine: template typing for self returning methods

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
mypy thinks that return value of these methods in subclusses is QEMUMachine, which is wrong. So, make typing smarter. Suggested-by: John Snow Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machine.py | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --g

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 10:35 AM, Philippe Mathieu-Daudé wrote: > On 8/24/21 10:13 AM, Markus Armbruster wrote: >> Eduardo Habkost writes: >> >>> +Markus >>> >>> On Thu, Aug 19, 2021 at 07:15:46PM +0200, Philippe Mathieu-Daudé wrote: Do not ignore eventual error if we failed at setting the 'host' pro

Re: [PATCH] hw/acpi/pcihp: validate bsel property of the bus before unplugging device

2021-08-24 Thread Igor Mammedov
On Mon, 23 Aug 2021 19:06:47 -0400 "Michael S. Tsirkin" wrote: > On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > > Bsel property of the pci bus indicates whether the bus supports acpi > > hotplug. > > We need to validate the presence of this property before performing any > > hotpl

[PATCH v8 20/34] block/block-copy: make setting progress optional

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Now block-copy will crash if user don't set progress meter by block_copy_set_progress_meter(). copy-before-write filter will be used in separate of backup job, and it doesn't want any progress meter (for now). So, allow not setting it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max

[PATCH v8 22/34] qapi: publish copy-before-write filter

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Acked-by: Markus Armbruster --- qapi/block-core.json | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 675d8265eb..6764d8b84f 100644

[BUG] scsi: vmw_pvscsi: Boot hangs during scsi under qemu, post commit e662502b3a78

2021-08-24 Thread Shmulik Ladkani
Hi, Commit e662502b3a78 ("scsi: vmw_pvscsi: Set correct residual data length"), and its backports to stable trees, makes kernel hang during boot, when ran as a VM under qemu with following parameters: -drive file=$DISKFILE,if=none,id=sda -device pvscsi -device scsi-hd,bus=scsi.0,drive=sda

Re: [PATCH] softmmu/physmem: Improve guest memory allocation failure error message

2021-08-24 Thread David Hildenbrand
On 24.08.21 10:37, Dr. David Alan Gilbert wrote: * David Hildenbrand (da...@redhat.com) wrote: On 23.08.21 12:34, Philippe Mathieu-Daudé wrote: On 8/23/21 12:24 PM, David Hildenbrand wrote: On 23.08.21 12:12, Philippe Mathieu-Daudé wrote: On 8/23/21 11:29 AM, David Hildenbrand wrote: On 23.0

[PATCH v8 32/34] iotests/image-fleecing: prepare for adding new test-case

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
We are going to add a test-case with some behavior modifications. So, let's prepare a function to be reused. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-)

Re: [RFC PATCH v2 0/5] physmem: Have flaview API check bus permission from MemTxAttrs argument

2021-08-24 Thread Stefan Hajnoczi
On Mon, Aug 23, 2021 at 06:41:52PM +0200, Philippe Mathieu-Daudé wrote: > This series aim to kill a recent class of bug, the infamous > "DMA reentrancy" issues found by Alexander while fuzzing. > > Introduce the 'bus_perm' field in MemTxAttrs, defining 3 bits: > > - MEMTXPERM_UNSPECIFIED (current

[PATCH v8 33/34] iotests/image-fleecing: add test-case for copy-before-write filter

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
New fleecing method becomes available: copy-before-write filter. Actually we don't need backup job to setup image fleecing. Add test for new recommended way of image fleecing. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 5

Re: [PATCH 1/3] simplebench: add img_bench_templater.py

2021-08-24 Thread Hanna Reitz
On 24.08.21 10:53, Vladimir Sementsov-Ogievskiy wrote: 19.08.2021 19:37, Hanna Reitz wrote: On 24.07.21 15:38, Vladimir Sementsov-Ogievskiy wrote: [...] +import itertools +from lark import Lark + +grammar = """ +start: ( text | column_switch | row_switch )+ + +column_switch: "{" text ["|" te

[PATCH v8 34/34] block/block-copy: block_copy_state_new(): drop extra arguments

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
The only caller pass copy_range and compress both false. Let's just drop these arguments. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 1 - block/block-copy.c | 5 ++--- block/copy-before-write.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) d

Re: [RFC PATCH v2 1/5] softmmu/physmem: Simplify flatview_write and address_space_access_valid

2021-08-24 Thread Alexander Bulekov
On 210823 1841, Philippe Mathieu-Daudé wrote: > Remove unuseful local 'result' variables. > > Signed-off-by: Philippe Mathieu-Daudé > --- > softmmu/physmem.c | 11 +++ > 1 file changed, 3 insertions(+), 8 deletions(-) > Reviewed-by: Alexander Bulekov

Re: [PATCH 1/3] simplebench: add img_bench_templater.py

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
19.08.2021 19:37, Hanna Reitz wrote: On 24.07.21 15:38, Vladimir Sementsov-Ogievskiy wrote: Add simple grammar-parsing template benchmark. This doesn’t really say much, and FWIW, for like ten minutes I thought this would do something completely different than it did (while I was trying to pa

Re: [PATCH 0/3] gdbstub: add support for switchable endianness

2021-08-24 Thread Peter Maydell
On Tue, 24 Aug 2021 at 00:05, Changbin Du wrote: > > On Mon, Aug 23, 2021 at 04:30:05PM +0100, Peter Maydell wrote: > > changes to be more capable of handling dynamic target changes > > (this would also help with eg debugging across 32<->64 bit switches); > > as I understand it that gdb work would

[Bug 1921664] Re: Coroutines are racy for risc64 emu on arm64 - crash on Assertion

2021-08-24 Thread Christian Ehrhardt 
Hmm, thanks for the hint Thomas. Of the two formerly referenced same-source different result builds: [1] => built 2021-03-23 in Hirsute => works [2] => built 2021-04-12 in Hirsute => fails [1]: https://launchpad.net/ubuntu/+source/qemu/1:5.2+dfsg-9ubuntu1/+build/21196422 [2]: https://launchpad

Re: [qemu-web PATCH] Update the information about the required version of macOS

2021-08-24 Thread Peter Maydell
On Tue, 24 Aug 2021 at 08:27, Thomas Huth wrote: > > The versions that we specify for macOS are way too old already. Let's > rephrase this without specific version numbers, pointing the users > to the latest version instead. > > Signed-off-by: Thomas Huth > --- > _download/macos.md | 4 ++-- > 1

Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation

2021-08-24 Thread Peter Maydell
On Tue, 24 Aug 2021 at 09:22, Philippe Mathieu-Daudé wrote: > > On 8/23/21 9:46 PM, Gautam Bhat wrote: > > On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell > > wrote: > >> On Sun, 22 Aug 2021 at 15:37, Gautam Bhat wrote: > >>> > >>> Hi, > >>> > >>> I am to implement a very simple microcontroller

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Peter Maydell
On Tue, 24 Aug 2021 at 09:14, Markus Armbruster wrote: > In functions with an Error **errp parameter, use of &error_fatal is > almost always wrong. What are the cases where it is not wrong? My guess is "in board code and other places where the error handling would have been 'print a message and c

Re: [PATCH 1/3] simplebench: add img_bench_templater.py

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
24.08.2021 11:59, Hanna Reitz wrote: On 24.08.21 10:53, Vladimir Sementsov-Ogievskiy wrote: 19.08.2021 19:37, Hanna Reitz wrote: On 24.07.21 15:38, Vladimir Sementsov-Ogievskiy wrote: [...] +import itertools +from lark import Lark + +grammar = """ +start: ( text | column_switch | row_switch

Re: [RFC PATCH v2 0/5] physmem: Have flaview API check bus permission from MemTxAttrs argument

2021-08-24 Thread Edgar E. Iglesias
On Mon, Aug 23, 2021 at 08:10:50PM +0100, Peter Maydell wrote: > On Mon, 23 Aug 2021 at 17:42, Philippe Mathieu-Daudé > wrote: > > > > This series aim to kill a recent class of bug, the infamous > > "DMA reentrancy" issues found by Alexander while fuzzing. > > > > Introduce the 'bus_perm' field i

Re: [PATCH] hw/acpi/pcihp: validate bsel property of the bus before unplugging device

2021-08-24 Thread Ani Sinha
On Tue, 24 Aug 2021, Igor Mammedov wrote: > On Mon, 23 Aug 2021 19:06:47 -0400 > "Michael S. Tsirkin" wrote: > > > On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > > > Bsel property of the pci bus indicates whether the bus supports acpi > > > hotplug. > > > We need to validate the

Re: [PATCH V6 00/27] Live Update

2021-08-24 Thread Zheng Chuan
Hi, Steve. I think I have found the problem, it is because the rom_reset() during the cpr_exec will write dtb into the mach-virt.ram which cause the memory corruption. Also I found in x86 the memoryregion of acpi also changed during rom_rest. Maybe we should keep it consistent and skip the rom_

Re: [PATCH v3 0/6] qapi: Add support for aliases

2021-08-24 Thread Markus Armbruster
Conflicts with Marc-André's "[PATCH v7 00/10] qapi: untie 'if' conditions from C preprocessor", which I queued for 6.2. The conflicts look harmless to me.

Re: [RFC PATCH v2 0/5] physmem: Have flaview API check bus permission from MemTxAttrs argument

2021-08-24 Thread Peter Maydell
On Mon, 23 Aug 2021 at 21:50, Peter Xu wrote: > > On Mon, Aug 23, 2021 at 08:10:50PM +0100, Peter Maydell wrote: > > On Mon, 23 Aug 2021 at 17:42, Philippe Mathieu-Daudé > > wrote: > > > > > > This series aim to kill a recent class of bug, the infamous > > > "DMA reentrancy" issues found by Alex

Re: [qemu-web PATCH] Update the information about the required version of macOS

2021-08-24 Thread Thomas Huth
On 24/08/2021 11.16, Peter Maydell wrote: On Tue, 24 Aug 2021 at 08:27, Thomas Huth wrote: The versions that we specify for macOS are way too old already. Let's rephrase this without specific version numbers, pointing the users to the latest version instead. Signed-off-by: Thomas Huth ---

[RFC 00/10] hw/mos6522: VIA timer emulation fixes and improvements

2021-08-24 Thread Finn Thain
This is a patch series that I started last year. The aim was to try to get a monotonic clocksource for Linux/m68k guests. That aim hasn't been achieved yet (for q800 machines) but I'm submitting the patch series as an RFC because, - It does improve 6522 emulation fidelity. - It allows Linux/

[RFC 01/10] hw/mos6522: Remove get_load_time() methods and functions

2021-08-24 Thread Finn Thain
This code appears to be unnecessary. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 1c57332b40..a478c1ca43 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.

[RFC 02/10] hw/mos6522: Remove get_counter_value() methods and functions

2021-08-24 Thread Finn Thain
This code appears to be unnecessary. Also, these routines don't return the counter value but a time interval between counter values, so they are misnamed. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/

[RFC 04/10] hw/mos6522: Rename timer callback functions

2021-08-24 Thread Finn Thain
This improves readability. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 1d4a56077e..c0d6bee4cc 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -154,7 +154,7 @@

[RFC 05/10] hw/mos6522: Don't clear T1 interrupt flag on latch write

2021-08-24 Thread Finn Thain
The Synertek datasheet says, "A write to T1L-H loads an 8-bit count value into the latch. A read of T1L-H transfers the contents of the latch to the data bus. Neither operation has an affect [sic] on the interrupt flag." Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 1 - 1 file changed, 1 de

[RFC 03/10] hw/mos6522: Remove redundant mos6522_timer1_update() calls

2021-08-24 Thread Finn Thain
Reads and writes to the TL and TC registers have no immediate effect on a running timer, with the exception of a write to TCH. Hence these mos6522_timer_update() calls are not needed. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/hw/mis

[RFC 07/10] hw/mos6522: Fix initial timer counter reload

2021-08-24 Thread Finn Thain
The first reload of timer 1 is early by half of a clock cycle as it gets measured from a falling edge. By contrast, the succeeding reloads are measured from rising edge to rising edge. Neglecting that complication, the behaviour of the counter should be the same from one reload to the next. The se

[RFC 06/10] hw/mos6522: Implement oneshot mode

2021-08-24 Thread Finn Thain
Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 19 --- include/hw/misc/mos6522.h | 3 +++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 8991f4..5b1657ac0d 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos

[PATCH v2 2/3] qcow2: refactor handle_dependencies() loop body

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
No logic change, just prepare for the following commit. While being here do also small grammar fix in a comment. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- block/qcow2-cluster.c | 49 --- 1 file chang

[PATCH v2 0/3] qcow2: relax subclusters allocation dependencies

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Hi all! v2: 01: improve documentation 02: add Hanna's and Eric's r-bs, add tiny grammar fix 03: fix test by filtering instead of reducing number of writes Parallel small writes to unallocated cluster works bad when subclusters enabled. Look, without subclusters, one of write requests will alloca

[RFC 09/10] hw/mos6522: Avoid using discrepant QEMU clock values

2021-08-24 Thread Finn Thain
mos6522_read() and mos6522_write() may call various functions to determine timer irq state, timer counter value and QEMUTimer deadline. All called functions must use the same value for the present time. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 51 +---

[RFC 08/10] hw/mos6522: Call mos6522_update_irq() when appropriate

2021-08-24 Thread Finn Thain
It necessary to call mos6522_update_irq() when the interrupt flags change and unnecessary when they haven't. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 0a241fe9f8..0dd3ccf945 10

[RFC 10/10] hw/mos6522: Synchronize timer interrupt and timer counter

2021-08-24 Thread Finn Thain
We rely on a QEMUTimer callback to set the interrupt flag, and this races with counter register accesses, such that the guest might see the counter reloaded but might not see the interrupt flagged. According to the datasheet, a real 6522 device counts down to , then raises the relevant IRQ. Af

[PATCH v2 1/3] simplebench: add img_bench_templater.py

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Add simple grammar-parsing template benchmark. New tool consume test template written in bash with some special grammar injections and produces multiple tests, run them and finally print a performance comparison table of different tests produced from one template. Signed-off-by: Vladimir Sementsov

[PATCH v2 3/3] qcow2: handle_dependencies(): relax conflict detection

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
There is no conflict and no dependency if we have parallel writes to different subclusters of one cluster when the cluster itself is already allocated. So, relax extra dependency. Measure performance: First, prepare build/qemu-img-old and build/qemu-img-new images. cd scripts/simplebench ./img_be

Re: [RFC 08/10] hw/mos6522: Call mos6522_update_irq() when appropriate

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > It necessary to call mos6522_update_irq() when the interrupt flags > change and unnecessary when they haven't. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Philippe Mathieu

Re: [PATCH v5 2/5] python/aqmp-tui: Add AQMP TUI

2021-08-24 Thread Niteesh G. S.
On Tue, Aug 24, 2021 at 12:30 AM John Snow wrote: > > > On Mon, Aug 23, 2021 at 12:31 PM G S Niteesh Babu > wrote: > >> Added AQMP TUI. >> >> Implements the follwing basic features: >> 1) Command transmission/reception. >> 2) Shows events asynchronously. >> 3) Shows server status in the bottom s

Re: [RFC 09/10] hw/mos6522: Avoid using discrepant QEMU clock values

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > mos6522_read() and mos6522_write() may call various functions to determine > timer irq state, timer counter value and QEMUTimer deadline. All called > functions must use the same value for the present time. > > Signed-off-by: Finn Thain > --- > hw/misc/mo

Re: [RFC 04/10] hw/mos6522: Rename timer callback functions

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > This improves readability. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 10 ++ > 1 file changed, 6 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [RFC 01/10] hw/mos6522: Remove get_load_time() methods and functions

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > This code appears to be unnecessary. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 22 +- > 1 file changed, 1 insertion(+), 21 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [RFC 02/10] hw/mos6522: Remove get_counter_value() methods and functions

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > This code appears to be unnecessary. > > Also, these routines don't return the counter value but a time interval > between counter values, so they are misnamed. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 22 ++ > 1 file

Re: [RFC 00/10] hw/mos6522: VIA timer emulation fixes and improvements

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > On a real Quadra, accesses to the SY6522 chips are slow because they are > synchronous with the 783360 Hz "phase 2" clock. In QEMU, they are slow > only because of the division operation in the timer count calculation. > > This patch series improves the

Re: [PATCH] hw/acpi/pcihp: validate bsel property of the bus before unplugging device

2021-08-24 Thread Ani Sinha
On Tue, 24 Aug 2021, Igor Mammedov wrote: > On Mon, 23 Aug 2021 19:06:47 -0400 > "Michael S. Tsirkin" wrote: > > > On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > > > Bsel property of the pci bus indicates whether the bus supports acpi > > > hotplug. > > > We need to validate the

Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation

2021-08-24 Thread Philippe Mathieu-Daudé
On Tue, Aug 24, 2021 at 11:19 AM Peter Maydell wrote: > On Tue, 24 Aug 2021 at 09:22, Philippe Mathieu-Daudé wrote: > > On 8/23/21 9:46 PM, Gautam Bhat wrote: > > > On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell > > > wrote: > > >> On Sun, 22 Aug 2021 at 15:37, Gautam Bhat wrote: > > >>> > > >

[PATCH] ide: Cap LBA28 capacity announcement to 2^28-1

2021-08-24 Thread Samuel Thibault
The LBA28 capacity (at offsets 60/61 of identification) is supposed to express the maximum size supported by LBA28 commands. If the device is larger than this, we have to cap it to 2^28-1. At least NetBSD happens to be using this value to determine whether to use LBA28 or LBA48 for its commands, u

Re: [PATCH] hw/acpi/pcihp: validate bsel property of the bus before unplugging device

2021-08-24 Thread Ani Sinha
On Tue, 24 Aug 2021, Ani Sinha wrote: > > > On Tue, 24 Aug 2021, Igor Mammedov wrote: > > > On Mon, 23 Aug 2021 19:06:47 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > > > > Bsel property of the pci bus indicates whether the bus sup

  1   2   3   4   >