[Qemu-devel] [PULL 4/5] libqtest: Inline g_assert_no_errno()

2018-10-09 Thread Markus Armbruster
Macro g_assert_no_errno() intrudes into GLib's namespace. It's also pretty pointless. Inline. At one call site, its redundancy is now obvious. Delete it there. Signed-off-by: Markus Armbruster Message-Id: <20180926122933.3858-1-arm...@redhat.com> Reviewed-by: Laurent Vivier Reviewed-by: Thom

[Qemu-devel] [PULL 2/5] qapi/misc.json: Remove superfluous words in CpuModelExpansionType

2018-10-09 Thread Markus Armbruster
From: Kashyap Chamarthy Remove repetition of 'independent of'. While at it, s/QMU/QEMU in @CpuDefinitionInfo. Signed-off-by: Kashyap Chamarthy Message-Id: <20181003104605.8477-1-kcham...@redhat.com> Reviewed-by: Marc-André Lureau Reviewed-by: Eric Blake Reviewed-by: Eduardo Habkost [Commit

[Qemu-devel] [PULL 1/5] tests/check-qjson: fix a leak

2018-10-09 Thread Markus Armbruster
From: Marc-André Lureau Spotted by ASAN: = ==11893==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1120 byte(s) in 28 object(s) allocated from: #0 0x7fd0515b0c48 in malloc (/lib64/libasan.so.5+0xeec48) #1 0x7fd05

[Qemu-devel] [PULL 5/5] ivshmem: Fix unplug of device "ivshmem-plain"

2018-10-09 Thread Markus Armbruster
Commit 2aece63c8a "hostmem: detect host backend memory is being used properly" fixed "ivshmem-plain" to reject memory backends that are already in use, and to block their deletion while in use. Two bugs escaped review: * New ivshmem_plain_exit() fails to call ivshmem_exit(). This breaks unplug

[Qemu-devel] [PULL 3/5] tests: Restore check-qdict unit test

2018-10-09 Thread Markus Armbruster
Commit 0bcc8e5bd8d accidentally dropped check-qdict from the list of unit tests (again, see commit 4429532b48a). Put it back, and fix up the test. Signed-off-by: Markus Armbruster Message-Id: <20180926122309.30631-1-arm...@redhat.com> Reviewed-by: Thomas Huth --- tests/Makefile.include | 2 +-

[Qemu-devel] [PULL 0/5] Miscellaneous patches for 2018-10-10

2018-10-09 Thread Markus Armbruster
The following changes since commit 7c69b7c849641a39ba3defa40d384a2ba24cd7a2: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20181008' into staging (2018-10-08 15:01:30 +0100) are available in the Git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-misc-2018-10

[Qemu-devel] [Bug 1797033] Re: Running with -rtc clock=vm, base= introduces arbitrary base shift at guest startup

2018-10-09 Thread Artem Pisarenko
Why I didn't posted patch to qemu-devel ? I have no idea how to patch it correctly, because it isn't clear how these things are expected to work when referenced across all qemu code and different use cases. Should vl.c/qemu_get_timedate() just be fixed ? Does each caller expect same behavior fro

[Qemu-devel] [Bug 1797033] [NEW] Running with -rtc clock=vm, base= introduces arbitrary base shift at guest startup

2018-10-09 Thread Artem Pisarenko
Public bug reported: When specifying 'base' for RTC to start with, it has incorrect implementation in combination with clock=vm. I inspected source code. This is because it uses host clock (qemu_time() function return value) as reference with 'rtc_date_offset' operations across several places in

Re: [Qemu-devel] [QEMU-PPC] [PATCH V2 3/3] ppc/spapr_caps: Add SPAPR_CAP_NESTED_KVM_HV

2018-10-09 Thread David Gibson
On Mon, Oct 08, 2018 at 02:25:39PM +1100, Suraj Jitindar Singh wrote: > Add the spapr cap SPAPR_CAP_NESTED_KVM_HV to be used to control the > availability of nested kvm-hv to the level 1 (L1) guest. > > Assuming a hypervisor with support enabled an L1 guest can be allowed to > use the kvm-hv modul

Re: [Qemu-devel] [QEMU-PPC] [PATCH V2 2/3] target/ppc: Add one reg id for ptcr

2018-10-09 Thread David Gibson
On Mon, Oct 08, 2018 at 02:25:38PM +1100, Suraj Jitindar Singh wrote: > The ptcr (partition table control register) is used to store the address > and size of the partition table. For nested kvm-hv we have a level 1 > guest register the location of it's partition table with the hypervisor. > Thus t

Re: [Qemu-devel] [PATCH 4/6] monitor: check if chardev can switch gcontext for OOB

2018-10-09 Thread Peter Xu
On Tue, Oct 09, 2018 at 05:12:49PM +0400, Marc-André Lureau wrote: > Note: this patch will conflict with Peter "[PATCH v9 3/6] monitor: > remove "x-oob", turn oob on by default", but can be trivially updated. > > Signed-off-by: Marc-André Lureau > --- > monitor.c | 5 +++-- > 1 file changed, 3 i

[Qemu-devel] [PATCH] ide: piix: convert constant device name to MACRO

2018-10-09 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/ide/piix.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a3afe1f..5f29cce 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -35,6 +35,10 @@ #include "hw/ide/pci.h" #include "trace.h" +#d

Re: [Qemu-devel] [PATCH 3/6] char: add a QEMU_CHAR_FEATURE_GCONTEXT flag

2018-10-09 Thread Peter Xu
On Tue, Oct 09, 2018 at 05:12:48PM +0400, Marc-André Lureau wrote: > The feature should be set if the chardev is able to switch > GMainContext. Callers that want to put a chardev in a different thread > context can/should check this capabilities. IIRC we've had some discussion about whether we sho

Re: [Qemu-devel] [PATCH 2/6] monitor: accept chardev input from iothread

2018-10-09 Thread Peter Xu
On Tue, Oct 09, 2018 at 05:12:47PM +0400, Marc-André Lureau wrote: > Chardev backends may not handle safely IO events from concurrent > threads. Better to wake up the chardev from the monitor IO thread if > it's being used as the chardev context. > > Signed-off-by: Marc-André Lureau > --- > moni

[Qemu-devel] [Bug 1779017] Re: qemu-system-arm: crashes raspian kernels with divide-by-zero

2018-10-09 Thread Rob Thomas
This does not appear to be DIRECTLY a bug in QEMU, but 'something' has changed in the RPi Kernel to cause this issue. The actual cause of the panic is (in my situation) because the kernel is unable to mount root, and this is caused by it being unable to access the SD interface, as it can't get tim

Re: [Qemu-devel] [PATCH v9 2/6] monitor: resume the monitor earlier if needed

2018-10-09 Thread Peter Xu
On Tue, Oct 09, 2018 at 12:54:37PM +0400, Marc-André Lureau wrote: > Hi > On Tue, Oct 9, 2018 at 10:28 AM Peter Xu wrote: > > > > Currently when QMP request queue full we won't resume the monitor until > > we have completely handled the current command. It's not necessary > > since even before it

Re: [Qemu-devel] The results of lspci are inconsistent between vfio reset pci devices and reset devices by sysfs interafce

2018-10-09 Thread Alex Williamson
On Wed, 10 Oct 2018 01:47:10 + "Wuzongyong (Euler Dept)" wrote: > > You're right. The initial states are not identical. > I found the function vfio_pci_pre_reset in qemu. > /* > * Stop any ongoing DMA by disconecting I/O, MMIO, and bus master. > * Also put INTx Disable in known

Re: [Qemu-devel] [PATCH 1/1] i386: Add new model of Cascadelake-Server

2018-10-09 Thread Liu, Jingqi
Hi Eduardo/Paolo, Do you have any comments about this patch ? Thanks Jingqi > -Original Message- > From: Xu, Tao3 > Sent: Wednesday, September 19, 2018 11:11 AM > To: pbonz...@redhat.com; r...@twiddle.net; ehabk...@redhat.com > Cc: qemu-devel@nongnu.org; Liu, Jingqi ; Xu, Tao3 > > Subje

Re: [Qemu-devel] The results of lspci are inconsistent between vfio reset pci devices and reset devices by sysfs interafce

2018-10-09 Thread Wuzongyong (Euler Dept)
> > > Hi, > > > > > > I start a virtual machine with commandline: > > > /usr/libexec/qemu-kvm --enable-kvm -smp 8 -m 8192 -device > > > vfio-pci,host=:81:00.0 > > > > > > Then I pause the qemu process before executing the main_loop > > > function by > > gdb. > > > At this moment, lspci show

Re: [Qemu-devel] The results of lspci are inconsistent between vfio reset pci devices and reset devices by sysfs interafce

2018-10-09 Thread Wuzongyong (Euler Dept)
> > Hi, > > > > I start a virtual machine with commandline: > > /usr/libexec/qemu-kvm --enable-kvm -smp 8 -m 8192 -device > > vfio-pci,host=:81:00.0 > > > > Then I pause the qemu process before executing the main_loop function by > gdb. > > At this moment, lspci shows the regions are disabl

Re: [Qemu-devel] [PATCH v2] hw/ppc/spapr_rng: Introduce CONFIG_SPAPR_RNG switch for spapr_rng.c

2018-10-09 Thread David Gibson
On Mon, Oct 08, 2018 at 02:39:42PM +0200, Thomas Huth wrote: > The spapr-rng device is suboptimal when compared to virtio-rng, so > users might want to disable it in their builds. Thus let's introduce > a proper CONFIG switch to allow us to compile QEMU without this device. > The function spapr_rng

[Qemu-devel] [PATCH v2 7/7] Acceptance Tests: change the handling of tests for specific archs

2018-10-09 Thread Cleber Rosa
With the introduction of a variants file that can run the same tests on various architectures, it makes sense to make most tests to be reusable on those environments. The exception should be when a test is really testing a specific architecture feature. With the change proposed here, on a command

[Qemu-devel] [PATCH v2 5/7] Acceptance Tests: set machine type

2018-10-09 Thread Cleber Rosa
By setting the machine type, even if it's the one that will be picked based on the arch, it's possible to run the same tests with targets that require a machine type (in addition to those that don't). Given that only boot_linux_console.py contains code specific to x86_64 (an explicit reference to

[Qemu-devel] [PATCH v2 6/7] Acceptance Tests: add variants definition for architectures

2018-10-09 Thread Cleber Rosa
One of the Avocado features relevant to virtualization testing is the ability to reuse tests in different scenarios, known as variants. This adds a JSON based variants file, that can be used to run most tests in a number of different architectures. It can be run with: $ avocado run \ --js

[Qemu-devel] [PATCH v2 2/7] Acceptance Tests: introduce arch parameter and attribute

2018-10-09 Thread Cleber Rosa
On a number of different scenarios, such as when choosing a QEMU binary to be used on tests (or a image to use to boot a test VM), it's useful to define the architecture that should be used. This introduces both a test parameter and a test instance attribute, that will contain such a value. The s

[Qemu-devel] [PATCH v2 4/7] scripts/qemu.py: set predefined machine type based on arch

2018-10-09 Thread Cleber Rosa
Some targets require a machine type to be set, as there's no default (aarch64 is one example). To give a consistent interface to users of this API, this changes set_machine() so that a predefined default can be used, if one is not given. The approach used is exactly the same with the console devi

[Qemu-devel] [PATCH v2 0/7] Acceptance Tests: basic architecture support

2018-10-09 Thread Cleber Rosa
The current version of the Acceptance Tests have been basically tested on x86_64. Most of them should be valid tests on many different architectures. This introduces another standard test parameter, 'arch', and a public test attribute with the same name. Then, because of the different behavior i

[Qemu-devel] [PATCH v2 1/7] Acceptance Tests: improve docstring on pick_default_qemu_bin()

2018-10-09 Thread Cleber Rosa
Making it clear what is returned by this utility function. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé --- tests/acceptance/avocado_qemu/__init__.py | 4 1 file changed, 4 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_q

[Qemu-devel] [PATCH v2 3/7] scripts/qemu.py: add method and private attribute for arch

2018-10-09 Thread Cleber Rosa
Because some sane defaults may require the knowledge of the arch, let's give the QEMUMachine the opportunity to hold that information. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé --- scripts/qemu.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/scripts/qemu.py b/

[Qemu-devel] [Bug 1796754] Re: ioctl SIOCGIFCONF causes qemu-aarch64-static to crash with "received signal outside vCPU context"

2018-10-09 Thread Ke Liu
I sent out a patch: http://lists.nongnu.org/archive/html/qemu-devel/2018-10/msg01657.html (Please ignore the other 2 identical patches. It was my first time sending out patches and I didn't know it was moderated so I sent it out multiple times). -- You received this bug notification because you

Re: [Qemu-devel] [PATCH 5/7] Acceptance Tests: set machine type

2018-10-09 Thread Cleber Rosa
On 10/5/18 11:42 AM, Philippe Mathieu-Daudé wrote: > On 04/10/2018 17:14, Cleber Rosa wrote: >> By setting the machine type, even if it's the one that will be picked >> based on the arch, it's possible to run the same tests with targets >> that require a machine type (in addition to those that d

Re: [Qemu-devel] [Qemu-block] [PATCH v4 00/10] NBD reconnect

2018-10-09 Thread Vladimir Sementsov-Ogievskiy
On 10/09/2018 10:33 PM, John Snow wrote: > > > On 09/17/2018 11:26 AM, Vladimir Sementsov-Ogievskiy wrote: >> ping >> > > Is this still pending or did I/we miss a v5? still pending > >> 31.07.2018 20:30, Vladimir Sementsov-Ogievskiy wrote: >>> Hi all. >>> >>> Here is NBD reconnect. Previous

[Qemu-devel] [PATCH v1 3/7] range: pass const pointer where possible

2018-10-09 Thread David Hildenbrand
If there are no changes, let's use a const pointer. Signed-off-by: David Hildenbrand --- include/qemu/range.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qemu/range.h b/include/qemu/range.h index f28f0c1825..7e75f4e655 100644 --- a/include/qemu/range.h +++ b

[Qemu-devel] [PATCH v1 7/7] memory-device: rewrite address assignment using ranges

2018-10-09 Thread David Hildenbrand
Let's rewrite it properly using ranges. This fixes certain overflows that are right now possible. E.g. qemu-system-x86_64 -m 4G,slots=20,maxmem=40G -M pc \ -object memory-backend-file,id=mem1,share,mem-path=/dev/zero,size=2G -device pc-dimm,memdev=mem1,id=dimm1,addr=-0x4000 Now proper

[Qemu-devel] [PATCH v1 6/7] memory-device: avoid overflows on very huge devices

2018-10-09 Thread David Hildenbrand
Should not be a problem right now, but it could theoretically happen in the future. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index 996ad1490f..8be63c8032 10064

[Qemu-devel] [PATCH v1 1/7] qapi: correctly parse uint64_t values from strings

2018-10-09 Thread David Hildenbrand
Right now, we parse uint64_t values just like int64_t values, resulting in negative values getting accepted and certain valid large numbers only being representable as negative numbers. Also, reported errors indicate that an int64_t is expected. Parse uin64_t separately. Implementation inspired by

[Qemu-devel] [PATCH v1 5/7] memory-device: use QEMU_IS_ALIGNED

2018-10-09 Thread David Hildenbrand
Shorter and easier to read. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index 7de1ccd497..996ad1490f 100644 --- a/hw/mem/memory-device.c +++ b/hw/mem/memory-d

[Qemu-devel] [PATCH v1 2/7] qapi: use qemu_strtoi64() in parse_str_int64

2018-10-09 Thread David Hildenbrand
The qemu api claims to be easier to use, and the resulting code shows that. Signed-off-by: David Hildenbrand --- qapi/string-input-visitor.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index af0a8

[Qemu-devel] [PATCH v1 4/7] range: add some more functions

2018-10-09 Thread David Hildenbrand
Add some more functions that will be used in memory-device context. range_init(): Init using lower bound and size range_valid(): Check if there would be an overflow when initializin range_size(): Extract the size of a range range_overlaps_range(): Check for overlaps of two ranges range_contains_ra

[Qemu-devel] [PATCH v1 0/7] qapi/range/memory-device: fixes and cleanups

2018-10-09 Thread David Hildenbrand
While working on memory device code, I noticed that specifiying an uint64_t on command line does not work in all cases as we always parse an int64_t. So I fix that and also cleanup the old int64_t parser. To be able to fix some overflows in memory-device code in a clean way, I am reusing the range

Re: [Qemu-devel] [PATCH v5 3/6] exec: introduce tlb_init

2018-10-09 Thread Richard Henderson
On 10/9/18 10:45 AM, Emilio G. Cota wrote: > Paves the way for the addition of a per-TLB lock. > > Reviewed-by: Alex Bennée > Signed-off-by: Emilio G. Cota > --- > include/exec/exec-all.h | 8 > accel/tcg/cputlb.c | 4 > exec.c | 1 + > 3 files changed, 13 in

Re: [Qemu-devel] [PATCH v5 2/6] target/unicore32: remove tlb_flush from uc32_init_fn

2018-10-09 Thread Richard Henderson
On 10/9/18 10:45 AM, Emilio G. Cota wrote: > As far as I can tell tlb_flush does not need to be called > this early. tlb_flush is eventually called after the CPU > has been realized. > > This change paves the way to the introduction of tlb_init, > which will be called from cpu_exec_realizefn. > >

Re: [Qemu-devel] [PATCH v5 1/6] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-09 Thread Richard Henderson
On 10/9/18 11:25 AM, Peter Maydell wrote: >> /* PALBR */ >> tcg_gen_st_i64(vb, cpu_env, offsetof(CPUAlphaState, palbr)); >> /* Changing the PAL base register implies un-chaining all of the TBs >>that ended with a CALL_PAL. Since the base register usually only >>

Re: [Qemu-devel] [PATCH v5 1/6] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-09 Thread Richard Henderson
On 10/9/18 10:45 AM, Emilio G. Cota wrote: > As far as I can tell tlb_flush does not need to be called > this early. tlb_flush is eventually called after the CPU > has been realized. > > This change paves the way to the introduction of tlb_init, > which will be called from cpu_exec_realizefn. > >

Re: [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment

2018-10-09 Thread Richard Henderson
On 10/9/18 12:45 PM, Laurent Vivier wrote: > Le 09/10/2018 à 20:40, Peter Maydell a écrit : >> Remove a comment suggesting that we need to call tb_flush() >> after writing the SPARC signal frame trampoline insns. >> This isn't necessary in QEMU, because (even if the guest >> architecture requires e

[Qemu-devel] OpenBSD with VirtIO networking causes QEMU to crash

2018-10-09 Thread viq
(please CC me as I'm not subscribed to the list) I verified the behaviour on two different machines, both running archlinux with QEMU 3.0.0 and reported it on https://bugs.archlinux.org/task/60141 where it was suggested I bring it to the list. So what happens: if you try to run OpenBSD with VirtIO

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

2018-10-09 Thread David Hildenbrand
> +static void vfio_ap_realize(DeviceState *dev, Error **errp) > +{ > +int ret; > +char *mdevid; > +Error *local_err = NULL; > +VFIOGroup *vfio_group; > +APDevice *apdev = AP_DEVICE(dev); > +VFIOAPDevice *vapdev = VFIO_AP_DEVICE(apdev); > + > +vfio_group = vfio_ap_get_

Re: [Qemu-devel] [PATCH v10 3/6] s390x/kvm: enable AP instruction interpretation for guest

2018-10-09 Thread David Hildenbrand
On 09/10/2018 19:52, Tony Krowiak wrote: > From: Tony Krowiak > > Let's use the KVM_SET_DEVICE_ATTR ioctl to enable hardware > interpretation of AP instructions executed on the guest. > If the S390_FEAT_AP feature is switched on for the guest, > AP instructions must be interpreted by default; oth

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

2018-10-09 Thread David Hildenbrand
On 09/10/2018 21:14, Christian Borntraeger wrote: > > > On 10/09/2018 07:52 PM, 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

Re: [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment

2018-10-09 Thread Laurent Vivier
Le 09/10/2018 à 20:40, Peter Maydell a écrit : > Remove a comment suggesting that we need to call tb_flush() > after writing the SPARC signal frame trampoline insns. > This isn't necessary in QEMU, because (even if the guest > architecture requires explicit icache maintenance) we > ensure that memo

Re: [Qemu-devel] [Qemu-block] [PATCH v2] nvme: correct locking around completion

2018-10-09 Thread John Snow
On 08/14/2018 02:27 AM, Paolo Bonzini wrote: > nvme_poll_queues is already protected by q->lock, and > AIO callbacks are invoked outside the AioContext lock. > So remove the acquire/release pair in nvme_handle_event. > > Signed-off-by: Paolo Bonzini > --- > block/nvme.c | 2 -- > 1 file chang

[Qemu-devel] [PATCH 2/4] block: Add auto-read-only option

2018-10-09 Thread Kevin Wolf
If a management application builds the block graph node by node, the protocol layer doesn't inherit its read-only option from the format layer any more, so it must be set explicitly. Backing files should work on read-only storage, but at the same time, a block job like commit should be able to reo

[Qemu-devel] [PATCH 0/4] block: Add auto-read-only option

2018-10-09 Thread Kevin Wolf
Peter, would this provide what libvirt urgently needs for backing files vs. the commit block job? Kevin Wolf (4): block: Update flags in bdrv_set_read_only() block: Add auto-read-only option nbd: Support auto-read-only option file-posix: Support auto-read-only option qapi/block-core.json

[Qemu-devel] [PATCH 1/4] block: Update flags in bdrv_set_read_only()

2018-10-09 Thread Kevin Wolf
To fully change the read-only state of a node, we must not only change bs->read_only, but also update bs->open_flags. Signed-off-by: Kevin Wolf --- block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block.c b/block.c index 0d6e5f1a76..d7bd6d29b4 100644 --- a/block.c +++ b/block.c

[Qemu-devel] [PATCH 3/4] nbd: Support auto-read-only option

2018-10-09 Thread Kevin Wolf
If read-only=off, but auto-read-only=on are given, open a read-write NBD connection if the server provides a read-write export, but instead of erroring out for read-only exports, just degrade to read-only. Signed-off-by: Kevin Wolf --- block/nbd-client.h | 1 + block/nbd-client.c | 14 +

[Qemu-devel] [PATCH 4/4] file-posix: Support auto-read-only option

2018-10-09 Thread Kevin Wolf
If read-only=off, but auto-read-only=on are given, open the file read-write if we have the permissions, but instead of erroring out for read-only files, just degrade to read-only. Signed-off-by: Kevin Wolf --- block/file-posix.c | 13 + 1 file changed, 13 insertions(+) diff --git a/

Re: [Qemu-devel] [Spice-devel] [RFC PATCH spice 1/2] QXL interface: add functions to identify monitors in the guest

2018-10-09 Thread Jonathon Jongsma
On Tue, 2018-10-09 at 15:10 +0200, Lukáš Hrázký wrote: > Adds two functions to let QEMU provide information to identify > graphics > devices and their monitors in the guest: > > * device path - The path identifying the device on the system (e.g. > PCI > path): > spice_qxl_device_set_path(...)

Re: [Qemu-devel] [Qemu-block] [PATCH v4 00/10] NBD reconnect

2018-10-09 Thread John Snow
On 09/17/2018 11:26 AM, Vladimir Sementsov-Ogievskiy wrote: > ping > Is this still pending or did I/we miss a v5? > 31.07.2018 20:30, Vladimir Sementsov-Ogievskiy wrote: >> Hi all. >> >> Here is NBD reconnect. Previously, if connection failed all current >> and future requests will fail. Afte

Re: [Qemu-devel] [PATCH v3 4/8] qemu-img: potential Null pointer deref in img_commit()

2018-10-09 Thread John Snow
On 08/31/2018 02:16 PM, Liam Merwick wrote: > The function block_job_get() may return NULL so before dereferencing > the 'job' pointer in img_commit() it should be checked. > > Signed-off-by: Liam Merwick > Reviewed-by: Darren Kenny > Reviewed-by: Mark Kanda Reviewed-by: John Snow > --- >

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

2018-10-09 Thread Christian Borntraeger
On 10/09/2018 07:52 PM, 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 >instructions are available to the guest. Th

Re: [Qemu-devel] [PATCH v3 2/8] job: Fix off-by-one assert checks for JobSTT and JobVerbTable

2018-10-09 Thread John Snow
On 08/31/2018 02:16 PM, Liam Merwick wrote: > In the assert checking the array dereference of JobVerbTable[verb] > in job_apply_verb() the check of the index, verb, allows an overrun > because an index equal to the array size is permitted. > > Similarly, in the assert check of JobSTT[s0][s1] wi

Re: [Qemu-devel] [Qemu-block] [PATCH 0/3] block/qcow*: Don't take address of fields in packed structs

2018-10-09 Thread John Snow
On 10/09/2018 01:24 PM, 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.

Re: [Qemu-devel] [PATCH v3 0/9] tcg: Reorg 128-bit atomic operations

2018-10-09 Thread Emilio G. Cota
On Wed, Oct 03, 2018 at 14:39:22 -0500, Richard Henderson wrote: (snip) > Richard Henderson (9): > tcg: Split CONFIG_ATOMIC128 > target/i386: Convert to HAVE_CMPXCHG128 > target/arm: Convert to HAVE_CMPXCHG128 > target/arm: Check HAVE_CMPXCHG128 at translate time > target/ppc: Convert to

[Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment

2018-10-09 Thread Peter Maydell
Remove a comment suggesting that we need to call tb_flush() after writing the SPARC signal frame trampoline insns. This isn't necessary in QEMU, because (even if the guest architecture requires explicit icache maintenance) we ensure that memory writes result in invalidation of translated code from

Re: [Qemu-devel] [PATCH] coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls

2018-10-09 Thread Peter Maydell
On 9 October 2018 at 19:23, Eric Blake wrote: > On 10/9/18 1:16 PM, Peter Maydell wrote: >> >> Add a new Coccinelle script which replaces uses of the inplace >> byteswapping functions *_to_cpus() and cpu_to_*s() with their >> not-in-place equivalents. This is useful for where the swapping >> is do

[Qemu-devel] [PATCH] target/i386: Remove #ifdeffed-out icebp debugging hack

2018-10-09 Thread Peter Maydell
Remove a debugging hack which could be used to cause the undocumented 'icebp' instruction to enable QEMU internal debug logging. This code has always been #ifdeffed out since it was introduced in commit aba9d61e34b9 in 2005; judging by the rest of that commit (which is entirely unrelated) it may ha

Re: [Qemu-devel] [PATCH v5 1/6] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-09 Thread Peter Maydell
On 9 October 2018 at 19:20, Emilio G. Cota wrote: > On Tue, Oct 09, 2018 at 18:55:30 +0100, Peter Maydell wrote: >> >> What's the codepath by which tlb_flush gets called on >> cpu reset? I had a quick look but couldn't find it... > > From cpu.c: > > static void cpu_common_reset(CPUState *cpu) > {

Re: [Qemu-devel] [PATCH] coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls

2018-10-09 Thread Eric Blake
On 10/9/18 1:16 PM, Peter Maydell wrote: Add a new Coccinelle script which replaces uses of the inplace byteswapping functions *_to_cpus() and cpu_to_*s() with their not-in-place equivalents. This is useful for where the swapping is done on members of a packed struct -- taking the address of the

Re: [Qemu-devel] [PATCH v5 1/6] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-09 Thread Emilio G. Cota
On Tue, Oct 09, 2018 at 18:55:30 +0100, Peter Maydell wrote: > On 9 October 2018 at 18:45, Emilio G. Cota wrote: (snip) > > @@ -201,7 +201,6 @@ static void alpha_cpu_initfn(Object *obj) > > CPUAlphaState *env = &cpu->env; > > > > cs->env_ptr = env; > > -tlb_flush(cs); > > > > en

Re: [Qemu-devel] [PATCH v2 3/3] Travis support for the acceptance tests

2018-10-09 Thread Alex Bennée
Cleber Rosa writes: > On 10/9/18 9:46 AM, Philippe Mathieu-Daudé wrote: >> Hi Cleber, >> >> On 09/10/2018 06:18, Cleber Rosa wrote: >>> This enables the execution of the acceptance tests on Travis. >> >> Did you test this? =) >> > > I did have some jobs on Travis that looked promising. But yea

[Qemu-devel] [PATCH] coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls

2018-10-09 Thread Peter Maydell
Add a new Coccinelle script which replaces uses of the inplace byteswapping functions *_to_cpus() and cpu_to_*s() with their not-in-place equivalents. This is useful for where the swapping is done on members of a packed struct -- taking the address of the member to pass it to an inplace function is

Re: [Qemu-devel] [PATCH v5 2/6] target/unicore32: remove tlb_flush from uc32_init_fn

2018-10-09 Thread Alex Bennée
Emilio G. Cota writes: > As far as I can tell tlb_flush does not need to be called > this early. tlb_flush is eventually called after the CPU > has been realized. > > This change paves the way to the introduction of tlb_init, > which will be called from cpu_exec_realizefn. > > Cc: Guan Xuetao

Re: [Qemu-devel] [PATCH v5 1/6] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-09 Thread Alex Bennée
Emilio G. Cota writes: > As far as I can tell tlb_flush does not need to be called > this early. tlb_flush is eventually called after the CPU > has been realized. > > This change paves the way to the introduction of tlb_init, > which will be called from cpu_exec_realizefn. > > Signed-off-by: Em

[Qemu-devel] [PATCH v10 4/6] s390x/ap: base Adjunct Processor (AP) object model

2018-10-09 Thread Tony Krowiak
From: Tony Krowiak Introduces the base object model for virtualizing AP devices. Signed-off-by: Tony Krowiak Tested-by: Pierre Morel Acked-by: David Hildenbrand --- MAINTAINERS | 12 ++ hw/s390x/Makefile.objs | 2 + hw/s390x/ap-bridge.c | 78 +++

[Qemu-devel] [PATCH v3 3/3] Travis support for the acceptance tests

2018-10-09 Thread Cleber Rosa
This enables the execution of the acceptance tests on Travis. Because the Travis environment is based on Ubuntu Trusty, it requires the python3-pip. Note: while another supposedely required component on newer versions (such as on Bionic) split the Python 3 installation further on the python3-venv

[Qemu-devel] [PATCH v10 3/6] s390x/kvm: enable AP instruction interpretation for guest

2018-10-09 Thread Tony Krowiak
From: Tony Krowiak Let's use the KVM_SET_DEVICE_ATTR ioctl to enable hardware interpretation of AP instructions executed on the guest. If the S390_FEAT_AP feature is switched on for the guest, AP instructions must be interpreted by default; otherwise, they will be intercepted. This attribute set

Re: [Qemu-devel] [PATCH v3 1/3] Bootstrap Python venv for tests

2018-10-09 Thread Eric Blake
On 10/9/18 12:57 PM, Cleber Rosa wrote: A number of QEMU tests are written in Python, and may benefit from an untainted Python venv. By using make rules, tests that depend on specific Python libs can set that rule as a requiment, along with rules that require s/requiment/requirement/ the pre

[Qemu-devel] [PATCH v3 0/3] Bootstrap Python venv and acceptance/functional tests

2018-10-09 Thread Cleber Rosa
TL;DR = Allow acceptance tests to be run with `make check-acceptance`. Details === This introduces a Python virtual environment that will be setup within the QEMU build directory, that will contain the exact environment that tests may require. There's one current caveat: it requires Pyt

[Qemu-devel] [PATCH v3 2/3] Acceptance tests: add make rule for running them

2018-10-09 Thread Cleber Rosa
The acceptance (aka functional, aka Avocado-based) tests are Python files located in "tests/acceptance" that need to be run with the Avocado libs and test runner. Let's provide a convenient way for QEMU developers to run them, by making use of the tests-venv with the required setup. Also, while t

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

2018-10-09 Thread Tony Krowiak
Updates the linux header files in preparation for introduction of the VFIO AP device: * Added device attributes to the KVM_S390_VM_CRYPTO group to indicate whether AP instructions are to be interpreted * Added VFIO device information for AP devices Signed-off-by: Tony Krowiak --- linux-heade

Re: [Qemu-devel] [PATCH v5 1/6] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-09 Thread Peter Maydell
On 9 October 2018 at 18:45, Emilio G. Cota wrote: > As far as I can tell tlb_flush does not need to be called > this early. tlb_flush is eventually called after the CPU > has been realized. > > This change paves the way to the introduction of tlb_init, > which will be called from cpu_exec_realizef

[Qemu-devel] [RFC v3 2/5] (XXX) cputlb: introduce indirection for TLB size

2018-10-09 Thread Emilio G. Cota
This paves the way for implementing dynamic TLB resizing. XXX: convert other TCG backends Signed-off-by: Emilio G. Cota --- include/exec/cpu-defs.h | 10 ++ include/exec/cpu_ldst.h | 14 +- accel/tcg/cputlb.c| 18 +++--- tcg/i386/tcg-target.inc.c | 26

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

2018-10-09 Thread Tony Krowiak
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 AP device driver by writing a UUID to a sysfs attribute f

[Qemu-devel] [PATCH v10 6/6] s390: doc: detailed specifications for AP virtualization

2018-10-09 Thread Tony Krowiak
This patch provides documentation describing the AP architecture and design concepts behind the virtualization of AP devices. It also includes an example of how to configure AP devices for exclusive use of KVM guests. Signed-off-by: Tony Krowiak Reviewed-by: Pierre Morel Tested-by: Pierre Morel -

[Qemu-devel] [PATCH v3 1/3] Bootstrap Python venv for tests

2018-10-09 Thread Cleber Rosa
A number of QEMU tests are written in Python, and may benefit from an untainted Python venv. By using make rules, tests that depend on specific Python libs can set that rule as a requiment, along with rules that require the presence or installation of specific libraries. The tests/venv-requiremen

[Qemu-devel] [RFC v3 4/5] cputlb: track TLB use rate

2018-10-09 Thread Emilio G. Cota
This paves the way for implementing a dynamically-sized softmmu. Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- include/exec/cpu-defs.h | 5 + accel/tcg/cputlb.c | 17 ++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/exec/cpu-defs.h

[Qemu-devel] [PATCH v10 0/6] s390x: vfio-ap: guest dedicated crypto adapters

2018-10-09 Thread Tony Krowiak
From: Tony Krowiak This patch series is the QEMU counterpart to the KVM/kernel support for guest dedicated crypto adapters. The KVM/kernel model is built on the VFIO mediated device framework and provides the infrastructure for granting exclusive guest access to crypto devices installed on the

[Qemu-devel] [RFC v3 0/5] Dynamic TLB sizing

2018-10-09 Thread Emilio G. Cota
v2: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01495.html Changes since v2: - Add R-b's - Apply on top of tlb-lock-v5 series, fixing the alpha boot segfault due to the early tlb_flush + The series now passes `make check-qtest' - Alloc the iotlb with g_new instead of g_new0 -

[Qemu-devel] [RFC v3 5/5] (XXX) cputlb: dynamically resize TLBs based on use rate

2018-10-09 Thread Emilio G. Cota
XXX: convert CPU_TLB_BITS/CPU_TLB_SIZE users in non-i386 TCG backends Perform the resizing only on flushes, otherwise we'd have to take a perf hit by either rehashing the array or unnecessarily flushing it. We grow the array aggressively, and reduce the size more slowly. This accommodates mi

[Qemu-devel] [RFC v3 1/5] tcg: Add tlb_index and tlb_entry helpers

2018-10-09 Thread Emilio G. Cota
From: Richard Henderson Isolate the computation of an index from an address into a helper before we change that function. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson [ cota: convert tlb_vaddr_to_host; use atomic_read on addr_write ] Signed-off-by: Emilio G. Cota --- accel/tcg/s

Re: [Qemu-devel] [PATCH 0/3] block/qcow*: Don't take address of fields in packed structs

2018-10-09 Thread Richard Henderson
On 10/9/18 10:24 AM, Peter Maydell wrote: > Peter Maydell (3): > block/qcow2: Don't take address of fields in packed structs > block/qcow: Don't take address of fields in packed structs > block/qcow2-bitmap: Don't take address of fields in packed structs Reviewed-by: Richard Henderson Alth

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

2018-10-09 Thread Tony Krowiak
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 instructions are available to the guest. This feature will be enabled only if the AP instructions are

[Qemu-devel] [PATCH v5 6/6] cputlb: read CPUTLBEntry.addr_write atomically

2018-10-09 Thread Emilio G. Cota
Updates can come from other threads, so readers that do not take tlb_lock must use atomic_read to avoid undefined behaviour (UB). This and the previous commit result on average in no performance loss, as the following experiments (run on an Intel i7-6700K CPU @ 4.00GHz) show. 1. aarch64 bootup+sh

[Qemu-devel] [RFC v3 3/5] cputlb: do not evict empty entries to the vtlb

2018-10-09 Thread Emilio G. Cota
Currently we evict an entry to the victim TLB when it doesn't match the current address. But it could be that there's no match because the current entry is empty (i.e. all -1's, for instance via tlb_flush). Do not evict the entry to the vtlb in that case. This change will help us keep track of the

[Qemu-devel] [PATCH v5 2/6] target/unicore32: remove tlb_flush from uc32_init_fn

2018-10-09 Thread Emilio G. Cota
As far as I can tell tlb_flush does not need to be called this early. tlb_flush is eventually called after the CPU has been realized. This change paves the way to the introduction of tlb_init, which will be called from cpu_exec_realizefn. Cc: Guan Xuetao Signed-off-by: Emilio G. Cota --- targe

[Qemu-devel] [PATCH v5 5/6] cputlb: serialize tlb updates with env->tlb_lock

2018-10-09 Thread Emilio G. Cota
Currently we rely on atomic operations for cross-CPU invalidations. There are two cases that these atomics miss: cross-CPU invalidations can race with either (1) vCPU threads flushing their TLB, which happens via memset, or (2) vCPUs calling tlb_reset_dirty on their TLB, which updates .addr_write w

[Qemu-devel] [PATCH v5 0/6] per-TLB lock

2018-10-09 Thread Emilio G. Cota
v4: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01421.html Changes since v4: - Add two patches to remove early calls to tlb_flush. You can fetch the series from: https://github.com/cota/qemu/tree/tlb-lock-v5 Thanks, Emilio

[Qemu-devel] [PATCH v5 3/6] exec: introduce tlb_init

2018-10-09 Thread Emilio G. Cota
Paves the way for the addition of a per-TLB lock. Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 8 accel/tcg/cputlb.c | 4 exec.c | 1 + 3 files changed, 13 insertions(+) diff --git a/include/exec/exec-all.h b/include/e

[Qemu-devel] [PATCH v5 1/6] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-09 Thread Emilio G. Cota
As far as I can tell tlb_flush does not need to be called this early. tlb_flush is eventually called after the CPU has been realized. This change paves the way to the introduction of tlb_init, which will be called from cpu_exec_realizefn. Signed-off-by: Emilio G. Cota --- target/alpha/cpu.c | 1

[Qemu-devel] [PATCH v5 4/6] cputlb: fix assert_cpu_is_self macro

2018-10-09 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- accel/tcg/cputlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 502eea2850..f6b388c961 100644 --- a/accel/tcg/cputlb.c +++ b/accel/t

  1   2   3   4   >