[PATCH v2 07/33] block: rename backup-top to copy-before-write

2021-05-20 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 v2 11/33] block/copy-before-write: relax permission requirements when no parents

2021-05-20 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 v2 05/33] qdev-properties: PropertyInfo: add realized_set_allowed field

2021-05-20 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 --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c| 6 +++--- 2 files changed, 4 insertions(+), 3 deleti

[PATCH v2 12/33] block/copy-before-write: drop extra bdrv_unref on failure path

2021-05-20 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 --- 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 2a51cc64e4..945d9340f4 1006

[PATCH v2 14/33] block/copy-before-write: bdrv_cbw_append(): replace child at last

2021-05-20 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 initilization being done before replacing the child doesn't need any drained section. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-befor

[PATCH v2 08/33] block/backup: drop support for copy_range

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
copy_range is not a default behavior since 6a30f663d4c0b3c, and it's now available only though x-perf experimantal argument, so it's OK to drop it. Even when backup is used to copy disk to same filesystem, and filesystem supports zero-copy copy_range, copy_range is probably not what we want for ba

[PATCH v2 04/33] block: introduce blk_replace_bs

2021-05-20 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 v2 17/33] block/copy-before-write: cbw_init(): use file child after attaching

2021-05-20 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 v2 13/33] block/copy-before-write: use file child instead of backing

2021-05-20 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 --- block/copy-before-write.c | 39 ++

[PATCH v2 28/33] iotests: move 222 to tests/image-fleecing

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
Give a good name to test file. Signed-off-by: Vladimir Sementsov-Ogievskiy --- 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-iotests/{222 => tests/ima

[PATCH v2 06/33] qdev: allow setting drive property for realized device

2021-05-20 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 v2 23/33] python/qemu/machine.py: refactor _qemu_args()

2021-05-20 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 --- python/qemu/machine.py | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a

[PATCH v2 15/33] block/copy-before-write: introduce cbw_init()

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
Move part of bdrv_cbw_append() to new function cbw_open(). It's an intermediate step for adding noramal .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 Sementso

[PATCH v2 19/33] block/copy-before-write: initialize block-copy bitmap

2021-05-20 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 v2 18/33] block/copy-before-write: cbw_init(): use options

2021-05-20 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 --- block/copy-before-write.c | 40 +-- 1 file changed, 26 insertions(+),

[PATCH v2 26/33] iotests/222: fix pylint and mypy complains

2021-05-20 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 --- tests/qemu-io

[PATCH v2 29/33] iotests.py: hmp_qemu_io: support qdev

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- 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 c7ec16c082..9fa0162b07 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/

[PATCH v2 16/33] block/copy-before-write: cbw_init(): rename variables

2021-05-20 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 v2 25/33] iotests.py: VM: add own __enter__ method

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
In superclass __enter__ method is defined with return value type hint 'QEMUMachine'. So, mypy thinks that return value of VM.__enter__ is QEMUMachine. Let's redefine __enter__ in VM class, to give it correct type hint. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py

[PATCH v2 20/33] block/block-copy: make setting progress optional

2021-05-20 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 v2 30/33] iotests/image-fleecing: proper source device

2021-05-20 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 --- tests/qemu-iotests/te

[PATCH v2 22/33] qapi: publish copy-before-write filter

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 2ea294129e..8c4801a13d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core

[PATCH v2 27/33] iotests/222: constantly use single quotes for strings

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

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

2021-05-20 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 --- tests/qemu-iotests/tests/image-fleecing | 50 +- tests/

[PATCH v2 21/33] block/copy-before-write: make public block driver

2021-05-20 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 v2 32/33] iotests/image-fleecing: prepare for adding new test-case

2021-05-20 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 --- tests/qemu-iotests/tests/image-fleecing | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/qemu

Re: [PATCH 2/6] qapi/parser: Allow empty QAPIDoc Sections

2021-05-20 Thread Markus Armbruster
John Snow writes: > It simplifies the typing to say that _section is always a > QAPIDoc.Section(). > > To accommodate this change, we must allow for this object to evaluate to > False for functions like _end_section which behave differently based on > whether or not a Section has been started. >

Re: [RFC PATCH v4 6/7] hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35

2021-05-20 Thread Igor Mammedov
On Thu, 13 May 2021 08:26:41 +0200 Julia Suvorova wrote: > Q35 has three different types of PCI devices hot-plug: PCIe Native, > SHPC Native and ACPI hot-plug. This patch changes the default choice > for cold-plugged bridges from PCIe Native to ACPI Hot-plug with > ability to use SHPC and PCIe Na

Re: [PATCH v12 4/8] arm64: kvm: Introduce MTE VM feature

2021-05-20 Thread Steven Price
On 20/05/2021 09:51, Marc Zyngier wrote: > On Wed, 19 May 2021 11:48:21 +0100, > Steven Price wrote: >> >> On 17/05/2021 17:45, Marc Zyngier wrote: >>> On Mon, 17 May 2021 13:32:35 +0100, >>> Steven Price wrote: [...] + } + } + + return 0; +} + stati

[PATCH v2 24/33] python/qemu/machine: QEMUMachine: improve qmp() method

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
We often call qmp() with unpacking dict, like qmp('foo', **{...}). mypy don't really like it, it things 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 possing dict directly, simplifying inter

Re: [PULL 00/26] Misc patches for 2021-05-20

2021-05-20 Thread Peter Maydell
On Thu, 20 May 2021 at 15:20, Peter Maydell wrote: > > On Thu, 20 May 2021 at 14:26, Peter Maydell wrote: > > > > On Thu, 20 May 2021 at 09:31, Paolo Bonzini wrote: > > > > > > * submodule cleanups (Philippe, myself) > > > * tiny

[PATCH v2 31/33] iotests/image-fleecing: rename tgt_node

2021-05-20 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

Re: [PATCH 1/6] qapi/parser.py: remove unused check_args_section arguments

2021-05-20 Thread Markus Armbruster
John Snow writes: > (Addresses a pylint warning.) > > Signed-off-by: John Snow > --- > scripts/qapi/parser.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py > index 06167ed3e0a..b3a468504fc 100644 > --- a/scripts/qa

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDriverState to the other. Honestly, for me 4-state state-mach

Re: [PATCH v2 0/7] block-copy: protect block-copy internal structures

2021-05-20 Thread Emanuele Giuseppe Esposito
On 20/05/2021 15:47, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: This serie of patches aims to reduce the usage of the global AioContexlock in block-copy, by introducing smaller granularity locks thus on making the block layer thread safe. This ser

[RFC PATCH 1/7] target/i386: Declare constants for XSAVE offsets

2021-05-20 Thread David Edmondson
Declare and use manifest constants for the XSAVE state component offsets. Signed-off-by: David Edmondson --- target/i386/cpu.h | 30 +++--- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index e6836393f7..1fb732f366 10

Re: [RFC PATCH v4 0/7] Use ACPI PCI hot-plug for Q35

2021-05-20 Thread Igor Mammedov
On Thu, 13 May 2021 08:26:35 +0200 Julia Suvorova wrote: > The patch set consists of two parts: > patches 1-4: introduce new feature > 'acpi-pci-hotplug-with-bridge-support' on Q35 > patches 5-7: make the feature default along with changes in ACPI tables > > This way maintainers can

[RFC PATCH 7/7] target/i386: Manipulate only AMD XSAVE state on AMD

2021-05-20 Thread David Edmondson
On AMD CPUs, ensure to save/load only the relevant XSAVE state. Signed-off-by: David Edmondson --- target/i386/tcg/fpu_helper.c | 12 +-- target/i386/xsave_helper.c | 70 ++-- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/target/i386/tcg/f

Re: [PATCH 24/24] target/ppc: Restrict ppc_cpu_tlb_fill to TCG

2021-05-20 Thread Richard Henderson
On 5/20/21 8:18 AM, Bruno Piazera Larsen wrote: +#ifdef CONFIG_TCG bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr) @@ -2984,3 +2985,4 @@ bool ppc_cpu_tlb_fill(CPUSta

[RFC PATCH 2/7] target/i386: Use constants for XSAVE offsets

2021-05-20 Thread David Edmondson
Where existing constants for XSAVE offsets exists, use them. Signed-off-by: David Edmondson --- target/i386/kvm/kvm.c | 56 ++- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index d972eb4705..

[RFC PATCH 0/7] Support protection keys in an AMD EPYC-Milan VM

2021-05-20 Thread David Edmondson
AMD EPYC-Milan CPUs introduced support for protection keys, previously available only with Intel CPUs. AMD chose to place the XSAVE state component for the protection keys at a different offset in the XSAVE state area than that chosen by Intel. To accommodate this, modify QEMU to behave appropria

[RFC PATCH 6/7] target/i386: Adjust AMD XSAVE PKRU area offset in CPUID leaf 0xd

2021-05-20 Thread David Edmondson
AMD stores the pkru_state at a different offset to Intel, so update the CPUID leaf which indicates such. Signed-off-by: David Edmondson --- target/i386/cpu.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4f481691b4..9340a477

Re: [PATCH v3 14/15] qapi/parser: allow 'ch' variable name

2021-05-20 Thread John Snow
On 5/20/21 5:36 AM, Markus Armbruster wrote: Uh, one more little thing... this commit message isn't quite right: John Snow writes: We can have a two-letter variable name, as a treat. Signed-off-by: John Snow -- This line is not a separator. I don't want to use 'chr' or 'char', and in

[RFC PATCH 3/7] target/i386: Clarify the padding requirements of X86XSaveArea

2021-05-20 Thread David Edmondson
Replace the hard-coded size of offsets or structure elements with defined constants or sizeof(). Signed-off-by: David Edmondson --- target/i386/cpu.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 1fb732f366..0bb365bddf 1006

Re: [PATCH v2 3/7] block-copy: move progress_set_remaining in block_copy_task_end

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: Moving this function in task_end ensures to update the progress anyways, even if there is an error. It also helps in next patch, allowing task_end to have only one critical section. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vla

[RFC PATCH 4/7] target/i386: Prepare for per-vendor X86XSaveArea layout

2021-05-20 Thread David Edmondson
Move Intel specific components of X86XSaveArea into a sub-union. Signed-off-by: David Edmondson --- target/i386/cpu.c| 12 target/i386/cpu.h| 55 +--- target/i386/kvm/kvm.c| 12 target/i386/tcg/fpu_helper.c | 12 ++

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-20 Thread Emanuele Giuseppe Esposito
On 20/05/2021 16:42, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDr

Re: [PATCH 3/6] qapi/parser.py: add type hint annotations (QAPIDoc)

2021-05-20 Thread Markus Armbruster
John Snow writes: > Annotations do not change runtime behavior. > > This commit adds mostly annotations, but uses a TYPE_CHECKING runtime > check to conditionally import dependencies, which only triggers during > runs of mypy. > > Signed-off-by: John Snow > > --- > > TopLevelExpr, an idea from p

[RFC PATCH 5/7] target/i386: Introduce AMD X86XSaveArea sub-union

2021-05-20 Thread David Edmondson
AMD stores the pkru_state at a different offset to Intel. Signed-off-by: David Edmondson --- target/i386/cpu.h | 17 +++-- target/i386/kvm/kvm.c | 3 ++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index f1ce4e3008..99f0d

[PATCH 0/1] virtio: disable partitions scanning for no partitions block

2021-05-20 Thread Yury Kamenev
Some virtio blocks definitely have no partitions and should not be scanned. Yury Kamenev (1): virtio: disable partitions scanning for no partitions block hw/block/virtio-blk.c | 4 include/hw/virtio/virtio-blk.h | 1 + include/standard-headers/linux/virt

Re: [PATCH v2 2/7] block-copy: improve documentation of BlockCopyTask and BlockCopyState types and functions

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask and BlockCopyState in IN, State and OUT fields. This is just to understand which field has to be protected with a lock. BlockCopyTask .zeroes is a special case, because it is only initiali

[PATCH 0/1] virtio: disable partitions scanning for no partitions block

2021-05-20 Thread Yury Kamenev
Some virtio blocks definitely have no partitions and should not be scanned. Yury Kamenev (1): virtio: disable partitions scanning for no partitions block hw/block/virtio-blk.c | 4 include/hw/virtio/virtio-blk.h | 1 + include/standard-headers/linux/virt

Re: [PATCH v2 2/7] block-copy: improve documentation of BlockCopyTask and BlockCopyState types and functions

2021-05-20 Thread Emanuele Giuseppe Esposito
On 20/05/2021 17:00, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask and BlockCopyState in IN, State and OUT fields. This is just to understand which field has to be protected with a lock. BlockCo

Re: [RFC PATCH 0/7] Support protection keys in an AMD EPYC-Milan VM

2021-05-20 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210520145647.3483809-1-david.edmond...@oracle.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210520145647.3483809-1-david.edmond...@oracle.com Subject: [RFC PATCH 0/7] Sup

[PATCH 1/1] virtio: disable partitions scanning for no partitions block

2021-05-20 Thread Yury Kamenev
Signed-off-by: Yury Kamenev --- hw/block/virtio-blk.c | 4 include/hw/virtio/virtio-blk.h | 1 + include/standard-headers/linux/virtio_blk.h | 1 + 3 files changed, 6 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index f139cd7cc9

[PATCH 2/3] qapi/parser.py: add ParsedExpression type

2021-05-20 Thread John Snow
This is an immutable, named, typed tuple. It's nicer than arbitrary dicts for passing data around when using strict typing. We may upgrade this to a @dataclass style class in the future if we want to support mutability at a later time. (And after 3.7+ is available for use.) Turn parser.exprs into

[PATCH 0/3] qapi: static typing conversion, pt5c

2021-05-20 Thread John Snow
This is part five (c), and focuses on sharing strict types between parser.py and expr.py. gitlab: https://gitlab.com/jsnow/qemu/-/commits/python-qapi-cleanup-pt5c Requirements: - Python 3.6+ - mypy >= 0.770 - pylint >= 2.6.0 (2.7.0+ when using Python 3.9+) Every commit should pass with: - `isor

Re: [PATCH v12 4/8] arm64: kvm: Introduce MTE VM feature

2021-05-20 Thread Steven Price
On 20/05/2021 12:54, Catalin Marinas wrote: > On Mon, May 17, 2021 at 01:32:35PM +0100, Steven Price wrote: >> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c >> index c5d1f3c87dbd..8660f6a03f51 100644 >> --- a/arch/arm64/kvm/mmu.c >> +++ b/arch/arm64/kvm/mmu.c >> @@ -822,6 +822,31 @@ tran

[RFC PATCH] gitlab: add special rule for the hexagon container

2021-05-20 Thread Alex Bennée
The hexagon container is always manually built but of course not everyone will be building it themselves and pushing to their registries. We still need to create a "local" registry copy for the actual gitlab tests to run. We don't build it in this case, just pull it across from the upstream registr

[PATCH 3/3] qapi/parser: Remove _JSONObject

2021-05-20 Thread John Snow
Use TopLevelExpr where appropriate now (Any function that accepts exclusively a Top Level Expression), and replace any other remaining user with a generic Dict[str, object]. Signed-off-by: John Snow --- scripts/qapi/expr.py | 43 ++- 1 file changed, 18 ins

Re: [PATCH v12 5/8] arm64: kvm: Save/restore MTE registers

2021-05-20 Thread Steven Price
On 20/05/2021 10:46, Marc Zyngier wrote: > On Wed, 19 May 2021 14:04:20 +0100, > Steven Price wrote: >> >> On 17/05/2021 18:17, Marc Zyngier wrote: >>> On Mon, 17 May 2021 13:32:36 +0100, >>> Steven Price wrote: Define the new system registers that MTE introduces and context switch

[PATCH 1/3] qapi/expr: Split check_expr out from check_exprs

2021-05-20 Thread John Snow
Primarily, this reduces a nesting level of a particularly long block. Mostly code movement, a new docstring is created. (It also has the effect of creating a fairly convenient choke point in check_exprs for try/catch wrappers without making the nesting level even worse.) Signed-off-by: John Snow

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
20.05.2021 18:06, Emanuele Giuseppe Esposito wrote: On 20/05/2021 16:42, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for t

Re: [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: Because the list of tasks is only modified by coroutine functions, add a CoMutex in order to protect them. Use the same mutex to protect also BlockCopyState in_flight_bytes field to avoid adding additional syncronization primitives. Signed-off

[PATCH 0/9] target/arm: MVE preliminaries

2021-05-20 Thread Peter Maydell
This patchset is a collection of easy preliminary MVE patches, which I send out now just to try to avoid the MVE patchset landing as one enormous series. These patches: * update feature checks on existing insns that should now check "if FP or MVE" rather than just "if FP" * fixes a minor non-g

[PATCH 4/9] target/arm: Add MVE check to VMOV_reg_sp and VMOV_reg_dp

2021-05-20 Thread Peter Maydell
Split out the handling of VMOV_reg_sp and VMOV_reg_dp so that we can permit the insns if either FP or MVE are present. Signed-off-by: Peter Maydell --- target/arm/translate-vfp.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/target/arm/translate-vfp.c b/tar

[PATCH 2/9] target/arm: Update feature checks for insns which are "MVE or FP"

2021-05-20 Thread Peter Maydell
Some v8M instructions are present if either the floating point extension or MVE is implemented. Update our implementation of them to check for MVE as well as for FP. This is all the insns which use CheckDecodeFaults(ExtType_MveOrFp) or CheckDecodeFaults(ExtType_MveOrDpFp) in their pseudocode, whi

Re: [PATCH v2 5/7] block-copy: add QemuMutex lock for BlockCopyCallState list

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: As for BlockCopyTask, add a lock to protect BlockCopyCallState ret and sleep_state fields. Also move ret, finished and cancelled in the OUT fields of BlockCopyCallState. Here a QemuMutex is used to protect QemuCoSleep field, since it can be con

[PATCH 6/9] target/arm: Implement M-profile VPR register

2021-05-20 Thread Peter Maydell
If MVE is implemented for an M-profile CPU then it has a VPR register, which tracks predication information. Implement the read and write handling of this register, and the migration of its state. Signed-off-by: Peter Maydell --- target/arm/cpu.h | 6 ++ target/arm/machine.c

[PATCH 1/9] target/arm: Add isar feature check functions for MVE

2021-05-20 Thread Peter Maydell
Add the isar feature check functions we will need for v8.1M MVE: * a check for MVE present: this corresponds to the pseudocode's CheckDecodeFaults(ExtType_Mve) * a check for the optional floating-point part of MVE: this corresponds to CheckDecodeFaults(ExtType_MveFp) Signed-off-by: Peter M

[PATCH 7/9] target/arm: Make FPSCR.LTPSIZE writable for MVE

2021-05-20 Thread Peter Maydell
The M-profile FPSCR has an LTPSIZE field, but if MVE is not implemented it is read-only and always reads as 4; this is how QEMU currently handles it. Make the field writable when MVE is implemented. We can safely add the field to the MVE migration struct because currently no CPUs enable MVE and s

[PATCH 3/9] target/arm: Move fpsp/fpdp isar check into callers of do_vfp_2op_sp/dp

2021-05-20 Thread Peter Maydell
The do_vfp_2op_sp() and do_vfp_2op_dp() functions currently check whether floating point is supported via the aa32_fpdp_v2 and aa32_fpsp_v2 isar checks. For v8.1M MVE support, the VMOV_reg trans functions (but not any of the others) need to update this to also allow the insn if MVE is implemented.

[PATCH 9/9] target/arm: Allow board models to specify initial NS VTOR

2021-05-20 Thread Peter Maydell
Currently we allow board models to specify the initial value of the Secure VTOR register, using an init-svtor property on the TYPE_ARMV7M object which is plumbed through to the CPU. Allow board models to also specify the initial value of the Non-secure VTOR via a similar init-nsvtor property. Sig

[PATCH 5/9] target/arm: Fix return values in fp_sysreg_checks()

2021-05-20 Thread Peter Maydell
The fp_sysreg_checks() function is supposed to be returning an FPSysRegCheckResult, which is an enum with three possible values. However, three places in the function "return false" (a hangover from a previous iteration of the design where the function just returned a bool). Make these return FPSy

Re: [PATCH v2 6/7] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: By adding acquire/release pairs, we ensure that .ret and .error_is_read fields are written by block_copy_dirty_clusters before .finished is true. As I already said, please, can we live with one mutex for now? finished, ret, error_is_read, all

[RFC PATCH v2] gitlab: add special rule for the hexagon container

2021-05-20 Thread Alex Bennée
The hexagon container is always manually built but of course not everyone will be building it themselves and pushing to their registries. We still need to create a "local" registry copy for the actual gitlab tests to run. We don't build it in this case, just pull it across from the upstream registr

[PATCH 8/9] target/arm: Enable FPSCR.QC bit for MVE

2021-05-20 Thread Peter Maydell
MVE has an FPSCR.QC bit similar to the A-profile Neon one; when MVE is implemented make the bit writeable. Signed-off-by: Peter Maydell --- target/arm/vfp_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index e0886a

Re: [PATCH v2] hw/arm/smmuv3: Another range invalidation fix

2021-05-20 Thread Peter Maydell
On Mon, 10 May 2021 at 13:48, Eric Auger wrote: > > 6d9cd115b9 ("hw/arm/smmuv3: Enforce invalidation on a power of two range") > failed to completely fix misalignment issues with range > invalidation. For instance invalidations patterns like "invalidate 32 > 4kB pages starting from 0xff395000 are

Re: [PATCH 0/9] target/arm: MVE preliminaries

2021-05-20 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210520152840.24453-1-peter.mayd...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210520152840.24453-1-peter.mayd...@linaro.org Subject: [PATCH 0/9] target/arm: MVE

Re: [PATCH v12 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-20 Thread Steven Price
On 20/05/2021 13:05, Catalin Marinas wrote: > On Mon, May 17, 2021 at 01:32:38PM +0100, Steven Price wrote: >> diff --git a/arch/arm64/include/uapi/asm/kvm.h >> b/arch/arm64/include/uapi/asm/kvm.h >> index 24223adae150..b3edde68bc3e 100644 >> --- a/arch/arm64/include/uapi/asm/kvm.h >> +++ b/arch/a

Re: latest GOOD state of series i386 cleanup, arm cleanup, s390 cleanup

2021-05-20 Thread Alex Bennée
Claudio Fontana writes: > On 5/18/21 4:02 PM, Alex Bennée wrote: >> >> Claudio Fontana writes: >> >>> On 5/17/21 11:53 AM, Claudio Fontana wrote: Hello all, due to my inactivity for a few weeks coupled likely with the upstream processes around qemu-6.0 now the series: >>

Re: [PULL 42/46] softfloat: Move div_floats to softfloat-parts.c.inc

2021-05-20 Thread Richard Henderson
On 5/20/21 8:40 AM, Peter Maydell wrote: On Sun, 16 May 2021 at 13:38, Richard Henderson wrote: Rename to parts$N_div. Implement float128_div with FloatParts128. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- +static bool frac64_div(FloatParts64 *a, FloatParts64 *b) +{ +

Re: [PATCH] virtio: Clarify MR transaction optimization

2021-05-20 Thread Stefan Hajnoczi
On Mon, May 17, 2021 at 03:26:37PM +0200, Greg Kurz wrote: > The device model batching its ioeventfds in a single MR transaction is > an optimization. Clarify this in virtio-scsi, virtio-blk and generic > virtio code. Also clarify that the transaction must commit before > closing ioeventfds so that

Re: [RFC PATCH 17/25] hw/virtio: Use correct type sizes

2021-05-20 Thread Richard Henderson
On 5/18/21 1:36 PM, Philippe Mathieu-Daudé wrote: -static inline int virtio_lduw_p(VirtIODevice *vdev, const void *ptr) +static inline uint16_t virtio_lduw_p(VirtIODevice *vdev, const void *ptr) While this one looks obviously correct, -static inline int virtio_ldl_p(VirtIODevice *vdev, const

Re: [RFC PATCH 00/25] exec: Add load/store API for aligned pointers

2021-05-20 Thread Richard Henderson
On 5/19/21 2:40 PM, Philippe Mathieu-Daudé wrote: On 5/19/21 9:20 PM, Richard Henderson wrote: On 5/18/21 1:36 PM, Philippe Mathieu-Daudé wrote: The series is decomposed as: - cleanups (1-6) - clean ldst API using macros (7-13) - add aligned ldst methods (14) - add aligned memory methods (15-16

Re: [RFC PATCH v2] gitlab: add special rule for the hexagon container

2021-05-20 Thread Cornelia Huck
On Thu, 20 May 2021 16:38:31 +0100 Alex Bennée wrote: > The hexagon container is always manually built but of course not > everyone will be building it themselves and pushing to their > registries. We still need to create a "local" registry copy for the > actual gitlab tests to run. We don't buil

Re: [RFC PATCH v2] gitlab: add special rule for the hexagon container

2021-05-20 Thread Willian Rampazzo
On Thu, May 20, 2021 at 12:38 PM Alex Bennée wrote: > > The hexagon container is always manually built but of course not > everyone will be building it themselves and pushing to their > registries. We still need to create a "local" registry copy for the > actual gitlab tests to run. We don't build

Re: [PULL 42/46] softfloat: Move div_floats to softfloat-parts.c.inc

2021-05-20 Thread Peter Maydell
On Thu, 20 May 2021 at 17:15, Richard Henderson wrote: > > On 5/20/21 8:40 AM, Peter Maydell wrote: > > On Sun, 16 May 2021 at 13:38, Richard Henderson > > Hi -- Coverity is suspicious about this line (CID 1453209), > > because udiv_qrrnd()'s prototype is > > static inline uint64_t udiv_qrnnd(uint

[PULL v2 0/9] s390x update

2021-05-20 Thread Cornelia Huck
n-updates-180521-2' into staging (2021-05-20 10:00:58 +0100) are available in the Git repository at: https://gitlab.com/cohuck/qemu.git tags/s390x-20210520-v2 for you to fetch changes up to f66487756b0553b156d8e3e81bc6411cfc38176e: tests/tcg/x86_64: add vsyscall smoke test (2021

[PULL v2 4/9] accel/tcg: Assert that tb->size != 0 after translation

2021-05-20 Thread Cornelia Huck
From: Ilya Leoshkevich If arch-specific code generates a translation block of size 0, tb_gen_code() may generate a spurious exception. Add an assertion in order to catch such situations early. Signed-off-by: Ilya Leoshkevich Reviewed-by: David Hildenbrand Message-Id: <20210416154939.32404-5-..

[PULL v2 3/9] target/xtensa: Make sure that tb->size != 0

2021-05-20 Thread Cornelia Huck
From: Ilya Leoshkevich tb_gen_code() assumes that tb->size must never be zero, otherwise it may produce spurious exceptions. For xtensa this may happen when decoding an unknown instruction, when handling a write into the CCOUNT or CCOMPARE special register and when single-stepping the first instr

[PULL v2 1/9] target/s390x: Fix translation exception on illegal instruction

2021-05-20 Thread Cornelia Huck
From: Ilya Leoshkevich Hitting an uretprobe in a s390x TCG guest causes a SIGSEGV. What happens is: * uretprobe maps a userspace page containing an invalid instruction. * uretprobe replaces the target function's return address with the address of that page. * When tb_gen_code() is called on th

[PULL v2 2/9] target/arm: Make sure that commpage's tb->size != 0

2021-05-20 Thread Cornelia Huck
From: Ilya Leoshkevich tb_gen_code() assumes that tb->size must never be zero, otherwise it may produce spurious exceptions. For ARM this may happen when creating a translation block for the commpage. Fix by pretending that commpage translation blocks have at least one instruction. Signed-off-b

[PULL v2 6/9] hw/s390x/ccw: Register qbus type in abstract TYPE_CCW_DEVICE parent

2021-05-20 Thread Cornelia Huck
From: Philippe Mathieu-Daudé Instead of having all TYPE_CCW_DEVICE children set the bus type to TYPE_VIRTUAL_CSS_BUS, do it once in the abstract parent. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Eric Farman Message-Id: <20210424145313.3287400-1-f4...@amsat.org> Signed-off-by: Cornelia Hu

[PULL v2 5/9] vfio-ccw: Permit missing IRQs

2021-05-20 Thread Cornelia Huck
From: Eric Farman Commit 690e29b91102 ("vfio-ccw: Refactor ccw irq handler") changed one of the checks for the IRQ notifier registration from saying "the host needs to recognize the only IRQ that exists" to saying "the host needs to recognize ANY IRQ that exists." And this worked fine, because t

[PULL v2 7/9] vfio-ccw: Attempt to clean up all IRQs on error

2021-05-20 Thread Cornelia Huck
From: Eric Farman The vfio_ccw_unrealize() routine makes an unconditional attempt to unregister every IRQ notifier, though they may not have been registered in the first place (when running on an older kernel, for example). Let's mirror this behavior in the error cleanups in vfio_ccw_realize() s

Re: [PATCH 24/24] target/ppc: Restrict ppc_cpu_tlb_fill to TCG

2021-05-20 Thread Bruno Piazera Larsen
On 20/05/2021 11:52, Richard Henderson wrote: On 5/20/21 8:18 AM, Bruno Piazera Larsen wrote: +#ifdef CONFIG_TCG   bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,     MMUAccessType access_type, int mmu_idx,     bool probe, uintptr_t retaddr) @@

[PULL v2 9/9] tests/tcg/x86_64: add vsyscall smoke test

2021-05-20 Thread Cornelia Huck
From: Ilya Leoshkevich Having a small test will prevent trivial regressions in the future. Signed-off-by: Ilya Leoshkevich Message-Id: <20210519045738.1335210-3-...@linux.ibm.com> Reviewed-by: Richard Henderson Signed-off-by: Cornelia Huck --- tests/tcg/x86_64/Makefile.target | 6 +- te

[PULL v2 8/9] target/i386: Make sure that vsyscall's tb->size != 0

2021-05-20 Thread Cornelia Huck
From: Ilya Leoshkevich tb_gen_code() assumes that tb->size must never be zero, otherwise it may produce spurious exceptions. For x86_64 this may happen when creating a translation block for the vsyscall page. Fix by pretending that vsyscall translation blocks have at least one instruction. Sign

Re: [PATCH v12 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-20 Thread Catalin Marinas
On Thu, May 20, 2021 at 04:58:01PM +0100, Steven Price wrote: > On 20/05/2021 13:05, Catalin Marinas wrote: > > On Mon, May 17, 2021 at 01:32:38PM +0100, Steven Price wrote: > >> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > >> index e89a5e275e25..4b6c83beb75d 100644 > >> --- a/arch/ar

  1   2   3   4   >