[Qemu-devel] [PATCH] ide: ahci: add check to avoid null dereference (CVE-2019-12067)

2019-08-07 Thread P J P
From: Prasad J Pandit AHCI emulator while committing DMA buffer in ahci_commit_buf() may do a NULL dereference if the command header 'ad->cur_cmd' is null. Add check to avoid it. Reported-by: Bugs SysSec Signed-off-by: Prasad J Pandit --- hw/ide/ahci.c | 6 -- 1 file changed, 4 insertions

Re: [Qemu-devel] [PATCH v2] hw: net: cadence_gem: Fix build errors in DB_PRINT()

2019-08-07 Thread Bin Meng
On Thu, Aug 8, 2019 at 1:21 PM Philippe Mathieu-Daudé wrote: > > Hi, > > On 8/8/19 6:44 AM, Bin Meng wrote: > > When CADENCE_GEM_ERR_DEBUG is turned on, there are several > > compilation errors in DB_PRINT(). Fix them. > > > > Signed-off-by: Bin Meng > > > > --- > > > > Changes in v2: > > Please

[Qemu-devel] [PATCH] scsi: lsi: exit infinite loop while executing script (CVE-2019-12068)

2019-08-07 Thread P J P
From: Prasad J Pandit When executing script in lsi_execute_script(), the LSI scsi adapter emulator advances 's->dsp' index to read next opcode. This can lead to an infinite loop if the next opcode is empty. Exit such loop after reading 10k empty opcodes. Reported-by: Bugs SysSec Signed-off-by:

Re: [Qemu-devel] [PATCH v2] numa: numa nodeid need not be sequential

2019-08-07 Thread David Gibson
On Tue, Aug 06, 2019 at 09:29:45PM +1000, Daniel Black wrote: > Replace all node_id assumptions with lookups from > machinestate->numa_state->nodes[] > and remove aspects that assume a sequential numbering of nodes. This enables > non-sequential NUMA node number topoligies to be created. > > Defa

[Qemu-devel] [Bug 1811533] Re: Unstable Win10 guest with qemu 3.1 + huge pages + hv_stimer

2019-08-07 Thread Žilvinas Žaltiena
** Changed in: qemu Status: New => Confirmed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1811533 Title: Unstable Win10 guest with qemu 3.1 + huge pages + hv_stimer Status in QEMU: Confi

Re: [Qemu-devel] [PATCH 01/11] target/arm: Pass in pc to thumb_insn_is_16bit

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/7/19 6:53 AM, Richard Henderson wrote: > This function is used in two different contexts, and it will be > clearer if the function is given the address to which it applies. > > Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé > --- > target/arm/translate.c | 14 ++

Re: [Qemu-devel] [PATCH 04/11] target/arm: Introduce add_reg_for_lit

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/7/19 6:53 AM, Richard Henderson wrote: > Provide a common routine for the places that require ALIGN(PC, 4) > as the base address as opposed to plain PC. The two are always > the same for A32, but the difference is meaningful for thumb mode. > > Signed-off-by: Richard Henderson > --- > Note:

Re: [Qemu-devel] Is network backend netmap worth keeping?

2019-08-07 Thread Jason Wang
On 2019/8/8 下午12:48, Markus Armbruster wrote: Please excuse the attention-grabbing subject. Philippe Mathieu-Daudé writes: On 8/7/19 10:16 PM, Markus Armbruster wrote: [...] Can you tell me offhand what I have to install so configure enables CONFIG_NETMAP? The steps are listed in tests/d

Re: [Qemu-devel] [PATCH v2] hw: net: cadence_gem: Fix build errors in DB_PRINT()

2019-08-07 Thread Philippe Mathieu-Daudé
Hi, On 8/8/19 6:44 AM, Bin Meng wrote: > When CADENCE_GEM_ERR_DEBUG is turned on, there are several > compilation errors in DB_PRINT(). Fix them. > > Signed-off-by: Bin Meng > > --- > > Changes in v2: Please don't reply to previous version, post as a new thread (it is harder to notice your ne

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

2019-08-07 Thread Richard Henderson
On 8/7/19 9:27 PM, Markus Armbruster wrote: typedef void SaveStateHandler(QEMUFile *f, void *opaque); typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id); +typedef void (*qemu_irq_handler)(void *opaque, int n, int level); >> >> Should we prefer a consistent form

[Qemu-devel] Is network backend netmap worth keeping? (was: [PATCH v2 27/29] Include sysemu/sysemu.h a lot less)

2019-08-07 Thread Markus Armbruster
Please excuse the attention-grabbing subject. Philippe Mathieu-Daudé writes: > On 8/7/19 10:16 PM, Markus Armbruster wrote: [...] >> Can you tell me offhand what I have to install so configure enables >> CONFIG_NETMAP? > > The steps are listed in tests/docker/dockerfiles/debian-amd64.docker, > b

Re: [Qemu-devel] [PATCH] hw: net: cadence_gem: Fix build errors in DB_PRINT()

2019-08-07 Thread Bin Meng
On Tue, Aug 6, 2019 at 6:57 PM Stefano Garzarella wrote: > > On Mon, Aug 05, 2019 at 08:52:54AM -0700, Bin Meng wrote: > > When CADENCE_GEM_ERR_DEBUG is turned on, there are several > > compilation errors in DB_PRINT(). Fix them. > > > > Signed-off-by: Bin Meng > > --- > > > > hw/net/cadence_gem

[Qemu-devel] [PATCH v2] hw: net: cadence_gem: Fix build errors in DB_PRINT()

2019-08-07 Thread Bin Meng
When CADENCE_GEM_ERR_DEBUG is turned on, there are several compilation errors in DB_PRINT(). Fix them. Signed-off-by: Bin Meng --- Changes in v2: - use HWADDR_PRIx instead of TARGET_FMT_plx for consistency - use 'z' modifier to print sizeof(..) hw/net/cadence_gem.c | 7 --- 1 file changed

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

2019-08-07 Thread Markus Armbruster
Eric Blake writes: > On 8/7/19 8:04 AM, Philippe Mathieu-Daudé wrote: >> On 8/6/19 5:14 PM, Markus Armbruster wrote: >>> 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

Re: [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained

2019-08-07 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> Alex Bennée writes: >> >>> Markus Armbruster writes: >>> 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 go

[Qemu-devel] [PATCH v2] migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap

2019-08-07 Thread Wei Yang
Rename for better understanding of the code. Suggested-by: Paolo Bonzini Signed-off-by: Wei Yang --- v2: * rebase on top of "just pass RAMBlock is enough" --- migration/ram.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index ee

Re: [Qemu-devel] [PATCH] migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap

2019-08-07 Thread Wei Yang
On Wed, Aug 07, 2019 at 06:49:48PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Rename for better understanding of the code. >> >> Suggested-by: Paolo Bonzini >> Signed-off-by: Wei Yang > >this needs fixing after 'just pass RAMBlock is enough' > Ok,

[Qemu-devel] [PATCH v2] riscv: hmp: Add a command to show virtual memory mappings

2019-08-07 Thread Bin Meng
This adds 'info mem' command for RISC-V, to show virtual memory mappings that aids debugging. Rather than showing every valid PTE, the command compacts the output by merging all contiguous physical address mappings into one block and only shows the merged block mapping details. Signed-off-by: Bin

Re: [Qemu-devel] [PATCH-for-4.2 v3 2/5] memory: Add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute

2019-08-07 Thread Alex Williamson
On Thu, 11 Jul 2019 08:18:54 +0200 Eric Auger wrote: > We introduce a new IOMMU Memory Region attribute, > IOMMU_ATTR_VFIO_NESTED that tells whether the virtual IOMMU > requires HW nested paging for VFIO integration. > > Current Intel virtual IOMMU device supports "Caching > Mode" and does not r

[Qemu-devel] [PATCH v2] riscv: rv32: Root page table address can be larger than 32-bit

2019-08-07 Thread Bin Meng
For RV32, the root page table's PPN has 22 bits hence its address bits could be larger than the maximum bits that target_ulong is able to represent. Use hwaddr instead. Signed-off-by: Bin Meng --- Changes in v2: - promote ppn, env->satp/env->sptbl to hwaddr otherwise the page table base will

Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check

2019-08-07 Thread Wei Yang
On Thu, Aug 08, 2019 at 02:30:02AM +, Zeng, Star wrote: >> -Original Message- >> From: Wei Yang [mailto:richardw.y...@linux.intel.com] >> Sent: Thursday, August 8, 2019 10:13 AM >> To: Zeng, Star >> Cc: Wei Yang ; qemu-devel@nongnu.org; >> imamm...@redhat.com; da...@redhat.com; m...@re

Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check

2019-08-07 Thread Zeng, Star
> -Original Message- > From: Wei Yang [mailto:richardw.y...@linux.intel.com] > Sent: Thursday, August 8, 2019 10:13 AM > To: Zeng, Star > Cc: Wei Yang ; qemu-devel@nongnu.org; > imamm...@redhat.com; da...@redhat.com; m...@redhat.com > Subject: Re: [Qemu-devel] [PATCH v2 1/2] memory-device:

Re: [Qemu-devel] [PATCH v3 05/14] hw/machine: add helper to query the memory encryption state

2019-08-07 Thread Singh, Brijesh
On 8/7/19 11:14 AM, Dr. David Alan Gilbert wrote: > * Singh, Brijesh (brijesh.si...@amd.com) wrote: >> To enable a memory encryption inside a VM, user must pass the object >> name used for the encryption in command line parameter as shown below. >> >> # $(QEMU) \ >> -machine memory-encryption= >

Re: [Qemu-devel] [PATCH v3 03/14] migration.json: add AMD SEV specific migration parameters

2019-08-07 Thread Singh, Brijesh
On 8/7/19 6:06 AM, Dr. David Alan Gilbert wrote: > * Singh, Brijesh (brijesh.si...@amd.com) wrote: >> AMD SEV migration flow requires that target machine's public Diffie-Hellman >> key (PDH) and certificate chain must be passed before initiating the guest >> migration. User can use QMP 'migrate-se

Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check

2019-08-07 Thread Wei Yang
On Thu, Aug 08, 2019 at 01:42:14AM +, Zeng, Star wrote: >> -Original Message- >> From: Qemu-devel [mailto:qemu-devel- >> bounces+star.zeng=intel@nongnu.org] On Behalf Of Wei Yang >> Sent: Tuesday, July 30, 2019 8:38 AM >> To: qemu-devel@nongnu.org >> Cc: imamm...@redhat.com; da...@r

[Qemu-devel] [Fail] tests/test-util-filemonitor fails

2019-08-07 Thread Wei Yang
Current qemu fails tests/test-util-filemonitor. By bisect, it shows this commit introduced the error. commit ff3dc8fefe953fd3650279e064bf63b212c5699a Author: Daniel P. Berrang茅 Date: Wed Mar 13 17:36:18 2019 + filemon: ensure watch IDs are unique to QFileMonitor scope The wa

Re: [Qemu-devel] [PATCH v7 4/9] block/nbd: add cmdline and qapi parameter reconnect-delay

2019-08-07 Thread Eric Blake
On 6/18/19 6:43 AM, Vladimir Sementsov-Ogievskiy wrote: > Reconnect will be implemented in the following commit, so for now, > in semantics below, disconnect itself is a "serious error". > > Signed-off-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Eric Blake > --- > qapi/block-core.json | 11

Re: [Qemu-devel] [PATCH v3] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-08-07 Thread Wei Yang
On Wed, Aug 07, 2019 at 07:35:34PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> For migration incoming side, it either quit in precopy or postcopy. It >> is safe to use the mis->bh for both instead of allocating a dedicated >> QEMUBH for postcopy. >> >

Re: [Qemu-devel] [PATCH v7 3/9] block/nbd: move from quit to state

2019-08-07 Thread Eric Blake
On 6/18/19 6:43 AM, Vladimir Sementsov-Ogievskiy wrote: > To implement reconnect we need several states for the client: > CONNECTED, QUIT and two different CONNECTING states. CONNECTING states > will be added in the following patches. This patch implements CONNECTED > and QUIT. > > QUIT means, tha

Re: [Qemu-devel] [PATCH] riscv: rv32: Root page table address can be larger than 32-bit

2019-08-07 Thread Bin Meng
Hi Palmer, On Thu, Aug 8, 2019 at 4:55 AM Palmer Dabbelt wrote: > > On Thu, Aug 1, 2019 at 7:58 AM Bin Meng wrote: >> >> On Thu, Aug 1, 2019 at 10:16 PM Richard Henderson >> wrote: >> > >> > On 7/31/19 6:53 PM, Bin Meng wrote: >> > > I am not sure how (idx * ptesize) could overflow. It represen

Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check

2019-08-07 Thread Zeng, Star
> -Original Message- > From: Qemu-devel [mailto:qemu-devel- > bounces+star.zeng=intel@nongnu.org] On Behalf Of Wei Yang > Sent: Tuesday, July 30, 2019 8:38 AM > To: qemu-devel@nongnu.org > Cc: imamm...@redhat.com; da...@redhat.com; Wei Yang > ; m...@redhat.com > Subject: [Qemu-devel] [P

Re: [Qemu-devel] [PATCH v8] qemu-io: add pattern file for write command

2019-08-07 Thread Eric Blake
On 8/7/19 2:06 AM, Denis Plotnikov wrote: > The patch allows to provide a pattern file for write > command. There was no similar ability before. > > Signed-off-by: Denis Plotnikov > --- > > +static void *qemu_io_alloc_from_file(BlockBackend *blk, size_t len, > +

Re: [Qemu-devel] [PATCH v3] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-08-07 Thread Wei Yang
On Wed, Aug 07, 2019 at 07:35:34PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> For migration incoming side, it either quit in precopy or postcopy. It >> is safe to use the mis->bh for both instead of allocating a dedicated >> QEMUBH for postcopy. >> >

Re: [Qemu-devel] [PATCH v2 3/3] qcow2: add zstd cluster compression

2019-08-07 Thread Eric Blake
On 7/4/19 8:09 AM, Denis Plotnikov wrote: > zstd significantly reduces cluster compression time. > It provides better compression performance maintaining > the same level of compression ratio in comparison with > zlib, which, by the moment, has been the only compression s/by/at/ > method availabl

Re: [Qemu-devel] [PATCH v2 1/3] qcow2: introduce compression type feature

2019-08-07 Thread Eric Blake
On 7/4/19 8:09 AM, Denis Plotnikov wrote: > The patch adds some preparation parts for incompatible compression type > feature to QCOW2 header that indicates that *all* compressed clusters > must be (de)compressed using a certain compression type. > > It is implied that the compression type is set

Re: [Qemu-devel] [PATCH v2 1/3] qcow2: introduce compression type feature

2019-08-07 Thread Eric Blake
On 8/7/19 6:12 PM, Max Reitz wrote: >> >> +static int check_compression_type(BDRVQcow2State *s, Error **errp) >> +{ >> +switch (s->compression_type) { >> +case QCOW2_COMPRESSION_TYPE_ZLIB: >> +break; >> + >> +default: >> +error_setg(errp, "qcow2: unknown compression t

Re: [Qemu-devel] [PATCH] tests/test-hbitmap: test next_zero and _next_dirty_area after truncate

2019-08-07 Thread John Snow
On 8/5/19 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: > Test that hbitmap_next_zero and hbitmap_next_dirty_area can find things > after old bitmap end. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > It's a follow-up for > > [PATCH for-4.1] util/hbitmap: update orig_size on

Re: [Qemu-devel] [PATCH 0/3] backup fixes for 4.1?

2019-08-07 Thread John Snow
On 7/31/19 6:29 AM, Vladimir Sementsov-Ogievskiy wrote: > 30.07.2019 21:41, John Snow wrote: >> >> >> On 7/30/19 12:32 PM, Vladimir Sementsov-Ogievskiy wrote: >>> Hi all! >>> >>> Here are two small fixes. >>> >>> 01 is not a degradation at all, so it's OK for 4.2 >>> 02 is degradation of 3.0, so

Re: [Qemu-devel] [PATCH v2 1/3] qcow2: introduce compression type feature

2019-08-07 Thread Max Reitz
On 04.07.19 15:09, Denis Plotnikov wrote: > The patch adds some preparation parts for incompatible compression type > feature to QCOW2 header that indicates that *all* compressed clusters > must be (de)compressed using a certain compression type. > > It is implied that the compression type is set

Re: [Qemu-devel] [PATCH] migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap

2019-08-07 Thread Wei Yang
On Wed, Aug 07, 2019 at 06:49:48PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Rename for better understanding of the code. >> >> Suggested-by: Paolo Bonzini >> Signed-off-by: Wei Yang > >this needs fixing after 'just pass RAMBlock is enough' > You

[Qemu-devel] bitmaps branch rebase

2019-08-07 Thread John Snow
FYI: I rebased jsnow/bitmaps on top of kwolf/block-next, itself based on top of v4.1.0-rc4. I'll post this along with the eventual pull request, but here's the diffstat against the published patches: 011/33:[0003] [FC] 'block/backup: upgrade copy_bitmap to BdrvDirtyBitmap' 016/33:[] [-C] 'iot

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

2019-08-07 Thread Max Reitz
On 07.08.19 16:46, Kevin Wolf wrote: > This fixes devices like IDE that can still start new requests from I/O > handlers in the CPU thread while the block backend is drained. > > The basic assumption is that in a drain section, no new requests should > be allowed through a BlockBackend (blk_draine

Re: [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained

2019-08-07 Thread Alex Bennée
Markus Armbruster writes: > Alex Bennée writes: > >> Markus Armbruster writes: >> >>> 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:

Re: [Qemu-devel] [PATCH v2 2/3] mirror: Keep mirror_top_bs drained after dropping permissions

2019-08-07 Thread Max Reitz
On 07.08.19 16:46, Kevin Wolf wrote: > mirror_top_bs is currently implicitly drained through its connection to > the source or the target node. However, the drain section for target_bs > ends early after moving mirror_top_bs from src to target_bs, so that > requests can already be restarted while m

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

2019-08-07 Thread Eric Blake
On 8/7/19 8:04 AM, Philippe Mathieu-Daudé wrote: > On 8/6/19 5:14 PM, Markus Armbruster wrote: >> 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

Re: [Qemu-devel] [PATCH v2 27/29] Include sysemu/sysemu.h a lot less

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/7/19 10:16 PM, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: > >> On 8/6/19 5:14 PM, Markus Armbruster wrote: >>> 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 depen

Re: [Qemu-devel] [Virtio-fs] [PATCH 0/4] virtiofsd: multithreading preparation part 3

2019-08-07 Thread Vivek Goyal
On Wed, Aug 07, 2019 at 07:03:55PM +0100, Stefan Hajnoczi wrote: > On Thu, Aug 01, 2019 at 05:54:05PM +0100, Stefan Hajnoczi wrote: > > Performance > > --- > > Please try these patches out and share your results. > > Here are the performance numbers: > > Threadpool | iodepth | iodepth >

Re: [Qemu-devel] [PATCH] riscv: rv32: Root page table address can be larger than 32-bit

2019-08-07 Thread Palmer Dabbelt
On Thu, Aug 1, 2019 at 7:58 AM Bin Meng wrote: > On Thu, Aug 1, 2019 at 10:16 PM Richard Henderson > wrote: > > > > On 7/31/19 6:53 PM, Bin Meng wrote: > > > I am not sure how (idx * ptesize) could overflow. It represents the > > > offset by a page table which is [0, 4096). > > > > You're right,

[Qemu-devel] [PATCH v2] RISC-V: Ignore the S and U extensions when formatting ISA strings

2019-08-07 Thread Palmer Dabbelt
The ISA strings we're providing from QEMU aren't actually legal RISC-V ISA strings, as both the S and U extensions cannot exist as single-letter extensions and must instead be multi-letter strings. We're still using the ISA strings inside QEMU to track the availiable extensions, so this patch just

Re: [Qemu-devel] [PATCH v2 00/29] Tame a few "touch this, recompile the world" headers

2019-08-07 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> 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 54 >> headers triggers a recompile of m

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

2019-08-07 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> In my "build everything" tree, changing sysemu/sysemu.h triggers a >> recompile of some 1800 out of 6600 objects (not counting tests and >> objects that don't depend on qemu/osdep.h, down from 5400 due to the >> previous commit). >> >> Several

Re: [Qemu-devel] [PATCH v2 27/29] Include sysemu/sysemu.h a lot less

2019-08-07 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 8/6/19 5:14 PM, Markus Armbruster wrote: >> 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 sy

Re: [Qemu-devel] [PATCH v2 26/29] Clean up inclusion of sysemu/sysemu.h

2019-08-07 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> 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 superfluo

Re: [Qemu-devel] [PATCH v2 09/29] Include migration/qemu-file-types.h a lot less

2019-08-07 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 8/7/19 2:25 PM, Philippe Mathieu-Daudé wrote: >> On 8/6/19 5:14 PM, Markus Armbruster wrote: >>> In my "build everything" tree, changing migration/qemu-file-types.h >>> triggers a recompile of some 2600 out of 6600 objects (not counting >>> tests and objects th

Re: [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained

2019-08-07 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> 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 normall

[Qemu-devel] [Bug 1811533] Re: Unstable Win10 guest with qemu 3.1 + huge pages + hv_stimer

2019-08-07 Thread Damir
Still broken with Qemu 4.1rc2 /w Kernel 5.2. This is a huge problem, as it breaks performance, either in networking (you can't use the virtio net which is the only 100G adapter afaik), or you have to disable huge pages, which is a blow to any large vm host, or it breaks stimer, which increases cpu

Re: [Qemu-devel] [PATCH v2 0/3] migration: add speed limit for multifd migration

2019-08-07 Thread Dr. David Alan Gilbert
* Ivan Ren (reny...@gmail.com) wrote: > From: Ivan Ren > > Currently multifd migration has not been limited and it will consume > the whole bandwidth of Nic. These two patches add speed limitation to > it. Queued > > This is the v3 patches: > > v3 VS v2: > Add Reviewed info and Suggested info

Re: [Qemu-devel] [PATCH v3] migration: always initial ram_counters for a new migration

2019-08-07 Thread Dr. David Alan Gilbert
* Ivan Ren (reny...@gmail.com) wrote: > From: Ivan Ren > > This patch fix a multifd migration bug in migration speed calculation, this > problem can be reproduced as follows: > 1. start a vm and give a heavy memory write stress to prevent the vm be >successfully migrated to destination > 2. b

Re: [Qemu-devel] [PATCH] migration: remove unused field bytes_xfer

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > MigrationState->bytes_xfer is only set to 0 in migrate_init(). > > Remove this unnecessary field. > > Signed-off-by: Wei Yang Queued (finally!) > --- > migration/migration.c | 1 - > migration/migration.h | 1 - > 2 files changed, 2 deletion

Re: [Qemu-devel] [PATCH 8/8] block/backup: backup_do_cow: use bdrv_dirty_bitmap_next_dirty_area

2019-08-07 Thread Max Reitz
On 07.08.19 10:07, Vladimir Sementsov-Ogievskiy wrote: > Use effective bdrv_dirty_bitmap_next_dirty_area interface. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/backup.c | 56 ++ > 1 file changed, 24 insertions(+), 32 deletions(-)

Re: [Qemu-devel] [PATCH v3] hmp: Remove migration capabilities from "info migrate"

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > With the growth of migration capabilities, it is not proper to display > them in "info migrate". Users are recommended to use "info > migrate_capabiltiies" to list them. > > Signed-off-by: Wei Yang > Suggested-by: Dr. David Alan Gilbert Queued

Re: [Qemu-devel] [PATCH 0/2] migration/postcopy: simplify postcopy_chunk_hostpages_pass

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > When looking into function postcopy_chunk_hostpages_pass(), we could use > alignment calculation to simplify it. > > Wei Yang (2): > migration/postcopy: simplify calculation of run_start and > fixup_start_addr > migration/postcopy: use QE

Re: [Qemu-devel] RISC-V: insn32.decode: Confusing encodings

2019-08-07 Thread Richard Henderson
On 8/6/19 5:48 AM, Maxim Blinov wrote: > slli 00 ... 001 . 0010011 @sh > srli 00 ... 101 . 0010011 @sh > srai 01 ... 101 . 0010011 @sh > > First question: Why does the %sh10 field exist? There are no 10-bit > shamt fields anyw

Re: [Qemu-devel] [Patch v2] migration/postcopy: make PostcopyDiscardState a static variable

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > In postcopy-ram.c, we provide three functions to discard certain > RAMBlock range: > > * postcopy_discard_send_init() > * postcopy_discard_send_range() > * postcopy_discard_send_finish() > > Currently, we allocate/deallocate PostcopyDiscar

Re: [Qemu-devel] [PATCH 7/8] block/backup: merge duplicated logic into backup_do_cow

2019-08-07 Thread Max Reitz
On 07.08.19 10:07, Vladimir Sementsov-Ogievskiy wrote: > backup_cow_with_offload and backup_cow_with_bounce_buffer contains a > lot of duplicated logic. Move it into backup_do_cow. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/backup.c | 83 +++

Re: [Qemu-devel] [PATCH v3] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > For migration incoming side, it either quit in precopy or postcopy. It > is safe to use the mis->bh for both instead of allocating a dedicated > QEMUBH for postcopy. > > Signed-off-by: Wei Yang > Reviewed-by: Dr. David Alan Gilbert Hi Wei, C

Re: [Qemu-devel] [PATCH 6/8] block/backup: teach backup_cow_with_bounce_buffer to copy more at once

2019-08-07 Thread Max Reitz
On 07.08.19 10:07, Vladimir Sementsov-Ogievskiy wrote: > backup_cow_with_offload can transfer more than on cluster. Let > backup_cow_with_bounce_buffer behave similarly. It reduces number > of IO and there are no needs to copy cluster by cluster. > > Signed-off-by: Vladimir Sementsov-Ogievskiy >

Re: [Qemu-devel] [PATCH 03/11] target/arm: Introduce read_pc

2019-08-07 Thread Richard Henderson
On 8/7/19 11:16 AM, Peter Maydell wrote: > How about we add this to the commit message? > > This changes the behaviour for load_reg() and load_reg_var() > when called with reg==15 from a 32-bit Thumb instruction: > previously they would have returned the incorrect value > of pc_curr + 6, and now t

Re: [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread Richard Henderson
On 8/7/19 11:00 AM, Paolo Bonzini wrote: > On 07/08/19 19:49, Richard Henderson wrote: >> On 8/7/19 1:33 AM, tony.ngu...@bt.com wrote: >>> @@ -551,6 +551,7 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, >>> hwaddr addr, >>> /* As length is under guest control, handle illegal va

Re: [Qemu-devel] [PATCH v2 22/29] Include hw/boards.h a bit less

2019-08-07 Thread Eduardo Habkost
On Wed, Aug 07, 2019 at 08:05:50PM +0200, Philippe Mathieu-Daudé wrote: > On 8/7/19 7:57 PM, Eduardo Habkost wrote: > > On Wed, Aug 07, 2019 at 07:26:56PM +0200, Philippe Mathieu-Daudé wrote: > >> On 8/6/19 5:14 PM, Markus Armbruster wrote: > >>> hw/boards.h pulls in almost 60 headers. The less we

Re: [Qemu-devel] [PATCH 03/11] target/arm: Introduce read_pc

2019-08-07 Thread Peter Maydell
On Wed, 7 Aug 2019 at 19:04, Richard Henderson wrote: > > On 8/7/19 10:27 AM, Peter Maydell wrote: > >> +/* The architectural value of PC. */ > >> +static uint32_t read_pc(DisasContext *s) > >> +{ > >> +return s->pc_curr + (s->thumb ? 4 : 8); > >> +} > >> + > >> /* Set a variable to the valu

Re: [Qemu-devel] [PATCH 5/8] block/backup: fix backup_cow_with_offload for last cluster

2019-08-07 Thread Max Reitz
On 07.08.19 10:07, Vladimir Sementsov-Ogievskiy wrote: > We shouldn't try to copy bytes beyond EOF. Fix it. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/backup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Max Reitz signature.asc Description: OpenPG

Re: [Qemu-devel] [PATCH v2 22/29] Include hw/boards.h a bit less

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/7/19 7:57 PM, Eduardo Habkost wrote: > On Wed, Aug 07, 2019 at 07:26:56PM +0200, Philippe Mathieu-Daudé wrote: >> On 8/6/19 5:14 PM, Markus Armbruster wrote: >>> hw/boards.h pulls in almost 60 headers. The less we include it into >>> headers, the better. As a first step, drop superfluous inc

Re: [Qemu-devel] [PATCH 03/11] target/arm: Introduce read_pc

2019-08-07 Thread Richard Henderson
On 8/7/19 10:27 AM, Peter Maydell wrote: >> +/* The architectural value of PC. */ >> +static uint32_t read_pc(DisasContext *s) >> +{ >> +return s->pc_curr + (s->thumb ? 4 : 8); >> +} >> + >> /* Set a variable to the value of a CPU register. */ >> static void load_reg_var(DisasContext *s, TC

Re: [Qemu-devel] [PATCH 0/4] virtiofsd: multithreading preparation part 3

2019-08-07 Thread Stefan Hajnoczi
On Thu, Aug 01, 2019 at 05:54:05PM +0100, Stefan Hajnoczi wrote: > Performance > --- > Please try these patches out and share your results. Here are the performance numbers: Threadpool | iodepth | iodepth size|1| 64 ---+-+ None | 44

Re: [Qemu-devel] [PATCH 4/8] block/backup: improve unallocated clusters skipping

2019-08-07 Thread Max Reitz
On 07.08.19 10:07, Vladimir Sementsov-Ogievskiy wrote: > Limit block_status querying to request bounds on write notifier to > avoid extra seeking. I don’t understand this reasoning. Checking whether something is allocated for qcow2 should just mean an L2 cache lookup. Which we have to do anyway

Re: [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread Paolo Bonzini
On 07/08/19 19:49, Richard Henderson wrote: > On 8/7/19 1:33 AM, tony.ngu...@bt.com wrote: >> @@ -551,6 +551,7 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, >> hwaddr addr, >> /* As length is under guest control, handle illegal values. */ >> return; >> } >> +

Re: [Qemu-devel] [PATCH for 4.1] RISC-V: Ignore the S and U extensions when formatting ISA strings

2019-08-07 Thread Alistair Francis
On Wed, Aug 7, 2019 at 8:00 AM Palmer Dabbelt wrote: > > The ISA strings we're providing from QEMU aren't actually legal RISC-V > ISA strings, as both the S and U extensions cannot exist as > single-letter extensions and must instead be multi-letter strings. > We're still using the ISA strings ins

Re: [Qemu-devel] [PATCH v2 22/29] Include hw/boards.h a bit less

2019-08-07 Thread Eduardo Habkost
On Wed, Aug 07, 2019 at 07:26:56PM +0200, Philippe Mathieu-Daudé wrote: > On 8/6/19 5:14 PM, Markus Armbruster wrote: > > 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'

[Qemu-devel] [Bug 1839367] [NEW] Wrong interrupts generated for I.MX6 FEC controller

2019-08-07 Thread Aaron Hill
Public bug reported: The imx_eth_update function in hw/net/imx_fec.c has the following comment (https://github.com/qemu/qemu/blob/864ab314f1d924129d06ac7b571f105a2b76a4b2/hw/net/imx_fec.c#L421-L445): /* * Previous versions of qemu had the ENET_INT_MAC and ENET_INT_MAC * interrupts s

Re: [Qemu-devel] [PATCH v2 0/2] migration: cleanup ram_load

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Two cleanup for ram_load: > > * return -EINVAL for version_id mismatch > * extract ram_load_precopy for better readability > > v2: fix a comment Queued > Wei Yang (2): > migration: return -EINVAL directly when version_id mismatch > migrati

Re: [Qemu-devel] [PATCH 00/11] target/arm: decodetree prep patches

2019-08-07 Thread Peter Maydell
On Wed, 7 Aug 2019 at 05:53, Richard Henderson wrote: > > These are split out of my decodetree conversion of the > aarch32 general instructions. With one exception, these > are all related to cleaning up how we refer to "PC". > > > r~ > > > Richard Henderson (11): > target/arm: Pass in pc to th

Re: [Qemu-devel] [PATCH] numa: Introduce MachineClass::auto_enable_numa for implicit NUMA node

2019-08-07 Thread Eduardo Habkost
On Tue, Aug 06, 2019 at 02:50:55PM +0200, Igor Mammedov wrote: > On Mon, 5 Aug 2019 15:13:02 +0800 > Tao Xu wrote: > > > Add MachineClass::auto_enable_numa field. When it is true, a NUMA node > > is expected to be created implicitly. > > > > Acked-by: David Gibson > > Suggested-by: Igor Mammed

Re: [Qemu-devel] [PATCH] migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Rename for better understanding of the code. > > Suggested-by: Paolo Bonzini > Signed-off-by: Wei Yang this needs fixing after 'just pass RAMBlock is enough' Dave > --- > migration/ram.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 dele

Re: [Qemu-devel] [PATCH] migration: equation is more proper than and to check LOADVM_QUIT

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > LOADVM_QUIT allows a command to quit all layers of nested loadvm loops, > while current return value check is not that proper even it works now. > > Current return value check "ret & LOADVM_QUIT" would return true if > bit[0] is 1. This would be

Re: [Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread Richard Henderson
On 8/7/19 1:33 AM, tony.ngu...@bt.com wrote: > @@ -551,6 +551,7 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, > hwaddr addr, > /* As length is under guest control, handle illegal values. */ > return; > } > +/* FIXME: memory_region_dispatch_write ignores MO_BS

Re: [Qemu-devel] [PATCH] migration: just pass RAMBlock is enough

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > RAMBlock->used_length is always passed to migration_bitmap_sync_range(), > which could be retrieved from RAMBlock. > > Suggested-by: Paolo Bonzini > Signed-off-by: Wei Yang Queued > --- > migration/ram.c | 9 - > 1 file changed, 4 in

Re: [Qemu-devel] [PATCH v6 21/26] cputlb: Replace size and endian operands for MemOp

2019-08-07 Thread Richard Henderson
On 8/7/19 1:33 AM, tony.ngu...@bt.com wrote: > @@ -1246,7 +1246,7 @@ typedef uint64_t FullLoadHelper(CPUArchState *env, > target_ulong addr, > > static inline uint64_t __attribute__((always_inline)) > load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, > -uintptr_t ret

Re: [Qemu-devel] [PATCH] migration: use migration_in_postcopy() to check POSTCOPY_ACTIVE

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Use common helper function to check the state. > > Signed-off-by: Wei Yang queued > --- > migration/rdma.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/migration/rdma.c b/migration/rdma.c > index 3036221ee8.

Re: [Qemu-devel] [PATCH] migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > There is only one place to set start_postcopy to true, > qmp_migrate_start_postcopy(), which make sure start_postcopy could be > set to true when migrate_postcopy() return true. > > So start_postcopy is true implies the other one. > > Signed-off

Re: [Qemu-devel] [PATCH 10/11] target/arm: Use unallocated_encoding for aarch32

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/7/19 6:53 AM, Richard Henderson wrote: > Promote this function from aarch64 to fully general use. > Use it to unify the code sequences for generating illegal > opcode exceptions. > > Signed-off-by: Richard Henderson > --- > target/arm/translate-a64.h | 2 -- > target/arm/translate.h

Re: [Qemu-devel] [PATCH] migration/postcopy: PostcopyState is already set in loadvm_postcopy_handle_advise()

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > PostcopyState is already set to ADVISE at the beginning of > loadvm_postcopy_handle_advise(). > > Remove the redundant set. > > Signed-off-by: Wei Yang Queued > --- > migration/savevm.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --gi

Re: [Qemu-devel] [PATCH v2 27/29] Include sysemu/sysemu.h a lot less

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/6/19 5:14 PM, Markus Armbruster wrote: > 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 e965ff

Re: [Qemu-devel] [PATCH 0/3] migration/savevm: move non SaveStateEntry condition check out of iteration

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > qemu_savevm_state_complete_precopy() iterates SaveStateEntry and does proper > tasks for migration. > > For each iteration, in_postcopy and iterable_only would be checked to see > whether it should skip. Since these two conditions are not SaveSta

Re: [Qemu-devel] [PATCH v2 09/29] Include migration/qemu-file-types.h a lot less

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/7/19 2:25 PM, Philippe Mathieu-Daudé wrote: > On 8/6/19 5:14 PM, Markus Armbruster wrote: >> In my "build everything" tree, changing migration/qemu-file-types.h >> triggers a recompile of some 2600 out of 6600 objects (not counting >> tests and objects that don't depend on qemu/osdep.h). >> >>

Re: [Qemu-devel] [PATCH 3/8] block/io: handle alignment and max_transfer for copy_range

2019-08-07 Thread Max Reitz
On 07.08.19 10:07, Vladimir Sementsov-Ogievskiy wrote: > copy_range ignores these limitations, let's improve it. block/backup > code handles max_transfer for copy_range by itself, now it's not needed > more, drop it. Shouldn’t this be two separate patches? > Signed-off-by: Vladimir Sementsov-Ogie

Re: [Qemu-devel] [PATCH 03/11] target/arm: Introduce read_pc

2019-08-07 Thread Peter Maydell
On Wed, 7 Aug 2019 at 05:53, Richard Henderson wrote: > > We currently have 3 different ways of computing the architectural > value of "PC" as seen in the ARM ARM. > > The value of s->pc has been incremented past the current insn, > but that is all. Thus for a32, PC = s->pc + 4; for t32, PC = s->

Re: [Qemu-devel] [PATCH v2 22/29] Include hw/boards.h a bit less

2019-08-07 Thread Philippe Mathieu-Daudé
On 8/6/19 5:14 PM, Markus Armbruster wrote: > 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: Edu

Re: [Qemu-devel] [PATCH 0/2] migration/postcopy: cleanup function postcopy_chunk_hostpages_pass

2019-08-07 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Here are two trivial function cleanup. Queued > BTW, I didn't test them since TPS == HPS. How could I setup a guest with > TPS != HPS? > > Wei Yang (2): > migration/postcopy: reduce one operation to calculate fixup_start_addr > migration/po

Re: [Qemu-devel] [PATCH for 4.1] RISC-V: Ignore the S and U extensions when formatting ISA strings

2019-08-07 Thread Palmer Dabbelt
On Wed, 07 Aug 2019 09:41:17 PDT (-0700), Peter Maydell wrote: On Wed, 7 Aug 2019 at 16:02, Palmer Dabbelt wrote: The ISA strings we're providing from QEMU aren't actually legal RISC-V ISA strings, as both the S and U extensions cannot exist as single-letter extensions and must instead be mult

  1   2   3   4   >