Re: [PATCH v6 4/4] new qTest case to test the vhost-user-blk-server

2020-06-04 Thread Thomas Huth
On 30/05/2020 19.14, Coiby Xu wrote: > This test case has the same tests as tests/virtio-blk-test.c except for > tests have block_resize. Since vhost-user server can only server one > client one time, two instances of qemu-storage-daemon are launched > for the hotplug test. > > In order to not

Re: [PATCH] qga: fix assert regression on guest-shutdown

2020-06-04 Thread Christian Ehrhardt
On Thu, Jun 4, 2020 at 11:46 AM Marc-André Lureau < marcandre.lur...@redhat.com> wrote: > Since commit 781f2b3d1e ("qga: process_event() simplification"), > send_response() is called unconditionally, but will assert when "rsp" is > NULL. This may happen with QCO_NO_SUCCESS_RESP commands, such as

RE: [PATCH v13 1/5] i386: Add support for CPUID_8000_001E for AMD

2020-06-04 Thread Babu Moger
> -Original Message- > From: Eduardo Habkost > Sent: Tuesday, June 2, 2020 12:52 PM > To: Moger, Babu > Cc: m...@redhat.com; marcel.apfelb...@gmail.com; pbonz...@redhat.com; > r...@twiddle.net; mtosa...@redhat.com; qemu-devel@nongnu.org; > k...@vger.kernel.org; k...@tripleback.net;

Re: [PATCH v4 05/10] Lift max memory slots limit imposed by vhost-user

2020-06-04 Thread Marc-André Lureau
On Thu, May 21, 2020 at 7:00 AM Raphael Norwitz wrote: > Historically, sending all memory regions to vhost-user backends in a > single message imposed a limitation on the number of times memory > could be hot-added to a VM with a vhost-user device. Now that backends > which support the

[Bug 1777235] Re: NVME is missing support for Get Log Page command

2020-06-04 Thread Philippe Mathieu-Daudé
Hi Lorenz, Can you send your patch to the mailing list adding your Signed-off-by tag? See: https://wiki.qemu.org/Contribute/SubmitAPatch#Submitting_your_Patches -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

Re: [PATCH 2/2] lockable: do not rely on optimization for null lockables

2020-06-04 Thread Eric Blake
On 6/3/20 5:49 PM, Joe Slater wrote: If we use QLNULL for null lockables, we can always use referencing unknown_lock_type as a link time error indicator. Signed-off-by: Joe Slater --- include/qemu/lockable.h | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff

Re: [PATCH] pci: assert configuration access is within bounds

2020-06-04 Thread Dr. David Alan Gilbert
* P J P (ppan...@redhat.com) wrote: > From: Prasad J Pandit > > While accessing PCI configuration bytes, assert that > 'address + len' is within PCI configuration space. > > Generally it is within bounds. This is more of a defensive > assert, in case a buggy device was to send 'address' which >

Re: [PATCH v2] hw/virtio/vhost: re-factor vhost-section and allow DIRTY_MEMORY_CODE

2020-06-04 Thread Michael S. Tsirkin
On Thu, Jun 04, 2020 at 02:40:22PM +0100, Alex Bennée wrote: > The purpose of vhost_section is to identify RAM regions that need to > be made available to a vhost client. However when running under TCG > all RAM sections have DIRTY_MEMORY_CODE set which leads to problems > down the line. > >

Re: [PULL v2 05/13] accel/tcg: Relax va restrictions on 64-bit guests

2020-06-04 Thread Alex Bennée
Laurent Vivier writes: > On 15/05/2020 16:43, Alex Bennée wrote: >> From: Richard Henderson >> >> We cannot at present limit a 64-bit guest to a virtual address >> space smaller than the host. It will mostly work to ignore this >> limitation, except if the guest uses high bits of the

[Bug 1866870] Re: KVM Guest pauses after upgrade to Ubuntu 20.04

2020-06-04 Thread Dr. David Alan Gilbert
Fabrice: That's probably a different error given that this lp seems to be with x86 vmx flags. Check your /var/log/libvirt/qemu/ on the host to see if there's a particular error shown in the destination qemu after migration. -- You received this bug notification because you are a member of

[PATCH v4 06/12] qcow2_format.py: use strings to specify c-type of struct fields

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
We are going to move field-parsing to super-class, this will be simpler with simple string specifiers instead of variables. For some reason python doesn't allow to define ctypes in class too, as well as fields: it's not available than in 'for' operator. Don't worry: ctypes will be moved to

[PATCH v4 11/12] qcow2: QcowHeaderExtension print names for extension magics

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Suggested-by: Andrey Shinkevich Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/031.out | 22 +++--- tests/qemu-iotests/036.out | 4 ++-- tests/qemu-iotests/061.out | 14 +++--- tests/qemu-iotests/qcow2_format.py | 17

[Bug 1852196] Re: update edk2 submodule & binaries to edk2-stable202005

2020-06-04 Thread Philippe Mathieu-Daudé
** Summary changed: - update edk2 submodule & binaries to edk2-stable201911 + update edk2 submodule & binaries to edk2-stable202005 ** Description changed: - edk2-stable201911 will be tagged soon: + edk2-stable202005 has been tagged: -

[Bug 714629] Re: BIOS doesn't load when read() returns less than the full ROM length

2020-06-04 Thread Philippe Mathieu-Daudé
Fix included in QEMU v4.0.0. ** Changed in: qemu Status: New => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/714629 Title: BIOS doesn't load when read() returns less than the

Re: kvm_target, QEMU_KVM_ARM_TARGET_GENERIC_V8 questions

2020-06-04 Thread Leif Lindholm
On Thu, Jun 04, 2020 at 17:09:30 +0100, Peter Maydell wrote: > On Thu, 4 Jun 2020 at 17:03, Leif Lindholm wrote: > > But there's also things like: > > - a57_initfn explicitly setting kvm_target, then only being called > > from max_initfn for !kvm_enabled() > > Expected -- a KVM 'max' is

[PATCH v4 12/12] qcow2_format.py: dump bitmaps header extension

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Add class for bitmap extension and dump its fields. Further work is to dump bitmap directory. Test new functionality inside 291 iotest. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/291 | 4 +++ tests/qemu-iotests/291.out | 33 +++

[PATCH v4 04/12] qcow2_format.py: use tuples instead of lists for fields

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
No need in lists: it's a constant variable. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2_format.py | 40 +++--- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/qemu-iotests/qcow2_format.py

[PATCH v4 02/12] qcow2.py: move qcow2 format classes to separate module

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
We are going to enhance qcow2 format parsing by adding more structure classes. Let's split format parsing from utility code. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2.py| 161 + tests/qemu-iotests/qcow2_format.py | 157

[PATCH v4 05/12] qcow2_format.py: use modern string formatting

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Use .format and f-strings instead of old %style. Also, the file uses both '' and "" quotes, for consistency let's use '', except for cases when we need '' inside the string (use "" to avoid extra escaping). Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2_format.py | 54

[PATCH v4 09/12] qcow2_format.py: QcowHeaderExtension: add dump method

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Obviously, for-loop body in dump_extensions should be the dump method of extension. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2_format.py | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/qcow2_format.py

Re: [RFC PATCH] hw/virtio/vhost: re-factor vhost-section and allow DIRTY_MEMORY_CODE

2020-06-04 Thread Dr. David Alan Gilbert
* Alex Bennée (alex.ben...@linaro.org) wrote: > > Dr. David Alan Gilbert writes: > > > * Alex Bennée (alex.ben...@linaro.org) wrote: > >> The purpose of vhost_section is to identify RAM regions that need to > >> be made available to a vhost client. However when running under TCG > >> all

Re: [PATCH v4 03/10] Add VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS

2020-06-04 Thread Marc-André Lureau
Hi On Thu, May 21, 2020 at 7:00 AM Raphael Norwitz wrote: > This change introduces a new feature to the vhost-user protocol allowing > a backend device to specify the maximum number of ram slots it supports. > > At this point, the value returned by the backend will be capped at the > maximum

Re: [PATCH v4 02/10] Add vhost-user helper to get MemoryRegion data

2020-06-04 Thread Marc-André Lureau
Hi On Thu, May 21, 2020 at 7:00 AM Raphael Norwitz wrote: > When setting the memory tables, qemu uses a memory region's userspace > address to look up the region's MemoryRegion struct. Among other things, > the MemoryRegion contains the region's offset and associated file > descriptor, all of

Re: [PATCH] hw/block/pflash_cfi01: Limit maximum flash size to 256 MiB

2020-06-04 Thread Peter Maydell
On Thu, 4 Jun 2020 at 16:16, Philippe Mathieu-Daudé wrote: > On 5/25/20 10:59 PM, Peter Maydell wrote: > > What problem is this check solving? Is there some implementation > > imposed limitation or a limit within the flash header format > > that means larger sizes don't work? If so, what's the

Re: kvm_target, QEMU_KVM_ARM_TARGET_GENERIC_V8 questions

2020-06-04 Thread Peter Maydell
On Thu, 4 Jun 2020 at 16:38, Leif Lindholm wrote: > On Thu, Jun 04, 2020 at 14:10:08 +0100, Peter Maydell wrote: > > On Thu, 4 Jun 2020 at 13:55, Leif Lindholm wrote: > > > So, then I decided to actually test things, and found that > > > (with -enable-kvm): > > > - on Cortex-A53 hardware > > >

Re: [PATCH v4] xen: fix build without pci passthrough

2020-06-04 Thread Paolo Bonzini
On 04/06/20 15:30, Anthony PERARD wrote: > - fix build when Xen headers aren't available. > By building stubs/xen-pt.c only when CONFIG_XEN=y > (The alternative would be to move the prototypes used by the stub into > xen.h, which doesn't depends on xen headers.) Good catch.

[PATCH v7 2/4] generic vhost user server

2020-06-04 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol. Only one vhost-user client can connect to the server one time. Signed-off-by: Coiby Xu --- util/Makefile.objs | 1 + util/vhost-user-server.c | 406 +++ util/vhost-user-server.h | 59 ++ 3 files

[PATCH v7 4/4] new qTest case to test the vhost-user-blk-server

2020-06-04 Thread Coiby Xu
This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Since vhost-user server can only server one client one time, two instances of qemu-storage-daemon are launched for the hotplug test. In order to not block scripts/tap-driver.pl, vhost-user-blk-server

[PATCH v7 3/4] vhost-user block device backend server

2020-06-04 Thread Coiby Xu
By making use of libvhost-user, block device drive can be shared to the connected vhost-user client. Only one client can connect to the server one time. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu ---

[PATCH v7 0/4] vhost-user block device backend implementation

2020-06-04 Thread Coiby Xu
v7 - fix docker-test-debug@fedora errors by freeing malloced memory v6 - add missing license header and include guard - vhost-user server only serve one client one time - fix a bug in custom vu_message_read - using qemu-storage-daemon to start vhost-user-blk-server - a bug fix to pass

[PATCH v7 1/4] Allow vu_message_read to be replaced

2020-06-04 Thread Coiby Xu
Allow vu_message_read to be replaced by one which will make use of the QIOChannel functions. Thus reading vhost-user message won't stall the guest. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user-glib.c | 2 +- contrib/libvhost-user/libvhost-user.c | 11 ++-

Re: [PATCH v2 05/16] python/qmp.py: add casts to JSON deserialization

2020-06-04 Thread Kevin Wolf
Am 02.06.2020 um 23:45 hat John Snow geschrieben: > mypy and python type hints are not powerful enough to properly describe > JSON messages in Python 3.6. The best we can do, generally, is describe > them as Dict[str, Any]. > > Add casts to coerce this type for static analysis; but do NOT enforce

Re: [PULL v2 05/13] accel/tcg: Relax va restrictions on 64-bit guests

2020-06-04 Thread Laurent Vivier
On 15/05/2020 16:43, Alex Bennée wrote: > From: Richard Henderson > > We cannot at present limit a 64-bit guest to a virtual address > space smaller than the host. It will mostly work to ignore this > limitation, except if the guest uses high bits of the address > space for tags. But it will

Re: [PATCH v4 06/10] Refactor out libvhost-user fault generation logic

2020-06-04 Thread Marc-André Lureau
Hi On Thu, May 21, 2020 at 7:00 AM Raphael Norwitz wrote: > In libvhost-user, the incoming postcopy migration path for setting the > backend's memory tables has become convolued. In particular, moving the > logic which starts generating faults, having received the final ACK from > qemu can be

Re: [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image

2020-06-04 Thread Alex Bennée
Bastian Koppelmann writes: > we get an authentication errror when trying to pull qemu:debian9. Thus > just start from a plain debian image. Ahh I see a breakage in tests/docker/Makefile.include where the line should be: docker-image-debian-tricore-cross: docker-image-debian9 to ensure

Re: [PATCH] hw/block/pflash_cfi01: Limit maximum flash size to 256 MiB

2020-06-04 Thread Peter Maydell
On Thu, 4 Jun 2020 at 16:55, Philippe Mathieu-Daudé wrote: > > On 6/4/20 5:30 PM, Peter Maydell wrote: > > Not really; I think we should know what we're limiting against. > > Currently you're checking total_len, but this is just sector_len * nb_blocs, > > so if there's a problem with silly large

Re: kvm_target, QEMU_KVM_ARM_TARGET_GENERIC_V8 questions

2020-06-04 Thread Leif Lindholm
On Thu, Jun 04, 2020 at 15:18:02 +0200, Andrew Jones wrote: > > - drop the call from aarch64_max_initfn to aarch64_a57_initfn, and > > copy the relevant bits into the former for the !kvm case > > I don't have a strong preference here, but if the naming is what's > troublesome, then I'd think

[PATCH v4 01/12] qcow2.py: python style fixes

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Fix flake8 complains. Leave the only chunk of lines over 79 characters: initialization of cmds variable. Leave it for another day, when it should be refactored to utilize argparse instead of hand-written parsing. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2.py | 92

[PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is my suggestion to substitute only first three patches :) of Andrey's [PATCH v3 0/6] iotests: Dump QCOW2 dirty bitmaps metadata so, I called it v4 for convenience. What is here: 1. First, update code style 2. Next, try to refactor in a manner which will make adding new data

[PATCH v2] hw/virtio/vhost: re-factor vhost-section and allow DIRTY_MEMORY_CODE

2020-06-04 Thread Alex Bennée
The purpose of vhost_section is to identify RAM regions that need to be made available to a vhost client. However when running under TCG all RAM sections have DIRTY_MEMORY_CODE set which leads to problems down the line. Re-factor the code so: - steps are clearer to follow - reason for

[Bug 1866870] Re: KVM Guest pauses after upgrade to Ubuntu 20.04

2020-06-04 Thread Fabrice Moyen
Same issue here. I've upgraded my IBM Power ppc64le system to ubuntu 20.04. Now I'm trying to create KVM VMs and whatever I'm doing, the VM is created but before any installation step starts, it's falling into "paused" mode. When trying to resume it, I get: " Error unpausing domain: internal

Re: [PATCH v6 4/4] new qTest case to test the vhost-user-blk-server

2020-06-04 Thread Coiby Xu
On Thu, Jun 04, 2020 at 03:49:13PM +0200, Thomas Huth wrote: On 04/06/2020 15.42, Thomas Huth wrote: + * Copyright (c) 2018 Emanuele Giuseppe Esposito Don't you want to add a remark here for you, too? + * This library is free software; you can redistribute it and/or + * modify it under the

Re: [PATCH v3] ati-vga: check mm_index before recursive call (CVE-2020-13800)

2020-06-04 Thread BALATON Zoltan
On Thu, 4 Jun 2020, Gerd Hoffmann wrote: +} else if (s->regs.mm_index > MM_DATA + 3) { val = ati_mm_read(s, s->regs.mm_index + addr - MM_DATA, size); MM_INDEX is 0 MM_DATA is 4 "normal" registers start at 8. So we want allow indirect access for offset 8 and above and

Re: [PATCH v2 2/2] pci: ensure configuration access is within bounds

2020-06-04 Thread Michael S. Tsirkin
On Thu, Jun 04, 2020 at 02:14:46PM +0200, BALATON Zoltan wrote: > On Thu, 4 Jun 2020, Michael S. Tsirkin wrote: > > On Thu, Jun 04, 2020 at 01:49:53PM +0200, BALATON Zoltan wrote: > > > On Thu, 4 Jun 2020, Michael S. Tsirkin wrote: > > > > On Thu, Jun 04, 2020 at 01:37:13PM +0200, BALATON Zoltan

Re: [PATCH v4 01/10] Add helper to populate vhost-user message regions

2020-06-04 Thread Marc-André Lureau
On Thu, May 21, 2020 at 7:00 AM Raphael Norwitz wrote: > When setting vhost-user memory tables, memory region descriptors must be > copied from the vhost_dev struct to the vhost-user message. To avoid > duplicating code in setting the memory tables, we should use a helper to > populate this

Re: [PATCH v2 00/16] python: add mypy support to python/qemu

2020-06-04 Thread Kevin Wolf
Am 02.06.2020 um 23:45 hat John Snow geschrieben: > Requires: 20200602194844.15258-1-js...@redhat.com > > This series is extracted from my larger series that attempted to bundle > our python module as an installable module. These fixes don't require that, > so they are being sent first as I think

Re: [PATCH] hw/block/pflash_cfi01: Limit maximum flash size to 256 MiB

2020-06-04 Thread Philippe Mathieu-Daudé
On 6/4/20 5:30 PM, Peter Maydell wrote: > On Thu, 4 Jun 2020 at 16:16, Philippe Mathieu-Daudé wrote: >> On 5/25/20 10:59 PM, Peter Maydell wrote: >>> What problem is this check solving? Is there some implementation >>> imposed limitation or a limit within the flash header format >>> that means

Re: [PATCH v3] migration/xbzrle: add encoding rate

2020-06-04 Thread Richard Henderson
On 6/4/20 3:27 AM, Wei Wang wrote: > On 06/04/2020 05:38 PM, Dr. David Alan Gilbert wrote: >> Hmm OK; I'll admit to not liking NaN/Inf in output. >> >> Dave >> > > OK. To deal with the reported issue, how about using FLT_MAX (as opposed to > UINT64_MAX or inf): > xbzrle_counters.encoding_rate =

[PATCH] hw/sd/sdcard: Verify CMD24 (Block Write) address is valid

2020-06-04 Thread Philippe Mathieu-Daudé
Avoid OOB access by verifying the requested address belong to the actual card size. Return ADDRESS_ERROR when not in range. "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01" 4.3.4 Data Write * Block Write Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR

Re: kvm_target, QEMU_KVM_ARM_TARGET_GENERIC_V8 questions

2020-06-04 Thread Peter Maydell
On Thu, 4 Jun 2020 at 14:32, Andrew Jones wrote: > On Thu, Jun 04, 2020 at 02:10:08PM +0100, Peter Maydell wrote: > > These explicit settings are correct, because for these CPUs > > the kernel does have a "give me what I want in particular" > > setting (which it will fail on the wrong h/w), and

Re: [PATCH v2 16/16] python/qemu: Add mypy type annotations

2020-06-04 Thread Kevin Wolf
Am 02.06.2020 um 23:45 hat John Snow geschrieben: > 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

Re: [PATCH v4 07/10] Support ram slot configuration in libvhost-user

2020-06-04 Thread Marc-André Lureau
On Thu, May 21, 2020 at 7:00 AM Raphael Norwitz wrote: > The VHOST_USER_GET_MAX_MEM_SLOTS message allows a vhost-user backend to > specify a maximum number of ram slots it is willing to support. This > change adds support for libvhost-user to process this message. For now > the backend will

[Bug 1880822] Re: CVE-2020-13253 QEMU: sd: OOB access could crash the guest resulting in DoS

2020-06-04 Thread Philippe Mathieu-Daudé
Patch reducing the exposure to this bug: https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00823.html -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1880822 Title: CVE-2020-13253 QEMU: sd:

Re: [PATCH 1/2] lockable: use QLNULL for a null lockable

2020-06-04 Thread Eric Blake
On 6/3/20 5:49 PM, Joe Slater wrote: Allows us to build with -Og and optimizations that do not clean up dead-code. Signed-off-by: Joe Slater to be squished Signed-off-by: Joe Slater These last two lines can be elided (looks like a rebase mishap). --- block/block-backend.c | 4

Re: [PATCH RFC v2 1/5] block: add bitmap-populate job

2020-06-04 Thread Peter Krempa
On Thu, Jun 04, 2020 at 13:31:45 +0200, Kevin Wolf wrote: > Am 04.06.2020 um 11:16 hat Peter Krempa geschrieben: > > On Thu, Jun 04, 2020 at 11:12:31 +0200, Kevin Wolf wrote: > > > Am 18.05.2020 um 22:49 hat Eric Blake geschrieben: > > > > > + > > > > > +/* NB: new bitmap is anonymous and

Re: [PATCH v3] ati-vga: check mm_index before recursive call (CVE-2020-13800)

2020-06-04 Thread Gerd Hoffmann
> +} else if (s->regs.mm_index > MM_DATA + 3) { > val = ati_mm_read(s, s->regs.mm_index + addr - MM_DATA, size); MM_INDEX is 0 MM_DATA is 4 "normal" registers start at 8. So we want allow indirect access for offset 8 and above and deny offsets 0-7. mm_index is interpreted

Re: [PATCH v2 1/7] qdev: add support for device module loading

2020-06-04 Thread BALATON Zoltan
On Thu, 4 Jun 2020, Gerd Hoffmann wrote: When compiling devices as modules we'll need some infrastrtucture to actually load those modules if needed. This patch adds it. Signed-off-by: Gerd Hoffmann --- include/hw/qdev-core.h | 3 +++ include/qemu/module.h | 1 + hw/core/qdev.c | 50

Re: [PATCH v6 4/4] new qTest case to test the vhost-user-blk-server

2020-06-04 Thread Thomas Huth
On 04/06/2020 15.42, Thomas Huth wrote: > On 30/05/2020 19.14, Coiby Xu wrote: >> This test case has the same tests as tests/virtio-blk-test.c except for >> tests have block_resize. Since vhost-user server can only server one >> client one time, two instances of qemu-storage-daemon are launched >>

Re: [PATCH v2 10/16] python/machine.py: Handle None events in event_wait

2020-06-04 Thread Kevin Wolf
Am 02.06.2020 um 23:45 hat John Snow geschrieben: > If the timeout is 0, we can get None back. Handle this explicitly. > > Signed-off-by: John Snow Subject line: This is events_wait(), not event_wait(). Both functions exist. > @@ -562,6 +564,8 @@ def _match(event): > # Poll for new

Re: [PATCH v4 04/10] Transmit vhost-user memory regions individually

2020-06-04 Thread Marc-André Lureau
Hi On Thu, May 21, 2020 at 7:00 AM Raphael Norwitz wrote: > With this change, when the VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS > protocol feature has been negotiated, Qemu no longer sends the backend > all the memory regions in a single message. Rather, when the memory > tables are set or

[Bug 714629] Re: BIOS doesn't load when read() returns less than the full ROM length

2020-06-04 Thread Philippe Mathieu-Daudé
This seems to have been fixed by commit 1f40547f5ce0c135faa7d14f066b97002fd8c204. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/714629 Title: BIOS doesn't load when read() returns less than the

Re: [PATCH v2] hw/virtio/vhost: re-factor vhost-section and allow DIRTY_MEMORY_CODE

2020-06-04 Thread Fabiano Rosas
Alex Bennée writes: > The purpose of vhost_section is to identify RAM regions that need to > be made available to a vhost client. However when running under TCG > all RAM sections have DIRTY_MEMORY_CODE set which leads to problems > down the line. > > Re-factor the code so: > > - steps are

Re: [RFC v2 00/18] Refactor configuration of guest memory protection

2020-06-04 Thread Sean Christopherson
On Thu, Jun 04, 2020 at 01:11:29PM +1000, David Gibson wrote: > On Mon, Jun 01, 2020 at 10:16:18AM +0100, Dr. David Alan Gilbert wrote: > > * Sean Christopherson (sean.j.christopher...@intel.com) wrote: > > > On Thu, May 21, 2020 at 01:42:46PM +1000, David Gibson wrote: > > > > Note: I'm using the

[PATCH v4 10/12] qcow2_format: refactor QcowHeaderExtension as a subclass of Qcow2Struct

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Only two fields we can parse by generic code, but that is better than nothing. Keep further refactoring of variable-length fields for another day. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2_format.py | 51 -- 1 file changed, 35

[PATCH v4 07/12] qcow2_format.py: separate generic functionality of structure classes

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
We are going to introduce more Qcow2 structure types, defined like QcowHeader. Move generic functionality into base class to be reused for further structure classes. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2_format.py | 93 +++--- 1 file

[PATCH v4 08/12] qcow2_format.py: add field-formatting class

2020-06-04 Thread Vladimir Sementsov-Ogievskiy
Allow formatter class in structure definition instead of hacking with 'mask'. This will simplify further introduction of new formatters. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/qcow2_format.py | 35 +- 1 file changed, 25 insertions(+), 10

Re: [PATCH 0/4] target/i386: miscellaneous x87 fixes

2020-06-04 Thread Paolo Bonzini
On 02/06/20 20:38, Joseph Myers wrote: > Ping for this patch series > , and > the subsequent series > and > individual patch >

Re: [PATCH] hw/sd/sdcard: Verify CMD24 (Block Write) address is valid

2020-06-04 Thread Paolo Bonzini
On 04/06/20 19:34, Philippe Mathieu-Daudé wrote: > Avoid OOB access by verifying the requested address belong to > the actual card size. Return ADDRESS_ERROR when not in range. > > "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01" > > 4.3.4 Data Write > > * Block Write > >

Re: [PATCH 05/13] i386: hvf: Use ins_len to advance IP

2020-06-04 Thread Paolo Bonzini
On 04/06/20 08:39, Philippe Mathieu-Daudé wrote: >> simulate_wrmsr(cpu); >> } >> -RIP(env) += rvmcs(cpu->hvf_fd, VMCS_EXIT_INSTRUCTION_LENGTH); >> +RIP(env) += ins_len; > I'd feel safer if you change ins_len to uint64_t first. > Why? It will

Re: [PATCH v2 1/1] python/machine.py: refactor shutdown

2020-06-04 Thread John Snow
On 6/4/20 8:39 AM, Kevin Wolf wrote: > Am 02.06.2020 um 21:48 hat John Snow geschrieben: >> This is done primarily to avoid the 'bare except' pattern, which >> suppresses ALL exceptions and not just ones that we are anticipating to >> see. >> >> Replace this with a pattern that isolates the

[Bug 1882123] [NEW] ARM cpu emulation regression on QEMU 4.2.0

2020-06-04 Thread Hajin Jang
Public bug reported: [*] Summary Latest QEMU has an ARM CPU emulation regression. Regression is reproducible by building any C# project with .NET Core SDK 3.1.300 on Debian 10 armhf guest OS. Releases affected: QEMU 4.2.0, 5.0.0 Releases not affected: QEMU 4.1.0, QEMU 4.1.1 [*] Detail .NET

[PATCH v2] hw/sd/sdcard: Verify CMD24 (Block Write) address is valid

2020-06-04 Thread Philippe Mathieu-Daudé
Avoid OOB access by verifying the requested address belong to the actual card size. Return ADDRESS_ERROR when not in range. Only move the state machine to ReceivingData if there is no pending error. "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01" 4.3.4 Data Write * Block

[PATCH v5] xen: fix build without pci passthrough

2020-06-04 Thread Paolo Bonzini
From: Anthony PERARD Xen PCI passthrough support may not be available and thus the global variable "has_igd_gfx_passthru" might be compiled out. Common code should not access it in that case. Unfortunately, we can't use CONFIG_XEN_PCI_PASSTHROUGH directly in xen-common.c so this patch instead

Re: [PATCH v3] osdep: Make MIN/MAX evaluate arguments only once

2020-06-04 Thread Paolo Bonzini
On 03/06/20 21:26, Eric Blake wrote: > > Yes, I just tested; using "((void)0)" in place of > "__builtin_unreachable()" has the same effect (no change to valid use, > and still a compiler error on misuse). gcc: > > /home/eblake/qemu/qemu-img.c: In function ‘is_allocated_sectors’: >

Re: [PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata

2020-06-04 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200604174135.11042-1-vsement...@virtuozzo.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200604174135.11042-1-vsement...@virtuozzo.com Subject: [PATCH v4 00/12] iotests: Dump QCOW2

Re: [PATCH] checkpatch: reversed logic with acpi test checks

2020-06-04 Thread Peter Maydell
On Thu, 4 Jun 2020 at 20:09, Michael S. Tsirkin wrote: > On Thu, Jun 04, 2020 at 08:45:15PM +0200, Paolo Bonzini wrote: > > On 02/06/20 07:36, Michael S. Tsirkin wrote: > > > + } elsif (not $name =~ > > > m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { > > >

[PATCH v3 3/3] python/machine.py: re-add sigkill warning suppression

2020-06-04 Thread John Snow
If the user kills QEMU on purpose, we don't need to warn them about that having happened: they know already. Signed-off-by: John Snow --- python/qemu/machine.py | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index

[PATCH v3 13/16] python/machine.py: fix _popen access

2020-06-04 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 --- python/qemu/machine.py | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git

Re: [PATCH v13 1/5] i386: Add support for CPUID_8000_001E for AMD

2020-06-04 Thread Eduardo Habkost
On Thu, Jun 04, 2020 at 09:06:27AM -0500, Babu Moger wrote: > > > > -Original Message- > > From: Eduardo Habkost > > Sent: Tuesday, June 2, 2020 12:52 PM > > To: Moger, Babu > > Cc: m...@redhat.com; marcel.apfelb...@gmail.com; pbonz...@redhat.com; > > r...@twiddle.net;

Re: [PATCH] configure: Do not ignore malloc value

2020-06-04 Thread Paolo Bonzini
On 25/05/20 00:12, Leonid Bloch wrote: > From: Leonid Bloch > > Not checking the value of malloc will cause a warning with GCC 10.1, > which may result in configuration failure, with the following line in > config.log: > > config-temp/qemu-conf.c:2:18: error: ignoring return value of ‘malloc’

Re: [PATCH v4] exec: set map length to zero when returning NULL

2020-06-04 Thread Paolo Bonzini
On 26/05/20 13:17, P J P wrote: > From: Prasad J Pandit > > When mapping physical memory into host's virtual address space, > 'address_space_map' may return NULL if BounceBuffer is in_use. > Set and return '*plen = 0' to avoid later NULL pointer dereference. > > Reported-by: Alexander Bulekov

Re: [PATCH v2 05/16] python/qmp.py: add casts to JSON deserialization

2020-06-04 Thread John Snow
On 6/4/20 9:49 AM, Kevin Wolf wrote: > Am 02.06.2020 um 23:45 hat John Snow geschrieben: >> mypy and python type hints are not powerful enough to properly describe >> JSON messages in Python 3.6. The best we can do, generally, is describe >> them as Dict[str, Any]. >> >> Add casts to coerce

Re: [PATCH v2 10/16] python/machine.py: Handle None events in event_wait

2020-06-04 Thread John Snow
On 6/4/20 10:20 AM, Kevin Wolf wrote: > Am 02.06.2020 um 23:45 hat John Snow geschrieben: >> If the timeout is 0, we can get None back. Handle this explicitly. >> >> Signed-off-by: John Snow > > Subject line: This is events_wait(), not event_wait(). Both functions > exist. > >> @@ -562,6

Re: [PATCH v2 16/16] python/qemu: Add mypy type annotations

2020-06-04 Thread John Snow
On 6/4/20 10:50 AM, Kevin Wolf wrote: > Am 02.06.2020 um 23:45 hat John Snow geschrieben: >> 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

Re: [PATCH] checkpatch: reversed logic with acpi test checks

2020-06-04 Thread Michael S. Tsirkin
On Thu, Jun 04, 2020 at 08:45:15PM +0200, Paolo Bonzini wrote: > On 02/06/20 07:36, Michael S. Tsirkin wrote: > > Logic reversed: allowed list should just be ignored. Instead we > > only take that into account :( > > > > Fixes: e11b06a880ca ("checkpatch: ignore allowed diff list") > >

[PATCH v3 16/16] python/qemu: Add mypy type annotations

2020-06-04 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 --- python/qemu/accel.py

[PATCH v3 15/16] iotests.py: Adjust HMP kwargs typing

2020-06-04 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.

Re: [PATCH v2 0/7] exec/cpu: Cleanups around "exec/hwaddr.h" (reserved to system-mode)

2020-06-04 Thread Paolo Bonzini
On 26/05/20 19:24, Philippe Mathieu-Daudé wrote: > The 'hwaddr' type declared in "exec/hwaddr.h" is meant for > system-mode emulation only. > This series is a preparatory cleanup to allow later poisoning > it in user-mode code. > > Missing review: patche 7 > - target/s390x: Restrict system-mode

Re: [PATCH] hw/sd/sdcard: Verify CMD24 (Block Write) address is valid

2020-06-04 Thread Philippe Mathieu-Daudé
On 6/4/20 8:03 PM, Paolo Bonzini wrote: > On 04/06/20 19:34, Philippe Mathieu-Daudé wrote: >> Avoid OOB access by verifying the requested address belong to >> the actual card size. Return ADDRESS_ERROR when not in range. >> >> "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01" >>

Re: [PATCH 0/9] AMD SEV: Cleanup state handling

2020-06-04 Thread Paolo Bonzini
On 04/06/20 08:42, David Gibson wrote: > This series has an assortment of cleanups to the AMD SEV memory > encryption code. Amongst other things it: > * Removes the confusion between struct SEVState and enum SevState > * Reduces use of global variables > * Unifies some ad-hoc structures

Re: [PATCH] checkpatch: reversed logic with acpi test checks

2020-06-04 Thread Paolo Bonzini
On 02/06/20 07:36, Michael S. Tsirkin wrote: > Logic reversed: allowed list should just be ignored. Instead we > only take that into account :( > > Fixes: e11b06a880ca ("checkpatch: ignore allowed diff list") > Signed-off-by: Michael S. Tsirkin > --- > scripts/checkpatch.pl | 2 +- > 1 file

[PATCH v3 1/3] python/machine.py: consolidate _post_shutdown()

2020-06-04 Thread John Snow
Move more cleanup actions into _post_shutdown. As a change, if QEMU should so happen to be terminated during a call to wait(), that event will now be logged. This is not likely to occur during normative use. Signed-off-by: John Snow --- python/qemu/machine.py | 27 +--

[PATCH v3 0/3] python/machine.py: refactor shutdown

2020-06-04 Thread John Snow
v3: - Split _post_shutdown refactor into own patch (now 1/3) - Re-add sigkill warning squelch (now 3/3) NOTE: I re-added the squelch in its own patch for review purposes, but for the purposes of avoiding temporary breakage, a maintainer may wish to squash patches 2 and 3 if they are accepted.

Re: [PATCH v8 25/62] target/riscv: vector single-width averaging add and subtract

2020-06-04 Thread Richard Henderson
On 5/21/20 2:43 AM, LIU Zhiwei wrote: > Signed-off-by: LIU Zhiwei > Reviewed-by: Alistair Francis > --- > target/riscv/helper.h | 17 > target/riscv/insn32.decode | 5 ++ > target/riscv/insn_trans/trans_rvv.inc.c | 7 ++ > target/riscv/vector_helper.c

[PATCH v3 00/16] python: add mypy support to python/qemu

2020-06-04 Thread John Snow
Based-on: 20200604195252.20739-1-js...@redhat.com This series is extracted from my larger series that attempted to bundle our python module as an installable module. These fixes don't require that, so they are being sent first as I think there's less up for debate in here. This requires my

[PATCH v3 07/16] python/machine.py: Fix monitor address typing

2020-06-04 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 simply static type analysis. To preserve our ability to clean

[PATCH v3 05/16] python/qmp.py: add casts to JSON deserialization

2020-06-04 Thread John Snow
mypy and python type hints are not powerful enough to properly describe JSON messages in Python 3.6. The best we can do, generally, is describe them as Dict[str, Any]. Add casts to coerce this type for static analysis; but do NOT enforce this type at runtime in any way. Note: Python 3.8 adds a

[PATCH v3 09/16] python/machine.py: Don't modify state in _base_args()

2020-06-04 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 ---

[PATCH v3 12/16] python/machine.py: Add _qmp access shim

2020-06-04 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 --- python/qemu/machine.py | 12 +--- 1 file changed, 9 insertions(+), 3

[PATCH v3 14/16] python/qemu: make 'args' style arguments immutable

2020-06-04 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

  1   2   3   4   >