[PATCH v2 1/2] Acceptance Tests: Add default kernel params and pxeboot url to the KNOWN_DISTROS collection

2021-04-21 Thread Eric Auger
When running LinuxTests we may need to run the guest with custom params. It is practical to store the pxeboot URL and the default kernel params so that the tests just need to fetch those and augment the kernel params. Signed-off-by: Eric Auger --- tests/acceptance/avocado_qemu/__init__.py | 46 +

Re: [Virtio-fs] [PATCH v2 08/25] DAX: virtio-fs: Add vhost-user slave commands for mapping

2021-04-21 Thread Dr. David Alan Gilbert
* Greg Kurz (gr...@kaod.org) wrote: > On Wed, 14 Apr 2021 16:51:20 +0100 > "Dr. David Alan Gilbert (git)" wrote: > > > From: "Dr. David Alan Gilbert" > > > > The daemon may request that fd's be mapped into the virtio-fs cache > > visible to the guest. > > These mappings are triggered by command

Re: [PATCH v6] qapi: introduce 'query-cpu-model-cpuid' action

2021-04-21 Thread Valeriy Vdovin
On Tue, Apr 20, 2021 at 01:09:00PM -0400, Eduardo Habkost wrote: > On Tue, Apr 20, 2021 at 07:19:40PM +0300, Valeriy Vdovin wrote: > [...] > > +## > > +# @query-cpu-model-cpuid: > > +# > > +# Returns description of a virtual CPU model, created by QEMU after cpu > > +# initialization routines. The r

Re: [PATCH 14/14] hw/nvme: move nvme emulation out of hw/block

2021-04-21 Thread Klaus Jensen
On Apr 19 21:28, Klaus Jensen wrote: From: Klaus Jensen With the introduction of the nvme-subsystem device we are really cluttering up the hw/block directory. As suggested by Philippe previously, move the nvme emulation to hw/nvme. Suggested-by: Philippe Mathieu-Daudé Hi Philippe, You ori

Re: [PATCH v4 16/19] qapi/expr.py: Add docstrings

2021-04-21 Thread John Snow
On 4/21/21 9:58 AM, Markus Armbruster wrote: John Snow writes: [...] I've made a re-spin. Let's try something new, if you don't mind: I've pushed a "almost v5" copy onto my gitlab, where edits made against this patch are in their own commit so that all of the pending edits I've made are easil

[PATCH v5 00/17] qapi: static typing conversion, pt3

2021-04-21 Thread John Snow
Hi, this series adds static types to the QAPI module. This is part three, and it focuses on expr.py. Environment: - Python >= 3.6, <= 3.8 * - mypy >= 0.770 - pylint >= 2.6.0 - flake8 - isort Every commit should pass with (from ./scripts/): - flake8 qapi/ - pylint --rcfile=qapi/pylintrc qapi/ -

[PATCH v5 03/17] qapi/expr.py: Check for dict instead of OrderedDict

2021-04-21 Thread John Snow
OrderedDict is a subtype of dict, so we can check for a more general form. These functions do not themselves depend on it being any particular type. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/expr.py | 5 ++--- 1 file changed, 2 insertions(+

[PATCH v5 04/17] qapi/expr.py: constrain incoming expression types

2021-04-21 Thread John Snow
mypy does not know the types of values stored in Dicts that masquerade as objects. Help the type checker out by constraining the type. Signed-off-by: John Snow --- scripts/qapi/expr.py | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/

[PATCH v5 05/17] qapi/expr.py: Add assertion for union type 'check_dict'

2021-04-21 Thread John Snow
mypy isn't fond of allowing you to check for bool membership in a collection of str elements. Guard this lookup for precisely when we were given a name. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/expr.py | 4 +++- 1 file changed, 3 insertion

[PATCH v5 01/17] qapi/expr: Comment cleanup

2021-04-21 Thread John Snow
The linter yaps after 0825f62c842. Fix this trivial issue to restore the linter baseline. (Yes, ideally -- and soon -- the linter will be part of CI so we don't clutter up the log with fixups. For now, though, the baseline is useful for testing intermediate commits as types are added to the QAPI l

[PATCH v5 08/17] qapi/expr.py: Add casts in a few select cases

2021-04-21 Thread John Snow
Casts are instructions to the type checker only, they aren't "safe" and should probably be avoided in general. In this case, when we perform type checking on a nested structure, the type of each field does not "stick". (See PEP 647 for an example of "type narrowing" that does "stick". It is avail

[PATCH v5 12/17] qapi/expr.py: Remove single-letter variable

2021-04-21 Thread John Snow
Signed-off-by: John Snow --- scripts/qapi/expr.py | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index de7fc16fac2..5e4d5f80aa7 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -238,14 +238,14 @@ def ch

[PATCH v5 09/17] qapi/expr.py: Modify check_keys to accept any Collection

2021-04-21 Thread John Snow
This is a minor adjustment that lets parameters @required and @optional take tuple arguments, in particular (). Later patches will make use of that. (Iterable would also have worked, but Iterable also includes things like generator expressions which are consumed upon iteration, which would requir

[PATCH v5 11/17] qapi/expr.py: Consolidate check_if_str calls in check_if

2021-04-21 Thread John Snow
This is a small rewrite to address some minor style nits. Don't compare against the empty list to check for the empty condition, and move the normalization forward to unify the check on the now-normalized structure. With the check unified, the local nested function isn't needed anymore and can be

[PATCH v5 06/17] qapi/expr.py: move string check upwards in check_type

2021-04-21 Thread John Snow
For readability purposes only, shimmy the early return upwards to the top of the function, so cases proceed in order from least to most complex. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/expr.py | 8 1 file changed, 4 insertions(+)

[PATCH v5 10/17] qapi/expr.py: add type hint annotations

2021-04-21 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by: John Snow --- scripts/qapi/expr.py | 68 +++ scripts/qapi/mypy.ini | 5 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/scripts/qapi/exp

[PATCH v5 14/17] qapi/expr: Only explicitly prohibit 'Kind' nor 'List' for type names

2021-04-21 Thread John Snow
Per list review: qapi-code-gen.txt reserves suffixes Kind and List only for type names, but the code rejects them for events and commands, too. It turns out we reject them earlier anyway: In check_name_upper() for event names, and in check_name_lower() for command names. Still, adjust the code fo

[PATCH v5 07/17] qapi/expr.py: Check type of union and alternate 'data' member

2021-04-21 Thread John Snow
Prior to this commit, specifying a non-object value here causes the QAPI parser to crash in expr.py with a stack trace with (likely) an AttributeError when we attempt to call that value's items() method. This member needs to be an object (Dict), and not anything else. Add a check for this with a n

[PATCH v5 16/17] qapi/expr.py: Use tuples instead of lists for static data

2021-04-21 Thread John Snow
It is -- maybe -- possibly -- three nanoseconds faster. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/expr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index 0b66d808421.

[PATCH v5 17/17] qapi/expr: Update authorship and copyright information

2021-04-21 Thread John Snow
Signed-off-by: John Snow --- scripts/qapi/expr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index 225a82e20d3..496f7e0333e 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*

[PATCH v5 13/17] qapi/expr.py: enable pylint checks

2021-04-21 Thread John Snow
Signed-off-by: John Snow Tested-by: Eduardo Habkost Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- scripts/qapi/pylintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index b9e077a1642..fb0386d529a 100644 ---

[PATCH v5 02/17] qapi/expr.py: Remove 'info' argument from nested check_if_str

2021-04-21 Thread John Snow
The function can just use the argument from the scope above. Otherwise, we get shadowed argument errors because the parameter name clashes with the name of a variable already in-scope. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- scripts/qapi/expr.py | 6 +

[PATCH v5 15/17] qapi/expr.py: Add docstrings

2021-04-21 Thread John Snow
Now with more :words:! Signed-off-by: John Snow --- scripts/qapi/expr.py | 256 ++- 1 file changed, 251 insertions(+), 5 deletions(-) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index c33caf00d91..0b66d808421 100644 --- a/scripts/qapi/expr.py

[PATCH] target/mips: Add missing CP0 check to nanoMIPS RDPGPR / WRPGPR opcodes

2021-04-21 Thread Philippe Mathieu-Daudé
Per the nanoMIPS32 Instruction Set Technical Reference Manual, Revision 01.01, Chapter 3. "Instruction Definitions": The Read/Write Previous GPR opcodes "require CP0 privilege". Add the missing CP0 checks. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 2 ++ 1 file changed

[PATCH] docs: Add SEV-ES documentation to amd-memory-encryption.txt

2021-04-21 Thread Tom Lendacky
From: Tom Lendacky Update the amd-memory-encryption.txt file with information about SEV-ES, including how to launch an SEV-ES guest and some of the differences between SEV and SEV-ES guests in regards to launching and measuring the guest. Signed-off-by: Tom Lendacky --- docs/amd-memory-encrypt

[PATCH v3 1/8] qapi/error: Repurpose QAPIError as an abstract base exception class

2021-04-21 Thread John Snow
Rename QAPIError to QAPISourceError, and then create a new QAPIError class that serves as the basis for all of our other custom exceptions, without specifying any class properties. This leaves QAPIError as a package-wide error class that's suitable for any current or future errors. (Right now, we

[PATCH v3 2/8] qapi/error: Use Python3-style super()

2021-04-21 Thread John Snow
Missed in commit 2cae67bcb5 "qapi: Use super() now we have Python 3". Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/error.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py index 126dda7c9b2..38bd7c4dd6

[PATCH v3 6/8] qapi/error.py: enable pylint checks

2021-04-21 Thread John Snow
Signed-off-by: John Snow --- scripts/qapi/pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index fb0386d529a..88efbf71cb2 100644 --- a/scripts/qapi/pylintrc +++ b/scripts/qapi/pylintrc @@ -2,8 +2,7 @@ # Add files or di

[PATCH v3 3/8] qapi/error: Make QAPISourceError 'col' parameter optional

2021-04-21 Thread John Snow
It's already treated as optional, with one direct caller and some subclass callers passing 'None'. Make it officially optional, which requires moving the position of the argument to come after all required parameters. QAPISemError becomes functionally identical to QAPISourceError. Keep the name to

[PATCH v3 0/8] qapi: static typing conversion, pt4

2021-04-21 Thread John Snow
Hi, this series adds static type hints to the QAPI module. This is part four, and focuses on error.py. Part 4: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt4 CI: https://gitlab.com/jsnow/qemu/-/pipelines/290152364 Requirements: - Python 3.6+ - mypy >= 0.770 - pylint >= 2.6.0 (2.7.0+

[PATCH v3 5/8] qapi/error.py: move QAPIParseError to parser.py

2021-04-21 Thread John Snow
Keeping it in error.py will create some cyclic import problems when we add types to the QAPISchemaParser. Callers don't need to know the details of QAPIParseError unless they are parsing or dealing directly with the parser, so this won't create any harsh new requirements for callers in the general

[PATCH v3 8/8] qapi/error.py: enable mypy checks

2021-04-21 Thread John Snow
Signed-off-by: John Snow --- (This can be squashed with the previous commit when staged.) Signed-off-by: John Snow --- scripts/qapi/mypy.ini | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 7797c834328..54ca4483d6d 100644 --- a/script

[PATCH v3 4/8] qapi/error: assert QAPISourceInfo is not None

2021-04-21 Thread John Snow
Built-in stuff is not parsed from a source file, and therefore have no QAPISourceInfo. If such None info was used for reporting an error, built-in stuff would be broken. Programming error. Instead of reporting a confusing error with bogus source location then, we better crash. We currently crash o

[PATCH v3 7/8] qapi/error: Add type hints

2021-04-21 Thread John Snow
No functional change. Note: QAPISourceError's info parameter is Optional[] because schema.py treats the info property of its various classes as Optional to accommodate built-in types, which have no source. See prior commit 'qapi/error: assert QAPISourceInfo is not None'. Signed-off-by: John Snow

Re: [PATCH] docs: Add SEV-ES documentation to amd-memory-encryption.txt

2021-04-21 Thread Tom Lendacky
On 4/21/21 2:12 PM, Tom Lendacky wrote: > From: Tom Lendacky > > Update the amd-memory-encryption.txt file with information about SEV-ES, > including how to launch an SEV-ES guest and some of the differences > between SEV and SEV-ES guests in regards to launching and measuring the > guest. > Hm

Re: [PATCH] monitor: hmp_qemu_io: acquire aio contex, fix crash

2021-04-21 Thread Philippe Mathieu-Daudé
On 4/21/21 10:32 AM, Vladimir Sementsov-Ogievskiy wrote: > Max reported the following bug: > > $ ./qemu-img create -f raw src.img 1G > $ ./qemu-img create -f raw dst.img 1G > > $ (echo ' >{"execute":"qmp_capabilities"} >{"execute":"blockdev-mirror", > "arguments":{"job-id":"mirror", >

Re: [RFC PATCH] tests/tcg: add a multiarch signals test to stress test signal delivery

2021-04-21 Thread Alex Bennée
Alex Bennée writes: > Alex Bennée writes: > >> This adds a simple signal test that combines the POSIX timer_create >> with signal delivery across multiple threads. >> >> [AJB: So I wrote this in an attempt to flush out issues with the >> s390x-linux-user handling. However I suspect I've done s

Re: [PATCH-for-6.0] net: tap: fix crash on hotplug

2021-04-21 Thread Peter Maydell
On Wed, 21 Apr 2021 at 16:24, Cole Robinson wrote: > > Attempting to hotplug a tap nic with libvirt will crash qemu: > > $ sudo virsh attach-interface f32 network default > error: Failed to attach interface > error: Unable to read from monitor: Connection reset by peer > > 0x55875b7f3a99 in ta

Re: [RFC PATCH] tests/tcg: add a multiarch signals test to stress test signal delivery

2021-04-21 Thread Peter Maydell
On Wed, 21 Apr 2021 at 20:51, Alex Bennée wrote: > > > Alex Bennée writes: > > To further document my confusion: > > > > gdb --args $QEMU ./tests/tcg/$ARCH/signals > > > > will SEGV in generated code for every target I've run. This seems to be > > some sort of change of behaviour by running ins

Re: [PATCH v3 2/3] vhost-user-blk: perform immediate cleanup if disconnect on initialization

2021-04-21 Thread Michael S. Tsirkin
On Wed, Apr 21, 2021 at 07:13:24PM +0300, Denis Plotnikov wrote: > > On 21.04.2021 18:24, Kevin Wolf wrote: > > Am 25.03.2021 um 16:12 hat Denis Plotnikov geschrieben: > > > Commit 4bcad76f4c39 ("vhost-user-blk: delay vhost_user_blk_disconnect") > > > introduced postponing vhost_dev cleanup aiming

Re: [PATCH] target/mips: Add missing CP0 check to nanoMIPS RDPGPR / WRPGPR opcodes

2021-04-21 Thread Richard Henderson
On 4/21/21 11:50 AM, Philippe Mathieu-Daudé wrote: Per the nanoMIPS32 Instruction Set Technical Reference Manual, Revision 01.01, Chapter 3. "Instruction Definitions": The Read/Write Previous GPR opcodes "require CP0 privilege". Add the missing CP0 checks. Signed-off-by: Philippe Mathieu-Daudé

Re: [Virtio-fs] [PATCH v2 17/25] DAX/unmap: virtiofsd: Add VHOST_USER_SLAVE_FS_IO

2021-04-21 Thread Vivek Goyal
On Wed, Apr 14, 2021 at 04:51:29PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Define a new slave command 'VHOST_USER_SLAVE_FS_IO' for a > client to ask qemu to perform a read/write from an fd directly > to GPA. Hi David, Today I came across process_vm_readv(

Re: [PATCH v6] qapi: introduce 'query-cpu-model-cpuid' action

2021-04-21 Thread Eduardo Habkost
On Wed, Apr 21, 2021 at 08:39:42PM +0300, Valeriy Vdovin wrote: > On Tue, Apr 20, 2021 at 01:09:00PM -0400, Eduardo Habkost wrote: > > On Tue, Apr 20, 2021 at 07:19:40PM +0300, Valeriy Vdovin wrote: > > [...] > > > +## > > > +# @query-cpu-model-cpuid: > > > +# > > > +# Returns description of a virt

[Bug 1918084] Re: Build fails on macOS 11.2.2

2021-04-21 Thread Eddy Hahn
It builds with v6.0.0-rc4 release from Git. Had to add --enable-trace- backends=syslog -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1918084 Title: Build fails on macOS 11.2.2 Status in QEMU: Tr

Re: [PATCH v6 11/15] qmp: Clarify memory backend properties returned via query-memdev

2021-04-21 Thread Eduardo Habkost
On Wed, Apr 21, 2021 at 02:26:20PM +0200, David Hildenbrand wrote: > We return information on the currently configured memory backends and > don't configure them, so decribe what the currently set properties > express. > > Reviewed-by: Philippe Mathieu-Daudé > Suggested-by: Markus Armbruster > C

Re: [PATCH v6 12/15] qmp: Include "share" property of memory backends

2021-04-21 Thread Eduardo Habkost
On Wed, Apr 21, 2021 at 02:26:21PM +0200, David Hildenbrand wrote: > Let's include the property, which can be helpful when debugging, > for example, to spot misuse of MAP_PRIVATE which can result in some ugly > corner cases (e.g., double-memory consumption on shmem). > > Use the same description w

Re: [PATCH v6 13/15] hmp: Print "share" property of memory backends with "info memdev"

2021-04-21 Thread Eduardo Habkost
On Wed, Apr 21, 2021 at 02:26:22PM +0200, David Hildenbrand wrote: > Let's print the property. > > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Dr. David Alan Gilbert > Cc: Markus Armbruster > Cc: Eric Blake > Cc: Igor Mammedov > Signed-off-by: David Hildenbrand Reviewed-by: Eduardo H

Re: [PATCH v6 00/15] RAM_NORESERVE, MAP_NORESERVE and hostmem "reserve" property

2021-04-21 Thread Eduardo Habkost
On Wed, Apr 21, 2021 at 02:26:09PM +0200, David Hildenbrand wrote: > Based-on: 20210406080126.24010-1-da...@redhat.com > > Some cleanups previously sent in other context (resizeable allocations), > followed by RAM_NORESERVE, implementing it under Linux using MAP_NORESERVE, > and letting users conf

Re: [PATCH v6 14/15] qmp: Include "reserve" property of memory backends

2021-04-21 Thread Eduardo Habkost
On Wed, Apr 21, 2021 at 02:26:23PM +0200, David Hildenbrand wrote: > Let's include the new property. > > Reviewed-by: Philippe Mathieu-Daudé > Cc: Eric Blake > Cc: Markus Armbruster > Cc: Igor Mammedov > Signed-off-by: David Hildenbrand Reviewed-by: Eduardo Habkost -- Eduardo

Re: [PATCH v6 15/15] hmp: Print "reserve" property of memory backends with "info memdev"

2021-04-21 Thread Eduardo Habkost
On Wed, Apr 21, 2021 at 02:26:24PM +0200, David Hildenbrand wrote: > Let's print the new property. > > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Dr. David Alan Gilbert > Cc: Markus Armbruster > Cc: Eric Blake > Cc: Igor Mammedov > Signed-off-by: David Hildenbrand Reviewed-by: Eduar

[Bug 1817268] Re: Input/output error during migration

2021-04-21 Thread Mathieu Corbin
I guess the bug still exists, I fixed it back in the time by repackaging OVMF_VARS.fd (padded to be 1M). I will try to find some time to mount an environment to reproduce the issue again. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEM

Re: [PATCH v3 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-21 Thread Connor Kuehl
On 4/21/21 6:04 AM, Stefano Garzarella wrote: >> +static char *qemu_rbd_strchr(char *src, char delim) >> +{ >> +char *p; >> + >> +for (p = src; *p; ++p) { >> +if (*p == delim) { >> +return p; >> +} >> +if (*p == '\\' && p[1] != '\0') { >> +++p

[PATCH v4 0/2] Fix segfault in qemu_rbd_parse_filename

2021-04-21 Thread Connor Kuehl
Connor Kuehl (2): iotests/231: Update expected deprecation message block/rbd: Add an escape-aware strchr helper block/rbd.c| 32 +--- tests/qemu-iotests/231 | 4 tests/qemu-iotests/231.out | 7 --- 3 files changed, 29 insertions(+), 1

Re: [PATCH v2 4/8] block: make before-write notifiers thread-safe

2021-04-21 Thread Vladimir Sementsov-Ogievskiy
19.04.2021 11:55, Emanuele Giuseppe Esposito wrote: Reads access the list in RCU style, so be careful to avoid use-after-free scenarios in the backup block job. Apart from this, all that's needed is protecting updates with a mutex. Note that backup doesn't use write-notifiers now. Probably bes

[PATCH v4 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-21 Thread Connor Kuehl
Sometimes the parser needs to further split a token it has collected from the token input stream. Right now, it does a cursory check to see if the relevant characters appear in the token to determine if it should break it down further. However, qemu_rbd_next_tok() will escape characters as it remo

[PATCH v4 1/2] iotests/231: Update expected deprecation message

2021-04-21 Thread Connor Kuehl
The deprecation message in the expected output has technically been wrong since the wrong version of a patch was applied to it. Because of this, the test fails. Correct the expected output so that it passes. Signed-off-by: Connor Kuehl Reviewed-by: Max Reitz Reviewed-by: Stefano Garzarella ---

Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-21 Thread Eduardo Habkost
On Tue, Mar 02, 2021 at 03:57:52PM +0100, Philippe Mathieu-Daudé wrote: > The cpu model is the single device available in user-mode. > Since we want to restrict some fields to user-mode emulation, > we prefer to set the vmsd field of CPUClass, rather than the > DeviceClass one. > > Signed-off-by:

[PATCH] block: simplify write-threshold and drop write notifiers

2021-04-21 Thread Vladimir Sementsov-Ogievskiy
write-notifiers are used only for write-threshold. New code for such purpose should create filters. Let's handle write-threshold simply in generic code and drop write notifiers at all. Also move part of write-threshold API that is used only for testing to the test. Signed-off-by: Vladimir Sement

Re: [PATCH v2 4/8] block: make before-write notifiers thread-safe

2021-04-21 Thread Vladimir Sementsov-Ogievskiy
22.04.2021 00:23, Vladimir Sementsov-Ogievskiy wrote: 19.04.2021 11:55, Emanuele Giuseppe Esposito wrote: Reads access the list in RCU style, so be careful to avoid use-after-free scenarios in the backup block job.  Apart from this, all that's needed is protecting updates with a mutex. Note th

Re: [PATCH] monitor: hmp_qemu_io: acquire aio contex, fix crash

2021-04-21 Thread Vladimir Sementsov-Ogievskiy
21.04.2021 22:47, Philippe Mathieu-Daudé wrote: On 4/21/21 10:32 AM, Vladimir Sementsov-Ogievskiy wrote: Max reported the following bug: $ ./qemu-img create -f raw src.img 1G $ ./qemu-img create -f raw dst.img 1G $ (echo ' {"execute":"qmp_capabilities"} {"execute":"blockdev-mirror",

Re: [PATCH v3 02/33] block/nbd: fix how state is cleared on nbd_open() failure paths

2021-04-21 Thread Vladimir Sementsov-Ogievskiy
21.04.2021 17:00, Roman Kagan wrote: On Fri, Apr 16, 2021 at 11:08:40AM +0300, Vladimir Sementsov-Ogievskiy wrote: We have two "return error" paths in nbd_open() after nbd_process_options(). Actually we should call nbd_clear_bdrvstate() on these paths. Interesting that nbd_process_options() call

Re: [PATCH-for-6.0] net: tap: fix crash on hotplug

2021-04-21 Thread Cole Robinson
On 4/21/21 3:54 PM, Peter Maydell wrote: > On Wed, 21 Apr 2021 at 16:24, Cole Robinson wrote: >> >> Attempting to hotplug a tap nic with libvirt will crash qemu: >> >> $ sudo virsh attach-interface f32 network default >> error: Failed to attach interface >> error: Unable to read from monitor: Conn

Re: [PATCH v2] fpu/softfloat: set invalid excp flag for RISC-V muladd instructions

2021-04-21 Thread Alistair Francis
On Wed, Apr 21, 2021 at 12:17 AM Richard Henderson wrote: > > On 4/19/21 6:31 PM, frank.ch...@sifive.com wrote: > > From: Frank Chang > > > > In IEEE 754-2008 spec: > >Invalid operation exception is signaled when doing: > >fusedMultiplyAdd(0, Inf, c) or fusedMultiplyAdd(Inf, 0, c) > >u

Re: [RFC PATCH 03/11] hw/intc: Add CLIC device

2021-04-21 Thread Alistair Francis
On Tue, Apr 20, 2021 at 10:57 AM LIU Zhiwei wrote: > > > On 2021/4/20 上午7:25, Alistair Francis wrote: > > On Fri, Apr 9, 2021 at 5:56 PM LIU Zhiwei wrote: > >> The Core-Local Interrupt Controller (CLIC) provides low-latency, > >> vectored, pre-emptive interrupts for RISC-V systems. > >> > >> The

Re: [RFC PATCH 00/11] RISC-V: support clic v0.9 specification

2021-04-21 Thread Alistair Francis
On Tue, Apr 20, 2021 at 5:20 PM LIU Zhiwei wrote: > > > On 2021/4/20 下午2:26, Alistair Francis wrote: > > On Tue, Apr 20, 2021 at 11:45 AM LIU Zhiwei wrote: > >> > >> On 2021/4/20 上午7:30, Alistair Francis wrote: > >>> On Fri, Apr 9, 2021 at 5:56 PM LIU Zhiwei wrote: > This patch set gives an

Re: [PATCH] target/riscv: fix a typo with interrupt names

2021-04-21 Thread Alistair Francis
On Wed, Apr 21, 2021 at 11:33 PM Emmanuel Blot wrote: > > Interrupt names have been swapped in 205377f8 and do not follow > IRQ_*_EXT definition order. > > Signed-off-by: Emmanuel Blot Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu.c | 2 +- > 1 file changed, 1 insertion(+),

[PATCH v2 0/2] plugins: Freeing allocated values in hash tables.

2021-04-21 Thread Mahmoud Mandour
A hash table made using ``g_hash_table_new`` requires manually freeing any dynamically allocated keys/values. The two patches in this series fixes this issue in hotblocks and hotpages plugins. v1 -> v2: Added a freeing function to hotpages instead of freeing the sorted list. That's probably be

[PATCH v2 1/2] plugins/hotblocks: Properly freed the hash table values

2021-04-21 Thread Mahmoud Mandour
Freed the values stored in the hash table ``hotblocks`` returned by ``g_hash_table_get_values()`` by freeing the sorted list and destroyed the hash table afterward. Signed-off-by: Mahmoud Mandour --- contrib/plugins/hotblocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v2 2/2] plugins/hotpages: Properly freed the hash table values

2021-04-21 Thread Mahmoud Mandour
Allocated ``pages`` hash table through ``g_hash_table_new_full`` to add a freeing function & destroyed the hash table on exit. Signed-off-by: Mahmoud Mandour --- contrib/plugins/hotpages.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/plugins/hotpages.c b/contrib/

Re: [PATCH v2] fpu/softfloat: set invalid excp flag for RISC-V muladd instructions

2021-04-21 Thread Richard Henderson
On 4/19/21 6:31 PM, frank.ch...@sifive.com wrote: +return 3; /* deafult NaN */ Late notice of spelling error: default. r~

Re: [RFC PATCH v2 1/7] hw/misc: Add device to help managing aliased memory regions

2021-04-21 Thread Richard Henderson
On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: Not really RFC, simply that I'v to add the technical description, but I'd like to know if there could be a possibility to not accept this device (because I missed something) before keeping working on it. So far it is only used in hobbyist boards.

Re: [PATCH v2 2/7] hw/arm/musicpal: Open-code pflash_cfi02_register() call

2021-04-21 Thread Richard Henderson
On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: To be able to manually map the flash region on the main memory (in the next commit), first expand the pflash_cfi02_register in place. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/musicpal.c | 27 +-- 1 file changed

Re: [PATCH v2 3/7] hw/arm/musicpal: Map flash using memory_region_add_subregion_aliased()

2021-04-21 Thread Richard Henderson
On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: Instead of using a device specific feature for mapping the flash memory multiple times over a wider region, use the generic memory_region_add_subregion_aliased() helper. There is no change in the memory layout: - before: (qemu) info mtree

Re: [PATCH v2 4/7] hw/arm/digic: Open-code pflash_cfi02_register() call

2021-04-21 Thread Richard Henderson
On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: To be able to manually map the flash region on the main memory (in the next commit), first expand the pflash_cfi02_register in place. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/digic_boards.c | 27 +-- 1 file cha

Re: [PATCH v2] fpu/softfloat: set invalid excp flag for RISC-V muladd instructions

2021-04-21 Thread Alistair Francis
On Thu, Apr 22, 2021 at 11:06 AM Richard Henderson wrote: > > On 4/19/21 6:31 PM, frank.ch...@sifive.com wrote: > > +return 3; /* deafult NaN */ > > Late notice of spelling error: default. Fixed when I applied it. Thanks! Applied to riscv-to-apply.next Alistair > > r~ >

Re: [PATCH v2 5/7] hw/arm/digic: Map flash using memory_region_add_subregion_aliased()

2021-04-21 Thread Richard Henderson
On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: Instead of using a device specific feature for mapping the flash memory multiple times over a wider region, use the generic memory_region_add_subregion_aliased() helper. There is no change in the memory layout. * before: $ qemu-system-arm -M

Re: [PATCH v2 6/7] hw/block/pflash_cfi02: Remove pflash_setup_mappings()

2021-04-21 Thread Richard Henderson
On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: All boards calling pflash_cfi02_register() use nb_mappings=1, which does not do any mapping: $ git grep -wl pflash_cfi02_register hw/ hw/arm/xilinx_zynq.c hw/block/pflash_cfi02.c hw/lm32/lm32_boards.c hw/ppc/ppc405_boards.c hw/s

Re: [PATCH v2 7/7] hw/block/pflash_cfi02: Simplify pflash_cfi02_register() prototype

2021-04-21 Thread Richard Henderson
On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: The previous commit removed the mapping code from TYPE_PFLASH_CFI02. pflash_cfi02_register() doesn't use the 'nb_mappings' argument anymore. Simply remove it to simplify. Reviewed-by: David Gibson Signed-off-by: Philippe Mathieu-Daudé Reviewe

Re: [PATCH v2 8/9] target/riscv: Consolidate RV32/64 32-bit instructions

2021-04-21 Thread Alistair Francis
On Wed, Apr 14, 2021 at 1:42 PM Richard Henderson wrote: > > On 4/13/21 4:34 PM, Alistair Francis wrote: > > -#ifndef CONFIG_USER_ONLY > > -# ifdef TARGET_RISCV32 > > -# define is_32bit(ctx) true > > -# else > > +#ifdef TARGET_RISCV32 > > +# define is_32bit(ctx) true > > +#else > > static inl

Re: [PATCH v5 3/3] ppc: Enable 2nd DAWR support on p10

2021-04-21 Thread David Gibson
On Wed, Apr 21, 2021 at 12:24:22PM +0530, Ravi Bangoria wrote: > Hi Cedric, > > On 4/21/21 12:01 PM, Cédric Le Goater wrote: > > On 4/21/21 8:20 AM, Ravi Bangoria wrote: > > > Hi David, > > > > > > On 4/19/21 10:23 AM, David Gibson wrote: > > > > On Mon, Apr 12, 2021 at 05:14:33PM +0530, Ravi Ban

Re: [PATCH qemu v18] spapr: Implement Open Firmware client interface

2021-04-21 Thread David Gibson
On Wed, Apr 21, 2021 at 04:50:12PM +1000, Alexey Kardashevskiy wrote: > > > On 4/21/21 15:27, David Gibson wrote: > > On Tue, Apr 20, 2021 at 07:16:35PM +1000, Alexey Kardashevskiy wrote: > > > On 20/04/2021 13:14, David Gibson wrote: [snip] > > > > > diff --git a/pc-bios/vof/Makefile b/pc-bios/v

Re: [PATCH-for-6.0] net: tap: fix crash on hotplug

2021-04-21 Thread Jason Wang
在 2021/4/21 下午11:22, Cole Robinson 写道: Attempting to hotplug a tap nic with libvirt will crash qemu: $ sudo virsh attach-interface f32 network default error: Failed to attach interface error: Unable to read from monitor: Connection reset by peer 0x55875b7f3a99 in tap_send (opaque=0x55875e

[PATCH 00/22] qapi: static typing conversion, pt5a

2021-04-21 Thread John Snow
This is part five, and focuses on QAPISchemaParser in parser.py. It does not touch QAPIDoc yet, which will be covered next. gitlab: https://gitlab.com/jsnow/qemu/-/commits/python-qapi-cleanup-pt5a merge-request (and CI): https://gitlab.com/jsnow/qemu/-/merge_requests/3 I encourage you to leave co

[PATCH 03/22] qapi/source: Remove line number from QAPISourceInfo initializer

2021-04-21 Thread John Snow
With the QAPISourceInfo(None, None, None) construct gone, there's not really any reason to have to specify that a file starts on the first line. Remove it from the initializer and have it default to 1. Remove the last vestiges where we check for 'line' being unset. That won't happen again, now!

[PATCH 08/22] qapi/parser: Use @staticmethod where appropriate

2021-04-21 Thread John Snow
No self, no thank you! Signed-off-by: John Snow --- scripts/qapi/parser.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 8d1fe0ddda5..f2425c0228a 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@

[PATCH 07/22] qapi/parser: assert object keys are strings

2021-04-21 Thread John Snow
The single quote token implies the value is a string. Assert this to be the case. Signed-off-by: John Snow --- scripts/qapi/parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 6b443b1247e..8d1fe0ddda5 100644 --- a/scripts/qapi/par

[PATCH 01/22] qapi/parser: Don't try to handle file errors

2021-04-21 Thread John Snow
The short-ish version of what motivates this patch is: - The parser initializer does not possess adequate context to write a good error message -- It tries to determine the caller's semantic context. - We don't want to allow QAPISourceInfo(None, None, None) to exist. - Errors made using such a

[PATCH 05/22] qapi/parser: Assert lexer value is a string

2021-04-21 Thread John Snow
The type checker can't narrow the type of the token value to string, because it's only loosely correlated with the return token. We know that a token of '#' should always have a "str" value. Add an assertion. Signed-off-by: John Snow --- scripts/qapi/parser.py | 1 + 1 file changed, 1 insertion

[PATCH 06/22] qapi/parser: assert get_expr returns object in outer loop

2021-04-21 Thread John Snow
get_expr can return many things, depending on where it is used. In the outer parsing loop, we expect and require it to return a dict. (It's (maybe) a bit involved to teach mypy that when nested is False, this is already always True. I'll look into it later, maybe.) Signed-off-by: John Snow ---

[PATCH 16/22] qapi/parser: add docstrings

2021-04-21 Thread John Snow
Signed-off-by: John Snow --- My hubris is infinite. OK, I only added a few -- to help me remember how the parser works at a glance. Signed-off-by: John Snow --- scripts/qapi/parser.py | 66 ++ 1 file changed, 66 insertions(+) diff --git a/scripts/qapi

[PATCH 02/22] qapi/source: [RFC] add "with_column" contextmanager

2021-04-21 Thread John Snow
This is a silly one, but... it's important to have fun. This patch isn't *needed*, it's here as an RFC. In trying to experiment with different ways to solve the problem addressed by the previous commit, I kept getting confused at how the "source location" string with line and column number was bui

[PATCH 04/22] qapi/parser: factor parsing routine into method

2021-04-21 Thread John Snow
For the sake of keeping __init__ smaller (and treating it more like a gallery of what state variables we can expect to see), put the actual parsing action into a parse method. We can still invoke it from the init method to reduce churn. To accomplish this, 'previously_included' because the private

[PATCH 20/22] qapi: [WIP] Import QAPIDoc from qapidoc Signed-off-by: John Snow

2021-04-21 Thread John Snow
Signed-off-by: John Snow --- scripts/qapi/expr.py | 2 +- scripts/qapi/parser.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index 496f7e0333e..7616646e43d 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -44,7

[PATCH 12/22] qapi/parser: add type hint annotations

2021-04-21 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. (Annotations for QAPIDoc are in a later commit.) Signed-off-by: John Snow --- scripts/qapi/parser.py | 61 -- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/

[PATCH 09/22] qapi: add match_nofail helper

2021-04-21 Thread John Snow
Mypy cannot generally understand that these regex functions cannot possibly fail. Add a _nofail helper that clarifies this for mypy. Signed-off-by: John Snow --- scripts/qapi/common.py | 8 +++- scripts/qapi/main.py | 6 ++ scripts/qapi/parser.py | 13 +++-- 3 files changed, 1

[PATCH 21/22] qapi: [WIP] Add QAPIDocError

2021-04-21 Thread John Snow
Raise this error instead of QAPIParseError and delegate the context up to the parent parser. In a chat off-list, we discussed how this design forces us to continue having less accurate error context information. Still, it's useful for an extremely simple split without a lot of fuss. Signed-off-b

[PATCH 17/22] CHECKPOINT

2021-04-21 Thread John Snow
As of here, parser is actually fully typed, and QAPIDoc is not. Below, there are a few extra patches that "prove" this, but they are not necessarily meant for inclusion. They could theoretically be included anyway, but a few of them would need to be squashed together to ensure our "no intermediate

[PATCH 11/22] qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard

2021-04-21 Thread John Snow
TypeGuards wont exist in Python proper until 3.10. Ah well. We can hack up our own by declaring this function to return the type we claim it checks for and using this to safely downcast object -> List[str]. In so doing, I bring this function in-line under _pragma so it can use the 'info' object in

[PATCH 13/22] qapi/parser: [RFC] overload the return type of get_expr

2021-04-21 Thread John Snow
Teach mypy that there are two possible return types here: either an Expression, or ... something else. Not a SLOC reduction, but it does remove an assertion. It also isn't much safer than a cast, mypy has no insight into if overloads are true or not. It's on the honor system. I thought I'd demons

[PATCH 10/22] qapi/parser: Fix typing of token membership tests

2021-04-21 Thread John Snow
When the token can be None, we can't use 'x in "abc"' style membership tests to group types of tokens together, because 'None in "abc"' is a TypeError. Easy enough to fix, if not a little ugly. Signed-off-by: John Snow --- scripts/qapi/parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 del

<    1   2   3   4   >