Re: [Qemu-devel] [PATCH v4 5/9] x86_iommu/amd: Prepare for interrupt remap support

2018-09-27 Thread Peter Xu
On Thu, Sep 27, 2018 at 04:45:57PM +, Singh, Brijesh wrote: [...] > +static MemTxResult amdvi_mem_ir_write(void *opaque, hwaddr addr, > + uint64_t value, unsigned size, > + MemTxAttrs attrs) > +{ > +int ret; > +

Re: [Qemu-devel] [PATCH v4 4/9] x86_iommu/amd: make the address space naming consistent with intel-iommu

2018-09-27 Thread Peter Xu
On Thu, Sep 27, 2018 at 04:45:56PM +, Singh, Brijesh wrote: > To be consistent with intel-iommu: > > - rename the address space to use '_' instead of '-' > - update the memory region relationships > > Signed-off-by: Brijesh Singh > Cc: Peter Xu > Cc: "Michael S. Tsirkin" > Cc: Paolo

Re: [Qemu-devel] [PATCH v4 3/9] x86_iommu/amd: remove V=1 check from amdvi_validate_dte()

2018-09-27 Thread Peter Xu
On Thu, Sep 27, 2018 at 04:45:55PM +, Singh, Brijesh wrote: > Currently, the amdvi_validate_dte() assumes that a valid DTE will > always have V=1. This is not true. The V=1 means that bit[127:1] are > valid. A valid DTE can have IV=1 and V=0 (i.e address translation > disabled and interrupt

Re: [Qemu-devel] [PATCH v8 0/6] monitor: enable OOB by default

2018-09-27 Thread Peter Xu
On Wed, Sep 05, 2018 at 02:23:07PM +0800, Peter Xu wrote: > Based-on: <20180828191048.29806-1-arm...@redhat.com> > Based-on: <2018090716.1675-1-arm...@redhat.com> > > (this series is based on Markus's monitor-next tree) > > v8: > - remove patch 1 & 2 since already in the QAPI pull > - squash

Re: [Qemu-devel] [PATCH] intel_iommu: handle invalid ce for shadow sync

2018-09-27 Thread Peter Xu
On Thu, Sep 13, 2018 at 03:55:17PM +0800, Peter Xu wrote: > There are two callers for vtd_sync_shadow_page_table_range(), one > provided a valid context entry and one not. Move that fetching > operation into the caller vtd_sync_shadow_page_table() where we need to > fetch the context entry. > >

Re: [Qemu-devel] [PATCH v3] intel_iommu: better handling of dmar state switch

2018-09-27 Thread Peter Xu
On Fri, Sep 07, 2018 at 10:46:40AM +0800, Peter Xu wrote: > QEMU is not handling the global DMAR switch well, especially when from > "on" to "off". > > Let's first take the example of system reset. > > Assuming that a guest has IOMMU enabled. When it reboots, we will drop > all the existing

Re: [Qemu-devel] [PATCH v12 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-27 Thread Leonid Bloch
On September 27, 2018 5:53:34 PM CEST, Eric Blake wrote: >On 9/26/18 11:04 AM, Leonid Bloch wrote: >> The default cache-clean-interval is set to 10 minutes, in order to >lower >> the overhead of the qcow2 caches (before the default was 0, i.e. >> disabled). >> >> * For non-Linux platforms the

Re: [Qemu-devel] [PATCH 2/2] nvdimm: use IS_NVDIMM macro

2018-09-27 Thread Yi Zhang
On 2018-09-21 at 15:13:32 +0400, Marc-André Lureau wrote: Thanks for the improvemnet. Reviewed-by: Zhang Yi > Put into use the macros proposed in the previous Object documentation change. > > Signed-off-by: Marc-André Lureau > --- > include/hw/mem/nvdimm.h | 1 + > hw/acpi/ich9.c |

Re: [Qemu-devel] [PATCH rebased 2/2] monitor: delay monitor iothread creation

2018-09-27 Thread Peter Xu
On Thu, Sep 27, 2018 at 02:35:07PM +0200, Markus Armbruster wrote: > Peter Xu writes: > > > On Thu, Sep 27, 2018 at 10:46:34AM +0200, Markus Armbruster wrote: > >> Peter Xu writes: > >> > >> > On Tue, Sep 25, 2018 at 01:09:57PM +0200, Wolfgang Bumiller wrote: > >> >> > >> >> > On September

Re: [Qemu-devel] [PATCH v3 6/9] x86_iommu/amd: Add interrupt remap support when VAPIC is not enabled

2018-09-27 Thread Peter Xu
On Thu, Sep 27, 2018 at 12:28:42PM +, Singh, Brijesh wrote: > >> +static bool amdvi_validate_int_remap(AMDVIState *s, uint64_t *dte) > >> +{ > >> +/* Check if IR is enabled in DTE */ > >> +if (!(dte[2] & AMDVI_IR_REMAP_ENABLE)) { > >> +return false; > >> +} > >> + > >> +

[Qemu-devel] [RFC PATCH 2/3] acceptance tests: Add EDK2 OVMF boot and debug console checking test

2018-09-27 Thread Philippe Mathieu-Daudé
This test boots OVMF and check the debug console (I/O port on the ISA bus) report enough information on the initialized devices. Example: $ avocado --show=QMP,serial run tests/acceptance/boot_firmware.py Signed-off-by: Philippe Mathieu-Daudé --- - how to refactor common code from

[Qemu-devel] [RFC PATCH 0/3] acceptance tests: Test firmware checking debug console output

2018-09-27 Thread Philippe Mathieu-Daudé
Hi, This RFC series add simple acceptance tests which boot SeaBIOS and EDK2 on Q35 and virt/aarch64. It is more of a proof of concept (to motivate the Avocado team ;) ). Regards, Phil. Philippe Mathieu-Daudé (3): acceptance tests: Add SeaBIOS boot and debug console checking test

[Qemu-devel] [RFC PATCH 3/3] acceptance tests: Add EDK2 AAVMF boot and console checking test

2018-09-27 Thread Philippe Mathieu-Daudé
This test boots EDK2 AAVMF and check the debug console (PL011) reports enough information on the initialized devices. Example: $ avocado --show=console run tests/acceptance/boot_firmware.py --cit-parameter-file aarch64.cit having aarch64.cit: [parameters] qemu_bin:

[Qemu-devel] [RFC PATCH 1/3] acceptance tests: Add SeaBIOS boot and debug console checking test

2018-09-27 Thread Philippe Mathieu-Daudé
This test boots SeaBIOS and check the debug console (I/O port on the ISA bus) reports enough information on the initialized devices. Example: $ avocado --show=debugcon run tests/acceptance/boot_firmware.py Signed-off-by: Philippe Mathieu-Daudé --- - can we avoid the time.time() 2nd timeout

Re: [Qemu-devel] [PATCH v9 2/6] s390x/cpumodel: Set up CPU model for AP device support

2018-09-27 Thread Tony Krowiak
On 09/27/2018 03:50 AM, David Hildenbrand wrote: On 27/09/2018 00:54, Tony Krowiak wrote: A new CPU model feature and two new CPU model facilities are introduced to support AP devices for a KVM guest. CPU model features: 1. The S390_FEAT_AP CPU model feature indicates whether AP

Re: [Qemu-devel] [PATCH v9 1/6] linux-headers: linux header updates for AP support

2018-09-27 Thread Tony Krowiak
On 09/27/2018 03:41 AM, David Hildenbrand wrote: On 27/09/2018 00:54, Tony Krowiak wrote: Updates the linux header files in preparation for introduction of the VFIO AP device: * Added a feature ID to indicate AP facilities are installed * Added device attributes to the KVM_S390_VM_CRYPTO

[Qemu-devel] [PATCH v2 9/9] target/arm: Convert v8.2-fp16 from feature bit to pfr0 test

2018-09-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu.h | 17 +++- target/arm/translate-a64.h | 1 + target/arm/translate.h | 1 + linux-user/elfload.c | 6 +- target/arm/cpu64.c | 13 ++--- target/arm/helper.c| 2 +-

[Qemu-devel] [PATCH v2 3/9] target/arm: Align cortex-r5 id_isar0

2018-09-27 Thread Richard Henderson
The missing nibble made it more difficult to read. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 17c9c43f41..03bf28f533 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@

[Qemu-devel] [PATCH v2 7/9] target/arm: Convert t32ee from feature bit to isar3 test

2018-09-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu.h | 6 +- linux-user/elfload.c | 2 +- target/arm/cpu.c | 4 target/arm/helper.c | 2 +- target/arm/machine.c | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index

[Qemu-devel] [PATCH v2 0/9] target/arm: Rely on id regs instead of features

2018-09-27 Thread Richard Henderson
There are more feature bits that could be converted, but I thought I should show the work to this point to get feedback. This is the "v2" as compared to http://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg01849.html r~ Richard Henderson (9): target/arm: Define fields of ISAR

[Qemu-devel] [PATCH v2 5/9] target/arm: Convert division from feature bits to isar0 tests

2018-09-27 Thread Richard Henderson
Both arm and thumb2 division are controlled by the same ISAR field, which takes care of the arm implies thumb case. Having M imply thumb2 division was wrong for cortex-m0, which is v6m and does not have thumb2 at all, much less thumb2 division. Signed-off-by: Richard Henderson ---

[Qemu-devel] [PATCH v2 1/9] target/arm: Define fields of ISAR registers

2018-09-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu.h | 80 1 file changed, 80 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 65c0fa0a65..e1b9270b8c 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1428,6 +1428,86 @@

[Qemu-devel] [PATCH v2 6/9] target/arm: Convert jazelle from feature bit to isar1 test

2018-09-27 Thread Richard Henderson
Having V6 alone imply jazelle was wrong for cortex-m0. Change to an assertion for V6 & !M. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 6 +- target/arm/translate.h | 1 + target/arm/cpu.c | 17 ++--- target/arm/translate.c | 2 +- 4 files changed, 21

[Qemu-devel] [PATCH v2 8/9] target/arm: Convert sve from feature bit to pfr0 test

2018-09-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu.h| 16 +++- target/arm/translate-a64.h | 1 + linux-user/aarch64/signal.c | 4 ++-- linux-user/elfload.c| 2 +- linux-user/syscall.c| 10 ++ target/arm/cpu64.c | 3 ++-

[Qemu-devel] [PATCH v2 1/4] MAINTAINERS: list "tests/acpi-test-data" files in ACPI/SMBIOS section

2018-09-27 Thread Laszlo Ersek
The "tests/acpi-test-data" files are currently not covered by any section in MAINTAINERS, and "scripts/checkpatch.pl" complains when new data files are added. Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Gerd Hoffmann Cc: Igor Mammedov Cc: Marcel Apfelbaum Signed-off-by: Laszlo Ersek

[Qemu-devel] [PATCH v2 2/9] target/arm: Convert v8 extensions from feature bits to isar tests

2018-09-27 Thread Richard Henderson
Most of the v8 extensions are self-contained within the ISAR registers and are not implied by other feature bits, which makes them the easiest to convert. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 123 + target/arm/translate-a64.h |

Re: [Qemu-devel] [PATCH v2] qemu/compiler: Wrap __attribute__((flatten)) in a macro

2018-09-27 Thread Richard Henderson
On 9/26/18 11:11 PM, Thomas Huth wrote: > Older versions of Clang (before 3.5) and GCC (before 4.1) do not > support the "__attribute__((flatten))" yet. We don't care about > such old versions of GCC anymore, but since Clang 3.4 is still > used in EPEL for RHEL7 / CentOS 7, we should not use this

[Qemu-devel] [PATCH v2 2/4] tests/bios-tables-test: add 64-bit PCI MMIO aperture round-up test on Q35

2018-09-27 Thread Laszlo Ersek
In commit 9fa99d2519cb ("hw/pci-host: Fix x86 Host Bridges 64bit PCI hole", 2017-11-16), we meant to expose such a 64-bit PCI MMIO aperture in the ACPI DSDT that would be at least as large as the new "pci-hole64-size" property (2GB on i440fx, 32GB on q35). The goal was to offer "enough" 64-bit

[Qemu-devel] [PATCH v2 4/9] target/arm: Fix cortex-a7 id_isar0

2018-09-27 Thread Richard Henderson
The incorrect value advertised only thumb2 div without arm div. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 03bf28f533..020e79918b 100644 --- a/target/arm/cpu.c +++

[Qemu-devel] [PATCH v2 0/4] hw/pci-host/x86: extend the 64-bit PCI hole relative to the fw-assigned base

2018-09-27 Thread Laszlo Ersek
This is v2 of the series previously posted at <20180924221346.16733-1-lersek@redhat.com">http://mid.mail-archive.com/20180924221346.16733-1-lersek@redhat.com>. Changes are noted on every patch. The bios-tables-test case depends on Gerd's "[PATCH] pci-testdev: add optional memory bar" at

[Qemu-devel] [PATCH v2 4/4] hw/pci-host/x86: extend the 64-bit PCI hole relative to the fw-assigned base

2018-09-27 Thread Laszlo Ersek
In commit 9fa99d2519cb ("hw/pci-host: Fix x86 Host Bridges 64bit PCI hole", 2017-11-16), we meant to expose such a 64-bit PCI MMIO aperture in the ACPI DSDT that would be at least as large as the new "pci-hole64-size" property (2GB on i440fx, 32GB on q35). The goal was to offer "enough" 64-bit

[Qemu-devel] [PATCH v2 3/4] hw/pci-host/x86: extract get_pci_hole64_start_value() helpers

2018-09-27 Thread Laszlo Ersek
Expose the calculated "hole64 start" GPAs as plain uint64_t values, extracting the internals of the current property getters. This patch doesn't change behavior. Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Gerd Hoffmann Cc: Igor Mammedov Cc: Marcel Apfelbaum Signed-off-by: Laszlo Ersek

Re: [Qemu-devel] [PATCH] multiboot: Make the message more user friendly

2018-09-27 Thread Eric Blake
On 9/26/18 2:29 AM, Mao Zhongyi wrote: Since this one is intended to be a user-facing error message rather than just a debug note, it could also be reasonably expanded to be a bit more user friendly. Reported-by: Peter Maydell Signed-off-by: Mao Zhongyi --- hw/i386/multiboot.c | 3 ++- 1

Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs

2018-09-27 Thread Philippe Mathieu-Daudé
On 9/27/18 7:16 PM, Eric Blake wrote: > On 9/27/18 11:42 AM, Peter Maydell wrote: >> Taking the address of a field in a packed struct is a bad idea, because >> it might not be actually aligned enough for that pointer type (and >> thus cause a crash on dereference on some host architectures). Newer

Re: [Qemu-devel] [PATCH] multiboot: Make the message more user friendly

2018-09-27 Thread Eduardo Habkost
CCing Markus and Eric, so they can help review the error message grammar and style. On Wed, Sep 26, 2018 at 03:29:48AM -0400, Mao Zhongyi wrote: > Since this one is intended to be a user-facing error message > rather than just a debug note, it could also be reasonably > expanded to be a bit

Re: [Qemu-devel] [PATCH] hw/display/qxl: Suppress clang-7 warning about misaligned atomic operation

2018-09-27 Thread Philippe Mathieu-Daudé
On 9/27/18 5:55 PM, Peter Maydell wrote: > If QEMU is compiled with clang-7 it results in the warning: > > hw/display/qxl.c:1884:19: error: misaligned or large atomic operation > may incur significant performance penalty [-Werror,-Watomic-alignment] > old_pending =

Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs

2018-09-27 Thread Peter Maydell
On 27 September 2018 at 19:16, Eric Blake wrote: > Okay, I am also in favor of the complete conversion. Want me to squash in > the remaining 3 spots as part of queuing my patch, so you don't have to send > a v2? Yes, please. thanks -- PMM

Re: [Qemu-devel] [PATCH] pci-testdev: add optional memory bar

2018-09-27 Thread Laszlo Ersek
On 09/27/18 14:10, Gerd Hoffmann wrote: > Add memory bar to pci-testdev. Size is configurable using the membar > property. Setting the size to zero (default) turns it off. Can be used > to check whenever guests handle large pci bars correctly. > > Signed-off-by: Gerd Hoffmann > --- >

Re: [Qemu-devel] Qemu hanging

2018-09-27 Thread Filipe Manana
On Thu, Sep 27, 2018 at 5:29 PM Alex Bennée wrote: > > > Peter Maydell writes: > > > On 27 September 2018 at 16:42, Alex Bennée wrote: > >> If you can rebuild with: > >> > >> ./configure --enable-debug --extra-cflags="-O0 -g3 > >> -fno-omit-frame-pointer" > > > > -O0 is the default if you

Re: [Qemu-devel] [PATCH 2/2] hw/pci-host/x86: extend the 64-bit PCI hole relative to the fw-assigned base

2018-09-27 Thread Laszlo Ersek
On 09/27/18 09:03, Igor Mammedov wrote: > On Thu, 27 Sep 2018 00:31:07 +0200 > Laszlo Ersek wrote: >> - I guess I could ascertain the mis-alignment by using small guest RAM >> (128MB), a single DIMM hotplug slot so that reserved-memory-end is >> rounded up to 5GB (through the 1GB alignment), and

Re: [Qemu-devel] [PATCH 4/7] qcow2: async scheme for qcow2_co_preadv

2018-09-27 Thread Max Reitz
On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: > Start several async requests instead of read chunk by chunk. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.c | 208 > -- > 1 file changed, 204 insertions(+), 4

Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs

2018-09-27 Thread Eric Blake
On 9/27/18 1:03 PM, Peter Maydell wrote: I'm a bit confused. After applying your patch (and rebasing it to my pending pull request), I still found instances of be16_to_cpus() and others. Were you only flipping instances that were members of a packed struct, while leaving other instances

Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs

2018-09-27 Thread Peter Maydell
On 27 September 2018 at 18:30, Eric Blake wrote: > On 9/27/18 11:42 AM, Peter Maydell wrote: >> >> Taking the address of a field in a packed struct is a bad idea, because >> it might not be actually aligned enough for that pointer type (and >> thus cause a crash on dereference on some host

Re: [Qemu-devel] [PATCH v3 0/5] dirty-bitmaps: fix QMP command permissions

2018-09-27 Thread John Snow
On 09/26/2018 10:23 PM, Eric Blake wrote: > On 9/25/18 6:49 PM, John Snow wrote: >> based on: jsnow/bitmaps staging branch >> >> This series builds on a previous standalone patch and adjusts >> the permission for all (or most) of the QMP bitmap commands. >> >> John Snow (5): >>   

Re: [Qemu-devel] [PATCH 3/7] qcow2: split out reading normal clusters from qcow2_co_preadv

2018-09-27 Thread Max Reitz
On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: > Memory allocation may become less efficient for encrypted case. It's a > payment for further asynchronous scheme. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.c | 114 >

Re: [Qemu-devel] [PATCH v3 1/5] block/dirty-bitmaps: add user_modifiable status checker

2018-09-27 Thread John Snow
On 09/26/2018 10:17 PM, Eric Blake wrote: > On 9/26/18 6:53 AM, Vladimir Sementsov-Ogievskiy wrote: >> 26.09.2018 02:49, John Snow wrote: >>> Instead of both frozen and qmp_locked checks, wrap it into one check. >>> frozen implies the bitmap is split in two (for backup), and shouldn't >>> be

Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs

2018-09-27 Thread Eric Blake
On 9/27/18 11:42 AM, Peter Maydell wrote: Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this. Avoid the

Re: [Qemu-devel] [PATCH] util/hbitmaps: recalculate count on merge

2018-09-27 Thread John Snow
On 09/27/2018 10:09 AM, Eric Blake wrote: > On 9/27/18 2:31 AM, Vladimir Sementsov-Ogievskiy wrote: >> 27.09.2018 00:28, John Snow wrote: >>> We have been neglecting to do so, which results in wrong counts >>> after merge. In the worst case, we may think the bitmap is empty >>> when it has had

Re: [Qemu-devel] [PATCH] bitmap: Update count after a merge

2018-09-27 Thread John Snow
On 09/26/2018 11:11 PM, Eric Blake wrote: > We need an accurate count of the number of bits set in a bitmap > after a merge. In particular, since the merge operation short-circuits > a merge from an empty source, if you have bitmaps A, B, and C where > B started empty, then merge C into B, and

Re: [Qemu-devel] [PATCH] dirty-bitmaps: allow merging to disabled bitmaps

2018-09-27 Thread John Snow
On 09/26/2018 10:25 PM, Eric Blake wrote: > On 9/19/18 4:16 PM, John Snow wrote: >> >> >> On 09/19/2018 05:08 PM, Eric Blake wrote: >>> On 9/19/18 2:58 PM, John Snow wrote: We wish to prohibit merging to read-only bitmaps and frozen bitmaps, but "disabled" bitmaps only preclude their

Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs

2018-09-27 Thread Eric Blake
On 9/27/18 11:42 AM, Peter Maydell wrote: Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this. Avoid the

Re: [Qemu-devel] linux-user's __get_user/__put_user macros vs clang-7 -Waddress-of-packed-member

2018-09-27 Thread Peter Maydell
On 27 September 2018 at 18:02, Peter Maydell wrote: > clang 7 complains about taking the address of a member of a > packed struct, which is good because those are usually bugs. > Unfortunately it also means it complains a lot if you pass > _struct->field to __get_user or __put_user, even > though

[Qemu-devel] [PATCH] cpus: fix TCG kick timer leak

2018-09-27 Thread Alex Bennée
This is an alternative fix to Marc's original patch as per Paolo's suggestion. Reported-by: Marc-André Lureau Suggested-by: Paolo Bonzini Signed-off-by: Alex Bennée --- cpus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 719788320f..d7d69a101e

Re: [Qemu-devel] [PATCH v5 6/8] target/mips: Define the R5900 CPU

2018-09-27 Thread Fredrik Noring
Thank you for your reviews, Philippe, > Fredrik: maybe you can simply name the C790 in the comment pointing to > the DS documentation. Sure, I will do that for v6! I am also adding some of Maciej's notes on the differences between the C790 and the R5900, along with PRId 0X2E00 as noted by

Re: [Qemu-devel] [PATCH] hw/display/qxl: Suppress clang-7 warning about misaligned atomic operation

2018-09-27 Thread Richard Henderson
On 9/27/18 8:55 AM, Peter Maydell wrote: > If QEMU is compiled with clang-7 it results in the warning: > > hw/display/qxl.c:1884:19: error: misaligned or large atomic operation > may incur significant performance penalty [-Werror,-Watomic-alignment] > old_pending =

Re: [Qemu-devel] [PATCH 2/7] qcow2: bdrv_co_pwritev: move encryption code out of lock

2018-09-27 Thread Max Reitz
On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: > We don't need locking for encryption code. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.c | 20 > 1 file changed, 12 insertions(+), 8 deletions(-) > > diff --git a/block/qcow2.c b/block/qcow2.c

Re: [Qemu-devel] spice/qlx: atomic-alignment error with clang-7

2018-09-27 Thread Peter Maydell
On 27 September 2018 at 17:59, Richard Henderson wrote: > On 9/27/18 5:53 AM, Peter Maydell wrote: >> Maybe I can do something to persuade the compiler that the >> pointer really is 4 aligned... > > Hopefully __builtin_assume_aligned(ptr, 4) is supported by that version of > clang? Yes; I sent

[Qemu-devel] linux-user's __get_user/__put_user macros vs clang-7 -Waddress-of-packed-member

2018-09-27 Thread Peter Maydell
clang 7 complains about taking the address of a member of a packed struct, which is good because those are usually bugs. Unfortunately it also means it complains a lot if you pass _struct->field to __get_user or __put_user, even though in fact those macros are totally safe, since their entire

Re: [Qemu-devel] [PATCH 1/7] qcow2: move qemu_co_mutex_lock below decryption procedure

2018-09-27 Thread Max Reitz
On 27.09.18 18:58, Max Reitz wrote: > On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: >> From: "Denis V. Lunev" >> >> We are not working with a shared state data in the decruption code and (*decryption) >> thus this operation is safe. On the other hand this significantly >> reduces the

Re: [Qemu-devel] spice/qlx: atomic-alignment error with clang-7

2018-09-27 Thread Richard Henderson
On 9/27/18 5:53 AM, Peter Maydell wrote: > Maybe I can do something to persuade the compiler that the > pointer really is 4 aligned... Hopefully __builtin_assume_aligned(ptr, 4) is supported by that version of clang? r~

Re: [Qemu-devel] [PATCH 1/7] qcow2: move qemu_co_mutex_lock below decryption procedure

2018-09-27 Thread Max Reitz
On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: > From: "Denis V. Lunev" > > We are not working with a shared state data in the decruption code and > thus this operation is safe. On the other hand this significantly > reduces the scope of the lock. Sure, but does it have any effect?

[Qemu-devel] [PATCH v4 6/9] x86_iommu/amd: Add interrupt remap support when VAPIC is not enabled

2018-09-27 Thread Singh, Brijesh
Emulate the interrupt remapping support when guest virtual APIC is not enabled. For more info Refer: AMD IOMMU spec Rev 3.0 - section 2.2.5.1 When VAPIC is not enabled, it uses interrupt remapping as defined in Table 20 and Figure 15 from IOMMU spec. Signed-off-by: Brijesh Singh Cc: Peter Xu

[Qemu-devel] [PATCH v4 9/9] x86_iommu/amd: Enable Guest virtual APIC support

2018-09-27 Thread Singh, Brijesh
Now that amd-iommu support interrupt remapping, enable the GASup in IVRS table and GASup in extended feature register to indicate that IOMMU support guest virtual APIC mode. GASup provides option to guest OS to make use of 128-bit IRTE. Note that the GAMSup is set to zero to indicate that

[Qemu-devel] [PATCH v4 5/9] x86_iommu/amd: Prepare for interrupt remap support

2018-09-27 Thread Singh, Brijesh
Register the interrupt remapping callback and read/write ops for the amd-iommu-ir memory region. amd-iommu-ir is set to higher priority to ensure that this region won't be masked out by other memory regions. Signed-off-by: Brijesh Singh Cc: Peter Xu Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini

[Qemu-devel] [PATCH v4 4/9] x86_iommu/amd: make the address space naming consistent with intel-iommu

2018-09-27 Thread Singh, Brijesh
To be consistent with intel-iommu: - rename the address space to use '_' instead of '-' - update the memory region relationships Signed-off-by: Brijesh Singh Cc: Peter Xu Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: Tom

[Qemu-devel] [PATCH v4 1/9] x86_iommu: move the kernel-irqchip check in common code

2018-09-27 Thread Singh, Brijesh
Interrupt remapping needs kernel-irqchip={off|split} on both Intel and AMD platforms. Move the check in common place. Signed-off-by: Brijesh Singh Reviewed-by: Peter Xu Cc: Peter Xu Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum

[Qemu-devel] [PATCH v4 2/9] x86_iommu: move vtd_generate_msi_message in common file

2018-09-27 Thread Singh, Brijesh
The vtd_generate_msi_message() in intel-iommu is used to construct a MSI Message from IRQ. A similar function will be needed when we add interrupt remapping support in amd-iommu. Moving the function in common file to avoid the code duplication. Rename it to x86_iommu_irq_to_msi_message(). There is

[Qemu-devel] [PATCH v4 7/9] i386: acpi: add IVHD device entry for IOAPIC

2018-09-27 Thread Singh, Brijesh
When interrupt remapping is enabled, add a special IVHD device (type IOAPIC). Signed-off-by: Brijesh Singh Cc: Peter Xu Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: Tom Lendacky Cc: Suravee Suthikulpanit ---

[Qemu-devel] [PATCH v4 3/9] x86_iommu/amd: remove V=1 check from amdvi_validate_dte()

2018-09-27 Thread Singh, Brijesh
Currently, the amdvi_validate_dte() assumes that a valid DTE will always have V=1. This is not true. The V=1 means that bit[127:1] are valid. A valid DTE can have IV=1 and V=0 (i.e address translation disabled and interrupt remapping enabled) Remove the V=1 check from amdvi_validate_dte(), make

[Qemu-devel] [PATCH v4 0/9] x86_iommu/amd: add interrupt remap support

2018-09-27 Thread Singh, Brijesh
This series adds the interrupt remapping support for amd-iommu device. IOMMU spec is available at: https://support.amd.com/TechDocs/48882_IOMMU.pdf To enable the interrupt remap use below qemu cli # $QEMU \ -device amd-iommu,intremap=on I have tested FC-28 and Ubuntu 18.04 guest. Linux

[Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs

2018-09-27 Thread Peter Maydell
Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this. Avoid the bug by not using the "modify in place" byte

Re: [Qemu-devel] Qemu hanging

2018-09-27 Thread Alex Bennée
Peter Maydell writes: > On 27 September 2018 at 16:42, Alex Bennée wrote: >> If you can rebuild with: >> >> ./configure --enable-debug --extra-cflags="-O0 -g3 -fno-omit-frame-pointer" > > -O0 is the default if you specify --enable-debug, you don't > need to specify it separately. -O0 also

Re: [Qemu-devel] [PATCH 2/2] hw/pci-host/x86: extend the 64-bit PCI hole relative to the fw-assigned base

2018-09-27 Thread Laszlo Ersek
On 09/27/18 17:24, Eric Blake wrote: > On 9/26/18 3:35 PM, Laszlo Ersek wrote: >> (+Eric) > >> This too sounds useful. AIUI, ftruncate() is neither forbidden, nor >> required, to allocate filesystem extents when increasing the size of a >> file. Using one smaller regular temporary file as the

Re: [Qemu-devel] [PATCH 3/3] virtio-pmem: Add virtio pmem driver

2018-09-27 Thread Dan Williams
On Thu, Sep 27, 2018 at 6:07 AM Pankaj Gupta wrote: [..] > > We are plugging VIRTIO based flush callback for virtio_pmem driver. If pmem > > driver (pmem_make_request) has to queue request we have to plug "blk_mq_ops" > > callbacks for corresponding VIRTIO vqs. AFAICU there is no existing > >

[Qemu-devel] [PATCH] hw/display/qxl: Suppress clang-7 warning about misaligned atomic operation

2018-09-27 Thread Peter Maydell
If QEMU is compiled with clang-7 it results in the warning: hw/display/qxl.c:1884:19: error: misaligned or large atomic operation may incur significant performance penalty [-Werror,-Watomic-alignment] old_pending = atomic_fetch_or(>ram->int_pending, le_events); ^ This is

Re: [Qemu-devel] [PATCH v12 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-27 Thread Eric Blake
On 9/26/18 11:04 AM, Leonid Bloch wrote: The default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). * For non-Linux platforms the default is kept at 0, because cache-clean-interval is not supported

Re: [Qemu-devel] Qemu hanging

2018-09-27 Thread Peter Maydell
On 27 September 2018 at 16:42, Alex Bennée wrote: > If you can rebuild with: > > ./configure --enable-debug --extra-cflags="-O0 -g3 -fno-omit-frame-pointer" -O0 is the default if you specify --enable-debug, you don't need to specify it separately. -O0 also implies -fno-omit-frame-pointer.

Re: [Qemu-devel] Qemu hanging

2018-09-27 Thread Alex Bennée
Filipe Manana writes: > Hello, > > Recently qemu started hanging when running fstests (xfstests) after > upgrading the guests kernel (linux) from 4.15.x to 4.16. Nothing else > changed in the host or guest, besides the kernel version in the guest. > > Running fstests always hangs when running

Re: [Qemu-devel] [PATCH v3 1/5] qga: win32: fix crashes when PCI info cannot be retrived

2018-09-27 Thread Sameeh Jubran
On Thu, Sep 27, 2018 at 12:06 PM Tomáš Golembiovský wrote: > Hi Michael, > > thanks for looking into this. My comments are below. > > Adding Sameeh... > > > On Wed, 26 Sep 2018 12:15:48 -0500 > Michael Roth wrote: > > > Quoting Tomáš Golembiovský (2018-09-07 06:42:09) > > > The guest-get-fsinfo

[Qemu-devel] [PATCH] vhost-user: fix qemu crash caused by failed backend

2018-09-27 Thread Liang Li
During live migration, when stopping vhost-user device, 'vhost_dev_stop' will be called, 'vhost_dev_stop' will call a batch of 'vhost_user_read' and 'vhost_user_write'. If a previous 'vhost_user_read' or 'vhost_user_write' failed because the vhost user backend failed, the 'CHR_EVENT_CLOSED' event

[Qemu-devel] [PATCH] vhost-user: fix qemu crash caused by failed backend

2018-09-27 Thread Liang Li
During live migration, when stopping vhost-user device, 'vhost_dev_stop' will be called, 'vhost_dev_stop' will call a batch of 'vhost_user_read' and 'vhost_user_write'. If a previous 'vhost_user_read' or 'vhost_user_write' failed because the vhost user backend failed, the 'CHR_EVENT_CLOSED' event

Re: [Qemu-devel] [PATCH 2/2] hw/pci-host/x86: extend the 64-bit PCI hole relative to the fw-assigned base

2018-09-27 Thread Eric Blake
On 9/26/18 3:35 PM, Laszlo Ersek wrote: (+Eric) This too sounds useful. AIUI, ftruncate() is neither forbidden, nor required, to allocate filesystem extents when increasing the size of a file. Using one smaller regular temporary file as the common foundation for multiple "memory-backend-file"

Re: [Qemu-devel] [PATCH v12 0/9] Take the image size into account when allocating the L2 cache

2018-09-27 Thread Kevin Wolf
Am 26.09.2018 um 18:04 hat Leonid Bloch geschrieben: > This series makes the qcow2 L2 cache assignment aware of the image size, > with the intention for it to cover the entire image. The importance of > this change is in noticeable performance improvement, especially with > heavy random I/O. The

Re: [Qemu-devel] [PATCH 2/2] hw/pci-host/x86: extend the 64-bit PCI hole relative to the fw-assigned base

2018-09-27 Thread Eric Blake
On 9/26/18 3:26 PM, Laszlo Ersek wrote: (+Eric) I see shm_open() is used heavily in ivshmem-related tests. I haven't looked much at shm_open() before. (I've always known it existed in POSIX, but I've never cared.) I've never actually played with shm_open() myself, but understand the

Re: [Qemu-devel] [Qemu-block] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-27 Thread Max Reitz
On 27.09.18 16:23, Alberto Garcia wrote: > On Thu 27 Sep 2018 04:14:15 PM CEST, Max Reitz wrote: >> On 25.09.18 16:13, Alberto Garcia wrote: >>> On Thu 13 Sep 2018 08:37:05 PM CEST, Max Reitz wrote: First, split .003 into the part we want to commit and the part we don't want to commit.

Re: [Qemu-devel] [PATCH 2/2] hw/pci-host/x86: extend the 64-bit PCI hole relative to the fw-assigned base

2018-09-27 Thread Eric Blake
On 9/27/18 4:21 AM, Laszlo Ersek wrote: On 09/27/18 07:48, Gerd Hoffmann wrote: Hi, Maybe using memdev file backend with manually created sparse file might actually work (with preallocate disabled) Thanks, this sounds like a good idea. I see shm_open() is used heavily in ivshmem-related

Re: [Qemu-devel] [PATCH v2 2/2] docs: Document vCPU hotplug procedure

2018-09-27 Thread Kashyap Chamarthy
On Wed, Sep 26, 2018 at 05:24:27PM +0200, Igor Mammedov wrote: > On Tue, 25 Sep 2018 18:02:48 +0200 > Kashyap Chamarthy wrote: [...] > > +(1) Launch QEMU as follows (note that the "maxcpus" is mandatory to > > +allow vCPU hotplug):: > > + > > + $ qemu-system-x86_64 -display none

Re: [Qemu-devel] [PATCH v2 2/2] docs: Document vCPU hotplug procedure

2018-09-27 Thread Markus Armbruster
Igor Mammedov writes: > On Tue, 25 Sep 2018 18:02:48 +0200 > Kashyap Chamarthy wrote: > >> Signed-off-by: Kashyap Chamarthy >> --- >> docs/cpu-hotplug.rst | 140 +++ >> 1 file changed, 140 insertions(+) >> create mode 100644 docs/cpu-hotplug.rst >> >>

Re: [Qemu-devel] [Qemu-block] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-27 Thread Alberto Garcia
On Thu 27 Sep 2018 04:14:15 PM CEST, Max Reitz wrote: > On 25.09.18 16:13, Alberto Garcia wrote: >> On Thu 13 Sep 2018 08:37:05 PM CEST, Max Reitz wrote: >>> First, split .003 into the part we want to commit and the part we >>> don't want to commit. This is a bit tricky without qemu-img dd @seek

Re: [Qemu-devel] [Qemu-block] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-27 Thread Max Reitz
On 25.09.18 16:13, Alberto Garcia wrote: > On Thu 13 Sep 2018 08:37:05 PM CEST, Max Reitz wrote: >> First, split .003 into the part we want to commit and the part we >> don't want to commit. This is a bit tricky without qemu-img dd @seek >> (or a corresponding convert parameter), so we'll have to

Re: [Qemu-devel] [PATCH] cpus: fix TCG timer leak

2018-09-27 Thread Marc-André Lureau
Hi On Thu, Sep 27, 2018 at 5:57 PM Alex Bennée wrote: > > > Marc-André Lureau writes: > > > Spotted by ASAN: > > > > QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 tests/bios-tables-test > > -p /x86_64/acpi/piix4/cpuhp > > /x86_64/acpi/piix4/cpuhp: Could not access KVM kernel module: No

Re: [Qemu-devel] [PATCH v4 5/9] s390x/tcg: add instruction flags for floating point instructions

2018-09-27 Thread Thomas Huth
On 2018-09-27 15:02, David Hildenbrand wrote: > These flags allow us to later on detect if a DATA program interrupt > is to be injected, and which DXC (1,2,3) is to be used. > > Interestingly, some support FP instructions are considered as HFP > instructions (I assume simply because they were

Re: [Qemu-devel] [PATCH] util/hbitmaps: recalculate count on merge

2018-09-27 Thread Eric Blake
On 9/27/18 2:31 AM, Vladimir Sementsov-Ogievskiy wrote: 27.09.2018 00:28, John Snow wrote: We have been neglecting to do so, which results in wrong counts after merge. In the worst case, we may think the bitmap is empty when it has had new writes merged into it. Reported-by: Eric Blake

Re: [Qemu-devel] [PATCH v4 7/9] s390x/tcg: handle privileged instructions via flags

2018-09-27 Thread Thomas Huth
On 2018-09-27 15:03, David Hildenbrand wrote: > Let's check this also at a central place. > > Reviewed-by: Richard Henderson > Signed-off-by: David Hildenbrand > --- > target/s390x/insn-data.def | 138 ++--- > target/s390x/translate.c | 83

Re: [Qemu-devel] [PATCH] cpus: fix TCG timer leak

2018-09-27 Thread Alex Bennée
Marc-André Lureau writes: > Spotted by ASAN: > > QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 tests/bios-tables-test > -p /x86_64/acpi/piix4/cpuhp > /x86_64/acpi/piix4/cpuhp: Could not access KVM kernel module: No such file or > directory > qemu-system-x86_64: failed to initialize

Re: [Qemu-devel] [qemu-s390x] [PATCH v9 5/6] s390x/vfio: ap: Introduce VFIO AP device

2018-09-27 Thread Thomas Huth
On 2018-09-27 00:54, Tony Krowiak wrote: > Introduces a VFIO based AP device. The device is defined via > the QEMU command line by specifying: > > -device vfio-ap,sysfsdev= > > There may be only one vfio-ap device configured for a guest. > > The mediated matrix device is created by the VFIO

[Qemu-devel] [PATCH] hw/scsi/mptendian: Avoid taking address of fields in packed structs

2018-09-27 Thread Peter Maydell
Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this. Avoid the bug by not using the "modify in place" byte

Re: [Qemu-devel] [PATCH v2 1/3] hw/s390x/ipl: Fix alignment problems of S390IPLState members

2018-09-27 Thread Peter Maydell
On 26 September 2018 at 08:38, Thomas Huth wrote: > The IplParameterBlock and QemuIplParameters structures are declared > with QEMU_PACKED, so the compiler assumes that the structures do not > need to be aligned in memory. Since the are listed after a "bool" > within the S390IPLState, the

[Qemu-devel] Qemu hanging

2018-09-27 Thread Filipe Manana
Hello, Recently qemu started hanging when running fstests (xfstests) after upgrading the guests kernel (linux) from 4.15.x to 4.16. Nothing else changed in the host or guest, besides the kernel version in the guest. Running fstests always hangs when running either the test generic/299 or

[Qemu-devel] [PATCH v4 9/9] s390x/tcg: refactor specification checking

2018-09-27 Thread David Hildenbrand
We can fit this nicely into less LOC, without harming readability. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand --- target/s390x/translate.c | 34 ++ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git

  1   2   3   >