[PATCH 0/4] qom: reduce boilerplate required for declaring and defining objects

2020-07-23 Thread Daniel P . Berrangé
To just duplicate the patch 2 message When creating new QOM types, there is a lot of boilerplate code that must be repeated using a standard pattern. This is tedious to write and liable to suffer from subtle inconsistencies. Thus it would benefit from some simple automation. QOM was loosely

Re: [PATCH 3/4] crypto: use QOM macros for declaration/definition of secret types

2020-07-23 Thread Eduardo Habkost
On Thu, Jul 23, 2020 at 07:14:09PM +0100, Daniel P. Berrangé wrote: > This introduces the use of the OBJECT_DEFINE and OBJECT_DECLARE macro > families in the secret types, in order to eliminate boilerplate code. > > Signed-off-by: Daniel P. Berrangé > --- > crypto/secret.c |

Re: [PATCH 2/3] block/nbd: on shutdown terminate connection attempt

2020-07-23 Thread Eric Blake
On 7/20/20 4:00 AM, Vladimir Sementsov-Ogievskiy wrote: On shutdown nbd driver may be in a connecting state. We should shutdown it as well, otherwise we may hang in nbd_teardown_connection, waiting for conneciton_co to finish in BDRV_POLL_WHILE(bs, s->connection_co) loop if remote server is

Re: [PATCH 1/1] s390x/protvirt: allow to IPL secure execution guests with -no-reboot

2020-07-23 Thread Cornelia Huck
On Tue, 21 Jul 2020 06:32:02 -0400 Christian Borntraeger wrote: > Right now -no-reboot does prevent secure execution guests from running. > This is right from an implementation aspect, as we have modeled the > transition from non-secure to secure as a program directed IPL. > From a user

[PATCH 1/7] spice: simplify chardev setup

2020-07-23 Thread Christophe de Dinechin
From: Gerd Hoffmann Initialize spice before chardevs. That allows to register the spice chardevs directly in the init function and removes the need to maintain a linked list of chardevs just for registration. Signed-off-by: Gerd Hoffmann Signed-off-by: Christophe de Dinechin ---

[PATCH 5/7] spice: Move all the spice-related code in spice-app.so

2020-07-23 Thread Christophe de Dinechin
If we want to build spice as a separately loadable module, we need to put all the spice code in one loadable module, because the build system does not know how to deal with dependencies yet. Signed-off-by: Christophe de Dinechin --- audio/Makefile.objs | 2 +- chardev/Makefile.objs | 3 +--

[PATCH 4/7] spice: Make spice a module configuration

2020-07-23 Thread Christophe de Dinechin
This commit changes the spice configuration 'm' by default, and moves the spice components to obj-m variables. It is sufficient to build without modules enable, but does not link correctly yet, since no shims have been created for the missing functions yet. Signed-off-by: Christophe de Dinechin

[PATCH 7/7] spice: Call qemu spice functions indirectly

2020-07-23 Thread Christophe de Dinechin
In order to be able to move all of spice in a shared library that is loaded dynamically only on demand, this commit puts the functions called by the main binary in a QemuSpiceOps structure, and use static inline stubs to preserve the call sites. With these changes, the following shared libraries

[PATCH 0/7] Make SPICE a load module

2020-07-23 Thread Christophe de Dinechin
This series builds the qemu SPICE code into a load module in order to remove the number of shared libraries that the main qemu binary depends on. It is intended to be built on the work that Gerd shared recently regarding modular devices and chardev initialization. I left the patch I used in the

[PATCH 3/7] minikconf: Pass variables for modules

2020-07-23 Thread Christophe de Dinechin
Signed-off-by: Christophe de Dinechin --- scripts/minikconf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/minikconf.py b/scripts/minikconf.py index bcd91015d3..d60add97f6 100755 --- a/scripts/minikconf.py +++ b/scripts/minikconf.py @@ -690,10 +690,10 @@ if

Re: [PATCH for-5.1 2/3] virtiofsd: add container-friendly -o chroot sandboxing option

2020-07-23 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: > On Wed, Jul 22, 2020 at 08:03:18PM +0100, Dr. David Alan Gilbert wrote: > > * Stefan Hajnoczi (stefa...@redhat.com) wrote: > > > +/* > > > + * Make the shared directory the file system root so that FUSE_OPEN > > > + * (lo_open()) cannot

Re: [PATCH] block/amend: Check whether the node exists

2020-07-23 Thread Peter Maydell
On Fri, 10 Jul 2020 at 10:51, Max Reitz wrote: > > We should check whether the user-specified node-name actually refers to > a node. The simplest way to do that is to use bdrv_lookup_bs() instead > of bdrv_find_node() (the former wraps the latter, and produces an error > message if necessary). >

Re: [RFC PATCH] s390x/pci: vfio-pci breakage with disabled mem enforcement

2020-07-23 Thread Matthew Rosato
On 7/23/20 12:29 PM, Alex Williamson wrote: On Thu, 23 Jul 2020 11:13:55 -0400 Matthew Rosato wrote: I noticed that after kernel commit abafbc55 'vfio-pci: Invalidate mmaps and block MMIO access on disabled memory' vfio-pci via qemu on s390x fails spectacularly, with errors in qemu like:

Re: [PATCH 3/3] block/nbd: nbd_co_reconnect_loop(): don't sleep if drained

2020-07-23 Thread Eric Blake
On 7/20/20 4:00 AM, Vladimir Sementsov-Ogievskiy wrote: We try to go to wakeable sleep, so that, if drain begins it will break the sleep. But what if nbd_client_co_drain_begin() already called and s->drained is already true? We'll go to sleep, and drain will have to wait for the whole timeout.

Re: [PATCH] kvm: kvm_init_vcpu take Error pointer

2020-07-23 Thread Philippe Mathieu-Daudé
On 7/23/20 6:09 PM, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Clean up the error handling in kvm_init_vcpu so we can see what went > wrong more easily. > > Make it take an Error ** and fill it out with what failed, including > the cpu id, so you can tell if it

[PULL 0/1] x86 bug fix for -rc2

2020-07-23 Thread Eduardo Habkost
The following changes since commit 8ffa52c20d5693d454f65f2024a1494edfea65d4: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2020-07-23 13:38:21 +0100) are available in the Git repository at: git://github.com/ehabkost/qemu.git tags/x86-next-for-5.1-pull-request

[PATCH-for-5.1? v2] qapi/error: Check format string argument in error_*prepend()

2020-07-23 Thread Philippe Mathieu-Daudé
error_propagate_prepend() "behaves like error_prepend()", and error_prepend() uses "formatting @fmt, ... like printf()". error_prepend() checks its format string argument, but error_propagate_prepend() does not. Fix by addint the format attribute to error_propagate_prepend() and error_vprepend().

[PATCH-for-5.1] libvhost-user: Report descriptor index on panic

2020-07-23 Thread Philippe Mathieu-Daudé
We want to report the index of the descriptor, not its pointer. Fixes: 7b2e5c65f4 ("contrib: add libvhost-user") Signed-off-by: Philippe Mathieu-Daudé --- contrib/libvhost-user/libvhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v7 36/47] nbd: Use CAF when looking for dirty bitmap

2020-07-23 Thread Andrey Shinkevich
On 25.06.2020 18:22, Max Reitz wrote: When looking for a dirty bitmap to share, we should handle filters by just including them in the search (so they do not break backing chains). Signed-off-by: Max Reitz --- nbd/server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 2/7] build: fix device module builds

2020-07-23 Thread Christophe de Dinechin
From: Gerd Hoffmann See comment. Feels quite hackish. Better ideas anyone? Signed-off-by: Gerd Hoffmann Signed-off-by: Christophe de Dinechin --- dtc | 2 +- roms/SLOF | 2 +- roms/openbios | 2 +- roms/opensbi | 2 +- roms/seabios | 2 +- slirp | 2 +- 6 files

Re: [PATCH] ACPI: Assert that we don't run out of the preallocated memory

2020-07-23 Thread Peter Maydell
On Mon, 22 Jun 2020 at 12:30, Dongjiu Geng wrote: > > data_length is a constant value, so we use assert instead of > condition check. > > Signed-off-by: Dongjiu Geng > --- > 1. Address Peter and Michael's comments to use assert instead of if(). >

[PATCH 6/7] build: Add SPICE_CFLAGS and SPICE_LIBS to relevant files

2020-07-23 Thread Christophe de Dinechin
Instead of adding the spice build flags to the top-level build options, add them where they are necessary. This is a step to move the burden of linking with spice libraries away from the top-level qemu. Signed-off-by: Christophe de Dinechin --- configure| 4 ++--

Re: [PATCH-for-5.1] libvhost-user: Report descriptor index on panic

2020-07-23 Thread Marc-André Lureau
On Thu, Jul 23, 2020 at 9:19 PM Philippe Mathieu-Daudé wrote: > > We want to report the index of the descriptor, > not its pointer. > > Fixes: 7b2e5c65f4 ("contrib: add libvhost-user") > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau > --- >

[PATCH 1/4] qom: make object_ref/unref use a void * instead of Object *.

2020-07-23 Thread Daniel P . Berrangé
The object_ref/unref methods are intended for use with any subclass of the base Object. Using "Object *" in the signature is not adding any meaningful level of type safety, since callers simply use "OBJECT(ptr)" and this expands to an unchecked cast "(Object *)". By using "void *" we enable the

[PATCH 4/4] crypto: use QOM macros for declaration/definition of TLS creds types

2020-07-23 Thread Daniel P . Berrangé
This introduces the use of the OBJECT_DEFINE and OBJECT_DECLARE macro families in the TLS creds types, in order to eliminate boilerplate code. Signed-off-by: Daniel P. Berrangé --- crypto/tlscreds.c | 25 +++-- crypto/tlscredsanon.c | 23

[PATCH 2/4] qom: provide convenient macros for declaring and defining types

2020-07-23 Thread Daniel P . Berrangé
When creating new QOM types, there is a lot of boilerplate code that must be repeated using a standard pattern. This is tedious to write and liable to suffer from subtle inconsistencies. Thus it would benefit from some simple automation. QOM was loosely inspired by GLib's GObject, and indeed

Re: [PATCH 1/4] qom: make object_ref/unref use a void * instead of Object *.

2020-07-23 Thread Eric Blake
On 7/23/20 1:14 PM, Daniel P. Berrangé wrote: The object_ref/unref methods are intended for use with any subclass of the base Object. Using "Object *" in the signature is not adding any meaningful level of type safety, since callers simply use "OBJECT(ptr)" and this expands to an unchecked cast

Re: [PATCH v2 12/22] qemu-iotests/199: fix style

2020-07-23 Thread Eric Blake
On 2/17/20 9:02 AM, Vladimir Sementsov-Ogievskiy wrote: Mostly, satisfy pep8 complains. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/199 | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) With none of your series applied, I get: $ ./check -qcow2 199

Re: [PATCH v0 3/4] migration: add background snapshot

2020-07-23 Thread Peter Xu
On Wed, Jul 22, 2020 at 11:11:32AM +0300, Denis Plotnikov wrote: > +static void *background_snapshot_thread(void *opaque) > +{ > +MigrationState *m = opaque; > +QIOChannelBuffer *bioc; > +QEMUFile *fb; > +int res = 0; > + > +rcu_register_thread(); > + > +

Re: [PATCH v0 2/4] migration: add background snapshot capability

2020-07-23 Thread Peter Xu
On Wed, Jul 22, 2020 at 11:11:31AM +0300, Denis Plotnikov wrote: > diff --git a/migration/migration.c b/migration/migration.c > index 2ed9923227..2ec0451abe 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -1086,6 +1086,32 @@ static bool migrate_caps_check(bool *cap_list, >

[PATCH v2] linux-user: Add most IFTUN ioctls

2020-07-23 Thread Shu-Chun Weng
The three options handling `struct sock_fprog` (TUNATTACHFILTER, TUNDETACHFILTER, and TUNGETFILTER) are not implemented. Linux kernel keeps a user space pointer in them which we cannot correctly handle. Signed-off-by: Josh Kunz Signed-off-by: Shu-Chun Weng --- v2: Title changed from

[Bug 1888728] Re: Bare chroot in linux-user fails with pgb_reserved_va: Assertion `guest_base != 0' failed.

2020-07-23 Thread Laurent Vivier
** Tags added: linux-user -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1888728 Title: Bare chroot in linux-user fails with pgb_reserved_va: Assertion `guest_base != 0' failed. Status in QEMU:

Re: Testing the virtio-vhost-user QEMU patch

2020-07-23 Thread Alyssa Ross
Stefan Hajnoczi writes: > On Tue, Jul 21, 2020 at 07:14:38AM +, Alyssa Ross wrote: >> Hi -- I hope it's okay me reaching out like this. >> >> I've been trying to test out the virtio-vhost-user implementation that's >> been posted to this list a couple of times, but have been unable to get

Re: [PATCH v2 2/3] trace: Add support for recorder back-end

2020-07-23 Thread Christophe de Dinechin
On 2020-06-30 at 15:02 CEST, Daniel P. Berrangé wrote... > On Fri, Jun 26, 2020 at 06:27:05PM +0200, Christophe de Dinechin wrote: >> The recorder library provides support for low-cost continuous >> recording of events, which can then be replayed. This makes it >> possible to collect data "after

Re: [PATCH for-5.1 1/2] Revert "tpm: Clean up error reporting in tpm_init_tpmdev()"

2020-07-23 Thread Philippe Mathieu-Daudé
On 7/23/20 1:58 PM, Markus Armbruster wrote: > This reverts commit d10e05f15d5c3dd5e5cc59c5dfff460d89d48580. > > We report some -tpmdev failures, but then continue as if all was fine. > Reproducer: > > $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -chardev > null,id=tpm0

Re: [PATCH for-5.1 2/2] tpm: Improve help on TPM types when none are available

2020-07-23 Thread Philippe Mathieu-Daudé
On 7/23/20 1:58 PM, Markus Armbruster wrote: > Help is a bit awkward when no TPM types are built into QEMU: > > $ upstream-qemu -tpmdev nonexistent,id=tpm0 > upstream-qemu: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a > TPM backend type > Supported TPM types (choose only

Re: [PATCH 13/13] ssh: add GUri-based URI parsing

2020-07-23 Thread Marc-André Lureau
Hi On Thu, Jul 23, 2020 at 4:33 PM Richard W.M. Jones wrote: > On Thu, Jul 09, 2020 at 11:42:34PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > block/ssh.c | 75 + > > 1 file changed, 58 insertions(+), 17

Re: 5.1.0-rc1 regression: reset fails with kvm and -cpu host

2020-07-23 Thread Jan Kiszka
On 23.07.20 14:52, Dr. David Alan Gilbert wrote: * Vitaly Kuznetsov (vkuzn...@redhat.com) wrote: Philippe Mathieu-Daudé writes: +Vitaly On 7/23/20 10:40 AM, Dr. David Alan Gilbert wrote: * Eduardo Habkost (ehabk...@redhat.com) wrote: On Wed, Jul 22, 2020 at 04:47:32PM -0400, Eduardo

Re: [PATCH-for-5.1?] qapi/error: Check format string argument in error_propagate_prepend()

2020-07-23 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > error_propagate_prepend() "behaves like error_prepend()", and > error_prepend() uses "formatting @fmt, ... like printf()". > error_prepend() checks its format string argument, but > error_propagate_prepend() does not. Fix that. > > This would have catched the

Re: [PATCH] acpi: Fix access to PM1 control and status registers

2020-07-23 Thread Anthony PERARD
On Thu, Jul 23, 2020 at 08:44:27AM -0400, Michael S. Tsirkin wrote: > On Fri, Jul 10, 2020 at 10:42:58AM +0100, Anthony PERARD wrote: > > On Thu, Jul 02, 2020 at 07:12:08AM -0400, Michael S. Tsirkin wrote: > > > memory: align to min access size > > > > > > If impl.min_access_size >

[PATCH v4 2/2] trace: Example of non-tracing recorder use

2020-07-23 Thread Christophe de Dinechin
This patch is a simple example showing how the recorder can be used to have one "topic" covering multiple entries. Here, the topic is "lock", the idea being to have the latest lock changes for instance in case of a crash or hang. Here are a few use cases: * Tracing lock updates:

Re: [PATCH v2 20/20] simplebench: add bench-backup.py

2020-07-23 Thread Max Reitz
On 01.06.20 20:11, Vladimir Sementsov-Ogievskiy wrote: > Add script to benchmark new backup architecture. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > scripts/simplebench/bench-backup.py | 132 > 1 file changed, 132 insertions(+) > create mode 100755

Re: [PATCH v2 2/3] trace: Add support for recorder back-end

2020-07-23 Thread Markus Armbruster
Christophe de Dinechin writes: > On 2020-06-30 at 15:02 CEST, Daniel P. Berrangé wrote... >> On Fri, Jun 26, 2020 at 06:27:05PM +0200, Christophe de Dinechin wrote: >>> The recorder library provides support for low-cost continuous >>> recording of events, which can then be replayed. This makes

[PATCH 0/2] ppc: Enable 2nd DAWR support on p10

2020-07-23 Thread Ravi Bangoria
This series enables 2nd DAWR support on p10 qemu/kvm guest. This series depends on kernel patches: https://lore.kernel.org/linuxppc-dev/20200723102058.312282-1-ravi.bango...@linux.ibm.com Patches apply fine on qemu/master branch (c8004fe6bbfc) Ravi Bangoria (2): ppc: Rename current DAWR macros

[PATCH 1/2] ppc: Rename current DAWR macros

2020-07-23 Thread Ravi Bangoria
Power10 is introducing second DAWR. Use real register names (with suffix 0) from ISA for current macros. Signed-off-by: Ravi Bangoria --- include/hw/ppc/spapr.h | 2 +- linux-headers/asm-powerpc/kvm.h | 4 ++-- target/ppc/cpu.h| 4 ++-- target/ppc/translate_init.inc.c |

Re: [PATCH v2 3/7] target/riscv: Generate nanboxed results from trans_rvf.inc.c

2020-07-23 Thread LIU Zhiwei
On 2020/7/24 8:28, Richard Henderson wrote: Make sure that all results from inline single-precision scalar operations are properly nan-boxed to 64-bits. Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvf.inc.c | 4 1 file changed, 4 insertions(+) diff --git

Re: [PATCH v2 2/7] target/riscv: Generalize gen_nanbox_fpr to gen_nanbox_s

2020-07-23 Thread LIU Zhiwei
On 2020/7/24 8:28, Richard Henderson wrote: Do not depend on the RVD extension, take input and output via TCGv_i64 instead of fpu regno. Move the function to translate.c so that it can be used in multiple trans_*.inc.c files. Signed-off-by: Richard Henderson ---

Re: [PATCH v2 4/7] target/riscv: Check nanboxed inputs to fp helpers

2020-07-23 Thread LIU Zhiwei
On 2020/7/24 8:28, Richard Henderson wrote: If a 32-bit input is not properly nanboxed, then the input is replaced with the default qnan. Signed-off-by: Richard Henderson --- target/riscv/internals.h | 11 +++ target/riscv/fpu_helper.c | 64 ---

[for-5.2 v4 10/10] s390: Recognize host-trust-limitation option

2020-07-23 Thread David Gibson
At least some s390 cpu models support "Protected Virtualization" (PV), a mechanism to protect guests from eavesdropping by a compromised hypervisor. This is similar in function to other mechanisms like AMD's SEV and POWER's PEF, which are controlled bythe "host-trust-limitation" machine option.

Re: [PATCH v2 4/7] target/riscv: Check nanboxed inputs to fp helpers

2020-07-23 Thread Richard Henderson
On 7/23/20 7:47 PM, LIU Zhiwei wrote: > > > On 2020/7/24 8:28, Richard Henderson wrote: >> If a 32-bit input is not properly nanboxed, then the input is >> replaced with the default qnan. >> >> Signed-off-by: Richard Henderson >> --- >>   target/riscv/internals.h  | 11 +++ >>  

[Bug 1888431] Re: v5.1.0-rc1 build fails on Mac OS X 10.11.6

2020-07-23 Thread Thomas Huth
Hmm, let's see ... the work-arounds for old Mac OS X versions have been removed here: https://git.qemu.org/?p=qemu.git;a=commitdiff;h=483644c25b932360018 It mentiones that this commit has broken compilation earlier: https://git.qemu.org/?p=qemu.git;a=commitdiff;h=50290c002c045280f8d ... so the

Re: [PATCH v2 08/22] migration/block-dirty-bitmap: keep bitmap state for all bitmaps

2020-07-23 Thread Vladimir Sementsov-Ogievskiy
24.07.2020 00:30, Eric Blake wrote: On 2/17/20 9:02 AM, Vladimir Sementsov-Ogievskiy wrote: Keep bitmap state for disabled bitmaps too. Keep the state until the end of the process. It's needed for the following commit to implement bitmap postcopy canceling. To clean-up the new list the

[PATCH 0/7] IDE: SRST and other fixes

2020-07-23 Thread John Snow
The goal of this series is to fix the Software Reset (SRST) routine. That said, the first six patches are almost entirely unrelated... Patches 2, 3, and 6 fix extremely minor deviations from the spec I noticed while researching SRST. (One of them gets rid of a FIXME from 2003.) Patches 1, 4, and

[PATCH 7/7] ide: cancel pending callbacks on SRST

2020-07-23 Thread John Snow
The SRST implementation did not keep up with the rest of IDE; it is possible to perform a weak reset on an IDE device to remove the BSY/DRQ bits, and then issue writes to the control/device registers which can cause chaos with the state machine. Fix that by actually performing a real reset.

Avocado error fetching QEMU boot_linux.py assets

2020-07-23 Thread Philippe Mathieu-Daudé
Hi, [cross list post] Using QEMU at commit 3cbc8970f5 I'm getting this error: Fetching assets from tests/acceptance/boot_linux_console.py. Fetching assets from tests/acceptance/boot_linux.py. Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in

Re: [PATCH v2 0/7] target/riscv: NaN-boxing for multiple precison

2020-07-23 Thread LIU Zhiwei
On 2020/7/24 8:28, Richard Henderson wrote: This is my take on Liu Zhiwei's patch set: https://patchew.org/QEMU/20200626205917.4545-1-zhiwei_...@c-sky.com This differs from Zhiwei's v1 in: * If a helper is involved, the helper does the boxing and unboxing. * Which leaves only LDW and

[for-5.2 v4 02/10] host trust limitation: Handle memory encryption via interface

2020-07-23 Thread David Gibson
At the moment AMD SEV sets a special function pointer, plus an opaque handle in KVMState to let things know how to encrypt guest memory. Now that we have a QOM interface for handling things related to host trust limitation, use a QOM method on that interface, rather than a bare function pointer

[for-5.2 v4 03/10] host trust limitation: Move side effect out of machine_set_memory_encryption()

2020-07-23 Thread David Gibson
When the "memory-encryption" property is set, we also disable KSM merging for the guest, since it won't accomplish anything. We want that, but doing it in the property set function itself is thereoretically incorrect, in the unlikely event of some configuration environment that set the property

[for-5.2 v4 06/10] host trust limitation: Add Error ** to HostTrustLimitation::kvm_init

2020-07-23 Thread David Gibson
This allows failures to be reported richly and idiomatically. Signed-off-by: David Gibson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/kvm/kvm-all.c | 4 +++- include/exec/host-trust-limitation.h | 2 +- target/i386/sev.c|

[for-5.2 v4 07/10] spapr: Add PEF based host trust limitation

2020-07-23 Thread David Gibson
Some upcoming POWER machines have a system called PEF (Protected Execution Facility) which uses a small ultravisor to allow guests to run in a way that they can't be eavesdropped by the hypervisor. The effect is roughly similar to AMD SEV, although the mechanisms are quite different. Most of the

[for-5.2 v4 08/10] spapr: PEF: block migration

2020-07-23 Thread David Gibson
We haven't yet implemented the fairly involved handshaking that will be needed to migrate PEF protected guests. For now, just use a migration blocker so we get a meaningful error if someone attempts this (this is the same approach used by AMD SEV). Signed-off-by: David Gibson ---

[for-5.2 v4 09/10] host trust limitation: Alter virtio default properties for protected guests

2020-07-23 Thread David Gibson
The default behaviour for virtio devices is not to use the platforms normal DMA paths, but instead to use the fact that it's running in a hypervisor to directly access guest memory. That doesn't work if the guest's memory is protected from hypervisor access, such as with AMD's SEV or POWER's PEF.

[for-5.2 v4 01/10] host trust limitation: Introduce new host trust limitation interface

2020-07-23 Thread David Gibson
Several architectures have mechanisms which are designed to protect guest memory from interference or eavesdropping by a compromised hypervisor. AMD SEV does this with in-chip memory encryption and Intel has a similar mechanism. POWER's Protected Execution Framework (PEF) accomplishes a similar

Re: [PATCH v1] hw/pci-host: save/restore pci host config register

2020-07-23 Thread Wangjing (Hogan, Cloud Infrastructure Service Product Dept.)
On Sat, Jul 25, 2020 at 10:53:03AM Hogan Wang wrote: > * Michael S. Tsirkin (m...@redhat.com) wrote: > > On Thu, Jul 23, 2020 at 02:12:54PM +0100, Dr. David Alan Gilbert wrote: > > > * Michael S. Tsirkin (m...@redhat.com) wrote: > > > > On Thu, Jul 23, 2020 at 08:53:03PM +0800, Hogan Wang wrote: >

Re: [PATCH 2/2] e1000e: make TX reentrant

2020-07-23 Thread Jason Wang
On 2020/7/23 下午6:36, Peter Maydell wrote: On Wed, 22 Jul 2020 at 10:00, Jason Wang wrote: In loopback mode, e1000e RX can DMA into TX doorbell which requires TX to be reentrant. This patch make e1000e's TX routine reentrant by introducing a per device boolean for recording whether or not a

[Bug 1888601] Re: QEMU v5.1.0-rc0/rc1 hang with nested virtualization

2020-07-23 Thread Simon Kaegi
I believe the VSI itself is QEMU based but don't know the version or details but suspect it's 4.1 based. We compile our own QEMU version for use with Kata and that's where we're now using 5.1.0-rc1 with the above commit reverted. Host Kernel is ... 4.15.0-101-generic if that helps re: cpu --

[PATCH v5 6/6] target/ppc: add vmsumudm vmsumcud instructions

2020-07-23 Thread Lijun Pan
vmsumudm (Power ISA 3.0) - Vector Multiply-Sum Unsigned Doubleword Modulo VA-form. vmsumcud (Power ISA 3.1) - Vector Multiply-Sum & write Carry-out Unsigned Doubleword VA-form. Signed-off-by: Lijun Pan --- v5: update instruction flag for vmsumcud. integrate into this isa3.1 patch series v3:

[PATCH v5 1/6] Update PowerPC AT_HWCAP2 definition

2020-07-23 Thread Lijun Pan
Add PPC2_FEATURE2_ARCH_3_10 to the PowerPC AT_HWCAP2 definitions. Signed-off-by: Lijun Pan --- v5: match the definition with that in linux's arch/powerpc/include/uapi/asm/cputable.h v4: add missing changes, and split to 5/11, 6/11, 7/11 v3: use tcg_gen_gvec_mul() v2: fix coding style use

[PATCH v5 0/6] Add several Power ISA 3.1 32/64-bit vector instructions

2020-07-23 Thread Lijun Pan
This patch series add several newly introduced 32/64-bit vector instructions in Power ISA 3.1. Power ISA 3.1 flag is introduced in this version. In v4 version, coding style issues are fixed, community reviews/suggestions are taken into consideration. 1/11 - 5/11 of v4 were accepted by David

[PATCH v5 4/6] target/ppc: add vmulh{su}d instructions

2020-07-23 Thread Lijun Pan
vmulhsd: Vector Multiply High Signed Doubleword vmulhud: Vector Multiply High Unsigned Doubleword Signed-off-by: Lijun Pan --- v4/v5: no change Reviewed-by: Richard Henderson v3: simplify helper_vmulh{su}d v2: fix coding style use Power ISA 3.1 flag target/ppc/helper.h |

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

2020-07-23 Thread David Gibson
On Thu, Jul 23, 2020 at 04:12:20PM +0530, Ravi Bangoria wrote: > As per the PAPR, bit 0 of byte 64 in pa-features property indicates > availability of 2nd DAWR registers. i.e. If this bit is set, 2nd > DAWR is present, otherwise not. Use KVM_CAP_PPC_DAWR1 capability to > find whether kvm supports

[PATCH 3/7] ide: model HOB correctly

2020-07-23 Thread John Snow
I have been staring at this FIXME for years and I never knew what it meant. I finally stumbled across it! When writing to the command registers, the old value is shifted into a HOB copy of the register and the new value is written into the primary register. When reading registers, the value

[Bug 1888601] Re: QEMU v5.1.0-rc0/rc1 hang with nested virtualization

2020-07-23 Thread Jason Wang
Hi: It's not clear to me: - Is the hang happen on the host or L1 guest? - Is qemu 5.1-rc0 used on the host or L1 guest? - When did you see the hung, just after launching the guest? - Can you use gdb to get a calltrace of qemu when you see the hang? - What's the version of kernel in L1 and L2

Re: Avocado error fetching QEMU boot_linux.py assets

2020-07-23 Thread Philippe Mathieu-Daudé
On 7/24/20 7:43 AM, Philippe Mathieu-Daudé wrote: > Hi, > > [cross list post] > > Using QEMU at commit 3cbc8970f5 I'm getting this error: > > Fetching assets from tests/acceptance/boot_linux_console.py. > Fetching assets from tests/acceptance/boot_linux.py. > Traceback (most recent call last):

Re: [PATCH v2 1/7] target/riscv: Generate nanboxed results from fp helpers

2020-07-23 Thread LIU Zhiwei
On 2020/7/24 8:28, Richard Henderson wrote: Make sure that all results from single-precision scalar helpers are properly nan-boxed to 64-bits. Signed-off-by: Richard Henderson --- target/riscv/internals.h | 5 + target/riscv/fpu_helper.c | 42 +--

[for-5.2 v4 00/10] Generalize memory encryption models

2020-07-23 Thread David Gibson
A number of hardware platforms are implementing mechanisms whereby the hypervisor does not have unfettered access to guest memory, in order to mitigate the security impact of a compromised hypervisor. AMD's SEV implements this with in-cpu memory encryption, and Intel has its own memory encryption

[for-5.2 v4 05/10] host trust limitation: Decouple kvm_memcrypt_*() helpers from KVM

2020-07-23 Thread David Gibson
The kvm_memcrypt_enabled() and kvm_memcrypt_encrypt_data() helper functions don't conceptually have any connection to KVM (although it's not possible in practice to use them without it). They also rely on looking at the global KVMState. But the same information is available from the machine, and

[for-5.2 v4 04/10] host trust limitation: Rework the "memory-encryption" property

2020-07-23 Thread David Gibson
Currently the "memory-encryption" property is only looked at once we get to kvm_init(). Although protection of guest memory from the hypervisor isn't something that could really ever work with TCG, it's not conceptually tied to the KVM accelerator. In addition, the way the string property is

Re: [PATCH v2 1/7] target/riscv: Generate nanboxed results from fp helpers

2020-07-23 Thread Richard Henderson
On 7/23/20 7:35 PM, LIU Zhiwei wrote: > > > On 2020/7/24 8:28, Richard Henderson wrote: >> Make sure that all results from single-precision scalar helpers >> are properly nan-boxed to 64-bits. >> >> Signed-off-by: Richard Henderson >> --- >>   target/riscv/internals.h  |  5 + >>  

Re: [PATCH] hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES

2020-07-23 Thread Thomas Huth
On 23/07/2020 21.24, Peter Maydell wrote: > virtio-input-hid.c undefines CONFIG_CURSES before including > ui/console.h. However since commits e2f82e924d057935 and b0766612d16da18 > that header does not have behaviour dependent on CONFIG_CURSES. > Remove the now-unneeded undef. > > Signed-off-by:

[PATCH v5 5/6] target/ppc: add vdiv{su}{wd} vmod{su}{wd} instructions

2020-07-23 Thread Lijun Pan
vdivsw: Vector Divide Signed Word vdivuw: Vector Divide Unsigned Word vdivsd: Vector Divide Signed Doubleword vdivud: Vector Divide Unsigned Doubleword vmodsw: Vector Modulo Signed Word vmoduw: Vector Modulo Unsigned Word vmodsd: Vector Modulo Signed Doubleword vmodud: Vector Modulo Unsigned

[PATCH v5 2/6] target/ppc: add vmulld to INDEX_op_mul_vec case

2020-07-23 Thread Lijun Pan
Group vmuluwm and vmulld. Make vmulld-specific changes since it belongs to new ISA 3.1. Signed-off-by: Lijun Pan --- v5: no change v4: add missing changes, and split to 5/11, 6/11, 7/11 v3: use tcg_gen_gvec_mul() v2: fix coding style use Power ISA 3.1 flag tcg/ppc/tcg-target.h | 2 ++

[PATCH v5 3/6] target/ppc: add vmulh{su}w instructions

2020-07-23 Thread Lijun Pan
vmulhsw: Vector Multiply High Signed Word vmulhuw: Vector Multiply High Unsigned Word Signed-off-by: Lijun Pan --- v4/v5: no change Reviewed-by: Richard Henderson v3: inline the helper_vmulh{su}w multiply directly instead of using macro v2: fix coding style use Power ISA 3.1 flag

[PATCH 4/7] ide: reorder set/get sector functions

2020-07-23 Thread John Snow
Reorder these just a pinch to make them more obvious at a glance what the addressing mode is. Signed-off-by: John Snow --- hw/ide/core.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index a880b91b47..f35864070b

[PATCH 2/7] ide: don't tamper with the device register

2020-07-23 Thread John Snow
In real ISA operation, register writes go out to an entire bus channel and all listening devices receive the write. The devices do not toggle the DEV bit based on their own configuration, nor does the HBA intermediate or tamper with that value. The reality of the matter is that DEV0/DEV1

[PATCH 1/7] ide: rename cmd_write to ctrl_write

2020-07-23 Thread John Snow
It's the Control register, part of the Control block -- Command is misleading here. Rename all related functions and constants. Signed-off-by: John Snow --- include/hw/ide/internal.h | 9 + hw/ide/core.c | 12 ++-- hw/ide/ioport.c | 2 +- hw/ide/macio.c

[PATCH 6/7] ide: clear interrupt on command write

2020-07-23 Thread John Snow
Not known to fix any bug, but I couldn't help but notice that ATA specifies that writing to this register should clear an interrupt. ATA7: Section 5.3.3 (Command register - Effect) ATA6: Section 7.4.4 (Command register - Effect) ATA5: Section 7.4.4 (Command register - Effect) ATA4: Section 7.4.4

[PATCH 5/7] ide: remove magic constants from the device register

2020-07-23 Thread John Snow
(In QEMU, we call this the "select" register.) My memory isn't good enough to memorize what these magic runes do. Label them to prevent mixups from happening in the future. Side note: I assume it's safe to always set 0xA0 even though ATA2 claims these bits are reserved, because ATA3 immediately

[PATCH] hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES

2020-07-23 Thread Peter Maydell
virtio-input-hid.c undefines CONFIG_CURSES before including ui/console.h. However since commits e2f82e924d057935 and b0766612d16da18 that header does not have behaviour dependent on CONFIG_CURSES. Remove the now-unneeded undef. Signed-off-by: Peter Maydell --- NB: tested with 'make check' only.

Re: [PATCH v11 01/11] qcow2: Fix capitalization of header extension constant.

2020-07-23 Thread Eric Blake
On 7/17/20 3:14 AM, Andrey Shinkevich wrote: Make the capitalization of the hexadecimal numbers consistent for the QCOW2 header extension constants in docs/interop/qcow2.txt. Suggested-by: Eric Blake Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy ---

[PATCH-for-5.1] gitlab-ci: Fix Avocado cache

2020-07-23 Thread Philippe Mathieu-Daudé
In commit 6957fd98dc ("gitlab: add avocado asset caching") we tried to save the Avocado cache (as in commit c1073e44b4 with Travis-CI) however it doesn't work as expected. For some reason Avocado uses /root/avocado_cache/ which we can not select later. Manually generate a Avocado config to force

[Bug 1888728] [NEW] Bare chroot in linux-user fails with pgb_reserved_va: Assertion `guest_base != 0' failed.

2020-07-23 Thread John Paul Adrian Glaubitz
Public bug reported: Trying to run a bare chroot with no additional bind mounts fails on git master (8ffa52c20d5693d454f65f2024a1494edfea65d4) with: root@nofan:~/qemu> chroot /local_scratch/sid-m68k-sbuild/ qemu-m68k-static: /root/qemu/linux-user/elfload.c:2315: pgb_reserved_va: Assertion

Re: [PATCH v2 02/22] migration/block-dirty-bitmap: rename state structure types

2020-07-23 Thread Eric Blake
On 2/17/20 9:02 AM, Vladimir Sementsov-Ogievskiy wrote: Rename types to be symmetrical for load/save part and shorter. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/block-dirty-bitmap.c | 68 ++ 1 file changed, 36 insertions(+), 32 deletions(-)

[PATCH v2 3/3] linux-user: Add strace support for printing arguments for ioctls used for terminals and serial lines

2020-07-23 Thread Filip Bozuta
Functions "print_ioctl()" and "print_syscall_ret_ioctl()" are used to print arguments of "ioctl()" with "-strace". These functions use "thunk_print()", which is defined in "thunk.c", to print the contents of ioctl's third arguments that are not basic types. However, this function doesn't handle

[PATCH v2 0/3] Adding support for printing contents of 'struct termios' which is used by ioctls of group 'ioctl_tty'

2020-07-23 Thread Filip Bozuta
This series introduces strace printing functionality for contents of 'struct termios'. The first patch in the series introduces a generic 'termbits.h' file for some architectures which have same 'struct termios' flag values and 'ioctl_tty' definitions. The second patch introduces some missing

Re: [PATCH 2/4] qom: provide convenient macros for declaring and defining types

2020-07-23 Thread Eric Blake
On 7/23/20 1:14 PM, Daniel P. Berrangé wrote: When creating new QOM types, there is a lot of boilerplate code that must be repeated using a standard pattern. This is tedious to write and liable to suffer from subtle inconsistencies. Thus it would benefit from some simple automation. QOM was

Re: [PATCH v11 00/11] iotests: Dump QCOW2 dirty bitmaps metadata

2020-07-23 Thread Eric Blake
On 7/17/20 3:14 AM, Andrey Shinkevich wrote: Add dirty bitmap information to QCOW2 metadata dump in the qcow2_format.py. v10: 01: Fixing of issues in QCOW2 extension classes noted by Vladimir. 02: Reading bitmap tables was moved into Qcow2BitmapTable class. 03: Handling '-j' key was

Re: [PATCH v11 00/11] iotests: Dump QCOW2 dirty bitmaps metadata

2020-07-23 Thread Eric Blake
On 7/23/20 2:42 PM, Eric Blake wrote: On 7/17/20 3:14 AM, Andrey Shinkevich wrote: Add dirty bitmap information to QCOW2 metadata dump in the qcow2_format.py.   block/qcow2.c  |   2 +-   docs/interop/qcow2.txt |   2 +-   tests/qemu-iotests/qcow2.py    | 

Re: [PATCH v4 2/4] block/nbd: define new max_write_zero_fast limit

2020-07-23 Thread Eric Blake
On 6/11/20 11:26 AM, Vladimir Sementsov-Ogievskiy wrote: The NBD spec was recently updated to clarify that max_block doesn't relate to NBD_CMD_WRITE_ZEROES with NBD_CMD_FLAG_FAST_ZERO (which mirrors Qemu flag BDRV_REQ_NO_FALLBACK). bs->bl.max_write_zero_fast is zero by default which means using

Re: [PATCH v2 03/22] migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup

2020-07-23 Thread Eric Blake
On 2/19/20 8:20 AM, Vladimir Sementsov-Ogievskiy wrote: 18.02.2020 14:00, Andrey Shinkevich wrote: On 17/02/2020 18:02, Vladimir Sementsov-Ogievskiy wrote: Rename dirty_bitmap_mig_cleanup to dirty_bitmap_do_save_cleanup, to stress that it is on save part. Signed-off-by: Vladimir

<    1   2   3   4   >