[Qemu-devel] [PATCH v3 00/15] Invert Endian bit in SPARCv9 MMU TTE

2019-07-25 Thread tony.nguyen
This patchset implements the IE (Invert Endian) bit in SPARCv9 MMU TTE. It is an attempt of the instructions outlined by Richard Henderson to Mark Cave-Ayland. Tested with OpenBSD on sun4u. Solaris 10 is my actual goal, but unfortunately a separate keyboard issue remains in the way. On 01/11/17

[Qemu-devel] [PATCH v3 02/15] memory: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Replacing size with size+sign+endianness (MemOp) will enable us to collapse the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. While interfaces are converted, callers will have existing unsigned size coerced into a MemOp, and the callee will use this MemOp as an unsigned s

[Qemu-devel] [PATCH v3 01/15] tcg: TCGMemOp is now accelerator independent MemOp

2019-07-25 Thread tony.nguyen
Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Target dependant attributes are conditionalize upon NEED_CPU_H. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 2 +- include/exec/memop.h| 109 +

[Qemu-devel] [PATCH v3 03/15] target/mips: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- target/mips/op_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 9e2e02f..dccb8df 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -24,6 +24,7 @@ #include "

[Qemu-devel] [PATCH v3 04/15] hw/s390x: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/s390x/s390-pci-inst.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 0023514..c126bcc 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -15,6 +15,7 @@ #i

[Qemu-devel] [PATCH v3 05/15] hw/intc/armv7m_nic: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/intc/armv7m_nvic.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 9f8f0d3..25bb88a 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -18,6 +18,7 @@ #include "hw

[Qemu-devel] [PATCH v3 06/15] hw/virtio: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/virtio/virtio-pci.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index ce928f2..265f066 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -17,6 +17,7 @@ #include "qe

[Qemu-devel] [PATCH v3 07/15] hw/vfio: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/vfio/pci-quirks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index b35a640..3240afa 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1071,7 +1071,7 @@ static void vfio_rtl81

[Qemu-devel] [PATCH v3 08/15] exec: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- exec.c| 6 -- memory_ldst.inc.c | 18 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/exec.c b/exec.c index 3e78de3..5013864 100644 --- a/exec.c +++ b/exec.c @@ -3334,7 +3334,8 @@ static MemTxResult flatview_write

[Qemu-devel] [PATCH v3 09/15] cputlb: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 523be4c..a4a0bf7 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -906,8 +906,8 @@ static uint64_t io_readx(CPUArc

[Qemu-devel] [PATCH v3 10/15] memory: Access MemoryRegion with MemOp semantics

2019-07-25 Thread tony.nguyen
To convert interfaces of MemoryRegion access, MEMOP_SIZE and SIZE_MEMOP no-op stubs were introduced to change syntax while keeping the existing semantics. Now with interfaces converted, we fill the stubs and use MemOp semantics. Signed-off-by: Tony Nguyen --- include/exec/memop.h | 5 ++--- 1 f

[Qemu-devel] [PATCH v3 11/15] memory: Single byte swap along the I/O path

2019-07-25 Thread tony.nguyen
Now that MemOp has been pushed down into the memory API, we can collapse the two byte swaps adjust_endianness and handle_bswap into the former. Collapsing byte swaps along the I/O path enables additional endian inversion logic, e.g. SPARC64 Invert Endian TTE bit, with redundant byte swaps cancelli

[Qemu-devel] [PATCH v3 12/15] cpu: TLB_FLAGS_MASK bit to force memory slow path

2019-07-25 Thread tony.nguyen
The fast path is taken when TLB_FLAGS_MASK is all zero. TLB_FORCE_SLOW is simply a TLB_FLAGS_MASK bit to force the slow path, there are no other side effects. Signed-off-by: Tony Nguyen --- include/exec/cpu-all.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inc

[Qemu-devel] [PATCH v3 13/15] cputlb: Byte swap memory transaction attribute

2019-07-25 Thread tony.nguyen
Notice new attribute, byte swap, and force the transaction through the memory slow path. Required by architectures that can invert endianness of memory transaction, e.g. SPARC64 has the Invert Endian TTE bit. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 11 +++ include/exec/

[Qemu-devel] [PATCH v3 15/15] target/sparc: sun4u Invert Endian TTE bit

2019-07-25 Thread tony.nguyen
This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers. Tested working on OpenBSD. Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =) Signed-off-by: Tony Nguyen --- target/sparc

[Qemu-devel] [PATCH v3 14/15] target/sparc: Add TLB entry with attributes

2019-07-25 Thread tony.nguyen
Append MemTxAttrs to interfaces so we can pass along up coming Invert Endian TTE bit on SPARC64. Signed-off-by: Tony Nguyen --- target/sparc/mmu_helper.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/target/sparc/mmu_helper.c b/target/spar

Re: [Qemu-devel] [PATCH v3 00/15] Invert Endian bit in SPARCv9 MMU TTE

2019-07-25 Thread no-reply
Patchew URL: https://patchew.org/QEMU/1564038073754.91...@bt.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Subject: [Qemu-devel] [PATCH v3 00/15] Invert Endian bit in SPARCv9 MMU TTE Message-id: 1564038073754.91...@bt.com ==

Re: [Qemu-devel] [PATCH 1/1] MAINTAINERS: vfio-ccw: Remove myself as the maintainer

2019-07-25 Thread Cornelia Huck
[added the missing qemu mailing lists] On Wed, 24 Jul 2019 17:35:46 -0400 Farhan Ali wrote: > I will not be able to continue with my maintainership responsibilities > going forward, so remove myself as the maintainer. Thank you again for your work! > > Signed-off-by: Farhan Ali > --- > MAIN

Re: [Qemu-devel] [PATCH for 4.1?] pl330: fix vmstate description

2019-07-25 Thread Damien Hedde
On 7/24/19 6:38 PM, Dr. David Alan Gilbert wrote: > * Philippe Mathieu-Daudé (phi...@redhat.com) wrote: >> On 7/24/19 4:35 PM, Damien Hedde wrote: >>> Fix the pl330 main and queue vmstate description. >>> There were missing POINTER flags causing crashes during >>> incoming migration because: >>>

Re: [Qemu-devel] [PATCH v2 04/14] tests: arm: Introduce cpu feature tests

2019-07-25 Thread Auger Eric
Hi Drew, On 6/21/19 6:34 PM, Andrew Jones wrote: > Now that Arm CPUs have advertised features lets add tests to ensure > we maintain their expected availability with and without KVM. > > Signed-off-by: Andrew Jones > --- > tests/Makefile.include | 5 +- > tests/arm-cpu-features.c | 221

[Qemu-devel] [PATCH v4 00/15] Invert Endian bit in SPARCv9 MMU TTE

2019-07-25 Thread tony.nguyen
This patchset implements the IE (Invert Endian) bit in SPARCv9 MMU TTE. It is an attempt of the instructions outlined by Richard Henderson to Mark Cave-Ayland. Tested with OpenBSD on sun4u. Solaris 10 is my actual goal, but unfortunately a separate keyboard issue remains in the way. On 01/11/17

[Qemu-devel] [PATCH v4 02/15] memory: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Replacing size with size+sign+endianness (MemOp) will enable us to collapse the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. While interfaces are converted, callers will have existing unsigned size coerced into a MemOp, and the callee will use this MemOp as an unsigned s

[Qemu-devel] [PATCH v4 03/15] target/mips: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- target/mips/op_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 9e2e02f..dccb8df 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -24,6 +24,7 @@ #include "

[Qemu-devel] [PATCH v4 04/15] hw/s390x: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/s390x/s390-pci-inst.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 0023514..c126bcc 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -15,6 +15,7 @@ #i

[Qemu-devel] [PATCH v4 01/15] tcg: TCGMemOp is now accelerator independent MemOp

2019-07-25 Thread tony.nguyen
Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Target dependant attributes are conditionalize upon NEED_CPU_H. Signed-off-by: Tony Nguyen --- MAINTAINERS | 1 + accel/tcg/cputlb.c | 2 +-

[Qemu-devel] [PATCH v4 05/15] hw/intc/armv7m_nic: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/intc/armv7m_nvic.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 9f8f0d3..25bb88a 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -18,6 +18,7 @@ #include "hw

[Qemu-devel] [PATCH v4 06/15] hw/virtio: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/virtio/virtio-pci.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index ce928f2..265f066 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -17,6 +17,7 @@ #include "qe

[Qemu-devel] [PATCH v4 07/15] hw/vfio: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/vfio/pci-quirks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index b35a640..3240afa 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1071,7 +1071,7 @@ static void vfio_rtl81

[Qemu-devel] [PATCH v4 09/15] cputlb: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 523be4c..a4a0bf7 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -906,8 +906,8 @@ static uint64_t io_readx(CPUArc

[Qemu-devel] [PATCH v4 08/15] exec: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- exec.c| 6 -- memory_ldst.inc.c | 18 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/exec.c b/exec.c index 3e78de3..5013864 100644 --- a/exec.c +++ b/exec.c @@ -3334,7 +3334,8 @@ static MemTxResult flatview_write

[Qemu-devel] [PATCH v4 10/15] memory: Access MemoryRegion with MemOp semantics

2019-07-25 Thread tony.nguyen
To convert interfaces of MemoryRegion access, MEMOP_SIZE and SIZE_MEMOP no-op stubs were introduced to change syntax while keeping the existing semantics. Now with interfaces converted, we fill the stubs and use MemOp semantics. Signed-off-by: Tony Nguyen --- include/exec/memop.h | 5 ++--- 1 f

[Qemu-devel] [PATCH v4 12/15] cpu: TLB_FLAGS_MASK bit to force memory slow path

2019-07-25 Thread tony.nguyen
The fast path is taken when TLB_FLAGS_MASK is all zero. TLB_FORCE_SLOW is simply a TLB_FLAGS_MASK bit to force the slow path, there are no other side effects. Signed-off-by: Tony Nguyen --- include/exec/cpu-all.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inc

Re: [Qemu-devel] [PATCH v2 03/14] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-07-25 Thread Auger Eric
Hi Drew, On 6/21/19 6:34 PM, Andrew Jones wrote: > Add support for the query-cpu-model-expansion QMP command to Arm. We > do this selectively, only exposing CPU properties which represent > optional CPU features which the user may want to enable/disable. Also, > for simplicity, we restrict the lis

[Qemu-devel] [Bug 1837851] [NEW] hv-tlbflush malfunctions on Intel host CPUs with neither EPT nor VPID (qemu-kvm)

2019-07-25 Thread Stefan
Public bug reported: Enabling hv-tlbflush on older hosts using Intel CPUs supporting VT-x but neither EPT nor VPID will lead to bluescreens on the guest. It seems KVM only checks if EPT is available, and if it isn't it forcibly uses VPID. If that's *also* not available, it defaults to basically a

[Qemu-devel] [PATCH v4 11/15] memory: Single byte swap along the I/O path

2019-07-25 Thread tony.nguyen
Now that MemOp has been pushed down into the memory API, we can collapse the two byte swaps adjust_endianness and handle_bswap into the former. Collapsing byte swaps along the I/O path enables additional endian inversion logic, e.g. SPARC64 Invert Endian TTE bit, with redundant byte swaps cancelli

[Qemu-devel] [PATCH v4 13/15] cputlb: Byte swap memory transaction attribute

2019-07-25 Thread tony.nguyen
Notice new attribute, byte swap, and force the transaction through the memory slow path. Required by architectures that can invert endianness of memory transaction, e.g. SPARC64 has the Invert Endian TTE bit. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 11 +++ include/exec/

[Qemu-devel] [PATCH v4 14/15] target/sparc: Add TLB entry with attributes

2019-07-25 Thread tony.nguyen
Append MemTxAttrs to interfaces so we can pass along up coming Invert Endian TTE bit on SPARC64. Signed-off-by: Tony Nguyen --- target/sparc/mmu_helper.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/target/sparc/mmu_helper.c b/target/spar

[Qemu-devel] [PATCH v4 15/15] target/sparc: sun4u Invert Endian TTE bit

2019-07-25 Thread tony.nguyen
This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers. Tested working on OpenBSD. Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =) Signed-off-by: Tony Nguyen --- target/sparc

Re: [Qemu-devel] [PATCH v3] block/rbd: add preallocation support

2019-07-25 Thread Stefano Garzarella
On Wed, Jul 24, 2019 at 01:48:42PM -0400, Jason Dillaman wrote: > On Tue, Jul 23, 2019 at 3:13 AM Stefano Garzarella > wrote: > > > > This patch adds the support of preallocation (off/full) for the RBD > > block driver. > > If rbd_writesame() is available and supports zeroed buffers, we use > > i

Re: [Qemu-devel] [PATCH for 4.1?] pl330: fix vmstate description

2019-07-25 Thread Dr. David Alan Gilbert
* Damien Hedde (damien.he...@greensocs.com) wrote: > > > On 7/24/19 6:38 PM, Dr. David Alan Gilbert wrote: > > * Philippe Mathieu-Daudé (phi...@redhat.com) wrote: > >> On 7/24/19 4:35 PM, Damien Hedde wrote: > >>> Fix the pl330 main and queue vmstate description. > >>> There were missing POINTER

Re: [Qemu-devel] [RFC 08/19] fuzz: add shims to intercept libfuzzer init

2019-07-25 Thread Paolo Bonzini
On 25/07/19 05:23, Oleinik, Alexander wrote: > Intercept coverage buffer registration calls and use this information to > copy them to shared memory, if using fork() to avoid resetting device > state. > > Signed-off-by: Alexander Oleinik > --- > tests/fuzz/fuzzer_hooks.c | 106 ++

Re: [Qemu-devel] [PATCH v2 00/12] block: qiov_offset parameter for io

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
28.06.2019 11:43, Stefan Hajnoczi wrote: > On Tue, Jun 04, 2019 at 07:15:02PM +0300, Vladimir Sementsov-Ogievskiy wrote: >> Hi all! >> >> Here is new parameter qiov_offset for io path, to avoid >> a lot of places with same pattern of creating local_qiov or hd_qiov >> variables. >> >> These series a

Re: [Qemu-devel] [PATCH v4 0/3] pc: mmap kernel (ELF image) and initrd

2019-07-25 Thread Stefano Garzarella
On Wed, Jul 24, 2019 at 04:35:23PM +, Montes, Julio wrote: > Hi Stefano > > Here the results > > https://pasteboard.co/Ipu3DO4.png > https://pasteboard.co/Ipu3L69.png > > boot time with initrd is a little bit better > Thanks for sharing! It is interesting that 'inkernel' time with initrd

Re: [Qemu-devel] qemu-iotests 069 and 111 are failing on NetBSD

2019-07-25 Thread Thomas Huth
On 24/07/2019 18.29, Paolo Bonzini wrote: > On 24/07/19 11:34, Thomas Huth wrote: >> In case somebody is interested, two of the "auto" iotests are failing >> on NetBSD due to non-matching output: >> >> TESTiotest-qcow2: 069 [fail] >> --- /var/tmp/qemu-test.1BMupF/tests/qemu-iotests/069.out

Re: [Qemu-devel] [PATCH for 4.2 0/3] require newer glib2 to enable autofree'ing of stack variables exiting scope

2019-07-25 Thread Stefan Hajnoczi
On Tue, Jul 23, 2019 at 04:48:53PM +0100, Daniel P. Berrangé wrote: > Both GCC and CLang support a C extension attribute((cleanup)) which > allows you to define a function that is invoked when a stack variable > exits scope. This typically used to free the memory allocated to it, > though you're no

Re: [Qemu-devel] [Qemu-ppc] [PATCH v6] ppc: remove idle_timer logic

2019-07-25 Thread Greg Kurz
On Wed, 24 Jul 2019 07:47:45 -0500 Shivaprasad G Bhat wrote: You could mention that this code was completely broken and leaking memory on setups with multiple vCPUs. Not worth fixing since the KVM_CAP_PPC_IRQ_LEVEL is part... etc... > The KVM_CAP_PPC_IRQ_LEVEL is part of the kernel now since 2.6

[Qemu-devel] [PATCH v2 3/3] crypto: use auto cleanup for many stack variables

2019-07-25 Thread Daniel P . Berrangé
Simplify cleanup paths by using glib's auto cleanup macros for stack variables, allowing several goto jumps / labels to be eliminated. Signed-off-by: Daniel P. Berrangé --- crypto/afsplit.c | 28 +--- crypto/block-luks.c | 74 +-- crypto

[Qemu-devel] [PATCH v2 2/3] crypto: define cleanup functions for use with g_autoptr

2019-07-25 Thread Daniel P . Berrangé
Allow crypto structs to be used with g_autoptr, avoiding the need to explicitly call XXX_free() functions when variables go out of scope on the stack. Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrangé --- include/crypto/block.h | 2 ++ include/crypto/cipher.h | 2 ++ inclu

[Qemu-devel] [PATCH v2 1/3] glib: bump min required glib library version to 2.48

2019-07-25 Thread Daniel P . Berrangé
Per supported platforms doc[1], the various min glib on relevant distros is: RHEL-8: 2.56.1 RHEL-7: 2.50.3 Debian (Buster): 2.58.3 Debian (Stretch): 2.50.3 OpenBSD (Ports): 2.58.3 FreeBSD (Ports): 2.56.3 OpenSUSE Leap 15: 2.54.3 SLE12-SP2: 2.48.2 Ubuntu (Xenial): 2.48.0 macOS (

[Qemu-devel] [PATCH v2 0/3] require newer glib2 to enable autofree'ing of stack variables exiting scope

2019-07-25 Thread Daniel P . Berrangé
Both GCC and CLang support a C extension attribute((cleanup)) which allows you to define a function that is invoked when a stack variable exits scope. This typically used to free the memory allocated to it, though you're not restricted to this. For example it could be used to unlock a mutex. We co

[Qemu-devel] [for-4.2 PATCH v2 3/8] util/qemu-timer: refactor deadline calculation for external timers

2019-07-25 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk icount-based record/replay uses qemu_clock_deadline_ns_all to measure the period until vCPU may be interrupted. This function takes in account the virtual timers, because they belong to the virtual devices that may generate interrupt request or affect the virtual machine sta

[Qemu-devel] [for-4.2 PATCH v2 0/8] Some record/replay fixes

2019-07-25 Thread Pavel Dovgalyuk
The set of patches include the latest fixes for record/replay icount function: - fix for icount for the case when translation blocks are chained - development documentation update - some refactoring v2 changes (suggested by Paolo Bonzini): - allow fixed qemu_clock_deadline_ns_all to be used wi

[Qemu-devel] [for-4.2 PATCH v2 2/8] replay: document development rules

2019-07-25 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch introduces docs/devel/replay.txt which describes the rules that should be followed to make virtual devices usable in record/replay mode. Signed-off-by: Pavel Dovgalyuk -- v9: fixed external virtual clock description (reported by Artem Pisarenko) --- docs/deve

[Qemu-devel] [for-4.2 PATCH v2 1/8] replay: add missing fix for internal function

2019-07-25 Thread Pavel Dovgalyuk
From: pbonz...@redhat.com This is a fix which was missed by patch 74c0b816adfc6aa1b01b4426fdf385e32e35cbac, which added current_step parameter to the replay_advance_current_step function. Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c |2 +- 1 file changed, 1 insertion(+), 1 d

Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes

2019-07-25 Thread Kevin Wolf
Am 24.07.2019 um 16:35 hat Paolo Bonzini geschrieben: > On 24/07/19 10:43, Pavel Dovgalyuk wrote: > > The set of patches include the latest fixes for record/replay icount > > function: > > - fix for icount for the case when translation blocks are chained > > - block operation fixes for rr mode >

[Qemu-devel] [for-4.2 PATCH v2 4/8] replay: fix replay shutdown

2019-07-25 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch fixes shutdown of the replay process, which is terminated with the assert when shutdown event is read from the log. replay_finish_event reads new data_kind and therefore the value of data_kind should be preserved to be valid at qemu_system_shutdown_request call.

[Qemu-devel] [for-4.2 PATCH v2 5/8] replay: refine replay-time module

2019-07-25 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch removes refactoring artifacts from the replay/replay-time.c Signed-off-by: Pavel Dovgalyuk --- replay/replay-time.c | 36 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/replay/replay-time.c b/replay/replay

[Qemu-devel] [for-4.2 PATCH v2 7/8] icount: clean up cpu_can_io at the entry to the block

2019-07-25 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk Most of IO instructions can be executed only at the end of the block in icount mode. Therefore translator can set cpu_can_io flag when translating the last instruction. But when the blocks are chained, then this flag is not reset and may remain set at the beginning of the ne

[Qemu-devel] [for-4.2 PATCH v2 6/8] replay: rename step-related variables and functions

2019-07-25 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch renames replay_get_current_step() and related variables to make these names consistent with existing 'icount' command line option and future record/replay hmp/qmp commands. Signed-off-by: Pavel Dovgalyuk --- include/sysemu/replay.h |2 +- replay/replay-eve

Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes

2019-07-25 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > > Am 24.07.2019 um 16:35 hat Paolo Bonzini geschrieben: > > On 24/07/19 10:43, Pavel Dovgalyuk wrote: > > > The set of patches include the latest fixes for record/replay icount > > > function: > > > - fix for icount for the case when translation blo

[Qemu-devel] [for-4.2 PATCH v2 8/8] icount: remove unnecessary gen_io_end calls

2019-07-25 Thread Pavel Dovgalyuk
Prior patch resets can_do_io flag at the TB entry. Therefore there is no need in resetting this flag at the end of the block. This patch removes redundant gen_io_end calls. Signed-off-by: Pavel Dovgalyuk --- accel/tcg/translator.c |2 +- target/alpha/translate.c

Re: [Qemu-devel] Exploring Sphinx, autodoc, apidoc, and coverage tools for python/qemu

2019-07-25 Thread Peter Maydell
On Wed, 24 Jul 2019 at 22:06, John Snow wrote: > And then you can edit e.g. the top-level index.rst TOC in docs/index.rst > to look like this: > > ``` > .. toctree:: >:maxdepth: 2 >:caption: Contents: > >interop/index >devel/index >specs/index >modules > ``` This is obviou

Re: [Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qtest.c

2019-07-25 Thread Thomas Huth
On 25/07/2019 05.23, Oleinik, Alexander wrote: > libqtest directly invokes the qtest client and exposes a function to > accept responses. > > Signed-off-by: Alexander Oleinik > --- > tests/libqtest.c | 53 +++- > tests/libqtest.h | 6 ++ > 2 files

Re: [Qemu-devel] Sphinx and docs/index.rst: dead code?

2019-07-25 Thread Peter Maydell
On Thu, 25 Jul 2019 at 00:22, John Snow wrote: > > Does anything actually use this file? It doesn't appear to be used for > generating the HTML manuals. It's there for if you want to do a "build all the manuals into a single document" -- see the comments at the top of docs/conf.py. Basically this

Re: [Qemu-devel] [RFC 11/19] fuzz: add direct send/receive in qtest client

2019-07-25 Thread Thomas Huth
On 25/07/2019 05.23, Oleinik, Alexander wrote: > Directly interact with tests/libqtest.c functions > > Signed-off-by: Alexander Oleinik > --- > qtest.c | 19 ++- > 1 file changed, 18 insertions(+), 1 deletion(-) [...] > @@ -748,8 +755,11 @@ static void qtest_event(void *opaque, i

Re: [Qemu-devel] [PATCH for 4.2 0/3] require newer glib2 to enable autofree'ing of stack variables exiting scope

2019-07-25 Thread Peter Maydell
On Tue, 23 Jul 2019 at 16:49, Daniel P. Berrangé wrote: > > Both GCC and CLang support a C extension attribute((cleanup)) which > allows you to define a function that is invoked when a stack variable > exits scope. This typically used to free the memory allocated to it, > though you're not restric

[Qemu-devel] [PATCH v3 9/9] qcow2-bitmap: move bitmap reopen-rw code to qcow2_reopen_prepare

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
Since we have used .bdrv_need_rw_file_child_during_reopen_rw handler, and have write access to file child in reopen-prepare, and we prepared qcow2_reopen_bitmaps_rw to be called from reopening rw -> rw, we now can simple move qcow2_reopen_bitmaps_rw() call to qcow2_reopen_prepare() and handle error

[Qemu-devel] [PATCH v3 2/9] iotests.py: add event_wait_log and events_wait_log helpers

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ce74177ab1..4ad265f140 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iote

[Qemu-devel] [PATCH v3 7/9] block/qcow2-bitmap: fix and improve qcow2_reopen_bitmaps_rw

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
- Correct check for write access to file child, and in correct place (only if we want to write). - Support reopen rw -> rw (which will be used in furhter patches), for example, !bdrv_dirty_bitmap_readonly() is not a corruption if bitmap is marked IN_USE in the image. - Consider unexpected bit

[Qemu-devel] [PATCH v3 for-4.1? 0/9] qcow2-bitmaps: rewrite reopening logic

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
Hi all! Bitmaps reopening is buggy, we may easily produce broken incremental backup if we do temporary snapshot. Let's fix it! v3: 02: John's events_wait already merged in, so my 02 from v2 is not needed. Instead, add two simple logging wrappers here 03: rebase on 02 - use new wrappers, move

[Qemu-devel] [PATCH v3 5/9] block/qcow2-bitmap: drop qcow2_reopen_bitmaps_rw_hint()

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
The function is unused, drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- block/qcow2.h| 2 -- block/qcow2-bitmap.c | 15 +-- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index fc1b0d3c1e..a5b24f4

[Qemu-devel] [PATCH v3 6/9] block/qcow2-bitmap: do not remove bitmaps on reopen-ro

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
qcow2_reopen_bitmaps_ro wants to store bitmaps and then mark them all readonly. But the latter don't work, as qcow2_store_persistent_dirty_bitmaps removes bitmaps after storing. It's OK for inactivation but bad idea for reopen-ro. And this leads to the following bug: Assume we have persistent bitm

[Qemu-devel] [PATCH v3 8/9] block/qcow2-bitmap: fix reopening bitmaps to RW

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
Currently reopening bitmaps to RW can't work, as qcow2 needs write access to file child, to mark bitmaps in-image with IN_USE flag. The possibility to write-access file child during reopen-RW was implemented several patches ago with help of .bdrv_need_rw_file_child_during_reopen_rw handler. Let's

[Qemu-devel] [PATCH v3 3/9] iotests: add test 260 to check bitmap life after snapshot + commit

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
Two testcases with persistent bitmaps are not added here, as there are bugs to be fixed soon. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/260 | 85 ++ tests/qemu-iotests/260.out | 17 tests/qemu-iotests/group | 1 + 3 fil

[Qemu-devel] [PATCH v3 4/9] block/qcow2-bitmap: get rid of bdrv_has_changed_persistent_bitmaps

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
Firstly, no reason to optimize failure path. Then, function name is ambiguous: it checks for readonly and similar things, but someone may think that it will ignore normal bitmaps which was just unchanged, and this is in bad relation with the fact that we should drop IN_USE flag for unchanged bitmap

[Qemu-devel] [PATCH v3 1/9] block: add .bdrv_need_rw_file_child_during_reopen_rw handler

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
On reopen to rw parent may need rw access to child in .prepare, for example qcow2 needs to write IN_USE flags into stored bitmaps (currently it is done in a hacky way after commit and don't work). So, let's introduce such logic. The drawback is that in worst case bdrv_reopen_set_read_only may fini

[Qemu-devel] CC wangxiongfeng. RE: [PATCH] pcie: fix device unplug timeout

2019-07-25 Thread Zhangbo (Oscar)
>> If the linux kernel only receives an ABP event during pcie unplug, it will >> sleep 5s >> to expect a PDC event, which will cause device unplug timeout. > >My understanding is that there's no timeout. Spec says: > If present, the Power Indicator provides visual feedback to the human >oper

Re: [Qemu-devel] [PATCH for 4.2 0/3] require newer glib2 to enable autofree'ing of stack variables exiting scope

2019-07-25 Thread Daniel P . Berrangé
On Thu, Jul 25, 2019 at 10:13:11AM +0100, Peter Maydell wrote: > On Tue, 23 Jul 2019 at 16:49, Daniel P. Berrangé wrote: > > > > Both GCC and CLang support a C extension attribute((cleanup)) which > > allows you to define a function that is invoked when a stack variable > > exits scope. This typic

Re: [Qemu-devel] [PATCH V5] net/colo-compare.c: Fix memory leak and code style issue.

2019-07-25 Thread Peter Maydell
On Tue, 23 Jul 2019 at 04:24, Jason Wang wrote: > > > On 2019/7/23 上午2:38, Zhang, Chen wrote: > > > > > >> -Original Message- > >> From: Peter Maydell [mailto:peter.mayd...@linaro.org] > >> Sent: Tuesday, July 23, 2019 1:25 AM > >> To: Zhang, Chen > >> Cc: Li Zhijian ; Jason Wang > >> ;

Re: [Qemu-devel] [PATCH V5] net/colo-compare.c: Fix memory leak and code style issue.

2019-07-25 Thread Jason Wang
- Original Message - > On Tue, 23 Jul 2019 at 04:24, Jason Wang wrote: > > > > > > On 2019/7/23 上午2:38, Zhang, Chen wrote: > > > > > > > > >> -Original Message- > > >> From: Peter Maydell [mailto:peter.mayd...@linaro.org] > > >> Sent: Tuesday, July 23, 2019 1:25 AM > > >> To: Zh

Re: [Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qtest.c

2019-07-25 Thread Paolo Bonzini
On 25/07/19 11:04, Thomas Huth wrote: >> @@ -797,6 +832,9 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...) >> >> const char *qtest_get_arch(void) >> { >> +#ifdef CONFIG_FUZZ >> +return "i386"; >> +#endif > > Hard-coding "i386" is quite ugly ... it's ok for an RFC patch, but I > thin

Re: [Qemu-devel] [PATCH for 4.2 1/3] linux user: Add support for FDFLUSH ioctl

2019-07-25 Thread Laurent Vivier
Le 24/07/2019 à 16:12, Aleksandar Markovic a écrit : > From: Yunqiang Su > > FDFLUSH is used for flushing buffers of floppy drives. Support in > QEMU is needed because some of Debian packages use this ioctl while > running post-build tests. It's strange, because some floppy drivers like swim and

Re: [Qemu-devel] [PATCH v3 0/4] Introduce the microvm machine type

2019-07-25 Thread Sergio Lopez
Paolo Bonzini writes: > On 23/07/19 12:01, Paolo Bonzini wrote: >> The number of buses is determined by the firmware, not by QEMU, so >> fw_cfg would not be the right interface. In fact (as I have just >> learnt) lastbus is an x86-specific option that overrides the last bus >> returned by SeaBI

Re: [Qemu-devel] [PATCH for 4.2 2/3] linux-user: Add support for FDMSGON and FDMSGOFF ioctls

2019-07-25 Thread Laurent Vivier
Le 24/07/2019 à 16:12, Aleksandar Markovic a écrit : > From: Aleksandar Markovic > > FDMSGON and FDMSGOFF switch informational messages of floppy drives > on and off. > > Signed-off-by: Aleksandar Markovic > --- > linux-user/ioctls.h | 2 ++ > linux-user/syscall_defs.h | 2 ++ > 2 files

Re: [Qemu-devel] [RFC 10/19] fuzz: expose real_main (aka regular vl.c:main)

2019-07-25 Thread Paolo Bonzini
On 25/07/19 05:23, Oleinik, Alexander wrote: > Export normal qemu-system main so it can be called from tests/fuzz/fuzz.c > > Signed-off-by: Alexander Oleinik > --- > include/sysemu/sysemu.h | 4 > vl.c| 21 - > 2 files changed, 24 insertions(+), 1 de

Re: [Qemu-devel] [RFC 01/19] fuzz: add configure option and linker objects

2019-07-25 Thread Paolo Bonzini
On 25/07/19 05:23, Oleinik, Alexander wrote: > + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tests $QEMU_INCLUDES" Instead of this, please include files with the full path. Paolo

Re: [Qemu-devel] [RFC 14/19] fuzz: hard-code a main-loop timeout

2019-07-25 Thread Paolo Bonzini
On 25/07/19 05:23, Oleinik, Alexander wrote: > timeout_ns = qemu_soonest_timeout(timeout_ns, >timerlistgroup_deadline_ns( >&main_loop_tlg)); > +#ifdef CONFIG_FUZZ > +timeout_ns = 5; > +#endif > What

Re: [Qemu-devel] [PATCH for 4.2 3/3] linux-user: Add support for RNDRESEEDCRNG ioctl

2019-07-25 Thread Laurent Vivier
Le 24/07/2019 à 16:12, Aleksandar Markovic a écrit : > From: Aleksandar Markovic > > RNDRESEEDCRNG is a newer ioctl (added in mid-2018 in kernel), and > "ifdef" guard is used for that reason in this patch. since kernel 4.17 Reviewed-by: Laurent Vivier > > Signed-off-by: Aleksandar Markovic

Re: [Qemu-devel] [PATCH v3 1/4] hw/virtio: Factorize virtio-mmio headers

2019-07-25 Thread Liam Merwick
On 02/07/2019 13:11, Sergio Lopez wrote: Put QOM and main struct definition in a separate header file, so it can be accesed from other components. typo: accesed -> accessed This is needed for the microvm machine type implementation. Signed-off-by: Sergio Lopez One nit below, either way

[Qemu-devel] [PATCH v4] qapi: Add InetSocketAddress member keep-alive

2019-07-25 Thread Vladimir Sementsov-Ogievskiy
It's needed to provide keepalive for nbd client to track server availability. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Notes: v4; [by Markus's comments] - use "passive socket" term - move check for not enabled keep_alive to inet_listen_saddr() v3: [by Markus's co

[Qemu-devel] [PATCH v4 00/15] Invert Endian bit in SPARCv9 MMU TTE

2019-07-25 Thread tony.nguyen
This patchset implements the IE (Invert Endian) bit in SPARCv9 MMU TTE. It is an attempt of the instructions outlined by Richard Henderson to Mark Cave-Ayland. Tested with OpenBSD on sun4u. Solaris 10 is my actual goal, but unfortunately a separate keyboard issue remains in the way. On 01/11/17

[Qemu-devel] [PATCH v4 03/15] target/mips: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- target/mips/op_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 9e2e02f..dccb8df 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -24,6 +24,7 @@ #include "

[Qemu-devel] [PATCH v4 02/15] memory: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Replacing size with size+sign+endianness (MemOp) will enable us to collapse the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. While interfaces are converted, callers will have existing unsigned size coerced into a MemOp, and the callee will use this MemOp as an unsigned s

[Qemu-devel] [PATCH v4 01/15] tcg: TCGMemOp is now accelerator independent MemOp

2019-07-25 Thread tony.nguyen
Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Target dependant attributes are conditionalize upon NEED_CPU_H. Signed-off-by: Tony Nguyen --- MAINTAINERS | 1 + accel/tcg/cputlb.c | 2 +-

[Qemu-devel] [PATCH v4 04/15] hw/s390x: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/s390x/s390-pci-inst.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 0023514..c126bcc 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -15,6 +15,7 @@ #i

[Qemu-devel] [PATCH v4 05/15] hw/intc/armv7m_nic: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/intc/armv7m_nvic.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 9f8f0d3..25bb88a 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -18,6 +18,7 @@ #include "hw

[Qemu-devel] [PATCH v4 06/15] hw/virtio: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/virtio/virtio-pci.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index ce928f2..265f066 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -17,6 +17,7 @@ #include "qe

[Qemu-devel] [PATCH v4 07/15] hw/vfio: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- hw/vfio/pci-quirks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index b35a640..3240afa 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1071,7 +1071,7 @@ static void vfio_rtl81

[Qemu-devel] [PATCH v4 10/15] memory: Access MemoryRegion with MemOp semantics

2019-07-25 Thread tony.nguyen
To convert interfaces of MemoryRegion access, MEMOP_SIZE and SIZE_MEMOP no-op stubs were introduced to change syntax while keeping the existing semantics. Now with interfaces converted, we fill the stubs and use MemOp semantics. Signed-off-by: Tony Nguyen --- include/exec/memop.h | 5 ++--- 1 f

[Qemu-devel] [PATCH v4 08/15] exec: Access MemoryRegion with MemOp

2019-07-25 Thread tony.nguyen
Signed-off-by: Tony Nguyen --- exec.c| 6 -- memory_ldst.inc.c | 18 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/exec.c b/exec.c index 3e78de3..5013864 100644 --- a/exec.c +++ b/exec.c @@ -3334,7 +3334,8 @@ static MemTxResult flatview_write

  1   2   3   4   >