[Qemu-devel] [PATCH 06/28] trace: Eliminate use of TARGET_FMT_plx

2019-07-26 Thread Markus Armbruster
hw/tpm/trace-events uses TARGET_FMT_plx formats with uint64_t arguments. That's wrong, TARGET_FMT_plx takes hwaddr. Since hwaddr happens to be uint64_t, it works anyway. Messed up in commit ec427498da5, v2.12.0. Clean up by replacing TARGET_FMT_plx with its macro expansion. scripts/tracetool/f

[Qemu-devel] [PATCH 11/28] typedefs: Separate incomplete types and function types

2019-07-26 Thread Markus Armbruster
While there, drop the obsolete file comment. Signed-off-by: Markus Armbruster --- include/qemu/typedefs.h | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index fcdaae58c4..29346648d4 100644 --- a/include/qemu/type

[Qemu-devel] [PATCH 23/28] numa: Don't include hw/boards.h into sysemu/numa.h

2019-07-26 Thread Markus Armbruster
sysemu/numa.h includes hw/boards.h just for the CPUArchId typedef, at the cost of pulling in more than two dozen extra headers indirectly. I could move the typedef from hw/boards.h to qemu/typedefs.h. But it's used in just two headers: boards.h and numa.h. I could move it to another header both

[Qemu-devel] [PATCH 01/28] include: Make headers more self-contained

2019-07-26 Thread Markus Armbruster
Back in 2016, we discussed[1] rules for headers, and these were generally liked: 1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h. 2. Headers should normally include everything they need beyond osdep.h. If exceptions are need

[Qemu-devel] [PATCH 19/28] Include qemu/queue.h slightly less

2019-07-26 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- hw/scsi/vhost-scsi.c| 1 - hw/vfio/ap.c| 1 - include/exec/cpu-defs.h | 1 - include/hw/xen/xen_common.h | 1 - include/net/can_emu.h | 1 + include/net/filter.h| 1 + include/qemu/range.h| 2 -- include/qom/ob

[Qemu-devel] [PATCH 13/28] Clean up inclusion of exec/cpu-common.h

2019-07-26 Thread Markus Armbruster
migration/qemu-file.h neglects to include it even though it needs ram_addr_t. Fix that. Drop a few superfluous inclusions elsewhere. Signed-off-by: Markus Armbruster --- accel/stubs/tcg-stub.c | 1 - balloon.c | 1 - hw/smbios/smbios.c | 1 - include

[Qemu-devel] [PATCH 07/28] trace: Do not include qom/cpu.h into generated trace.h

2019-07-26 Thread Markus Armbruster
docs/devel/tracing.txt explains "since many source files include trace.h, [the generated trace.h use] a minimum of types and other header files included to keep the namespace clean and compile times and dependencies down." Commit 4815185902 "trace: Add per-vCPU tracing states for events with the '

[Qemu-devel] [PATCH 14/28] migration: Move the VMStateDescription typedef to typedefs.h

2019-07-26 Thread Markus Armbruster
We declare incomplete struct VMStateDescription in a couple of places so we don't have to include migration/vmstate.h for the typedef. That's fine with me. However, the next commit will drop migration/vmstate.h from a massive number of compiles. Move the typedef to qemu/typedefs.h now, so I don't

[Qemu-devel] [PATCH 18/28] Include hw/hw.h exactly where needed

2019-07-26 Thread Markus Armbruster
In my "build everything" tree, changing hw/hw.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). The previous commits have left only the declaration of hw_error() in hw/hw.h. This permits dropping most of its inclusions. To

[Qemu-devel] [PATCH 27/28] sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h

2019-07-26 Thread Markus Armbruster
The previous commit deleted superfluous inclusions of sysemu/sysemu.h, but that didn't really help. Several headers include sysemu/sysemu.h just to get typedef VMChangeStateEntry. Move it from sysemu/sysemu.h to qemu/typedefs.h. Spell its structure tag the same while there. All these headers sti

[Qemu-devel] [PATCH 22/28] Include hw/boards.h a bit less

2019-07-26 Thread Markus Armbruster
hw/boards.h pulls in almost 60 headers. The less we include it into headers, the better. As a first step, drop superfluous inclusions, and downgrade some more to what's actually needed. Gets rid of just one inclusion into a header. Cc: Eduardo Habkost Cc: Marcel Apfelbaum Signed-off-by: Marku

[Qemu-devel] [PATCH 00/28] Tame a few "touch this, recompile the world" headers

2019-07-26 Thread Markus Armbruster
We have quite a few "touch this, recompile the world" headers. My "build everything" tree has some 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). Touching any of 53 headers triggers a recompile of more than half of them. This series reduces them to 46. Six of t

[Qemu-devel] [PATCH 08/28] Include sysemu/reset.h a lot less

2019-07-26 Thread Markus Armbruster
In my "build everything" tree, changing sysemu/reset.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). The main culprit is hw/hw.h, which supposedly includes it for convenience. Include sysemu/reset.h only where it's needed

[Qemu-devel] [PATCH 28/28] Include sysemu/sysemu.h a lot less

2019-07-26 Thread Markus Armbruster
In my "build everything" tree, changing sysemu/sysemu.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). hw/qdev-core.h includes sysemu/sysemu.h since recent commit e965ffa70a "qdev: add qdev_add_vm_change_state_handler()".

[Qemu-devel] [PATCH 12/28] Include hw/irq.h a lot less

2019-07-26 Thread Markus Armbruster
In my "build everything" tree, changing hw/irq.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). hw/hw.h supposedly includes it for convenience. Several other headers include it just to get qemu_irq and.or qemu_irq_handler.

[Qemu-devel] [PATCH 26/28] Clean up inclusion of sysemu/sysemu.h

2019-07-26 Thread Markus Armbruster
In my "build everything" tree, changing sysemu/sysemu.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). 119 of 380 #include directives are actually superfluous. Delete them. Downgrade two more to qapi/qapi-types-run-state.h

[Qemu-devel] [PATCH 20/28] Include qemu/main-loop.h less

2019-07-26 Thread Markus Armbruster
In my "build everything" tree, changing qemu/main-loop.h triggers a recompile of some 5600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). It includes block/aio.h, which in turn includes qemu/event_notifier.h, qemu/notify.h, qemu/processor.h, qemu/qsp.h, qem

Re: [Qemu-devel] [PATCH v2 03/11] block: Add bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
On Fri, Jul 26, 2019 at 12:58:58PM +0200, Max Reitz wrote: > On 26.07.19 11:04, Stefano Garzarella wrote: > > On Wed, Jul 24, 2019 at 07:12:31PM +0200, Max Reitz wrote: > >> No .bdrv_has_zero_init() implementation returns 1 if growing the file > >> would add non-zero areas (at least with PREALLOC_M

Re: [Qemu-devel] [PATCH 3/4] mirror: Keep target drained until graph changes are done

2019-07-26 Thread Max Reitz
On 26.07.19 13:36, Kevin Wolf wrote: > Am 26.07.2019 um 11:52 hat Max Reitz geschrieben: >> On 25.07.19 18:27, Kevin Wolf wrote: >>> Calling bdrv_drained_end() for target_bs can restarts requests too >>> early, so that they would execute on mirror_top_bs, which however has >>> already dropped all p

Re: [Qemu-devel] [RFC 02/19] fuzz: add FUZZ_TARGET type to qemu module system

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 03:23:45AM +, Oleinik, Alexander wrote: > Signed-off-by: Alexander Oleinik > --- > include/qemu/module.h | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) I wouldn't worry about #ifdefs since none of this generates code. The only bloat will be the debugin

Re: [Qemu-devel] [RFC 03/19] fuzz: add fuzz accelerator

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 03:23:46AM +, Oleinik, Alexander wrote: > Much like the qtest accelerator, the fuzz accelerator skips the CPU > emulation > > Signed-off-by: Alexander Oleinik > --- > include/sysemu/qtest.h | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git

Re: [Qemu-devel] [PULL 00/22] virtio, pc, pci: features, fixes, cleanups

2019-07-26 Thread Peter Maydell
On Tue, 2 Jul 2019 at 19:27, Peter Maydell wrote: > > On Tue, 2 Jul 2019 at 19:22, Michael S. Tsirkin wrote: > > > > On Tue, Jul 02, 2019 at 06:20:01PM +0100, Peter Maydell wrote: > > > On Tue, 2 Jul 2019 at 18:01, Michael S. Tsirkin wrote: > > > > This isn't from mainline. We have a bit of a de

Re: [Qemu-devel] [PATCH 4/4] block-backend: Queue requests while drained

2019-07-26 Thread Max Reitz
On 26.07.19 13:49, Kevin Wolf wrote: > Am 26.07.2019 um 12:50 hat Max Reitz geschrieben: >> On 25.07.19 18:27, Kevin Wolf wrote: >>> This fixes device like IDE that can still start new requests from I/O >> >> *devices >> >>> handlers in the CPU thread while the block backend is drained. >>> >>> The

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

2019-07-26 Thread Igor Mammedov
On Thu, 25 Jul 2019 13:38:48 -0400 "Michael S. Tsirkin" wrote: > On Thu, Jul 25, 2019 at 05:39:39PM +0200, Paolo Bonzini wrote: > > On 25/07/19 17:01, Michael S. Tsirkin wrote: > > >> It would be educational to try to enable ACPI core but disable all > > >> optional features. > > > > A lot o

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

2019-07-26 Thread Jason Dillaman
On Fri, Jul 26, 2019 at 4:48 AM Stefano Garzarella wrote: > > On Thu, Jul 25, 2019 at 09:30:30AM -0400, Jason Dillaman wrote: > > On Thu, Jul 25, 2019 at 4:13 AM Stefano Garzarella > > wrote: > > > > > > On Wed, Jul 24, 2019 at 01:48:42PM -0400, Jason Dillaman wrote: > > > > On Tue, Jul 23, 2019

Re: [Qemu-devel] [RFC 06/19] fuzz: Add ramfile for fast vmstate/vmload

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 03:23:49AM +, Oleinik, Alexander wrote: > The ramfile allows vmstate to be saved and restored directly onto the > heap. > > Signed-off-by: Alexander Oleinik > --- > tests/fuzz/ramfile.c | 127 +++ > tests/fuzz/ramfile.h | 20 ++

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

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 11:04:11AM +0200, Thomas Huth wrote: > On 25/07/2019 05.23, Oleinik, Alexander wrote: > > @@ -379,9 +399,18 @@ static void socket_sendf(int fd, const char *fmt, > > va_list ap) > > { > > gchar *str = g_strdup_vprintf(fmt, ap); > > size_t size = strlen(str); > > +

Re: [Qemu-devel] [PATCH v4 0/7] Measure Tiny Code Generation Quality

2019-07-26 Thread Alex Bennée
vandersonmr writes: > This patch is part of Google Summer of Code (GSoC) 2019. > More about the project can be found in: > https://wiki.qemu.org/Internships/ProjectIdeas/TCGCodeQuality > > The goal of this patch is to add infrastructure to collect > execution and JIT statistics during the emula

Re: [Qemu-devel] [PULL v1 0/2] Merge tpm 2019/07/25 v1

2019-07-26 Thread Peter Maydell
On Thu, 25 Jul 2019 at 16:48, Stefan Berger wrote: > > This series of patches improves error handling with the TPM backend. > >Stefan > > The following changes since commit 9d2e1fcd14c2bae5be1992214a03c0ddff714c80: > > Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into >

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

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 03:23:49AM +, Oleinik, Alexander wrote: > @@ -379,9 +399,18 @@ static void socket_sendf(int fd, const char *fmt, > va_list ap) > { > gchar *str = g_strdup_vprintf(fmt, ap); > size_t size = strlen(str); > +#ifdef CONFIG_FUZZ > +// Directly call qtest_proce

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

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 10:21:18AM +0200, Paolo Bonzini wrote: > 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: Ale

Re: [Qemu-devel] [RFC 09/19] fuzz: use mtree_info to find mapped addresses

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 03:23:51AM +, Oleinik, Alexander wrote: > Locate mmio and port i/o addresses that are mapped to devices so we can > limit the fuzzer to only these addresses. This should be replaced with > a sane way of enumaring these memory regions. > > Signed-off-by: Alexander Oleini

Re: [Qemu-devel] [RFC 13/19] fuzz: add ctrl vq support to virtio-net in libqos

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 05:05:25PM +, Oleinik, Alexander wrote: > On Thu, 2019-07-25 at 12:25 -0400, John Snow wrote: > > > > On 7/24/19 11:23 PM, Oleinik, Alexander wrote: > > > Signed-off-by: Alexander Oleinik > > > > Is there some explanation for why the below patch does what the > > subj

Re: [Qemu-devel] [RFC 19/19] fuzz: Add documentation about the fuzzer to docs/

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 03:24:00AM +, Oleinik, Alexander wrote: > +== Main Modifications required for Fuzzing == > + > +Fuzzing is enabled with the -enable-fuzzing flag, which adds the needed > cflags > +to enable Libfuzzer and AddressSanitizer. In the code, most of the changes to > +existing

Re: [Qemu-devel] [RFC 00/19] Add virtual device fuzzing support

2019-07-26 Thread Stefan Hajnoczi
On Thu, Jul 25, 2019 at 03:23:43AM +, Oleinik, Alexander wrote: > As part of Google Summer of Code 2019, I'm working on integrating > fuzzing of virtual devices into QEMU [1]. This is a highly WIP patchset > adding this functionality. > > Fuzzers provide random data to a program and monitor it

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:43 PM, tony.ngu...@bt.com wrote: > +#ifdef NEED_CPU_H > +#ifdef ALIGNED_ONLY > +MO_ALIGN = 0, > +MO_UNALN = MO_AMASK, You need the configure patch got TARGET_ALIGNED_ONLY that you posted separately as patch 1 in order for this to work. Otherwise, Reviewed-by: Richard Hender

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:43 PM, tony.ngu...@bt.com wrote: > } MemOp; > > +/* No-op while memory_region_dispatch_[read|write] is converted to MemOp */ > +#define MEMOP_SIZE(op) (op)/* MemOp to size. */ > +#define SIZE_MEMOP(ul) (ul)/* Size to MemOp. */ > + This doesn't thrill me, because for 9 p

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:45 PM, tony.ngu...@bt.com wrote: > No-op SIZE_MEMOP macro allows us to later easily convert > memory_region_dispatch_{read|write} paramter "unsigned size" into a > size+sign+endianness encoded "MemOp op". > > Being a no-op macro, this patch does not introduce any logical change. > >

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:46 PM, tony.ngu...@bt.com wrote: > No-op SIZE_MEMOP macro allows us to later easily convert > memory_region_dispatch_{read|write} paramter "unsigned size" into a > size+sign+endianness encoded "MemOp op". > > Being a no-op macro, this patch does not introduce any logical change. > >

Re: [Qemu-devel] [PATCH v5 30/42] qemu-img: Use child access functions

2019-07-26 Thread Vladimir Sementsov-Ogievskiy
25.07.2019 19:34, Max Reitz wrote: > On 24.07.19 11:54, Vladimir Sementsov-Ogievskiy wrote: >> 21.06.2019 16:15, Vladimir Sementsov-Ogievskiy wrote: >>> 19.06.2019 18:49, Max Reitz wrote: On 19.06.19 11:18, Vladimir Sementsov-Ogievskiy wrote: > 13.06.2019 1:09, Max Reitz wrote: >> This

Re: [Qemu-devel] [PATCH v4 2/7] accel: collecting TB execution count

2019-07-26 Thread Alex Bennée
vandersonmr writes: > If a TB has a TBS (TBStatistics) with the TB_EXEC_STATS > enabled, then we instrument the start code of the TB > to atomically count the number of times it is executed. > The execution count of the TB is stored in its respective > TBS. > > Signed-off-by: Vanderson M. do Ro

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:44 PM, tony.ngu...@bt.com wrote: > No-op SIZE_MEMOP macro allows us to later easily convert > memory_region_dispatch_{read|write} paramter "unsigned size" into a > size+sign+endianness encoded "MemOp op". > > Being a no-op macro, this patch does not introduce any logical change. > >

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:45 PM, tony.ngu...@bt.com wrote: > No-op SIZE_MEMOP macro allows us to later easily convert > memory_region_dispatch_{read|write} paramter "unsigned size" into a > size+sign+endianness encoded "MemOp op". > > Being a no-op macro, this patch does not introduce any logical change. > >

Re: [Qemu-devel] [PULL 00/22] virtio, pc, pci: features, fixes, cleanups

2019-07-26 Thread Michael S. Tsirkin
On Fri, Jul 26, 2019 at 01:39:26PM +0100, Peter Maydell wrote: > On Tue, 2 Jul 2019 at 19:27, Peter Maydell wrote: > > > > On Tue, 2 Jul 2019 at 19:22, Michael S. Tsirkin wrote: > > > > > > On Tue, Jul 02, 2019 at 06:20:01PM +0100, Peter Maydell wrote: > > > > On Tue, 2 Jul 2019 at 18:01, Michael

Re: [Qemu-devel] [PATCH v7 02/11] numa: move numa global variable nb_numa_nodes into MachineState

2019-07-26 Thread Igor Mammedov
On Wed, 24 Jul 2019 15:15:28 -0300 Eduardo Habkost wrote: > On Wed, Jul 24, 2019 at 05:48:11PM +0200, Igor Mammedov wrote: > > On Wed, 24 Jul 2019 12:02:41 -0300 > > Eduardo Habkost wrote: > > > > > On Wed, Jul 24, 2019 at 04:27:21PM +0200, Igor Mammedov wrote: > > > > On Tue, 23 Jul 2019 1

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:44 PM, tony.ngu...@bt.com wrote: > memory_region_dispatch_read(env->itc_tag, index, &env->CP0_TagLo, > -8, MEMTXATTRS_UNSPECIFIED); > +SIZE_MEMOP(8), MEMTXATTRS_UNSPECIFIED); As an example of why I'm not

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:46 PM, tony.ngu...@bt.com wrote: > No-op SIZE_MEMOP macro allows us to later easily convert > memory_region_dispatch_{read|write} paramter "unsigned size" into a > size+sign+endianness encoded "MemOp op". > > Being a no-op macro, this patch does not introduce any logical change. > >

Re: [Qemu-devel] [PATCH 03/28] qapi: Split error.json off common.json

2019-07-26 Thread Eric Blake
On 7/26/19 7:05 AM, Markus Armbruster wrote: > In my "build everything" tree, changing a type in qapi/common.json > triggers a recompile of some 3600 out of 6600 objects (not counting > tests and objects that don't depend on qemu/osdep.h). > > One common dependency is QapiErrorClass: it's used onl

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

2019-07-26 Thread Richard Henderson
On 7/26/19 6:36 AM, Richard Henderson wrote: > On 7/25/19 11:43 PM, tony.ngu...@bt.com wrote: >> } MemOp; >> >> +/* No-op while memory_region_dispatch_[read|write] is converted to MemOp */ >> +#define MEMOP_SIZE(op) (op)/* MemOp to size. */ >> +#define SIZE_MEMOP(ul) (ul)/* Size to MemO

[Qemu-devel] [PATCH 0/2] ssh: add password and privkey auth methods

2019-07-26 Thread Pino Toscano
These two patches add the password and private key authentication methods to the ssh block driver, using secure objects for passwords/passphrases. Pino Toscano (2): ssh: implement password authentication ssh: implement private key authentication block/ssh.c | 133 +++

[Qemu-devel] [PATCH 1/2] ssh: implement password authentication

2019-07-26 Thread Pino Toscano
Add a 'password-secret' option which represents the name of an object with the password of the user. Signed-off-by: Pino Toscano --- block/ssh.c | 35 --- block/trace-events | 1 + docs/qemu-block-drivers.texi | 7 +-- qapi/block-c

[Qemu-devel] [PATCH 2/2] ssh: implement private key authentication

2019-07-26 Thread Pino Toscano
Add a 'private-key' option which represents the path of a private key to use for authentication, and 'private-key-secret' as the name of an object with its passphrase. Signed-off-by: Pino Toscano --- block/ssh.c | 98 block/trace-events

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:46 PM, tony.ngu...@bt.com wrote: > No-op MEMOP_SIZE and SIZE_MEMOP macros allows us to later easily > convert memory_region_dispatch_{read|write} paramter "unsigned size" > into a size+sign+endianness encoded "MemOp op". > > Being a no-op macro, this patch does not introduce any logi

Re: [Qemu-devel] [PATCH v7 02/11] numa: move numa global variable nb_numa_nodes into MachineState

2019-07-26 Thread Eduardo Habkost
On Fri, Jul 26, 2019 at 03:43:43PM +0200, Igor Mammedov wrote: > On Wed, 24 Jul 2019 15:15:28 -0300 > Eduardo Habkost wrote: > > > On Wed, Jul 24, 2019 at 05:48:11PM +0200, Igor Mammedov wrote: > > > On Wed, 24 Jul 2019 12:02:41 -0300 > > > Eduardo Habkost wrote: > > > > > > > On Wed, Jul 24,

Re: [Qemu-devel] [PATCH 2/2] ssh: implement private key authentication

2019-07-26 Thread Eric Blake
On 7/26/19 9:09 AM, Pino Toscano wrote: > Add a 'private-key' option which represents the path of a private key > to use for authentication, and 'private-key-secret' as the name of an > object with its passphrase. > > Signed-off-by: Pino Toscano > +++ b/qapi/block-core.json > @@ -3226,6 +3226,11

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:47 PM, tony.ngu...@bt.com wrote: > 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. > > Signe

Re: [Qemu-devel] [PATCH 0/2] ssh: add password and privkey auth methods

2019-07-26 Thread Richard W.M. Jones
On Fri, Jul 26, 2019 at 04:09:52PM +0200, Pino Toscano wrote: > These two patches add the password and private key authentication > methods to the ssh block driver, using secure objects for > passwords/passphrases. I was attempting to test this but couldn't work out the full command line to use it

Re: [Qemu-devel] [PATCH 2/2] ssh: implement private key authentication

2019-07-26 Thread Richard W.M. Jones
On Fri, Jul 26, 2019 at 09:24:34AM -0500, Eric Blake wrote: > On a different topic, how much of this work overlaps with the nbdkit ssh > plugin? Should we be duplicating efforts with both projects supporting > ssh natively, or is it worth considering getting qemu out of the ssh > business and inste

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

2019-07-26 Thread Richard Henderson
On 7/26/19 2:26 AM, Paolo Bonzini wrote: > On 26/07/19 08:47, tony.ngu...@bt.com wrote: >> +        op = SIZE_MEMOP(size); >> +        if (need_bswap(big_endian)) { >> +            op ^= MO_BSWAP; >> +        } > > And this has the same issue as the first version. It should be > > op = SIZ

Re: [Qemu-devel] [PATCH 03/28] qapi: Split error.json off common.json

2019-07-26 Thread Markus Armbruster
Eric Blake writes: > On 7/26/19 7:05 AM, Markus Armbruster wrote: >> In my "build everything" tree, changing a type in qapi/common.json >> triggers a recompile of some 3600 out of 6600 objects (not counting >> tests and objects that don't depend on qemu/osdep.h). >> >> One common dependency is Q

Re: [Qemu-devel] [PULL for-4.1 0/1] s390x: vfio-ccw maintainership update

2019-07-26 Thread Peter Maydell
m/cohuck/qemu tags/s390x-20190726 > > for you to fetch changes up to 6ef2d01abf44fa86f2de4bcde3be9391259bf718: > > MAINTAINERS: vfio-ccw: Remove myself as the maintainer (2019-07-25 09:36:14 > +0200) > > -

Re: [Qemu-devel] [PATCH 1/2] net: assert that tx packets have nonzero size

2019-07-26 Thread Oleinik, Alexander
On Tue, 2019-07-23 at 11:38 +0800, Jason Wang wrote: > On 2019/7/20 上午2:52, Oleinik, Alexander wrote: > > Virtual devices should not try to send zero-sized packets. The > > caller > > should check the size prior to calling qemu_sendv_packet_async. > > > > Signed-off-by: Alexander Oleinik > > ---

[Qemu-devel] [PATCH 2/3] spapr/pci: Free MSIs during reset

2019-07-26 Thread Greg Kurz
When the machine is reset, the MSI bitmap is cleared but the allocated MSIs are not freed. Some operating systems, such as AIX, can detect the previous configuration and assert. Empty the MSI cache, this performs the needed cleanup. Signed-off-by: Greg Kurz --- hw/ppc/spapr_pci.c |2 ++ 1 f

[Qemu-devel] [PATCH 1/3] spapr/pci: Consolidate de-allocation of MSIs

2019-07-26 Thread Greg Kurz
When freeing MSIs, we need to: - remove them from the machine's MSI bitmap - remove them from the IC backend - remove them from the PHB's MSI cache This is currently open coded in two places in rtas_ibm_change_msi(), and we're about to need this in spapr_phb_reset() as well. Instead of duplicating

[Qemu-devel] [PATCH 0/3] spapr/pci: Improve MSI tracking

2019-07-26 Thread Greg Kurz
Some recent tests with AIX guests showed that we don't tear down MSIs that were allocated with the "change-msi" RTAS call, when the guest is rebooted. This series teach PHBs to do the cleanup at reset time. This bug has always been there. Not sure it is worth the pain to have this fixed in 4.1. -

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

2019-07-26 Thread Richard Henderson
On 7/26/19 2:39 AM, Paolo Bonzini wrote: > Then memory_region_endianness_inverted can be: > > if (mr->ops->endianness == DEVICE_NATIVE_ENDIAN) > return (op & MO_BSWAP) != MO_TE; > else if (mr->ops->endianness == DEVICE_BIG_ENDIAN) > return (op & MO_BSWAP) != MO_BE; > else if (mr->ops

[Qemu-devel] [PATCH 3/3] spapr/irq: Drop spapr_irq_msi_reset()

2019-07-26 Thread Greg Kurz
PHBs already take care of clearing the MSIs from the bitmap during reset or unplug. No need to do this globally from the machine code. Rather add an assert to ensure that PHBs have acted as expected. Signed-off-by: Greg Kurz --- hw/ppc/spapr.c |4 hw/ppc/spapr_irq.c

Re: [Qemu-devel] [PATCH 0/2] ssh: add password and privkey auth methods

2019-07-26 Thread Pino Toscano
On Friday, 26 July 2019 16:27:11 CEST Richard W.M. Jones wrote: > On Fri, Jul 26, 2019 at 04:09:52PM +0200, Pino Toscano wrote: > > These two patches add the password and private key authentication > > methods to the ssh block driver, using secure objects for > > passwords/passphrases. > > I was a

Re: [Qemu-devel] [PATCH v4 3/7] accel: collecting JIT statistics

2019-07-26 Thread Alex Bennée
vandersonmr writes: > If a TB has a TBS (TBStatistics) with the TB_JIT_STATS > enabled then we collect statistics of its translation > processes and code translation. To collect the number > of host instructions we used a modified version of the > disas function to pass through the whole code w

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:48 PM, tony.ngu...@bt.com wrote: > 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 -- >

Re: [Qemu-devel] [PATCH v27 5/8] target/avr: Add limited support for USART and 16 bit timer peripherals

2019-07-26 Thread Sarah Harris
Hi Michael and Pavel, The USART was based on the ATMega2560. It was designed for testing so its functionality is somewhat limited. Peripherals seem to vary between AVR chips so the configuration in the 2560 may not match other chips, especially the older ones. >From memory, the only shared regis

Re: [Qemu-devel] [PATCH 0/2] ssh: add password and privkey auth methods

2019-07-26 Thread Richard W.M. Jones
On Fri, Jul 26, 2019 at 04:45:03PM +0200, Pino Toscano wrote: > On Friday, 26 July 2019 16:27:11 CEST Richard W.M. Jones wrote: > > On Fri, Jul 26, 2019 at 04:09:52PM +0200, Pino Toscano wrote: > > > These two patches add the password and private key authentication > > > methods to the ssh block dr

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:48 PM, tony.ngu...@bt.com wrote: > 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

Re: [Qemu-devel] [PATCH 2/3] spapr/pci: Free MSIs during reset

2019-07-26 Thread Cédric Le Goater
On 26/07/2019 16:44, Greg Kurz wrote: > When the machine is reset, the MSI bitmap is cleared but the allocated > MSIs are not freed. Some operating systems, such as AIX, can detect the > previous configuration and assert. > > Empty the MSI cache, this performs the needed cleanup. This is fixing t

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:49 PM, tony.ngu...@bt.com wrote: > 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

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

2019-07-26 Thread Richard Henderson
On 7/25/19 11:48 PM, tony.ngu...@bt.com wrote: > 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 delet

Re: [Qemu-devel] [PATCH 1/3] spapr/pci: Consolidate de-allocation of MSIs

2019-07-26 Thread Cédric Le Goater
On 26/07/2019 16:44, Greg Kurz wrote: > When freeing MSIs, we need to: > - remove them from the machine's MSI bitmap > - remove them from the IC backend > - remove them from the PHB's MSI cache > > This is currently open coded in two places in rtas_ibm_change_msi(), > and we're about to need this

Re: [Qemu-devel] [PATCH 3/3] spapr/irq: Drop spapr_irq_msi_reset()

2019-07-26 Thread Cédric Le Goater
On 26/07/2019 16:44, Greg Kurz wrote: > PHBs already take care of clearing the MSIs from the bitmap during reset > or unplug. No need to do this globally from the machine code. Rather add > an assert to ensure that PHBs have acted as expected. This works because spar_irq_reset() is called after qe

Re: [Qemu-devel] [PATCH 0/2] ssh: add password and privkey auth methods

2019-07-26 Thread Eric Blake
On 7/26/19 9:45 AM, Pino Toscano wrote: > On Friday, 26 July 2019 16:27:11 CEST Richard W.M. Jones wrote: >> On Fri, Jul 26, 2019 at 04:09:52PM +0200, Pino Toscano wrote: >>> These two patches add the password and private key authentication >>> methods to the ssh block driver, using secure objects

Re: [Qemu-devel] [PATCH 3/3] spapr/irq: Drop spapr_irq_msi_reset()

2019-07-26 Thread Greg Kurz
On Fri, 26 Jul 2019 17:01:36 +0200 Cédric Le Goater wrote: > On 26/07/2019 16:44, Greg Kurz wrote: > > PHBs already take care of clearing the MSIs from the bitmap during reset > > or unplug. No need to do this globally from the machine code. Rather add > > an assert to ensure that PHBs have acted

Re: [Qemu-devel] [PATCH v5] target/arm: generate a custom MIDR for -cpu max

2019-07-26 Thread Richard Henderson
On 7/26/19 4:39 AM, Alex Bennée wrote: > While most features are now detected by probing the ID_* registers > kernels can (and do) use MIDR_EL1 for working out of they have to > apply errata. This can trip up warnings in the kernel as it tries to > work out if it should apply workarounds to feature

[Qemu-devel] [PULL 0/5] target-arm queue

2019-07-26 Thread Peter Maydell
Handful of bug fixes to sneak in before rc3. thanks -- PMM The following changes since commit c985266ea5b50e46e07b3568c1346e10064205c9: Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190726' into staging (2019-07-26 13:52:06 +0100) are available in the Git repository at

[Qemu-devel] [PULL 2/5] stellaris_input: Fix vmstate description of buttons field

2019-07-26 Thread Peter Maydell
gamepad_state::buttons is a pointer to an array of structs, not an array of structs, so should be declared in the vmstate with VMSTATE_STRUCT_VARRAY_POINTER_INT32; otherwise we corrupt memory on incoming migration. We bump the vmstate version field as the easiest way to deal with the migration bre

[Qemu-devel] [PULL 1/5] pl330: fix vmstate description

2019-07-26 Thread Peter Maydell
From: Damien Hedde Fix the pl330 main and queue vmstate description. There were missing POINTER flags causing crashes during incoming migration because: + PL330State chan field is a pointer to an array + PL330Queue queue field is a pointer to an array Also bump corresponding vmsd version numbers

[Qemu-devel] [PULL 3/5] vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros

2019-07-26 Thread Peter Maydell
The VMSTATE_STRUCT_VARRAY_UINT32 macro is intended to handle migrating a field which is an array of structs, but where instead of migrating the entire array we only migrate a variable number of elements of it. The VMSTATE_STRUCT_VARRAY_POINTER_UINT32 macro is intended to handle migrating a field w

[Qemu-devel] [PULL 5/5] hw/arm/boot: Further improve initrd positioning code

2019-07-26 Thread Peter Maydell
In commit e6b2b20d9735d4ef we made the boot loader code try to avoid putting the initrd on top of the kernel. However the expression used to calculate the start of the initrd: info->initrd_start = info->loader_start + MAX(MIN(info->ram_size / 2, 128 * 1024 * 1024), kernel_size); inco

[Qemu-devel] [PULL 4/5] hw/arm/boot: Rename elf_{low, high}_addr to image_{low, high}_addr

2019-07-26 Thread Peter Maydell
Rename the elf_low_addr and elf_high_addr variables to image_low_addr and image_high_addr -- in the next commit we will extend them to be set for other kinds of image file and not just ELF files. Signed-off-by: Peter Maydell Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by

Re: [Qemu-devel] [Qemu-riscv] [PATCH-4.2 v1 3/6] riscv: plic: Remove unused interrupt functions

2019-07-26 Thread Jonathan Behrens
Reviewed-by: Jonathan Behrens On Thu, Jul 25, 2019 at 2:56 PM Alistair Francis wrote: > Signed-off-by: Alistair Francis > --- > hw/riscv/sifive_plic.c | 12 > include/hw/riscv/sifive_plic.h | 3 --- > 2 files changed, 15 deletions(-) > > diff --git a/hw/riscv/sifive_plic

Re: [Qemu-devel] [PATCH v4 4/7] accel: replacing part of CONFIG_PROFILER with TBStats

2019-07-26 Thread Alex Bennée
vandersonmr writes: > We add some of the statistics collected in the TCGProfiler > into the TBStats, having the statistics not only for the whole > emulation but for each TB. Then, we removed these stats > from TCGProfiler and reconstruct the information for the > "info jit" using the sum of al

Re: [Qemu-devel] [PATCH 0/2] ssh: add password and privkey auth methods

2019-07-26 Thread Richard W.M. Jones
On Fri, Jul 26, 2019 at 10:06:43AM -0500, Eric Blake wrote: > On 7/26/19 9:45 AM, Pino Toscano wrote: > > On Friday, 26 July 2019 16:27:11 CEST Richard W.M. Jones wrote: > >> On Fri, Jul 26, 2019 at 04:09:52PM +0200, Pino Toscano wrote: > >>> These two patches add the password and private key authe

Re: [Qemu-devel] [PATCH 0/2] ssh: add password and privkey auth methods

2019-07-26 Thread Daniel P . Berrangé
On Fri, Jul 26, 2019 at 04:35:27PM +0100, Richard W.M. Jones wrote: > On Fri, Jul 26, 2019 at 10:06:43AM -0500, Eric Blake wrote: > > On 7/26/19 9:45 AM, Pino Toscano wrote: > > > On Friday, 26 July 2019 16:27:11 CEST Richard W.M. Jones wrote: > > >> On Fri, Jul 26, 2019 at 04:09:52PM +0200, Pino T

Re: [Qemu-devel] [PATCH 14/28] migration: Move the VMStateDescription typedef to typedefs.h

2019-07-26 Thread Philippe Mathieu-Daudé
On 7/26/19 2:05 PM, Markus Armbruster wrote: > We declare incomplete struct VMStateDescription in a couple of places > so we don't have to include migration/vmstate.h for the typedef. > That's fine with me. However, the next commit will drop > migration/vmstate.h from a massive number of compiles.

Re: [Qemu-devel] [PATCH 17/28] Include qom/object.h slightly less

2019-07-26 Thread Philippe Mathieu-Daudé
On 7/26/19 2:05 PM, Markus Armbruster wrote: > hw/hw.h used to include headers hardware emulation "usually" needs. > The previous commits removed all but one of them, to good effect. > Only qom/object.h is left. Remove that one, too. > > Signed-off-by: Markus Armbruster Reviewed-by: Philippe Ma

Re: [Qemu-devel] [PATCH 24/28] Include sysemu/hostmem.h less

2019-07-26 Thread Philippe Mathieu-Daudé
On 7/26/19 2:05 PM, Markus Armbruster wrote: > Move the HostMemoryBackend typedef from sysemu/hostmem.h to > qemu/typedefs.h. This renders a few inclusions of sysemu/hostmem.h > superflouous; drop them. > > Cc: Eduardo Habkost > Cc: Igor Mammedov > Signed-off-by: Markus Armbruster Reviewed-by

Re: [Qemu-devel] [PATCH 25/28] numa: Move remaining NUMA declarations from sysemu.h to numa.h

2019-07-26 Thread Philippe Mathieu-Daudé
On 7/26/19 2:05 PM, Markus Armbruster wrote: > Commit e35704ba9c "numa: Move NUMA declarations from sysemu.h to > numa.h" left a few NUMA-related macros behind. Move them now. > > Cc: Eduardo Habkost > Cc: Marcel Apfelbaum > Signed-off-by: Markus Armbruster :) Reviewed-by: Philippe Mathieu-D

Re: [Qemu-devel] [PATCH 08/28] Include sysemu/reset.h a lot less

2019-07-26 Thread Philippe Mathieu-Daudé
On 7/26/19 2:05 PM, Markus Armbruster wrote: > In my "build everything" tree, changing sysemu/reset.h triggers a > recompile of some 2600 out of 6600 objects (not counting tests and > objects that don't depend on qemu/osdep.h). > > The main culprit is hw/hw.h, which supposedly includes it for > co

Re: [Qemu-devel] [PATCH 06/28] trace: Eliminate use of TARGET_FMT_plx

2019-07-26 Thread Philippe Mathieu-Daudé
On 7/26/19 2:05 PM, Markus Armbruster wrote: > hw/tpm/trace-events uses TARGET_FMT_plx formats with uint64_t > arguments. That's wrong, TARGET_FMT_plx takes hwaddr. Since hwaddr > happens to be uint64_t, it works anyway. Messed up in commit > ec427498da5, v2.12.0. Clean up by replacing TARGET_F

Re: [Qemu-devel] [PATCH 04/28] memory: Fix type of IOMMUMemoryRegionClass member @parent_class

2019-07-26 Thread Philippe Mathieu-Daudé
On 7/26/19 2:05 PM, Markus Armbruster wrote: > TYPE_IOMMU_MEMORY_REGION is a direct subtype of TYPE_MEMORY_REGION. > Its instance struct is IOMMUMemoryRegion, and its first member is a > MemoryRegion. Correct. Its class struct is IOMMUMemoryRegionClass, > and its first member is a DeviceClass. W

Re: [Qemu-devel] [PULL 0/5] target-arm queue

2019-07-26 Thread Peter Maydell
On Fri, 26 Jul 2019 at 16:19, Peter Maydell wrote: > > Handful of bug fixes to sneak in before rc3. > > thanks > -- PMM > > The following changes since commit c985266ea5b50e46e07b3568c1346e10064205c9: > > Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20

Re: [Qemu-devel] [PATCH 2/3] spapr/pci: Free MSIs during reset

2019-07-26 Thread Philippe Mathieu-Daudé
Cc'ing qemu-stable@ On 7/26/19 4:44 PM, Greg Kurz wrote: > When the machine is reset, the MSI bitmap is cleared but the allocated > MSIs are not freed. Some operating systems, such as AIX, can detect the > previous configuration and assert. > > Empty the MSI cache, this performs the needed cleanu

  1   2   3   4   >