[PATCH v2 1/5] tests/9pfs: Factor out do_version() helper

2020-10-20 Thread Greg Kurz
fs_version() is a top level test function. Factor out the reusable code to a separate helper instead of hijacking it in other tests. Signed-off-by: Greg Kurz --- tests/qtest/virtio-9p-test.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/qtest/virtio-9

[RFC PATCH 3/8] softfloat: Tidy a * b + inf return

2020-10-20 Thread Alex Bennée
From: Richard Henderson No reason to set values in 'a', when we already have float_class_inf in 'c', and can flip that sign. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20200925152047.709901-4-richard.hender...@linaro.org> --- fpu/s

[PATCH v2 3/5] tests/9pfs: Set alloc in fs_create_dir()

2020-10-20 Thread Greg Kurz
fs_create_dir() is a top level test function. It should set alloc. Signed-off-by: Greg Kurz --- tests/qtest/virtio-9p-test.c |1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 52d102a3fc9f..cc52ae9a77b3 100644 --- a/tests/qtes

[RFC PATCH 7/8] tests/fp: add quad support to the benchmark utility

2020-10-20 Thread Alex Bennée
Currently this only support softfloat calculations because working out if the hardware supports 128 bit floats needs configure magic. The 3 op muladd operation is currently unimplemented so commented out for now. Signed-off-by: Alex Bennée --- tests/fp/fp-bench.c | 88 +++

Re: [PATCH v2] Remove deprecated -no-kvm option

2020-10-20 Thread John Snow
On 10/20/20 12:05 PM, Thomas Huth wrote: The option has never been mentioned in our documentation, it's been deprecated since years, it's marked with QEMU_ARCH_I386 (which does not make sense anymore since KVM is available on other architectures, too), it does not do anything by default in upstre

[RFC PATCH 1/8] softfloat: Use mulu64 for mul64To128

2020-10-20 Thread Alex Bennée
From: Richard Henderson Via host-utils.h, we use a host widening multiply for 64-bit hosts, and a common subroutine for 32-bit hosts. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20200925152047.709901-2-richard.hender...@linaro.org> -

[RFC PATCH 2/8] softfloat: Use int128.h for some operations

2020-10-20 Thread Alex Bennée
From: Richard Henderson Use our Int128, which wraps the compiler's __int128_t, instead of open-coding left shifts and arithmetic. We'd need to extend Int128 to have unsigned operations to replace more than these three. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson Signed-off-

[RFC PATCH 4/8] softfloat: Add float_cmask and constants

2020-10-20 Thread Alex Bennée
From: Richard Henderson Testing more than one class at a time is better done with masks. This reduces the static branch count. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20200925152047.709901-5-richard.hender...@linaro.org> --- fpu

[RFC PATCH 8/8] softfloat: implement addsub_floats128 using Uint128 and new style code

2020-10-20 Thread Alex Bennée
This inevitably leads to duplication of almost identical functions for the 128 bit and the 64/32/16 bit code. We will try and address that later. The expanded code is longer than the previous softfloat code and we see a drop in performance from ~85 MFlops to ~72 MFlops. Signed-off-by: Alex Bennée

Re: [PULL 00/41] target-arm queue

2020-10-20 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20201020155656.8045-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: 20201020155656.8045-1-peter.mayd...@linaro.org Subject: [PULL 00/41] target-arm queue

Re: [PULL 09/31] hw/core/clock: introduce clock object

2020-10-20 Thread Peter Maydell
On Tue, 20 Oct 2020 at 17:06, Philippe Mathieu-Daudé wrote: > > On 10/17/20 1:47 PM, Philippe Mathieu-Daudé wrote: > > Hi Damien, Peter, > > > >> +/* > >> + * macro helpers to convert to hertz / nanosecond > >> + */ > >> +#define CLOCK_PERIOD_FROM_NS(ns) ((ns) * (CLOCK_SECOND / 10llu)) > >

Re: [PATCH] drivers/virt: vmgenid: add vm generation id driver

2020-10-20 Thread Catangiu, Adrian Costin
Hi all, On 17/10/2020, 21:09, "Graf (AWS), Alexander" wrote: On 17.10.20 15:24, Jason A. Donenfeld wrote: > > After discussing this offline with Jann a bit, I have a few general > comments on the design of this. > > First, the UUID communicated by the hypervisor sh

[RFC PATCH 0/8] fpu: experimental conversion of float128_addsub

2020-10-20 Thread Alex Bennée
Hi Richard, This is the current state of my experiment to convert a 128 bit float function (in this case addsub). The actual conversion was fairly simple (basically a copy & paste with some tweaks for using the unint128 inline functions). However I ran into a number of stumbles with the int128.h s

[RFC PATCH 5/8] softfloat: Inline pick_nan_muladd into its caller

2020-10-20 Thread Alex Bennée
From: Richard Henderson Because of FloatParts, there will only ever be one caller. Inlining allows us to re-use abc_mask for the snan test. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20200925152047.709901-6-richard.hender...@linaro.

[PATCH 0/2] KVM: Introduce ioeventfd read support

2020-10-20 Thread Amey Narkhede
The first patch updates linux headers to add ioeventfd read support while the second patch can be used to test the ioeventfd read feature with kvm-unit-test which reads from specified guest addres. Make sure the address provided in kvm_set_ioeventfd_read matches with address in x86/ioeventfd_read t

[PATCH 2/2] kvm: Add ioeventfd read test code

2020-10-20 Thread Amey Narkhede
This patch adds kvm_set_ioeventfd_read and dummy_notifier_read functons to test ioeventfd read support. When the guess writes to address provided in kvm_set_ioeventfd_read function, dummy_notifier_read prints to stdio. Signed-off-by: Amey Narkhede --- accel/kvm/kvm-all.c | 55 +++

[PATCH 1/2] linux-headers: Add support for reads in ioeventfd

2020-10-20 Thread Amey Narkhede
This patch introduces a new flag KVM_IOEVENTFD_FLAG_DATAREAD in ioeventfd to enable receiving a notification when a guest reads from registered PIO/MMIO address. Signed-off-by: Amey Narkhede --- linux-headers/linux/kvm.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lin

Re: [RFC PATCH 0/8] fpu: experimental conversion of float128_addsub

2020-10-20 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20201020163738.27700-1-alex.ben...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20201020163738.27700-1-alex.ben...@linaro.org Subject: [RFC PATCH 0/8] fpu: experimen

Re: [PATCH 0/2] KVM: Introduce ioeventfd read support

2020-10-20 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20201020170056.433528-1-ameynarkhed...@gmail.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20201020170056.433528-1-ameynarkhed...@gmail.com Subject: [PATCH 0/2] KVM: Introduc

Re: [PATCH 0/1] Do not stop guest when panic event is received

2020-10-20 Thread Paolo Bonzini
On 02/10/20 04:41, Alejandro Jimenez wrote: > The fact that the behavior of hv-crash is also affected is why I chose to > implement this change as an independent > option, as opposed to making it a property of the pvpanic device (e.g. > -device pvpanic,no-panicstop). > > Please let me know if yo

Re: [PATCH 0/2] KVM: Introduce ioeventfd read support

2020-10-20 Thread Amey Narkhede
On 20/10/20 10:30PM, Amey Narkhede wrote: Please ignore this mail. I meant to send this mail to stefan but due to me being careless I forgot that I previously configured git-publish for qemu and didn't check the final message before hitting send. > The first patch updates linux headers to > add io

Re: [Virtio-fs] [PATCH v2 3/6] tools/virtiofsd: xattr name mappings: Add option

2020-10-20 Thread Vivek Goyal
On Fri, Sep 18, 2020 at 06:38:38PM +0100, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > On Thu, Aug 27, 2020 at 04:36:54PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > Add an option to define mappings of xattr name

Re: [PATCH v2 0/5] tests/9pfs: Code refactoring

2020-10-20 Thread Christian Schoenebeck
On Dienstag, 20. Oktober 2020 18:09:07 CEST Greg Kurz wrote: > Some code refactoring to have a clear distinction between top level > test functions and helper functions. > > v2: - use "do_" prefix instead of "do_fs_" > > --- > > Greg Kurz (5): > tests/9pfs: Factor out do_version() helper >

Re: [PATCH] os: deprecate the -enable-fips option and QEMU's FIPS enforcement

2020-10-20 Thread Paolo Bonzini
On 20/10/20 18:22, Daniel P. Berrangé wrote: > @@ -153,6 +153,9 @@ int os_parse_cmd_args(int index, const char *optarg) > break; > #if defined(CONFIG_LINUX) > case QEMU_OPTION_enablefips: > +warn_report("-enable-fips is deprecated, please build QEMU with " > +

[PATCH 00/16] util/vfio-helpers: Allow using multiple MSIX IRQs

2020-10-20 Thread Philippe Mathieu-Daudé
This series allow using multiple MSIX IRQs We currently share a single IRQ between 2 NVMe queues (ADMIN and I/O). This series still uses 1 shared IRQ but prepare for using multiple ones. The series is organized as: - Fix device minimum page size (prerequisite: patch 1) - Check IOMMU minimum page s

[PATCH 01/16] block/nvme: Correct minimum device page size

2020-10-20 Thread Philippe Mathieu-Daudé
While trying to simplify the code using a macro, we forgot the 12-bit shift... Correct that. Fixes: fad1eb68862 ("block/nvme: Use register definitions from 'block/nvme.h'") Reported-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH 03/16] util/vfio-helpers: Pass minimum page size to qemu_vfio_open_pci()

2020-10-20 Thread Philippe Mathieu-Daudé
The block driver asks for a minimum page size, but it might not match the minimum IOMMU requirement. In the next commit qemu_vfio_init_pci() will be able to report the minimum IOMMU page size back to the block driver. In preparation, pass the minimum page size as argument to qemu_vfio_open_pci().

[PATCH 02/16] util/vfio-helpers: Improve reporting unsupported IOMMU type

2020-10-20 Thread Philippe Mathieu-Daudé
Change the confuse "VFIO IOMMU check failed" error message by the explicit "VFIO IOMMU Type1 is not supported" once. Example on POWER: $ qemu-system-ppc64 -drive if=none,id=nvme0,file=nvme://0001:01:00.0/1,format=raw qemu-system-ppc64: -drive if=none,id=nvme0,file=nvme://0001:01:00.0/1,format

[PATCH 11/16] util/vfio-helpers: Let qemu_vfio_do_mapping() propagate Error

2020-10-20 Thread Philippe Mathieu-Daudé
Pass qemu_vfio_do_mapping() an Error* argument so it can propagate any error to callers. Replace error_report() which only report to the monitor by the more generic error_setg_errno(). Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 8 1 file chan

[PATCH 05/16] util/vfio-helpers: Trace PCI I/O config accesses

2020-10-20 Thread Philippe Mathieu-Daudé
We sometime get kernel panic with some devices on Aarch64 hosts. Alex Williamson suggests it might be broken PCIe root complex. Add trace event to record the latest I/O access before crashing. In case, assert our accesses are aligned. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé

[PATCH 04/16] util/vfio-helpers: Report error when IOMMU page size is not supported

2020-10-20 Thread Philippe Mathieu-Daudé
This driver uses the host page size to align its memory regions, but this size is not always compatible with the IOMMU. Add a check if the size matches, and bails out providing a hint what is the minimum page size the driver should use. Suggested-by: Alex Williamson Signed-off-by: Philippe Mathie

[PATCH 06/16] util/vfio-helpers: Trace PCI BAR region info

2020-10-20 Thread Philippe Mathieu-Daudé
For debug purpose, trace BAR regions info. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 8 util/trace-events | 1 + 2 files changed, 9 insertions(+) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index ac9cc20ce29..4204ce55445 100644

[PATCH 07/16] util/vfio-helpers: Trace where BARs are mapped

2020-10-20 Thread Philippe Mathieu-Daudé
For debugging purpose, trace where a BAR is mapped. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 2 ++ util/trace-events | 1 + 2 files changed, 3 insertions(+) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 4204ce55445..95e010bed6d 100

[PATCH 13/16] util/vfio-helpers: Introduce qemu_vfio_pci_msix_init_irqs()

2020-10-20 Thread Philippe Mathieu-Daudé
qemu_vfio_pci_init_irq() allows us to initialize any type of IRQ, but only one. Introduce qemu_vfio_pci_msix_init_irqs() which is specific to MSIX IRQ type, and allow us to use multiple IRQs (thus passing multiple eventfd notifiers). All eventfd notifiers are initialized with the special '-1' value

[PULL 00/21] Python patches

2020-10-20 Thread John Snow
The following changes since commit 4c41341af76cfc85b5a6c0f87de4838672ab9f89: Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20201020' into staging (2020-10-20 11:20:36 +0100) are available in the Git repository at: https://gitlab.com/jsnow/qemu.git tags/python-pu

[PATCH 09/16] util/vfio-helpers: Convert vfio_dump_mapping to trace events

2020-10-20 Thread Philippe Mathieu-Daudé
The QEMU_VFIO_DEBUG definition is only modifiable at build-time. Trace events can be enabled at run-time. As we prefer the latter, convert qemu_vfio_dump_mappings() to use trace events instead of fprintf(). Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 1

[PULL 02/21] python/qemu: use isort to lay out imports

2020-10-20 Thread John Snow
Borrowed from the QAPI cleanup series, use the same configuration to standardize the way we write and sort imports. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-2-js...@redhat.com Signed-off-by: John Snow --- python/qe

[PATCH 08/16] util/vfio-helpers: Improve DMA trace events

2020-10-20 Thread Philippe Mathieu-Daudé
For debugging purpose, trace where DMA regions are mapped. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 3 ++- util/trace-events | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index

[PATCH 16/16] util/vfio-helpers: Remove now unused qemu_vfio_pci_init_irq()

2020-10-20 Thread Philippe Mathieu-Daudé
Our only user, the NVMe block driver, switched to the MSIX API. As this function is now unused, remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/vfio-helpers.h | 2 -- util/vfio-helpers.c | 43 - 2 files changed, 45 deletions(-) diff

[PATCH 10/16] util/vfio-helpers: Let qemu_vfio_dma_map() propagate Error

2020-10-20 Thread Philippe Mathieu-Daudé
Currently qemu_vfio_dma_map() displays errors on stderr. When using management interface, this information is simply lost. Pass qemu_vfio_dma_map() an Error* argument so it can propagate the error to callers. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/vfio-hel

[PULL 07/21] python/machine.py: use qmp.command

2020-10-20 Thread John Snow
machine.py and qmp.py both do the same thing here; refactor machine.py to use qmp.py's functionality more directly. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daudé Message-id: 20201006235817.3280413-7-js...@redhat.com Signed-off-by: John Snow --- python/qe

[PULL 03/21] python/machine.py: Fix monitor address typing

2020-10-20 Thread John Snow
Prior to this, it's difficult for mypy to intuit what the concrete type of the monitor address is; it has difficulty inferring the type across two variables. Create _monitor_address as a property that always returns a valid address to simplify static type analysis. To preserve our ability to clea

[PULL 01/21] MAINTAINERS: Add Python library stanza

2020-10-20 Thread John Snow
I'm proposing that I split the actual Python library off from the other miscellaneous python scripts we have and declare it maintained. Add myself as a maintainer of this folder, along with Cleber. I will be actively working to add CI style guide checks, strict typing, and an actual package infras

[PATCH 12/16] util/vfio-helpers: Let qemu_vfio_verify_mappings() use error_report()

2020-10-20 Thread Philippe Mathieu-Daudé
Instead of displaying the error on stderr, use error_report() which also report to the monitor. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c

[PULL 05/21] python/machine.py: Don't modify state in _base_args()

2020-10-20 Thread John Snow
Don't append to the _remove_files list during _base_args; instead do so during _launch. Rework _base_args as a @property to help facilitate this impression. This has the additional benefit of making the type of _console_address easier to analyze statically. Signed-off-by: John Snow Reviewed-by:

[PULL 10/21] python/qemu: make 'args' style arguments immutable

2020-10-20 Thread John Snow
These arguments don't need to be mutable and aren't really used as such. Clarify their types as immutable and adjust code to match where necessary. In general, It's probably best not to accept a user-defined mutable object and store it as internal object state unless there's a strong justification

[PULL 04/21] python/machine.py: reorder __init__

2020-10-20 Thread John Snow
Put the init arg handling all at the top, and mostly in order (deviating when one is dependent on another), and put what is effectively runtime state declaration at the bottom. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Wolf Message-id: 20201006235817.328041

[PATCH 14/16] util/vfio-helpers: Introduce qemu_vfio_pci_msix_set_irq()

2020-10-20 Thread Philippe Mathieu-Daudé
Introduce qemu_vfio_pci_msix_set_irq() to set the event notifier of a specific MSIX IRQ. All other registered IRQs are left unmodified. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/vfio-helpers.h | 2 ++ util/vfio-helpers.c | 35 +++ util/trace-

[PULL 09/21] python/machine.py: fix _popen access

2020-10-20 Thread John Snow
As always, Optional[T] causes problems with unchecked access. Add a helper that asserts the pipe is present before we attempt to talk with it. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-9-js...@redhat.com Signed-off-by: John Snow --- python/qemu/machine

[PULL 11/21] iotests.py: Adjust HMP kwargs typing

2020-10-20 Thread John Snow
mypy wants to ensure there's consistency between the kwargs arguments types and any unspecified keyword arguments. In this case, conv_keys is a bool, but the remaining keys are Any type. Mypy (correctly) infers the **kwargs type to be **Dict[str, str], which is not compatible with conv_keys: bool.

[PULL 08/21] python/machine.py: Add _qmp access shim

2020-10-20 Thread John Snow
Like many other Optional[] types, it's not always a given that this object will be set. Wrap it in a type-shim that raises a meaningful error and will always return a concrete type. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-8-js...@redhat.com Signed-off-

[PATCH 15/16] block/nvme: Switch to using the MSIX API

2020-10-20 Thread Philippe Mathieu-Daudé
In preparation of using multiple IRQs, switch to using the recently introduced MSIX API. Instead of allocating and assigning IRQ in a single step, we now have to use two distinct calls. Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 14 -- 1 file changed, 12 insertions(+),

[PULL 13/21] python/qemu/console_socket.py: Correct type of recv()

2020-10-20 Thread John Snow
The type and parameter names of recv() should match socket.socket(). OK, easy enough, but in the cases we don't pass straight through to the real socket implementation, we probably can't accept such flags. OK, for now, assert that we don't receive flags in such cases. Signed-off-by: John Snow Re

[PULL 12/21] python/qemu: Add mypy type annotations

2020-10-20 Thread John Snow
These should all be purely annotations with no changes in behavior at all. You need to be in the python folder, but you should be able to confirm that these annotations are correct (or at least self-consistent) by running `mypy --strict qemu`. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Mes

[PULL 14/21] python/qemu/console_socket.py: fix typing of settimeout

2020-10-20 Thread John Snow
The types and names of the parameters must match the socket.socket interface. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-14-js...@redhat.com Signed-off-by: John Snow --- python/qemu/console_socket.py | 10 ++ 1 file changed, 6 insertions(+), 4 d

[PULL 19/21] python: add mypy config

2020-10-20 Thread John Snow
Formalize the options used for checking the python library. You can run mypy from the directory that mypy.ini is in by typing `mypy qemu/`. Signed-off-by: John Snow Message-id: 20201009175123.249009-2-js...@redhat.com [Edit: Added newline; thanks Bin Meng --js] Signed-off-by: John Snow --- pyth

[PULL 06/21] python/machine.py: Handle None events in events_wait

2020-10-20 Thread John Snow
If the timeout is 0, we can get None back. Handle this explicitly. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-6-js...@redhat.com Signed-off-by: John Snow --- python/qemu/machine.py | 27 --- 1 file changed, 20 insertions(+), 7 de

[PULL 21/21] python/qemu/qmp.py: Fix settimeout operation

2020-10-20 Thread John Snow
We enabled callers to interface directly with settimeout, but this reacts poorly with blocking/nonblocking operation; as they are using the same internal mechanism. 1. Whenever we change the blocking mechanism temporarily, always set it back to what it was afterwards. 2. Disallow callers from set

[PULL 15/21] python/qemu/console_socket.py: Clarify type of drain_thread

2020-10-20 Thread John Snow
Mypy needs just a little help to guess the type here. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-15-js...@redhat.com Signed-off-by: John Snow --- python/qemu/console_socket.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/

[PULL 20/21] python/qemu/qmp.py: re-raise OSError when encountered

2020-10-20 Thread John Snow
Nested if conditions don't change when the exception block fires; we need to explicitly re-raise the error if we didn't intend to capture and suppress it. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Message-id: 20201009175123.249009-3-js...@redhat.com Signed-off-by: John Snow -

[PULL 17/21] python/qemu/console_socket.py: avoid encoding to/from string

2020-10-20 Thread John Snow
We can work directly in bytes instead of translating back and forth to string, which removes the question of which encodings to use. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-17-js...@redhat.com Signed-off-by: John Snow --- python/qemu/console_socket.p

[PULL 18/21] python/qemu/qmp.py: Preserve error context on re-raise

2020-10-20 Thread John Snow
Use the "from ..." phrasing when re-raising errors to preserve their initial context, to help aid debugging when things go wrong. This also silences a pylint 2.6.0+ error. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-18

[PULL 16/21] python/qemu/console_socket.py: Add type hint annotations

2020-10-20 Thread John Snow
Finish the typing of console_socket.py with annotations and no code changes. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-16-js...@redhat.com Signed-off-by: John Snow --- python/qemu/console_socket.py | 18 +- 1 file changed, 9 insertions(

Re: [PATCH v4 2/4] Jobs based on custom runners: build environment docs and playbook

2020-10-20 Thread Andrea Bolognani
On Sun, 2020-10-18 at 21:50 -0400, Cleber Rosa wrote: > +++ b/scripts/ci/setup/build-environment.yml > @@ -0,0 +1,233 @@ > +--- > +- name: Installation of basic packages to build QEMU > + hosts: all > + tasks: My Ansible-fu is a bit rusty at the moment, so please double-check my claims and apolo

Re: [PULL 09/31] hw/core/clock: introduce clock object

2020-10-20 Thread Philippe Mathieu-Daudé
On 10/20/20 6:46 PM, Peter Maydell wrote: On Tue, 20 Oct 2020 at 17:06, Philippe Mathieu-Daudé wrote: On 10/17/20 1:47 PM, Philippe Mathieu-Daudé wrote: Hi Damien, Peter, +/* + * macro helpers to convert to hertz / nanosecond + */ +#define CLOCK_PERIOD_FROM_NS(ns) ((ns) * (CLOCK_SECOND / 10

Re: [PATCH v3 4/5] tools/virtiofsd: xattr name mapping examples

2020-10-20 Thread Vivek Goyal
On Tue, Oct 20, 2020 at 04:34:43PM +0100, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > On Wed, Oct 14, 2020 at 07:02:08PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > Add a few examples of xattrmaps to the documen

Re: [PATCH v2 0/5] tests/9pfs: Code refactoring

2020-10-20 Thread Greg Kurz
On Tue, 20 Oct 2020 19:23:19 +0200 Christian Schoenebeck wrote: > On Dienstag, 20. Oktober 2020 18:09:07 CEST Greg Kurz wrote: > > Some code refactoring to have a clear distinction between top level > > test functions and helper functions. > > > > v2: - use "do_" prefix instead of "do_fs_" > >

Re: [PATCH 1/8] tests/9pfs: simplify fs_mkdir()

2020-10-20 Thread Greg Kurz
On Tue, 20 Oct 2020 15:43:21 +0200 Christian Schoenebeck wrote: > On Dienstag, 20. Oktober 2020 15:35:36 CEST Greg Kurz wrote: > > On Tue, 20 Oct 2020 01:13:23 +0200 > > > > Christian Schoenebeck wrote: > > > Split out walking a directory path to a separate new utility function > > > fs_walk_fi

Re: [PATCH v4 3/4] Jobs based on custom runners: docs and gitlab-runner setup playbook

2020-10-20 Thread Andrea Bolognani
On Tue, 2020-10-20 at 09:29 +0100, Daniel P. Berrangé wrote: > I think the obvious and easy place is start using lcitool is for the > tests/docker/dockerfiles/*. All that's required is to add mappings > to lcitool for the various deps that QEMU has which libvirt does not > already have. Then we sh

Re: [PULL 20/21] python/qemu/qmp.py: re-raise OSError when encountered

2020-10-20 Thread Nir Soffer
On Tue, Oct 20, 2020 at 8:52 PM John Snow wrote: > > Nested if conditions don't change when the exception block fires; we > need to explicitly re-raise the error if we didn't intend to capture and > suppress it. > > Signed-off-by: John Snow > Reviewed-by: Philippe Mathieu-Daudé > Message-id: 202

[PATCH 0/4] hw/clock: Inline and remove CLOCK_PERIOD_TO_HZ/CLOCK_PERIOD_TO_NS macro

2020-10-20 Thread Philippe Mathieu-Daudé
Following discussion and analysis from Peter: https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg05853.html Last patch is RFC because I doubt using 128-bit is what we want... but I'm not sure how to round it neither. Future possible cleanup: un-inline these helpers. Luc Michel (1): hw/co

[PATCH 2/4] hw/core/clock: trace clock values in Hz instead of ns

2020-10-20 Thread Philippe Mathieu-Daudé
From: Luc Michel The nanosecond unit greatly limits the dynamic range we can display in clock value traces, for values in the order of 1GHz and more. The internal representation can go way beyond this value and it is quite common for today's clocks to be within those ranges. For example, a frequ

[PATCH 1/4] qdev-monitor: Display frequencies scaled to SI unit

2020-10-20 Thread Philippe Mathieu-Daudé
Since commit 9f2ff99c7f2 ("qdev-monitor: print the device's clock with info qtree") we can display the clock frequencies in the monitor. Use the recently introduced freq_to_str() to display the frequencies using the closest SI unit (human friendlier). Before: (qemu) info qtree [...] dev: xi

[PATCH 3/4] hw/clock: Inline and remove CLOCK_PERIOD_TO_HZ()

2020-10-20 Thread Philippe Mathieu-Daudé
This macro is only used once. Inline and remove it. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- include/hw/clock.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/hw/clock.h b/include/hw/clock.h index cbc5e6ced1e..b58038f1e7d 100644

[RFC PATCH 4/4] hw/clock: Inline and remove CLOCK_PERIOD_TO_NS()

2020-10-20 Thread Philippe Mathieu-Daudé
This macro is only used once. Inline caring about 64-bit multiplication, and remove it. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- include/hw/clock.h | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/hw/clock.h b/include/hw/clock.

Re: [PATCH v4 4/7] nbd: Update qapi to support exporting multiple bitmaps

2020-10-20 Thread Eric Blake
On 10/20/20 3:51 AM, Markus Armbruster wrote: >> #define QAPI_LIST_ADD(list, element) do { \ >> typeof(list) _tmp = g_new(typeof(*(list)), 1); \ >> _tmp->value = (element); \ >> _tmp->next = (list); \ >> (list) = _tmp; \ >> } while (0) >> >> >> Markus, thoughts on if we should publ

Re: [PATCH 1/8] tests/9pfs: simplify fs_mkdir()

2020-10-20 Thread Christian Schoenebeck
On Dienstag, 20. Oktober 2020 20:03:09 CEST Greg Kurz wrote: > On Tue, 20 Oct 2020 15:43:21 +0200 > > Christian Schoenebeck wrote: > > On Dienstag, 20. Oktober 2020 15:35:36 CEST Greg Kurz wrote: > > > On Tue, 20 Oct 2020 01:13:23 +0200 > > > > > > Christian Schoenebeck wrote: > > > > Split out

Re: [RFC PATCH 8/8] softfloat: implement addsub_floats128 using Uint128 and new style code

2020-10-20 Thread Richard Henderson
On 10/20/20 9:37 AM, Alex Bennée wrote: > +static inline FloatParts128 unpack128_raw(FloatFmt fmt, Uint128 raw) > +{ > +const int sign_pos = fmt.frac_size + fmt.exp_size; > + > +return (FloatParts128) { > +.cls = float_class_unclassified, > +.sign = extract128(raw, sign_pos,

[PATCH v2 0/4] target/s390x: Improve carry computation

2020-10-20 Thread Richard Henderson
While testing the float128_muladd changes for s390x host, emulating under x86_64 of course, I noticed that the code we generate for strings of ALCGR and SLBGR is pretty awful. I realized that we were missing a trick: the output cc is based only on the output (result and carry) and so we don't need

[PATCH v2 2/4] target/s390x: Improve ADD LOGICAL WITH CARRY

2020-10-20 Thread Richard Henderson
Now that ADD LOGICAL outputs carry, we can use that as input directly. It also means we can re-use CC_OP_ADDU and produce an output carry directly from ADD LOGICAL WITH CARRY. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/internal.h| 2 -- target/s390x/cc

[PATCH v2 1/4] target/s390x: Improve cc computation for ADD LOGICAL

2020-10-20 Thread Richard Henderson
The resulting cc is only dependent on the result and the carry-out. So save those things rather than the inputs. Carry-out for 64-bit inputs is had via tcg_gen_add2_i64 directly into cc_src. Carry-out for 32-bit inputs is had via extraction from a normal 64-bit add (with zero-extended inputs).

[PATCH v2 3/4] target/s390x: Improve cc computation for SUBTRACT LOGICAL

2020-10-20 Thread Richard Henderson
The resulting cc is only dependent on the result and the carry-out. Carry-out and borrow-out are inverses, so are trivially converted. With tcg ops, it is easier to compute borrow-out than carry-out, so save result and borrow-out rather than the inputs. Borrow-out for 64-bit inputs is had via tcg_

[PATCH v2 4/4] target/s390x: Improve SUB LOGICAL WITH BORROW

2020-10-20 Thread Richard Henderson
Now that SUB LOGICAL outputs borrow, we can use that as input directly. It also means we can re-use CC_OP_SUBU and produce an output borrow directly from SUB LOGICAL WITH BORROW. Signed-off-by: Richard Henderson --- target/s390x/internal.h| 2 - target/s390x/cc_helper.c | 32 -

Re: [PATCH v3 4/5] tools/virtiofsd: xattr name mapping examples

2020-10-20 Thread Dr. David Alan Gilbert
* Vivek Goyal (vgo...@redhat.com) wrote: > On Tue, Oct 20, 2020 at 04:34:43PM +0100, Dr. David Alan Gilbert wrote: > > * Vivek Goyal (vgo...@redhat.com) wrote: > > > On Wed, Oct 14, 2020 at 07:02:08PM +0100, Dr. David Alan Gilbert (git) > > > wrote: > > > > From: "Dr. David Alan Gilbert" > > > >

Re: [PULL 20/21] python/qemu/qmp.py: re-raise OSError when encountered

2020-10-20 Thread John Snow
On 10/20/20 2:15 PM, Nir Soffer wrote: On Tue, Oct 20, 2020 at 8:52 PM John Snow wrote: Nested if conditions don't change when the exception block fires; we need to explicitly re-raise the error if we didn't intend to capture and suppress it. Signed-off-by: John Snow Reviewed-by: Philippe Ma

[PULL v2 00/21] Python patches

2020-10-20 Thread John Snow
The following changes since commit 4c41341af76cfc85b5a6c0f87de4838672ab9f89: Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20201020' into staging (2020-10-20 11:20:36 +0100) are available in the Git repository at: https://gitlab.com/jsnow/qemu.git tags/python-pu

Re: [PATCH PROTOTYPE 4/6] memory: Extend ram_block_discard_(require|disable) by two discard types

2020-10-20 Thread Peter Xu
On Thu, Sep 24, 2020 at 06:04:21PM +0200, David Hildenbrand wrote: > We want to separate the two cases whereby > - balloning drivers do random discards on random guest memory (e.g., > virtio-balloon) - uncoordinated discards > - paravirtualized memory devices do discards in well-known granularity

Re: [PATCH PROTOTYPE 1/6] memory: Introduce sparse RAM handler for memory regions

2020-10-20 Thread Peter Xu
On Thu, Sep 24, 2020 at 06:04:18PM +0200, David Hildenbrand wrote: > +static inline void memory_region_set_sparse_ram_handler(MemoryRegion *mr, > +SparseRAMHandler > *srh) > +{ > +g_assert(memory_region_is_ram(mr)); Nit: Maybe assert mr-

Re: [PATCH] trace/simple: Enable tracing on startup only if the user specifies a trace option

2020-10-20 Thread Josh DuBois
Thanks for keeping on following-up, Markus. I know it's a small one, but it's still nice to have a small patch feel loved ;) > On Oct 20, 2020, at 4:19 AM, Markus Armbruster wrote: > > Markus Armbruster writes: > >> Stefan Hajnoczi writes: >> >>> On Sun, Aug 16, 2020 at 12:46:10PM -0500,

[PATCH v3 00/15] python: create installable package

2020-10-20 Thread John Snow
Based-on: https://gitlab.com/jsnow/qemu/-/tree/python This series factors the python/qemu directory as an installable package. It does not yet actually change the mechanics of how any other python source in the tree actually consumes it (yet), beyond the import path. The point of this series is p

[PATCH v3 02/15] python: add qemu package installer

2020-10-20 Thread John Snow
Add setup.cfg and setup.py, necessary for installing a package via pip. Add a rst document explaining the basics of what this package is for and who to contact for more information. This document will be used as the landing page for the package on PyPI. I am not yet using a pyproject.toml style pa

[PATCH v3 11/15] python: move mypy.ini into setup.cfg

2020-10-20 Thread John Snow
mypy supports reading its configuration values from a central project configuration file; do so. Signed-off-by: John Snow --- python/mypy.ini | 4 python/setup.cfg | 5 + 2 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 python/mypy.ini diff --git a/python/mypy.ini

[PATCH v3 06/15] python: add pylint import exceptions

2020-10-20 Thread John Snow
Pylint 2.5.x and 2.6.x have regressions that make import checking inconsistent, see: https: //github.com/PyCQA/pylint/issues/3609 https: //github.com/PyCQA/pylint/issues/3624 https: //github.com/PyCQA/pylint/issues/3651 Pinning to 2.4.4 is worse, because it mandates versions of shared dependencie

[PATCH v3 01/15] python: create qemu packages

2020-10-20 Thread John Snow
move python/qemu/*.py to python/qemu/[machine, qmp]/*.py and update import directives across the tree. This is done to create a PEP420 namespace package, in which we may create subpackages. To do this, the namespace directory ("qemu") should not have any modules in it. Those files will go into new

[PATCH v3 10/15] python: Add flake8 to pipenv

2020-10-20 Thread John Snow
flake8 3.5.x does not support the --extend-ignore syntax used in the .flake8 file to gracefully extend default ignores, so 3.6.x is our minimum requirement. There is no known upper bound. flake8 can be run from the python/ directory with no arguments. Signed-off-by: John Snow --- python/Pipfile

[PATCH v3 03/15] python: add VERSION file

2020-10-20 Thread John Snow
Python infrastructure as it exists today is not capable reliably of single-sourcing a package version from a parent directory. The authors of pip are working to correct this, but as of today this is not possible to my knowledge. The problem is that when using pip to build and install a python pack

[PATCH v3 08/15] python: add pylint to pipenv

2020-10-20 Thread John Snow
We are specifying >= pylint 2.6.x for two reasons: 1. For setup.cfg support, added in pylint 2.5.x 2. To clarify that we are using a version that has incompatibly dropped bad-whitespace checks. Signed-off-by: John Snow --- python/Pipfile | 1 + python/Pipfile.lock | 127 +

[PATCH v3 14/15] python/qemu: add isort to pipenv

2020-10-20 Thread John Snow
isort 5.0.0 through 5.0.4 has a bug that causes it to misinterpret certain "from ..." clauses that are not related to imports. Require 5.0.5 or greater. isort can be run with 'isort -c qemu' from the python root. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé --- python/Pipfile

[PATCH v3 07/15] python: move pylintrc into setup.cfg

2020-10-20 Thread John Snow
Delete the empty settings now that it's sharing a home with settings for other tools. pylint can now be run from this folder as "pylint qemu". Signed-off-by: John Snow --- python/qemu/machine/pylintrc | 58 python/setup.cfg | 29 ++

[PATCH v3 04/15] python: add directory structure README.rst files

2020-10-20 Thread John Snow
Add short readmes to python/, python/qemu/, python/qemu/machine, and python/qemu/machine that explain the directory hierarchy. These readmes are visible when browsing the source on e.g. gitlab/github and are designed to help new developers/users quickly make sense of the source tree. They are not

<    1   2   3   4   5   >