[PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-11-15 Thread Fangrui Song
For lld, --image-base is the preferred way to set the base address. lld does not actually implement -Ttext-segment, but treats it as an alias for -Ttext. -Ttext-segment=0x6000 combined with --no-rosegment can create a 1.6GB executable. Fix the problem by using --image-base for lld. GNU ld and

Re: [PATCH] qemu-nbd: Document benefit of --pid-file

2019-11-15 Thread Eric Blake
On 10/8/19 8:38 AM, Daniel P. Berrangé wrote: On Tue, Oct 08, 2019 at 08:28:16AM -0500, Eric Blake wrote: On 10/8/19 4:40 AM, Vladimir Sementsov-Ogievskiy wrote: 08.10.2019 12:24, Daniel P. Berrangé wrote: On Mon, Oct 07, 2019 at 02:48:40PM -0500, Eric Blake wrote: One benefit of --pid-file

Re: [PATCH] hw: add compat machines for 5.0

2019-11-15 Thread Eduardo Habkost
CCing Jiri. On Fri, Nov 15, 2019 at 09:08:37AM -0500, Michael S. Tsirkin wrote: > On Tue, Nov 12, 2019 at 11:48:11AM +0100, Cornelia Huck wrote: > > Add 5.0 machine types for arm/i440fx/q35/s390x/spapr. > > > > For i440fx and q35, unversioned cpu models are still translated > > to -v1; I'll

[PATCH] Fix incorrect int->float conversions caught by clang -Wimplicit-int-float-conversion

2019-11-15 Thread Fangrui Song
The warning will be enabled by default in clang 10. It is not available for clang <= 9. qemu/migration/migration.c:2038:24: error: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion] ...

Re: [PATCH v2 for-5.0 0/8] ppc: Consolidate QOM links and pointers to the same object

2019-11-15 Thread David Gibson
On Fri, Nov 15, 2019 at 04:55:21PM +0100, Greg Kurz wrote: > There's a recurring pattern in the code where a const link is added to a > newly instanciated object and the link is then used in the object's realize > function to keep a pointer to the QOM entity which the link points to. > > void

Re: [RESEND PATCH v21 3/6] ACPI: Add APEI GHES table generation support

2019-11-15 Thread gengdongjiu
> On Fri, 15 Nov 2019 14:32:47 + > gengdongjiu wrote: > > > > > + */ > > > > +static void acpi_ghes_build_notify(GArray *table, const uint8_t > > > > +type) > > > > > > typically format should be build_WHAT(), so > > > build_ghes_hw_error_notification() > > > > > > And I'd move this out

[Bug 1846427] Re: 4.1.0: qcow2 corruption on savevm/quit/loadvm cycle

2019-11-15 Thread Michael Weiser
I have been dragging my feet exposing my production VMs to a patched 4.1.0 TBH. I have now taken the opportunity to upgrade from 4.0.0 to a 4.1.0 with the fix patches applied. As expected, I can not produce any image corruption with the reproducer I've been using all along. I will now use it in

Re: [PATCH v7 8/8] Acceptance test: add "boot_linux" tests

2019-11-15 Thread Cleber Rosa
On Tue, Nov 12, 2019 at 07:20:38PM +0100, Philippe Mathieu-Daudé wrote: > On 11/4/19 4:13 PM, Cleber Rosa wrote: > > This acceptance test, validates that a full blown Linux guest can > > successfully boot in QEMU. In this specific case, the guest chosen is > > Fedora version 31. > > > > *

Re: [PATCH v7 8/8] Acceptance test: add "boot_linux" tests

2019-11-15 Thread Cleber Rosa
On Fri, Nov 08, 2019 at 05:42:14PM -0200, Wainer dos Santos Moschetta wrote: > > On 11/4/19 1:13 PM, Cleber Rosa wrote: > > This acceptance test, validates that a full blown Linux guest can > > successfully boot in QEMU. In this specific case, the guest chosen is > > Fedora version 31. > > > >

Re: [PATCH v7 7/8] Acceptance tests: depend on qemu-img

2019-11-15 Thread Cleber Rosa
On Thu, Nov 07, 2019 at 06:31:03PM -0200, Wainer dos Santos Moschetta wrote: > > On 11/4/19 1:13 PM, Cleber Rosa wrote: > > Tests using the avocado.utils.vmimage library make use of qemu-img, > > and because it makes sense to use the version matching the rest of the > > source code, let's make

Re: [PATCH] Semihost SYS_READC implementation (v4)

2019-11-15 Thread Keith Packard
Peter Maydell writes: > It's on my queue to review if nobody else gets to it first, but since > we're in freeze right now it won't be landing til after the release > happens (expected mid-December). Thanks in advance! I'll get started pushing questions about the RISC-V semihosting ABI into that

Re: [PULL 0/6] ppc-for-4.2 queue 2019-11-15

2019-11-15 Thread David Gibson
On Fri, Nov 15, 2019 at 11:33:06PM +0100, Laurent Vivier wrote: > The following changes since commit 36609b4fa36f0ac934874371874416f7533a5408: > > Merge remote-tracking branch > 'remotes/palmer/tags/palmer-for-master-4.2-sf1' into staging (2019-11-02 > 17:59:03 +) > > are available in

Re: [PATCH v7 6/8] Acceptance tests: add the build directory to the system PATH

2019-11-15 Thread Cleber Rosa
On Fri, Nov 08, 2019 at 02:13:02PM +0100, Philippe Mathieu-Daudé wrote: > On 11/4/19 4:13 PM, Cleber Rosa wrote: > > So that when binaries such as qemu-img are searched for, those in the > > build tree will be favored. As a clarification, SRC_ROOT_DIR is > > dependent on the location from where

Re: [PATCH v7 6/8] Acceptance tests: add the build directory to the system PATH

2019-11-15 Thread Cleber Rosa
On Tue, Nov 12, 2019 at 12:00:20PM -0200, Wainer dos Santos Moschetta wrote: > > On 11/11/19 8:49 PM, Cleber Rosa wrote: > > On Thu, Nov 07, 2019 at 05:46:13PM -0200, Wainer dos Santos Moschetta wrote: > > > On 11/4/19 1:13 PM, Cleber Rosa wrote: > > > > So that when binaries such as qemu-img are

Re: [PATCH] ppc/pnv: Drop "chip" link from POWER9 PSI object

2019-11-15 Thread David Gibson
On Fri, Nov 15, 2019 at 05:03:51PM +0100, Greg Kurz wrote: > It has no apparent user. > > Signed-off-by: Greg Kurz Applied to ppc-for-5.0, thanks. > --- > hw/ppc/pnv.c |2 -- > 1 file changed, 2 deletions(-) > > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > index d7130c3304f0..24bc3d5ab32b

[PULL 5/6] spapr/kvm: Set default cpu model for all machine classes

2019-11-15 Thread Laurent Vivier
From: David Gibson We have to set the default model of all machine classes, not just for the active one. Otherwise, "query-machines" will indicate the wrong CPU model (e.g. "power9_v2.0-powerpc64-cpu" instead of "host-powerpc64-cpu") as "default-cpu-type". s390x already fixed this in de60a92e

[PULL 1/6] ppc: Add intc_destroy() handlers to SpaprInterruptController/PnvChip

2019-11-15 Thread Laurent Vivier
From: Greg Kurz SpaprInterruptControllerClass and PnvChipClass have an intc_create() method that calls the appropriate routine, ie. icp_create() or xive_tctx_create(), to establish the link between the VCPU and the presenter component of the interrupt controller during realize. There aren't any

[PULL 4/6] spapr: Add /chosen to FDT only at reset time to preserve kernel and initramdisk

2019-11-15 Thread Laurent Vivier
From: Alexey Kardashevskiy Since "spapr: Render full FDT on ibm,client-architecture-support" we build the entire flatten device tree (FDT) twice - at the reset time and when "ibm,client-architecture-support" (CAS) is called. The full FDT from CAS is then applied on top of the SLOF internal

[PULL 6/6] mos6522: fix T1 and T2 timers

2019-11-15 Thread Laurent Vivier
From: Laurent Vivier With the Quadra 800 emulation, mos6522 timers processing can consume until 70% of the host CPU time with an idle guest (I guess the problem should also happen with PowerMac emulation). On a recent system, it can be painless (except if you look at top), but on an old host

[PULL 3/6] ppc: Skip partially initialized vCPUs in 'info pic'

2019-11-15 Thread Laurent Vivier
From: Greg Kurz CPU_FOREACH() can race with vCPU hotplug/unplug on sPAPR machines, ie. we may try to print out info about a vCPU with a NULL presenter pointer. Check that in order to prevent QEMU from crashing. Signed-off-by: Greg Kurz Message-Id:

[PULL 2/6] xive, xics: Fix reference counting on CPU objects

2019-11-15 Thread Laurent Vivier
From: Greg Kurz When a VCPU gets connected to the XIVE interrupt controller, we add a const link targetting the CPU object to the TCTX object. Similar links are added to the ICP object when using the XICS interrupt controller. As explained in : * The caller must ensure that @target stays

[PULL 0/6] ppc-for-4.2 queue 2019-11-15

2019-11-15 Thread Laurent Vivier
The following changes since commit 36609b4fa36f0ac934874371874416f7533a5408: Merge remote-tracking branch 'remotes/palmer/tags/palmer-for-master-4.2-sf1' into staging (2019-11-02 17:59:03 +) are available in the Git repository at: https://github.com/vivier/qemu.git

Re: [PATCH v7 5/8] Acceptance tests: keep a stable reference to the QEMU build dir

2019-11-15 Thread Cleber Rosa
On Thu, Nov 07, 2019 at 05:22:24PM -0200, Wainer dos Santos Moschetta wrote: > > On 11/4/19 1:13 PM, Cleber Rosa wrote: > > This is related to the the differences in in-tree and out-of-tree > > builds in QEMU. For simplification, means my build directory. > > > > Currently, by running a `make

Re: [PATCH v3 3/4] nbd: Don't send oversize strings

2019-11-15 Thread Eric Blake
On 11/15/19 11:08 AM, Vladimir Sementsov-Ogievskiy wrote: 14.11.2019 5:46, Eric Blake wrote: Qemu as server currently won't accept export names larger than 256 bytes, nor create dirty bitmap names longer than 1023 bytes, so most uses of qemu as client or server have no reason to get anywhere

[PATCH 2/4] virtiofd: Create a notification queue

2019-11-15 Thread Vivek Goyal
Add a notification queue which will be used to send async notifications for file lock availability. Signed-off-by: Vivek Goyal --- contrib/virtiofsd/fuse_i.h | 1 + contrib/virtiofsd/fuse_virtio.c| 108 ++--- hw/virtio/vhost-user-fs-pci.c

[PATCH 1/4] virtiofsd: Release file locks using F_UNLCK

2019-11-15 Thread Vivek Goyal
We are emulating posix locks for guest using open file description locks in virtiofsd. When any of the fd is closed in guest, we find associated OFD lock fd (if there is one) and close it to release all the locks. Assumption here is that there is no other thread using lo_inode_plock structure or

[PATCH 3/4] virtiofsd: Specify size of notification buffer using config space

2019-11-15 Thread Vivek Goyal
Daemon specifies size of notification buffer needed and that should be done using config space. Only ->notify_buf_size value of config space comes from daemon. Rest of it is filled by qemu device emulation code. Signed-off-by: Vivek Goyal --- contrib/virtiofsd/fuse_virtio.c| 26

[PATCH 0/4] [RFC] virtiofsd, vhost-user-fs: Add support for notification queue

2019-11-15 Thread Vivek Goyal
Hi, Here are RFC patches for adding a notification queue to virtio-fs to send notifications from host to guest. It also has patches to support remote posix locks which make use of this newly introduced notification queue. These patches apply on top of following.

[PATCH 4/4] virtiofsd: Implement blocking posix locks

2019-11-15 Thread Vivek Goyal
As of now we don't support fcntl(F_SETLKW) and if we see one, we return -EOPNOTSUPP. Change that by accepting these requests and returning a reply immediately asking caller to wait. Once lock is available, send a notification to the waiter indicating lock is available. Signed-off-by: Vivek Goyal

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Philippe Mathieu-Daudé
On 11/15/19 5:13 PM, Thomas Huth wrote: On 15/11/2019 17.13, Paolo Bonzini wrote: On 15/11/19 16:54, Thomas Huth wrote: On 15/11/2019 16.54, Peter Maydell wrote: On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: When CONFIG_IDE_ISA is disabled, compilation currently fails:

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Philippe Mathieu-Daudé
On 11/15/19 5:12 PM, Thomas Huth wrote: On 15/11/2019 17.15, Peter Maydell wrote: On Fri, 15 Nov 2019 at 16:08, Thomas Huth wrote: On 15/11/2019 16.54, Peter Maydell wrote: On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -78,7 +78,6 @@

Re: [PATCH v1 1/1] hw/arm: versal: Add the CRP as unimplemented

2019-11-15 Thread Luc Michel
On 11/15/19 4:47 PM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add the CRP as unimplemented thus avoiding bus errors when > guests access these registers. > > Signed-off-by: Edgar E. Iglesias Reviewed-by: Luc Michel > --- > hw/arm/xlnx-versal.c | 2 ++ >

Re: [PATCH v1 0/1] hw/arm: versal: Add the CRP as unimplemented

2019-11-15 Thread Philippe Mathieu-Daudé
On 11/15/19 7:12 PM, no-re...@patchew.org wrote: Patchew URL: https://patchew.org/QEMU/20191115154734.26449-1-edgar.igles...@gmail.com/ This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can

Re: [PATCH] display: xlnx_dp: Provide sufficient bytes for silent audio channel

2019-11-15 Thread Philippe Mathieu-Daudé
Cc'ing Gerd (Audio) On 11/15/19 4:56 PM, Sai Pavan Boddu wrote: Fill the audio channel with required number of bytes to cover the elapsed time. This prevents rate control reset, and avoids debug prints like below log: Resetting rate control (65692 samples) ... Resetting

Re: [Bug 1852781] Re: qemu s390x on focal - applications breaking

2019-11-15 Thread Christian Ehrhardt 
Hi Colin, I didn't read much if the details but I think it is clear. Per request of IBM focal got -march=z13 but tcg has no emulation for some of the instructions of this cpu. That is the breakage that you are seeing and afaik there is nothing we can do than waiting for qemu to grow that

Re: [PATCH] display: xlnx_dp: Provide sufficient bytes for silent audio channel

2019-11-15 Thread Alistair Francis
On Fri, Nov 15, 2019 at 10:59 AM Sai Pavan Boddu wrote: > > Fill the audio channel with required number of bytes to cover the > elapsed time. This prevents rate control reset, and avoids debug prints > like below > > log: > Resetting rate control (65692 samples) > ... >

Re: [PATCH v1 0/1] hw/arm: versal: Add the CRP as unimplemented

2019-11-15 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191115154734.26449-1-edgar.igles...@gmail.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

[Bug 1852781] Re: qemu s390x on focal - applications breaking

2019-11-15 Thread Colin Ian King
ps is showing QEMU is running as follows: /usr/bin/qemu-system-s390x -name guest=ubuntu20.04-focal-s390x,debug- threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-10-ubuntu20.04-focal-s3 /master-key.aes -machine s390-ccw-virtio-eoan,accel=tcg,usb=off,dump-

[Bug 1852781] Re: qemu s390x on focal - applications breaking

2019-11-15 Thread Colin Ian King
I've also seen in the dmesg log: [ 287.624414] User process fault: interruption code 0007 ilc:3 in libstdc++.so.6.0.28[3ffb3e0+21d000] [ 288.991706] User process fault: interruption code 0007 ilc:3 in libstdc++.so.6.0.28[3ff9008+21d000] -- You received this bug notification because

[PATCH 0/4] python/qemu: New accel module and improvements

2019-11-15 Thread Wainer dos Santos Moschetta
On commit abf0bf998dcb John Snow moved some code out of __init__.py to machine.py. kvm_available() remained in though. So on patch 01 I continue his work by creating a home for that method (the new 'accel' module). Honestly I was unsure about whether move the code to any existing module or make a

[Bug 1852781] [NEW] qemu s390x on focal - applications breaking

2019-11-15 Thread Colin Ian King
Public bug reported: Running qemu-system-s390x (1:4.0+dfsg-0ubuntu10) on an x86-64 Focal host with an upgrade of a Eoan s390x VM to a Focal s390x is triggering random breakage, for example: sudo apt-get update && sudo apt-get dist-upgrade ... ... Unpacking debianutils (4.9) over (4.8.6.3) ...

[PATCH 4/4] python/qemu: accel: Add tcg_available() method

2019-11-15 Thread Wainer dos Santos Moschetta
This adds a method to check if the tcg accelerator is enabled in the QEMU binary. Signed-off-by: Wainer dos Santos Moschetta --- python/qemu/accel.py | 8 1 file changed, 8 insertions(+) diff --git a/python/qemu/accel.py b/python/qemu/accel.py index 1978fbee4e..513904d46d 100644 ---

[PATCH 2/4] python/qemu: accel: Add list_accel() method

2019-11-15 Thread Wainer dos Santos Moschetta
Since commit cbe6d6365a48 the command `qemu -accel help` returns the list of accelerators enabled in the QEMU binary. This adds the list_accel() method which return that same list. Signed-off-by: Wainer dos Santos Moschetta --- python/qemu/accel.py | 20 1 file changed, 20

[PATCH 1/4] python/qemu: Move kvm_available() to its own module

2019-11-15 Thread Wainer dos Santos Moschetta
This creates the 'accel' Python module to be the home for utilities that deal with accelerators. Also moved kvm_available() from __init__.py to this new module. Signed-off-by: Wainer dos Santos Moschetta --- python/qemu/__init__.py | 20 +--- python/qemu/accel.py| 36

[PATCH 3/4] python/qemu: accel: Strengthen kvm_available() checks

2019-11-15 Thread Wainer dos Santos Moschetta
Currently kvm_available() checks for the presence of kvm module and, if target and host arches don't mismatch. This patch adds an 3rd checking: if QEMU binary was compiled with kvm support. Signed-off-by: Wainer dos Santos Moschetta --- python/qemu/accel.py | 27 +-- 1

Re: [RFC 21/24] backup: move to block-copy

2019-11-15 Thread Eric Blake
On 11/15/19 8:14 AM, Vladimir Sementsov-Ogievskiy wrote: This brings async request handling and block-status driven chunk sizes to backup out of the box, which improves backup performance. Signed-off-by: Vladimir Sementsov-Ogievskiy --- +++ b/qapi/block-core.json @@ -1455,6 +1455,12 @@ #

Re: [PATCH] target/arm: Clean up arm_cpu_vq_map_next_smaller asserts

2019-11-15 Thread Richard Henderson
On 11/15/19 5:06 PM, Andrew Jones wrote: >> bitnum = find_last_bit(cpu->sve_vq_map, vq - 1); >> -return bitnum == vq - 1 ? 0 : bitnum + 1; >> + >> +/* We always have vq == 1 present in sve_vq_map. */ > > This is true with TCG and 99.% likely to be true with KVM... Eh? It's

Re: [RFC 00/24] backup performance: block_status + async

2019-11-15 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191115141444.24155-1-vsement...@virtuozzo.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [RFC 00/24] backup performance: block_status + async Type: series Message-id:

Re: [RFC 00/24] backup performance: block_status + async

2019-11-15 Thread Vladimir Sementsov-Ogievskiy
15.11.2019 20:30, no-re...@patchew.org wrote: > Patchew URL: > https://patchew.org/QEMU/20191115141444.24155-1-vsement...@virtuozzo.com/ > > > > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Subject: [RFC 00/24] backup performance:

[RFC PATCH 08/11] gdbstub: extend GByteArray to read register helpers

2019-11-15 Thread Alex Bennée
Instead of passing a pointer to memory now just extend the GByteArray to all the read register helpers. They can then safely append their data through the normal way. We don't bother with this abstraction for write registers as we have already ensured the buffer being copied from is the correct

[RFC PATCH 11/11] target/arm: generate xml description of our SVE registers

2019-11-15 Thread Alex Bennée
Signed-off-by: Alex Bennée --- target/arm/cpu.h | 10 - target/arm/gdbstub.c | 99 target/arm/helper.c | 69 -- 3 files changed, 173 insertions(+), 5 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h

[RFC PATCH 03/11] gdbstub: move str_buf to GDBState and use GString

2019-11-15 Thread Alex Bennée
Rather than having a static buffer replace str_buf with a GString which we know can grow on demand. Convert the internal functions to take a GString instead of a char * and length. Signed-off-by: Alex Bennée --- gdbstub.c | 194 -- 1 file

[RFC PATCH 10/11] target/arm: explicitly encode regnum in our XML

2019-11-15 Thread Alex Bennée
This is described as optional but I'm not convinced of the numbering when multiple target fragments are sent. Signed-off-by: Alex Bennée --- target/arm/cpu.h | 2 +- target/arm/gdbstub.c | 16 ++-- target/arm/helper.c | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-)

[RFC PATCH 09/11] target/arm: prepare for multiple dynamic XMLs

2019-11-15 Thread Alex Bennée
We will want to generate similar dynamic XML for gdbstub support of SVE registers (the upstream doesn't use XML). To that end lightly rename a few things to make the distinction. Signed-off-by: Alex Bennée --- target/arm/cpu.h | 20 +--- target/arm/gdbstub.c | 30

[RFC PATCH 04/11] gdbstub: move mem_buf to GDBState and use GByteArray

2019-11-15 Thread Alex Bennée
This is in preparation for further re-factoring of the register API with the rest of the code. Theoretically the read register function could overwrite the MAX_PACKET_LENGTH buffer although currently all registers are well within the size range. Signed-off-by: Alex Bennée --- gdbstub.c | 52

[RFC PATCH 05/11] gdbstub: add helper for 128 bit registers

2019-11-15 Thread Alex Bennée
Signed-off-by: Alex Bennée --- include/exec/gdbstub.h | 8 1 file changed, 8 insertions(+) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 08363969c14..a898a2af990 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -102,6 +102,14 @@ static inline int

[RFC PATCH 02/11] gdbstub: stop passing GDBState * around

2019-11-15 Thread Alex Bennée
We only have one GDBState which should be allocated at the time we process any commands. This will make further clean-up a bit easier. Signed-off-by: Alex Bennée --- gdbstub.c | 307 +++--- 1 file changed, 177 insertions(+), 130 deletions(-) diff

[RFC PATCH 07/11] target/m68k: use gdb_get_reg helpers

2019-11-15 Thread Alex Bennée
This is cleaner than poking memory directly and will make later clean-ups easier. Signed-off-by: Alex Bennée --- target/m68k/helper.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/target/m68k/helper.c b/target/m68k/helper.c index

[RFC PATCH 00/11] gdbstub re-factor and SVE support

2019-11-15 Thread Alex Bennée
Hi, This RFC is for supporting SVE registers in QEMU's gdbstub. However on the way to that there is a bunch of re-factoring to the core gdbstub code to remove some of the hardcoded size limits from its various buffers. By using dynamically sized buffers we are less likely to trip up as we

[RFC PATCH 01/11] gdbstub: move allocation of GDBState to one place

2019-11-15 Thread Alex Bennée
We use g_new0() as it is the preferred form for such allocations. We can also ensure that gdbserver_state is reset in one place. Signed-off-by: Alex Bennée --- gdbstub.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index

[RFC PATCH 06/11] target/arm: use gdb_get_reg helpers

2019-11-15 Thread Alex Bennée
This is cleaner than poking memory directly and will make later clean-ups easier. Signed-off-by: Alex Bennée --- target/arm/helper.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index be67e2c66d6..bd821931b3d

Re: [PATCH v3 2/4] bitmap: Enforce maximum bitmap name length

2019-11-15 Thread Vladimir Sementsov-Ogievskiy
15.11.2019 19:33, Eric Blake wrote: > On 11/15/19 9:47 AM, Vladimir Sementsov-Ogievskiy wrote: >> 15.11.2019 18:03, Vladimir Sementsov-Ogievskiy wrote: >>> 14.11.2019 5:46, Eric Blake wrote: We document that for qcow2 persistent bitmaps, the name cannot exceed 1023 bytes.  It is

Re: [PATCH v3 3/4] nbd: Don't send oversize strings

2019-11-15 Thread Vladimir Sementsov-Ogievskiy
14.11.2019 5:46, Eric Blake wrote: > Qemu as server currently won't accept export names larger than 256 > bytes, nor create dirty bitmap names longer than 1023 bytes, so most > uses of qemu as client or server have no reason to get anywhere near > the NBD spec maximum of a 4k limit per string. >

Re: [PATCH v1 1/1] hw/arm: versal: Add the CRP as unimplemented

2019-11-15 Thread Alistair Francis
On Fri, Nov 15, 2019 at 10:50 AM Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > Add the CRP as unimplemented thus avoiding bus errors when > guests access these registers. > > Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Alistair > --- > hw/arm/xlnx-versal.c

[PATCH for-5.0 v5 21/23] ppc/xive: Synthesize interrupt from the saved IPB in the NVT

2019-11-15 Thread Cédric Le Goater
When a vCPU is dispatched on a HW thread, its context is pushed in the thread registers and it is activated by setting the VO bit in the CAM line word2. The HW grabs the associated NVT, pulls the IPB bits and merges them with the IPB of the new context. If interrupts were missed while the vCPU was

Re: [qemu-web PATCH v3] Add a blog post on "Micro-Optimizing KVM VM-Exits"

2019-11-15 Thread Thomas Huth
On 15/11/2019 17.24, Kashyap Chamarthy wrote: > This blog post summarizes the talk "Micro-Optimizing KVM VM-Exits"[1], > given by Andrea Arcangeli at the recently concluded KVM Forum 2019. Thanks, pushed now: https://www.qemu.org/2019/11/15/micro-optimizing-kvm-vmexits/ Thomas

Re: [RESEND PATCH v21 5/6] target-arm: kvm64: handle SIGBUS signal from kernel or KVM

2019-11-15 Thread Igor Mammedov
On Mon, 11 Nov 2019 09:40:47 +0800 Xiang Zheng wrote: > From: Dongjiu Geng > > Add a SIGBUS signal handler. In this handler, it checks the SIGBUS type, > translates the host VA delivered by host to guest PA, then fills this PA > to guest APEI GHES memory, then notifies guest according to the

Re: [PATCH 2/2] docs/microvm.rst: add instructions for shutting down the guest

2019-11-15 Thread Paolo Bonzini
On 15/11/19 17:13, Sergio Lopez wrote: > Add a new section explaining the particularities of the microvm > machine type for triggering a guest-initiated shut down. > > Signed-off-by: Sergio Lopez > --- > docs/microvm.rst | 21 + > 1 file changed, 21 insertions(+) > > diff

Re: [PATCH] Implement backend program convention command for vhost-user-blk

2019-11-15 Thread Stefan Hajnoczi
On Fri, Nov 15, 2019 at 02:09:25PM +0800, Micky Yun Chan wrote: Thanks for the patch! > +context = g_option_context_new(NULL); Missing g_option_context_free() later in this function. g_auto() is the easiest way to ensure that. > +g_option_context_add_main_entries(context, entries,

[PATCH for-5.0 v5 18/23] ppc/xive: Move the TIMA operations to the controller model

2019-11-15 Thread Cédric Le Goater
On the P9 Processor, the thread interrupt context registers of a CPU can be accessed "directly" when by load/store from the CPU or "indirectly" by the IC through an indirect TIMA page. This requires to configure first the PC_TCTXT_INDIRx registers. Today, we rely on the get_tctx() handler to

Re: [PATCH v3 2/4] bitmap: Enforce maximum bitmap name length

2019-11-15 Thread Eric Blake
On 11/15/19 9:47 AM, Vladimir Sementsov-Ogievskiy wrote: 15.11.2019 18:03, Vladimir Sementsov-Ogievskiy wrote: 14.11.2019 5:46, Eric Blake wrote: We document that for qcow2 persistent bitmaps, the name cannot exceed 1023 bytes.  It is inconsistent if transient bitmaps do not have to abide by

[PATCH for-5.0 v5 23/23] ppc/pnv: Extend XiveRouter with a get_block_id() handler

2019-11-15 Thread Cédric Le Goater
When doing CAM line compares, fetch the block id from the interrupt controller which can have set the PC_TCTXT_CHIPID field. Signed-off-by: Cédric Le Goater --- include/hw/ppc/xive.h | 2 +- hw/intc/pnv_xive.c| 6 ++ hw/intc/spapr_xive.c | 6 ++ hw/intc/xive.c| 21

[PATCH for-5.0 v5 12/23] ppc/xive: Introduce a XiveFabric interface

2019-11-15 Thread Cédric Le Goater
The XiveFabric QOM interface acts as the PowerBUS interface between the interrupt controller and the system and should be implemented by the QEMU machine. On HW, the XIVE sub-engine is responsible for the communication with the other chip is the Common Queue (CQ) bridge unit. This interface

[PATCH for-5.0 v5 20/23] ppc/xive: Introduce a xive_tctx_ipb_update() helper

2019-11-15 Thread Cédric Le Goater
We will use it to resend missed interrupts when a vCPU context is pushed on a HW thread. Signed-off-by: Cédric Le Goater --- include/hw/ppc/xive.h | 1 + hw/intc/xive.c| 21 +++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/hw/ppc/xive.h

Re: [PATCH 0/2] A pair of memory access problems

2019-11-15 Thread Alex Williamson
On Mon, 11 Nov 2019 11:37:40 +0100 Michal Privoznik wrote: > The first patch fixes a crasher, the second fixes a memleak. > > Michal Privoznik (2): > hw/vfio/pci: Fix double free of migration_blocker > vfio-helpers: Free QEMUVFIOState in qemu_vfio_close() > > hw/vfio/pci.c | 2 ++ >

[PATCH for-5.0 v5 16/23] ppc/xive: Extend the TIMA operation with a XivePresenter parameter

2019-11-15 Thread Cédric Le Goater
The TIMA operations are performed on behalf of the XIVE IVPE sub-engine (Presenter) on the thread interrupt context registers. The current operations supported by the model are simple and do not require access to the controller but more complex operations will need access to the controller NVT

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Thomas Huth
On 15/11/2019 17.13, Paolo Bonzini wrote: > On 15/11/19 16:54, Thomas Huth wrote: >> On 15/11/2019 16.54, Peter Maydell wrote: >>> On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: When CONFIG_IDE_ISA is disabled, compilation currently fails: hw/i386/pc_piix.c: In function

[PATCH for-5.0 v5 17/23] ppc/pnv: Clarify how the TIMA is accessed on a multichip system

2019-11-15 Thread Cédric Le Goater
The TIMA region gives access to the thread interrupt context registers of a CPU. It is mapped at the same address on all chips and can be accessed by any CPU of the system. To identify the chip from which the access is being done, the PowerBUS uses a 'chip' field in the load/store messages. QEMU

[PATCH for-5.0 v5 15/23] ppc/xive: Use the XiveFabric and XivePresenter interfaces

2019-11-15 Thread Cédric Le Goater
Now that the machines have handlers implementing the XiveFabric and XivePresenter interfaces, remove xive_presenter_match() and make use of the 'match_nvt' handler of the machine. Signed-off-by: Cédric Le Goater --- hw/intc/xive.c | 48 +--- 1 file

[PATCH for-5.0 v5 22/23] ppc/pnv: Introduce a pnv_xive_block_id() helper

2019-11-15 Thread Cédric Le Goater
When PC_TCTXT_CHIPID_OVERRIDE is configured, the PC_TCTXT_CHIPID field overrides the hardwired chip ID in the Powerbus operations and for CAM compares. This is typically used in the one block-per-chip configuration to associate a unique block id number to each IC of the system. Simplify the model

[PATCH for-5.0 v5 14/23] ppc/spapr: Implement the XiveFabric interface

2019-11-15 Thread Cédric Le Goater
The CAM line matching sequence in the pseries machine does not change much apart from the use of the new QOM interfaces. There is an extra indirection because of the sPAPR IRQ backend of the machine. Only the XIVE backend implements the new 'match_nvt' handler. Signed-off-by: Cédric Le Goater

[PATCH for-5.0 v5 08/23] ppc/xive: Introduce a XivePresenter interface

2019-11-15 Thread Cédric Le Goater
When the XIVE IVRE sub-engine (XiveRouter) looks for a Notification Virtual Target (NVT) to notify, it broadcasts a message on the PowerBUS to find an XIVE IVPE sub-engine (Presenter) with the NVT dispatched on one of its HW threads, and then forwards the notification if any response was received.

[PATCH for-5.0 v5 19/23] ppc/xive: Remove the get_tctx() XiveRouter handler

2019-11-15 Thread Cédric Le Goater
It is now unused. Signed-off-by: Cédric Le Goater --- include/hw/ppc/xive.h | 2 -- hw/intc/pnv_xive.c| 13 - hw/intc/spapr_xive.c | 8 hw/intc/xive.c| 7 --- 4 files changed, 30 deletions(-) diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h

[PATCH for-5.0 v5 11/23] ppc/pnv: Introduce a pnv_xive_is_cpu_enabled() helper

2019-11-15 Thread Cédric Le Goater
and use this helper to exclude CPUs which are not enabled in the XIVE controller. Signed-off-by: Cédric Le Goater --- hw/intc/pnv_xive.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index 71ca4961b6b1..4c8c6e51c20f 100644 ---

[PATCH for-5.0 v5 05/23] ppc/pnv: Quiesce some XIVE errors

2019-11-15 Thread Cédric Le Goater
When dumping the END and NVT tables, the error logging is too noisy. Signed-off-by: Cédric Le Goater --- hw/intc/pnv_xive.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index 02faf4135e48..a394331ddd6a 100644 ---

[PATCH for-5.0 v5 10/23] ppc/pnv: Loop on the threads of the chip to find a matching NVT

2019-11-15 Thread Cédric Le Goater
CPU_FOREACH() loops on all the CPUs of the machine which is incorrect. Each XIVE Presenter should scan only the HW threads of the chip it belongs to. Signed-off-by: Cédric Le Goater --- include/hw/ppc/pnv.h | 2 ++ hw/intc/pnv_xive.c | 63 ++--

[PATCH for-5.0 v5 13/23] ppc/pnv: Implement the XiveFabric interface

2019-11-15 Thread Cédric Le Goater
The CAM line matching on the PowerNV machine now scans all chips of the system and all CPUs of a chip to find a dispatched NVT in the thread contexts. Signed-off-by: Cédric Le Goater --- hw/ppc/pnv.c | 35 +++ 1 file changed, 35 insertions(+) diff --git

[PATCH for-5.0 v5 02/23] ppc/xive: Introduce helpers for the NVT id

2019-11-15 Thread Cédric Le Goater
Each vCPU in the system is identified with an NVT identifier which is pushed in the OS CAM line (QW1W2) of the HW thread interrupt context register when the vCPU is dispatched on a HW thread. This identifier is used by the presenter subengine to find a matching target to notify of an event. It is

[PATCH for-5.0 v5 04/23] ppc/pnv: Dump the XIVE NVT table

2019-11-15 Thread Cédric Le Goater
This is useful to dump the saved contexts of the vCPUs : configuration of the base END index of the vCPU and the Interrupt Pending Buffer register, which is updated when an interrupt can not be presented. When dumping the NVT table, we skip empty indirect pages which are not necessarily

[PATCH for-5.0 v5 07/23] ppc/xive: Check V bit in TM_PULL_POOL_CTX

2019-11-15 Thread Cédric Le Goater
A context should be 'valid' when pulled from the thread interrupt context registers. Signed-off-by: Cédric Le Goater --- hw/intc/xive.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 42e9a11ef731..511e1a936347 100644 --- a/hw/intc/xive.c +++

[PATCH for-5.0 v5 09/23] ppc/xive: Implement the XivePresenter interface

2019-11-15 Thread Cédric Le Goater
Each XIVE Router model, sPAPR and PowerNV, now implements the 'match_nvt' handler of the XivePresenter QOM interface. This is simply moving code and taking into account the new API. To be noted that the xive_router_get_tctx() helper is not used anymore when doing CAM matching and will be removed

[qemu-web PATCH v3] Add a blog post on "Micro-Optimizing KVM VM-Exits"

2019-11-15 Thread Kashyap Chamarthy
This blog post summarizes the talk "Micro-Optimizing KVM VM-Exits"[1], given by Andrea Arcangeli at the recently concluded KVM Forum 2019. [1] https://kvmforum2019.sched.com/event/Tmwr/micro-optimizing-kvm-vm-exits-andrea-arcangeli-red-hat-inc Signed-off-by: Kashyap Chamarthy --- v3: -

[PATCH for-5.0 v5 06/23] ppc/xive: Introduce OS CAM line helpers

2019-11-15 Thread Cédric Le Goater
The OS CAM line has a special encoding exploited by the HW. Provide helper routines to hide the details to the TIMA command handlers. This also clarifies the endianness of different variables : 'qw1w2' is big-endian and 'cam' is native. Signed-off-by: Cédric Le Goater --- hw/intc/xive.c | 41

[PATCH for-5.0 v5 01/23] ppc/xive: Record the IPB in the associated NVT

2019-11-15 Thread Cédric Le Goater
When an interrupt can not be presented to a vCPU, because it is not running on any of the HW treads, the XIVE presenter updates the Interrupt Pending Buffer register of the associated XIVE NVT structure. This is only done if backlog is activated in the END but this is generally the case. The

[PATCH for-5.0 v5 00/23] ppc/pnv: add XIVE support for KVM guests

2019-11-15 Thread Cédric Le Goater
Hello, The QEMU PowerNV machine emulates a baremetal OpenPOWER system and acts as an hypervisor (L0). Supporting emulation of KVM to run guests (L1) requires a few more extensions, among which guest support for the XIVE interrupt controller on POWER9 processor. The following changes extend the

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Thomas Huth
On 15/11/2019 17.15, Peter Maydell wrote: > On Fri, 15 Nov 2019 at 16:08, Thomas Huth wrote: >> >> On 15/11/2019 16.54, Peter Maydell wrote: >>> On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -78,7 +78,6 @@ static void

[PATCH for-5.0 v5 03/23] ppc/pnv: Remove pnv_xive_vst_size() routine

2019-11-15 Thread Cédric Le Goater
pnv_xive_vst_size() tries to compute the size of a VSD table from the information given by FW. The number of entries of the table are deduced from the result and the MMIO regions of the ESBs and the END ESBs are then resized accordingly with the computed value. This reduces the number of elements

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Peter Maydell
On Fri, 15 Nov 2019 at 16:08, Thomas Huth wrote: > > On 15/11/2019 16.54, Peter Maydell wrote: > > On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: > >> --- a/hw/i386/pc_piix.c > >> +++ b/hw/i386/pc_piix.c > >> @@ -78,7 +78,6 @@ static void pc_init1(MachineState *machine, > >>

[PATCH 1/2] docs/microvm.rst: fix alignment in "Limitations"

2019-11-15 Thread Sergio Lopez
Fix the alignment of the items in the "Limitations" section. Signed-off-by: Sergio Lopez --- docs/microvm.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/microvm.rst b/docs/microvm.rst index aae811a922..4cf84746b9 100644 --- a/docs/microvm.rst +++

[PATCH] vfio: vfio-pci requires EDID

2019-11-15 Thread Paolo Bonzini
hw/vfio/display.c needs the EDID subsystem, select it. Cc: Alex Williamson Signed-off-by: Paolo Bonzini --- hw/vfio/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig index 34da2a3cfd..f0eaa75ce7 100644 --- a/hw/vfio/Kconfig +++ b/hw/vfio/Kconfig @@

  1   2   3   >