[PATCH v7 05/15] block/nvme: Improve error message when IO queue creation failed

2020-09-03 Thread Philippe Mathieu-Daudé
Do not use the same error message for different failures. Display a different error whether it is the CQ or the SQ. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) dif

[PATCH v7 12/15] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE

2020-09-03 Thread Philippe Mathieu-Daudé
BDRV_POLL_WHILE() is defined as: #define BDRV_POLL_WHILE(bs, cond) ({ \ BlockDriverState *bs_ = (bs); \ AIO_WAIT_WHILE(bdrv_get_aio_context(bs_), \ cond); }) As we will remove the BlockDriverState use in the next commit, start by using the e

[PATCH v7 02/15] block/nvme: Avoid further processing if trace event not enabled

2020-09-03 Thread Philippe Mathieu-Daudé
Avoid further processing if TRACE_NVME_SUBMIT_COMMAND_RAW is not enabled. This is an untested intend of performance optimization. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/nvme.c b/block/nvme.

[PATCH v7 03/15] block/nvme: Let nvme_create_queue_pair() fail gracefully

2020-09-03 Thread Philippe Mathieu-Daudé
As nvme_create_queue_pair() is allowed to fail, replace the alloc() calls by try_alloc() to avoid aborting QEMU. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(

[PATCH v7 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-09-03 Thread Philippe Mathieu-Daudé
We allocate an unique chunk of memory then use it for two different structures. By using an union, we make it clear the data is overlapping (and we can remove the casts). Suggested-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-D

[PATCH v7 14/15] block/nvme: Extract nvme_poll_queue()

2020-09-03 Thread Philippe Mathieu-Daudé
As we want to do per-queue polling, extract the nvme_poll_queue() method which operates on a single queue. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 44 +++- 1 file changed, 27 i

[PATCH v7 09/15] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset

2020-09-03 Thread Philippe Mathieu-Daudé
In the next commit we'll get rid of qemu_try_blockalign(). To ease review, first replace qemu_try_blockalign0() by explicit calls to qemu_try_blockalign() and memset(). Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 16

Re: flatview_write_continue global mutex deadlock

2020-09-03 Thread Paolo Bonzini
On 03/09/20 13:16, Vladimir Sementsov-Ogievskiy wrote: > (gdb) info thr >   Id   Target Id    Frame > * 1    Thread 0x7fb9f0f39e00 (LWP 215115) "qemu-system-x86" > 0x7fb9d784f54d in __lll_lock_wait () from /lib64/libpthread.so.0 > [...] > #1  0x56069b

[PATCH v7 04/15] block/nvme: Define INDEX macros to ease code review

2020-09-03 Thread Philippe Mathieu-Daudé
Use definitions instead of '0' or '1' indexes. Also this will be useful when using multi-queues later. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 33 +++-- 1 file changed, 19 insertions(+), 1

QEMU | Pipeline #185250681 has failed for master | e4d8b7c1

2020-09-03 Thread GitLab via
Your pipeline has failed. Project: QEMU ( https://gitlab.com/qemu-project/qemu ) Branch: master ( https://gitlab.com/qemu-project/qemu/-/commits/master ) Commit: e4d8b7c1 ( https://gitlab.com/qemu-project/qemu/-/commit/e4d8b7c1a95fffcfa4bdab9aa7ffd1cf590cdcf5 ) Commit Message: Merge remote-tr

[PATCH v7 06/15] block/nvme: Use common error path in nvme_add_io_queue()

2020-09-03 Thread Philippe Mathieu-Daudé
Rearrange nvme_add_io_queue() by using a common error path. This will be proven useful in few commits where we add IRQ notification to the IO queues. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 9 + 1 file change

[PULL v3 06/15] meson: fix keymaps without qemu-keymap

2020-09-03 Thread Thomas Huth
From: Gerd Hoffmann In case the qemu-keymap tool generating them is neither installed on the system nor built from sources (due to xkbcommon not being available) qemu will not find the keymaps when started directly from the build tree, This happens because commit ddcf607fa3d6 ("meson: drop keyma

[PATCH v7 07/15] block/nvme: Rename local variable

2020-09-03 Thread Philippe Mathieu-Daudé
We are going to modify the code in the next commit. Renaming the 'resp' variable to 'id' first makes the next commit easier to review. No logical changes. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 19 +-

Re: [RFC qemu 0/6] mirror: implement incremental and bitmap modes

2020-09-03 Thread Kevin Wolf
Am 03.09.2020 um 13:04 hat Max Reitz geschrieben: > On 03.09.20 12:13, Fabian Grünbichler wrote: > > On August 21, 2020 3:03 pm, Max Reitz wrote: > >> On 18.02.20 11:07, Fabian Grünbichler wrote: > > I am not sure how > > the S-O-B by John is supposed to enter the mix - should I just include > >

[PATCH v7 10/15] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz)

2020-09-03 Thread Philippe Mathieu-Daudé
qemu_try_blockalign() is a generic API that call back to the block driver to return its page alignment. As we call from within the very same driver, we already know to page alignment stored in our state. Remove indirections and use the value from BDRVNVMeState. This change is required to later remo

[PATCH v7 11/15] block/nvme: Simplify nvme_init_queue() arguments

2020-09-03 Thread Philippe Mathieu-Daudé
nvme_init_queue() doesn't require BlockDriverState anymore. Replace it by BDRVNVMeState to simplify. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bl

[PATCH v7 13/15] block/nvme: Simplify nvme_create_queue_pair() arguments

2020-09-03 Thread Philippe Mathieu-Daudé
nvme_create_queue_pair() doesn't require BlockDriverState anymore. Replace it by BDRVNVMeState and AioContext to simplify. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 13 +++-- 1 file changed, 7 insertions(+), 6

[PATCH v7 15/15] block/nvme: Use an array of EventNotifier

2020-09-03 Thread Philippe Mathieu-Daudé
In preparation of using multiple IRQ (thus multiple eventfds) make BDRVNVMeState::irq_notifier an array (for now of a single element, the admin queue notifier). Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 31

Re: [PATCH 20/63] pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost > --- > Cc: "Hervé Poussineau" > Cc: qemu-...@nongnu.org > Cc: qemu-devel@nongnu.org > --- > include/hw/isa/pc87312.h | 4

Re: [PATCH v6 00/12] monitor: Optionally run handlers in coroutines

2020-09-03 Thread Kevin Wolf
Am 03.09.2020 um 12:49 hat Markus Armbruster geschrieben: > Markus Armbruster writes: > > > Markus Armbruster writes: > > > >> I let this series slide to get my Error API rework done, along with much > >> else. My sincere apologies! > >> > >> Unsurprisingly, it needs a rebase now. I suggest to

[PULL v3 00/15] Cirrus-CI improvements, and other CI-related fixes, m68k

2020-09-03 Thread Thomas Huth
Hi Peter! The following changes since commit ed215cec0fcaeaece064b0fdf37fe3bceb06d76c: Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2020-09-02 15:26:38 +0100) are available in the Git repository at: https://gitlab.com/huth/qemu.git tags/pul

Re: [PATCH 15/63] i8259: Rename TYPE_I8259 to TYPE_PIC

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost > --- > Cc: "Michael S. Tsirkin" > Cc: Paolo Bonzini > Cc: qemu-devel@nongnu.org > --- > hw/intc/i8259.c | 10 +-

Re: [PATCH 14/63] i8254: Rename TYPE_I8254 to TYPE_PIT

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost > --- > Cc: "Michael S. Tsirkin" > Cc: Paolo Bonzini > Cc: qemu-devel@nongnu.org > --- > include/hw/timer/i8254.h | 4 ++-

Re: [PATCH 02/63] chardev: Rename TYPE_CHARDEV_* to TYPE_*_CHARDEV

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the TYPE_* constants consistent with the name of > most type checking macros we have today. > > Signed-off-by: Eduardo Habkost > --- > Cc: Samuel Thibault > Cc: "Marc-André Lureau" > Cc: Paolo Bonzini > Cc: "Alex Bennée" > Cc: "Phili

Re: [PATCH 01/63] gpex: Fix type checking function name

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This looks like a copy/paste mistake: the instance type checking > macro for TYPE_GPEX_ROOT_DEVICE was named MCH_PCI_DEVICE. > > Signed-off-by: Eduardo Habkost > --- > Cc: qemu-devel@nongnu.org > --- > include/hw/pci-host/gpex.h | 2 +- > 1 file chang

Re: [PATCH 10/63] vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé > --- > Cc: Ben Warren > Cc: "Michael S. Tsirkin" > Cc: Igor Mammedov > Cc: qemu-d

Re: [PATCH 06/63] dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé > --- > Cc: Gerd Hoffmann > Cc: qemu-devel@nongnu.org > --- > hw/usb/dev-smartcard-

Re: [PATCH 16/63] i8259: Rename TYPE_KVM_I8259 to TYPE_KVM_PIC

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost > --- > Cc: "Michael S. Tsirkin" > Cc: Marcel Apfelbaum > Cc: Paolo Bonzini > Cc: Richard Henderson > Cc: Eduardo Habkos

Re: [PATCH] iotests: Allow running from different directory

2020-09-03 Thread Max Reitz
On 02.09.20 13:03, Kevin Wolf wrote: > It is convenient to be able to edit the tests and run them without > changing the current working directory back and forth. Instead of > assuming that $PWD is the qemu-iotests build directory, derive the build > directory from the executed script. > > This al

Re: [PATCH 24/63] scsi: Rename TYPE_AM53C974_DEVICE to TYPE_PCI_ESP

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost > --- > Cc: Paolo Bonzini > Cc: Fam Zheng > Cc: qemu-devel@nongnu.org > --- > hw/scsi/esp-pci.c | 8 > 1 file ch

Re: [PATCH 28/63] tusb6010: Rename TYPE_TUSB6010 to TYPE_TUSB

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost > --- > Cc: Gerd Hoffmann > Cc: qemu-devel@nongnu.org > --- > hw/usb/tusb6010.c | 6 +++--- > 1 file changed, 3 insertions

Re: [PATCH 32/63] ahci: Rename ICH_AHCI to ICH9_AHCI

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > Make the type checking macro name consistent with the TYPE_* > constant. > > Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé > --- > Cc: John Snow > Cc: qemu-bl...@nongnu.org > Cc: qemu-devel@nongnu.org > --- > include/hw/ide/ah

Re: [RFC qemu 0/6] mirror: implement incremental and bitmap modes

2020-09-03 Thread Max Reitz
On 03.09.20 14:38, Kevin Wolf wrote: > Am 03.09.2020 um 13:04 hat Max Reitz geschrieben: >> On 03.09.20 12:13, Fabian Grünbichler wrote: >>> On August 21, 2020 3:03 pm, Max Reitz wrote: On 18.02.20 11:07, Fabian Grünbichler wrote: >>> I am not sure how >>> the S-O-B by John is supposed to ent

Re: [PATCH 33/63] net/can: Rename TYPE_CAN_CPI constants

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > Rename macros to names that are unique in the source tree, to > reduce confusion and make automated conversion of the code > easier. > > Signed-off-by: Eduardo Habkost > --- > Cc: Jason Wang > Cc: qemu-devel@nongnu.org > --- > hw/net/can/can_kvaser_p

Re: [PATCH 39/63] esp: Rename ESP_STATE to ESP

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > Make the type checking macro name consistent with the TYPE_* > constant. > > Signed-off-by: Eduardo Habkost > --- > Cc: Mark Cave-Ayland > Cc: Laurent Vivier > Cc: "Hervé Poussineau" > Cc: Aleksandar Rikalo > Cc: Aleksandar Markovic > Cc: Aurelien

Re: [PATCH 47/63] rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > Make the type checking macro name consistent with the TYPE_* > constant. > > Signed-off-by: Eduardo Habkost > --- > Cc: "Hervé Poussineau" > Cc: David Gibson > Cc: qemu-...@nongnu.org > Cc: qemu-devel@nongnu.org > --- > hw/ppc/rs6000_mc.c | 4 ++-- >

Re: [PATCH 48/63] sabre: Rename SABRE_DEVICE to SABRE

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > Make the type checking macro name consistent with the TYPE_* > constant. > > Signed-off-by: Eduardo Habkost > --- > Cc: Mark Cave-Ayland > Cc: Artyom Tarasenko > Cc: qemu-devel@nongnu.org > --- > include/hw/pci-host/sabre.h | 2 +- > hw/pci-host/sab

Re: [PATCH 53/63] usb: Rename USB_SERIAL_DEV to USB_SERIAL

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 12:43 AM, Eduardo Habkost wrote: > Make the type checking macro name consistent with the TYPE_* > constant. > > Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé > --- > Cc: Gerd Hoffmann > Cc: Samuel Thibault > Cc: qemu-devel@nongnu.org > --- > hw/usb/dev-serial.

Re: [PULLv2] nvme updates

2020-09-03 Thread Peter Maydell
On Wed, 2 Sep 2020 at 15:43, Keith Busch wrote: > > Hi Peter, > > This is our second attempt at the nvme pull request from me and Klaus > after fixing the error you identified in the first attempt. > > The following changes since commit 8d90bfc5c31ad60f6049dd39be636b06bc00b652: > > Merge remote-

Re: [PATCH] hw/ide: check null block pointer before blk_drain

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 1:05 PM, P J P wrote: > +-- On Mon, 31 Aug 2020, Philippe Mathieu-Daudé wrote --+ > | > +++ b/hw/ide/core.c > | > @@ -718,7 +718,7 @@ void ide_cancel_dma_sync(IDEState *s) > | > -if (s->bus->dma->aiocb) { > | > +if (s->blk && s->bus->dma->aiocb) { > | > | But s->blk mustn't be nu

Re: [PATCH] qcow2: Fix removal of list members from BDRVQcow2State.cluster_allocs

2020-09-03 Thread Max Reitz
On 02.09.20 19:42, Alberto Garcia wrote: > When a write request needs to allocate new clusters (or change the L2 > bitmap of existing ones) a QCowL2Meta structure is created so the L2 > metadata can be later updated and any copy-on-write can be performed > if necessary. > > A write request can spa

Re: [RFC PATCH 11/12] hw/pci: Only allow PCI slave devices to write to direct memory

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 2:26 PM, Paolo Bonzini wrote: > On 03/09/20 13:08, Philippe Mathieu-Daudé wrote: >> Do not allow PCI slaves to write to indirect memory >> regions such MMIO. >> >> This fixes LP#1886362 and LP#1888606. > > What is a "PCI slave"? TBH I at a quick look at the PCIe SPEC, but not PCI. PCIe

Re: [RFC qemu 0/6] mirror: implement incremental and bitmap modes

2020-09-03 Thread Kevin Wolf
Am 03.09.2020 um 14:57 hat Max Reitz geschrieben: > On 03.09.20 14:38, Kevin Wolf wrote: > > Am 03.09.2020 um 13:04 hat Max Reitz geschrieben: > >> On 03.09.20 12:13, Fabian Grünbichler wrote: > >>> On August 21, 2020 3:03 pm, Max Reitz wrote: > On 18.02.20 11:07, Fabian Grünbichler wrote: > >

[PATCH 0/3] target/arm: Decode Neon fp sizes in decodetree

2020-09-03 Thread Peter Maydell
This patchset fixes something that Richard pointed out during review of my fp16 patchset. In the Neon instruction set, integer operations always have a 2-bit size field with an encoding corresponding to QEMU's MO_{8,16,32,64} constants: 0 for 8 bit, 1 for 16 bit, 2 for 32 bit and 3 for 64-bit. How

[PATCH 3/3] target/arm: Convert VCMLA, VCADD size field to MO_* in decode

2020-09-03 Thread Peter Maydell
The VCMLA and VCADD insns have a size field which is 0 for fp16 and 1 for fp32 (note that this is the reverse of the Neon 3-same encoding!). Convert it to MO_* values in decode for consistency. Signed-off-by: Peter Maydell --- target/arm/neon-shared.decode | 18 -- target/arm/t

[PATCH 1/3] target/arm: Convert Neon 3-same-fp size field to MO_* in decode

2020-09-03 Thread Peter Maydell
In the Neon instructions, some instruction formats have a 2-bit size field which corresponds exactly to QEMU's MO_8/16/32/64. However the floating-point insns in the 3-same group have a 1-bit size field which is "0 for 32-bit float and 1 for 16-bit float". Currently we pass these values directly

[PATCH 2/3] target/arm: Convert Neon VCVT fp size field to MO_* in decode

2020-09-03 Thread Peter Maydell
Convert the insns using the 2reg_vcvt and 2reg_vcvt_f16 formats to pass the size through to the trans function as a MO_* value rather than the '0==f32, 1==f16' used in the fp 3-same encodings. Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 3 +-- target/arm/translate-neon.c.i

[PATCH 1/1] Skip flatview_simplify() for specific cpu vendor

2020-09-03 Thread FelixCuioc
Flatview_simplify() will merge many address ranges into one range.When a part of the big range needs to be changed,this will cause some innocent mappings to be unmapped.So we want to skip flatview_simplify(). Signed-off-by: FelixCuioc --- softmmu/memory.c | 16 +++- target/i386/cpu.

Re: [RFC 0/3] try to solve the DMA to MMIO issue

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 1:28 PM, Peter Maydell wrote: > On Thu, 3 Sep 2020 at 12:24, Li Qiang wrote: >> Peter Maydell 于2020年9月3日周四 下午7:19写道: >>> No. Any device can have an inbound or outbound qemu_irq line. >>> We use them not just for actual IRQ lines but for any >>> situation where we need to pass an on-or-o

Re: [RFC qemu 0/6] mirror: implement incremental and bitmap modes

2020-09-03 Thread Fabian Grünbichler
On September 3, 2020 3:23 pm, Kevin Wolf wrote: > Am 03.09.2020 um 14:57 hat Max Reitz geschrieben: >> On 03.09.20 14:38, Kevin Wolf wrote: >> > Am 03.09.2020 um 13:04 hat Max Reitz geschrieben: >> >> On 03.09.20 12:13, Fabian Grünbichler wrote: >> >>> On August 21, 2020 3:03 pm, Max Reitz wrote: >

[PATCH 0/1] Skip flatview_simplify() for specific cpu vendor

2020-09-03 Thread FelixCuioc
The reason we want to skip flatview_simplify() is to prevent unnecessary IOVA address range mapping from being unmapped. The actual situation we encountered is: When assign EHCI device to the virtual machine, after initializing EHCI in seabios, it will continuously send dma cycles.And EHCI dma buf

Re: [RFC PATCH 00/12] hw: Forbid DMA write accesses to MMIO regions

2020-09-03 Thread Laszlo Ersek
Hi Phil, On 09/03/20 13:08, Philippe Mathieu-Daudé wrote: > Hi, > > I'm not suppose to work on this but I couldn't sleep so kept > wondering about this problem the whole night and eventually > woke up to write this quickly, so comments are scarce, sorry. > > The first part is obvious anyway, simpl

答复: [PATCH 1/1] Skip flatview_simplify() for specific cpu vendor

2020-09-03 Thread FelixCui-oc
>I think you're seeing issues when a guest accesses an adjacent mapping >between the delete and add phases of the KVM MemoryListener. >We're considering fixing that in the kernel, by adding a new ioctl that >changes the whole memory map in a single step. I am CCing Peter Xu. hi paolo,

Re: [PATCH] hw/ide: check null block pointer before blk_drain

2020-09-03 Thread P J P
+-- On Thu, 3 Sep 2020, Philippe Mathieu-Daudé wrote --+ | > +if (s->blk) { | > +ide_cancel_dma_sync(s); | > +bm->status &= ~BM_STATUS_DMAING; | | If you don't clear this bit the guest might keep retrying (looping). Oh, okay will keep it out of the if(s

Re: [RFC 0/3] try to solve the DMA to MMIO issue

2020-09-03 Thread Peter Maydell
On Thu, 3 Sep 2020 at 14:36, Philippe Mathieu-Daudé wrote: > Not sure if this is a valid example, but when adding: > > -- >8 -- > diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c > index bca71b5934b..b8b4ba362b1 100644 > --- a/hw/intc/ioapic.c > +++ b/hw/intc/ioapic.c > @@ -96,6 +96,8 @@ static vo

Re: [RFC qemu 0/6] mirror: implement incremental and bitmap modes

2020-09-03 Thread Kevin Wolf
Am 03.09.2020 um 15:36 hat Fabian Grünbichler geschrieben: > On September 3, 2020 3:23 pm, Kevin Wolf wrote: > > Am 03.09.2020 um 14:57 hat Max Reitz geschrieben: > >> On 03.09.20 14:38, Kevin Wolf wrote: > >> > Am 03.09.2020 um 13:04 hat Max Reitz geschrieben: > >> >> On 03.09.20 12:13, Fabian Grü

[PATCH 1/2] hw/timer/hpet: Remove dead code

2020-09-03 Thread Philippe Mathieu-Daudé
This code was never compiled/used, remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/timer/hpet.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 380acfa7c8a..b683f64f1d3 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -416,2

[PATCH 0/2] hw/timer/hpet: Trivial format string fix

2020-09-03 Thread Philippe Mathieu-Daudé
Fix a format string and remove dead code. Philippe Mathieu-Daudé (2): hw/timer/hpet: Remove dead code hw/timer/hpet: Fix DPRINTF format string hw/timer/hpet.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) -- 2.26.2

[PATCH 2/2] hw/timer/hpet: Fix DPRINTF format string

2020-09-03 Thread Philippe Mathieu-Daudé
Fix building with HPET_DEBUG enabled: hw/timer/hpet.c:512:73: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr, value);

Re: [PATCH] qcow2: Fix removal of list members from BDRVQcow2State.cluster_allocs

2020-09-03 Thread Alberto Garcia
On Thu 03 Sep 2020 03:12:22 PM CEST, Max Reitz wrote: > On my search for /(\.|->)nb_clusters/ to verify this, I noticed this > comment for qcow2_alloc_cluster_offset(): > > * If the cluster was already allocated, m->nb_clusters is set to 0 and > * other fields in m are meaningless. > > Should tha

Re: [RFC PATCH 12/12] dma: Assert when device writes to indirect memory (such MMIO regions)

2020-09-03 Thread Edgar E. Iglesias
On Thu, Sep 03, 2020 at 01:08:31PM +0200, Philippe Mathieu-Daudé wrote: > Assert DMA accesses are done on direct memory (in particular > to catch invalid accesses to MMIO regions). Hi Philippe, Is the motivation for this to make it easier to find DMA programming errors? Shouldn't guest SW use the

Re: [RFC qemu 0/6] mirror: implement incremental and bitmap modes

2020-09-03 Thread Max Reitz
On 03.09.20 15:36, Fabian Grünbichler wrote: > On September 3, 2020 3:23 pm, Kevin Wolf wrote: >> Am 03.09.2020 um 14:57 hat Max Reitz geschrieben: >>> On 03.09.20 14:38, Kevin Wolf wrote: Am 03.09.2020 um 13:04 hat Max Reitz geschrieben: > On 03.09.20 12:13, Fabian Grünbichler wrote:

Re: [RFC PATCH 00/12] hw: Forbid DMA write accesses to MMIO regions

2020-09-03 Thread Peter Maydell
On Thu, 3 Sep 2020 at 14:37, Laszlo Ersek wrote: > Peter mentions an approach at the end of > that I believe > to understand, but -- according to him -- it seems too much work. It also would only be effective for MMIO, not for qemu_irq lin

Re: [PATCH 1/2] hw/timer/hpet: Remove dead code

2020-09-03 Thread Thomas Huth
On 03/09/2020 15.45, Philippe Mathieu-Daudé wrote: > This code was never compiled/used, remove it. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/timer/hpet.c | 14 -- > 1 file changed, 14 deletions(-) > > diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c > index 380acfa7c8a..b68

Re: [PATCH v1] sd: sdhci: assert data_count is within fifo_buffer

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 9:08 AM, P J P wrote: > From: Prasad J Pandit > > While doing multi block SDMA, transfer block size may exceed > the 's->fifo_buffer[s->buf_maxsz]' size. It may leave the > current element pointer 's->data_count' pointing out of bounds. > Leading the subsequent DMA r/w operation to OOB

Re: [PATCH 2/2] hw/timer/hpet: Fix DPRINTF format string

2020-09-03 Thread Thomas Huth
On 03/09/2020 15.45, Philippe Mathieu-Daudé wrote: > Fix building with HPET_DEBUG enabled: > > hw/timer/hpet.c:512:73: error: format specifies type 'unsigned int' but the > argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] > DPRINTF("qemu: Enter hpet_ram_writel at %" P

Re: [PATCH v6 00/12] monitor: Optionally run handlers in coroutines

2020-09-03 Thread Markus Armbruster
Kevin Wolf writes: > Am 03.09.2020 um 12:49 hat Markus Armbruster geschrieben: >> Markus Armbruster writes: >> >> > Markus Armbruster writes: >> > >> >> I let this series slide to get my Error API rework done, along with much >> >> else. My sincere apologies! >> >> >> >> Unsurprisingly, it ne

Re: [PATCH v1 0/8] some testing and CI updates (re-greening)

2020-09-03 Thread Thomas Huth
On 03/09/2020 13.34, Daniel P. Berrangé wrote: > On Thu, Sep 03, 2020 at 12:20:59PM +0100, Alex Bennée wrote: >> Hi, >> >> My first series after a holiday is a bunch of clean-ups for testing. >> Currently they all apply on top of Thomas' pull-request-2020-09-02 tag >> which is currently in flight.

Re: [PATCH v2 6/7] spapr_numa: move NVLink2 associativity handling to spapr_numa.c

2020-09-03 Thread Daniel Henrique Barboza
On 9/2/20 10:56 PM, David Gibson wrote: On Tue, Sep 01, 2020 at 09:56:44AM -0300, Daniel Henrique Barboza wrote: This patch adds a new spapr_numa_write_assoc_nvlink2() helper to handle the ibm,associativity for NVLink2 GPUs. Signed-off-by: Daniel Henrique Barboza Reviewed-by: David Gibson

Re: [RFC PATCH 00/12] hw: Forbid DMA write accesses to MMIO regions

2020-09-03 Thread Edgar E. Iglesias
On Thu, Sep 03, 2020 at 02:58:19PM +0100, Peter Maydell wrote: > On Thu, 3 Sep 2020 at 14:37, Laszlo Ersek wrote: > > Peter mentions an approach at the end of > > that I believe > > to understand, but -- according to him -- it seems too muc

Re: [PATCH v2] Fix a gap where acpi_pcihp_find_hotplug_bus() returns a non-hotpluggable bus

2020-09-03 Thread Ani Sinha
Please do not pull this patch. This patch has a bug and it will crash here: Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. 0x55c2805339e9 in acpi_pcihp_find_hotplug_bus (bsel=bsel@entry=1, s=) at /home/ani/workspace/qemu/hw/acpi/pcihp.c:162 162if (!qbus_is_

Re: make -i check resut for msys2

2020-09-03 Thread Thomas Huth
On 03/09/2020 11.18, 罗勇刚(Yonggang Luo) wrote: [...] >   TEST    check-unit: tests/test-replication.exe > ** > ERROR:C:/work/xemu/qemu/tests/test-replication.c:136:make_temp: > assertion failed: (fd >= 0) > ERROR test-replication.exe - Bail out! > ERROR:C:/work/xemu/qemu/tests/test-replication.c:136

Re: [PATCH v1 0/8] some testing and CI updates (re-greening)

2020-09-03 Thread Alex Bennée
Daniel P. Berrangé writes: > On Thu, Sep 03, 2020 at 12:20:59PM +0100, Alex Bennée wrote: >> Hi, >> >> My first series after a holiday is a bunch of clean-ups for testing. >> Currently they all apply on top of Thomas' pull-request-2020-09-02 tag >> which is currently in flight. The fixes to sh

Re: [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS)

2020-09-03 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200902080552.159806-1-phi...@redhat.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

Re: [PATCH v4 06/12] block: Fixes nfs on msys2/mingw

2020-09-03 Thread Thomas Huth
CC: NFS maintainer + qemu-block On 03/09/2020 10.31, Yonggang Luo wrote: > Signed-off-by: Yonggang Luo > --- > block/nfs.c | 26 +- > 1 file changed, 17 insertions(+), 9 deletions(-) > > diff --git a/block/nfs.c b/block/nfs.c > index 61a249a9fc..34b2cd5708 100644 > ---

[PATCH v3] Fix a gap where acpi_pcihp_find_hotplug_bus() returns a non-hotpluggable bus

2020-09-03 Thread Ani Sinha
When ACPI hotplug for the root bus is disabled, the bsel property for that bus is not set. Please see the following commit: 3d7e78aaf ("Introduce a new flag for i440fx to disable PCI hotplug on the root bus"). As a result, when acpi_pcihp_find_hotplug_bus() is called with bsel set to 0, it m

[PATCH] hw/arm/mps2: New board model mps2-386

2020-09-03 Thread Peter Maydell
Implement a model of the MPS2 with the AN386 firmware. This is essentially identical to the AN385 firmware, but it has a Cortex-M4 rather than a Cortex-M3. Signed-off-by: Peter Maydell --- hw/arm/mps2.c | 30 +++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff -

Re: qemu panic on OSX 10.15.6

2020-09-03 Thread Roman Bolshakov
On Wed, Sep 02, 2020 at 10:17:01AM +0200, Christian Schoenebeck wrote: > On Dienstag, 1. September 2020 14:45:55 CEST David Cohen wrote: > > Hi, > > > > I'm trying to use qemu on OSX Catalina using HVF hypervisor, but it's > > currently panic'ing upon booting Linux guest. > > > > These are the ar

Re: [PATCH] qemu-img: avoid unaligned read requests during convert

2020-09-03 Thread Max Reitz
On 01.09.20 14:51, Peter Lieven wrote: > in case of large continous areas that share the same allocation status > it happens that the value of s->sector_next_status is unaligned to the > cluster size or even request alignment of the source. Avoid this by > stripping down the s->sector_next_status p

Re: [PATCH] hw/arm/mps2: New board model mps2-386

2020-09-03 Thread Philippe Mathieu-Daudé
On 9/3/20 4:44 PM, Peter Maydell wrote: > Implement a model of the MPS2 with the AN386 firmware. This is > essentially identical to the AN385 firmware, but it has a > Cortex-M4 rather than a Cortex-M3. > > Signed-off-by: Peter Maydell > --- > hw/arm/mps2.c | 30 +++--- >

Re: [PATCH 6/7] hw/display/artist: Fix artist screen resolution

2020-09-03 Thread Richard Henderson
On 9/2/20 11:09 PM, Helge Deller wrote: > New patch #3/3: > > From 476aeb9b832ae172a9d6a28aa9e43300dedd419b Mon Sep 17 00:00:00 2001 > Subject: [PATCH] hw/display/artist: Allow screen size up to 2048 lines > > Adjust the ADDR_TO_Y() macro to extract 11 bits, which allows userspace > to address sc

Re: [PATCH v2 0/1] 9pfs: log warning if msize <= 8192

2020-09-03 Thread Greg Kurz
On Thu, 3 Sep 2020 16:41:02 +0200 Christian Schoenebeck wrote: > I have updated the QEMU 9P setup wiki page about this 'msize' issue. For > some reason the dedicated anchor 'msize' does not work though: > > https://wiki.qemu.org/Documentation/9psetup#msize > AFAICT the wiki derives the anchor

[PATCH v6 2/8] util: split off a helper for dealing with O_CLOEXEC flag

2020-09-03 Thread Daniel P . Berrangé
We're going to have multiple callers to open() from qemu_open() soon. Readability would thus benefit from having a helper for dealing with O_CLOEXEC. Reviewed-by: Markus Armbruster Signed-off-by: Daniel P. Berrangé --- util/osdep.c | 23 +++ 1 file changed, 15 insertions(+),

[PATCH v6 0/8] block: improve error reporting for unsupported O_DIRECT

2020-09-03 Thread Daniel P . Berrangé
v1: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg00269.html v2: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg00589.html v3: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg07098.html v4: https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg05334.html v5: https:/

[PATCH v6 4/8] util: refactor qemu_open_old to split off variadic args handling

2020-09-03 Thread Daniel P . Berrangé
This simple refactoring prepares for future patches. The variadic args handling is split from the main bulk of the open logic. Reviewed-by: Markus Armbruster Signed-off-by: Daniel P. Berrangé --- util/osdep.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff

[PATCH v6 1/8] monitor: simplify functions for getting a dup'd fdset entry

2020-09-03 Thread Daniel P . Berrangé
Currently code has to call monitor_fdset_get_fd, then dup the return fd, and then add the duplicate FD back into the fdset. This dance is overly verbose for the caller and introduces extra failure modes which can be avoided by folding all the logic into monitor_fdset_dup_fd_add and removing monitor

[PATCH v6 6/8] util: introduce qemu_open and qemu_create with error reporting

2020-09-03 Thread Daniel P . Berrangé
qemu_open_old() works like open(): set errno and return -1 on failure. It has even more failure modes, though. Reporting the error clearly to users is basically impossible for many of them. Our standard cure for "errno is too coarse" is the Error object. Introduce two new helper methods: int q

[PATCH v6 3/8] util: rename qemu_open() to qemu_open_old()

2020-09-03 Thread Daniel P . Berrangé
We want to introduce a new version of qemu_open() that uses an Error object for reporting problems and make this it the preferred interface. Rename the existing method to release the namespace for the new impl. Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbr

[PATCH v6 5/8] util: add Error object for qemu_open_internal error reporting

2020-09-03 Thread Daniel P . Berrangé
Instead of relying on the limited information from errno, we can now also provide detailed error messages to callers that ask for it. Reviewed-by: Markus Armbruster Signed-off-by: Daniel P. Berrangé --- util/osdep.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --

[PATCH v6 7/8] util: give a specific error message when O_DIRECT doesn't work

2020-09-03 Thread Daniel P . Berrangé
A common error scenario is to tell QEMU to use O_DIRECT in combination with a filesystem that doesn't support it. To aid users to diagnosing their mistake we want to provide a clear error message when this happens. Reviewed-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Daniel P. B

[PATCH v6 8/8] block/file: switch to use qemu_open/qemu_create for improved errors

2020-09-03 Thread Daniel P . Berrangé
Currently at startup if using cache=none on a filesystem lacking O_DIRECT such as tmpfs, at startup QEMU prints qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: file system may not support O_DIRECT qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: Could not open '/tmp/foo.img': In

[PATCH 0/5] migration/postcopy: Sync faulted addresses after network recovered

2020-09-03 Thread Peter Xu
We've seen conditional guest hangs on destination VM after postcopy recovered. However the hang will resolve itself after a few minutes. The problem is: after a postcopy recovery, the prioritized postcopy queue on the source VM is actually missing. So all the faulted threads before the postcopy r

[PATCH 1/5] migration: Rework migrate_send_rp_req_pages() function

2020-09-03 Thread Peter Xu
We duplicated the logic of maintaining the last_rb variable at both callers of this function. Pass *rb pointer into the function so that we can avoid duplicating the logic. Also, when we have the rb pointer, it's also easier to remove the original 2nd & 4th parameters, because both of them (name

[PATCH 3/5] migration: Pass incoming state into qemu_ufd_copy_ioctl()

2020-09-03 Thread Peter Xu
It'll be used in follow up patches to access more fields out of it. Meanwhile fetch the userfaultfd inside the function. Signed-off-by: Peter Xu --- migration/postcopy-ram.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy

[PATCH 2/5] migration: Introduce migrate_send_rp_message_req_pages()

2020-09-03 Thread Peter Xu
This is another layer wrapper for sending a page request to the source VM, Signed-off-by: Peter Xu --- migration/migration.c | 10 -- migration/migration.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 6761e3f

[PATCH] meson: remove linkage of sdl to baum

2020-09-03 Thread Bruce Rogers
Ever since commit 537fe2d63f744e7c96ff45b60d09486a81958e06 there has been a 'linkage' to sdl for compiling baum.c. Originally it had to do with including sdl cflags for any file including sdl headers. There is no longer any such need for baum.c, but the association has persisted in the make system,

[PATCH 4/5] migration: Maintain postcopy faulted addresses

2020-09-03 Thread Peter Xu
Maintain a list of faulted addresses on the destination host for which we're waiting on. This is implemented using a GTree rather than a real list to make sure even there're plenty of vCPUs/threads that are faulting, the lookup will still be fast with O(log(N)) (because we'll do that after placing

[PATCH 5/5] migration: Sync requested pages after postcopy recovery

2020-09-03 Thread Peter Xu
We synchronize the requested pages right after a postcopy recovery happens. This helps to synchronize the prioritized pages on source so that the faulted threads can be served faster. Reported-by: Xiaohui Li Signed-off-by: Peter Xu --- migration/savevm.c | 56 +++

[PATCH] meson: install ivshmem-client and ivshmem-server

2020-09-03 Thread Bruce Rogers
Turn on the meson install flag for these executables Signed-off-by: Bruce Rogers --- contrib/ivshmem-client/meson.build | 2 +- contrib/ivshmem-server/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/ivshmem-client/meson.build b/contrib/ivshmem-client/m

Re: [PATCH v2 0/1] 9pfs: log warning if msize <= 8192

2020-09-03 Thread Greg Kurz
On Thu, 3 Sep 2020 17:19:31 +0200 Greg Kurz wrote: > On Thu, 3 Sep 2020 16:41:02 +0200 > Christian Schoenebeck wrote: > > > I have updated the QEMU 9P setup wiki page about this 'msize' issue. For > > some reason the dedicated anchor 'msize' does not work though: > > > > https://wiki.qemu.org/

<    1   2   3   4   5   6   7   >