RE: [PATCH v2 1/1] net/colo-compare.c: Fix memory leak in packet_enqueue()

2020-03-24 Thread Zhang, Chen
> -Original Message- > From: Derek Su > Sent: Wednesday, March 25, 2020 12:17 PM > To: Zhang, Chen > Cc: qemu-devel@nongnu.org; lizhij...@cn.fujitsu.com; > jasow...@redhat.com; dere...@qnap.com > Subject: Re: [PATCH v2 1/1] net/colo-compare.c: Fix memory leak in > packet_enqueue() > >

RE: [PATCH v15 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Tian, Kevin
> From: Dr. David Alan Gilbert > Sent: Wednesday, March 25, 2020 4:23 AM > > * Alex Williamson (alex.william...@redhat.com) wrote: > > On Mon, 23 Mar 2020 23:01:18 -0400 > > Yan Zhao wrote: > > > > > On Tue, Mar 24, 2020 at 02:51:14AM +0800, Dr. David Alan Gilbert wrote: > > > > * Alex

Re: [PATCH 6/6] qga/commands-posix: fix use after free of local_err

2020-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2020 23:03, Eric Blake wrote: On 3/24/20 10:36 AM, Vladimir Sementsov-Ogievskiy wrote: local_err is used several times in guest_suspend(). Setting non-NULL local_err will crash, so let's zero it after freeing. Also fix possible leak of local_err in final if(). Signed-off-by: Vladimir

Re: [PATCH v2 1/1] net/colo-compare.c: Fix memory leak in packet_enqueue()

2020-03-24 Thread Derek Su
Jing-Wei Su 於 2020年3月25日 週三 上午10:05寫道: > > Zhang, Chen 於 2020年3月25日 週三 上午9:37寫道: > > > > > > > > > -Original Message- > > > From: Jing-Wei Su > > > Sent: Tuesday, March 24, 2020 10:47 AM > > > To: Zhang, Chen > > > Cc: qemu-devel@nongnu.org; lizhij...@cn.fujitsu.com; > > >

[PATCH v5 0/3] redundant code: Fix warnings reported by Clang static code analyzer

2020-03-24 Thread Chen Qun
v1->v2: - Patch1: Add John Snow review comment. - Patch9: Move the 'dst_type' declaration to while() statement. - Patch12: Add Philippe Mathieu-Daud?? review comment. - Patch13: Move the 'set' declaration to the for() statement. v2->v3: - Patch1: Add Kevin Wolf review comment. - Patch2: Keep the

[PATCH v5 2/3] display/blizzard: use extract16() for fix clang analyzer warning in blizzard_draw_line16_32()

2020-03-24 Thread Chen Qun
Clang static code analyzer show warning: hw/display/blizzard.c:940:9: warning: Value stored to 'data' is never read data >>= 5; ^~ Reported-by: Euler Robot Signed-off-by: Chen Qun --- Cc: Andrzej Zaborowski Cc: Peter Maydell v1->v2: Use extract16() function instead

[PATCH v5 3/3] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write()

2020-03-24 Thread Chen Qun
Clang static code analyzer show warning: hw/timer/exynos4210_mct.c:1370:9: warning: Value stored to 'index' is never read index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i); ^ ~ hw/timer/exynos4210_mct.c:1399:9: warning: Value stored to 'index'

[PATCH v5 1/3] scsi/esp-pci: add g_assert() for fix clang analyzer warning in esp_pci_io_write()

2020-03-24 Thread Chen Qun
Clang static code analyzer show warning: hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read size = 4; ^ ~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Laurent Vivier --- Cc: Paolo Bonzini Cc:Fam Zheng v1->v2: keep ' size = 4' and

Re: Qemu master crashing on boot when using file backend for memory

2020-03-24 Thread Raphael Norwitz
On Thu, Mar 12, 2020 at 11:54:50AM +0100, Igor Mammedov wrote: > > On Thu, 12 Mar 2020 01:36:48 -0400 > Raphael Norwitz wrote: > > > When I try run master qemu I am hitting a divide by zero error. It seems > > to be coming from util/oslib-posix.c in touch_all_pages(). see line 477: > > > >

Re: [PATCH v3] hw/char/pl011: Enable TxFIFO and async transmission

2020-03-24 Thread Gavin Shan
On 3/11/20 3:09 PM, Gavin Shan wrote: The depth of TxFIFO can be 1 or 16 depending on LCR[4]. The TxFIFO is disabled when its depth is 1. It's nice to have TxFIFO enabled if possible because more characters can be piled and transmitted at once, which would have less overhead. Besides, we can be

Re: [PATCH v16 QEMU 14/16] vfio: Add vfio_listener_log_sync to mark dirty pages

2020-03-24 Thread Yan Zhao
On Wed, Mar 25, 2020 at 05:09:12AM +0800, Kirti Wankhede wrote: > vfio_listener_log_sync gets list of dirty pages from container using > VFIO_IOMMU_GET_DIRTY_BITMAP ioctl and mark those pages dirty when all > devices are stopped and saving state. > Return early for the RAM block section of mapped

Re: [PATCH v16 Kernel 5/7] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2020-03-24 Thread Yan Zhao
On Wed, Mar 25, 2020 at 03:32:37AM +0800, Kirti Wankhede wrote: > DMA mapped pages, including those pinned by mdev vendor drivers, might > get unpinned and unmapped while migration is active and device is still > running. For example, in pre-copy phase while guest driver could access > those

Re: [RFC PATCH v2 1/7] vfio-ccw: Return IOINST_CC_NOT_OPERATIONAL for EIO

2020-03-24 Thread Halil Pasic
On Tue, 24 Mar 2020 18:04:30 +0100 Cornelia Huck wrote: > On Thu, 6 Feb 2020 22:45:03 +0100 > Eric Farman wrote: > > > From: Farhan Ali > > > > EIO is returned by vfio-ccw mediated device when the backing > > host subchannel is not operational anymore. So return cc=3 > > back to the guest,

Re: [PATCH v16 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Yan Zhao
On Wed, Mar 25, 2020 at 05:18:52AM +0800, Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start dirty pages tracking while migration is active > - Stop dirty pages tracking. > - Get dirty pages bitmap. Its user space application's responsibility to > copy

Re: [PATCH v2 1/1] net/colo-compare.c: Fix memory leak in packet_enqueue()

2020-03-24 Thread Jing-Wei Su
Zhang, Chen 於 2020年3月25日 週三 上午9:37寫道: > > > > > -Original Message- > > From: Jing-Wei Su > > Sent: Tuesday, March 24, 2020 10:47 AM > > To: Zhang, Chen > > Cc: qemu-devel@nongnu.org; lizhij...@cn.fujitsu.com; > > jasow...@redhat.com; dere...@qnap.com > > Subject: Re: [PATCH v2 1/1]

[PATCH v3] migration: use "" instead of (null) for tls-authz

2020-03-24 Thread Mao Zhongyi
run: (qemu) info migrate_parameters announce-initial: 50 ms ... announce-max: 550 ms multifd-compression: none xbzrle-cache-size: 4194304 max-postcopy-bandwidth: 0 tls-authz: '(null)' Migration parameter 'tls-authz' is used to provide the QOM ID of a QAuthZ subclass instance that provides the

RE: [PATCH v2 1/1] net/colo-compare.c: Fix memory leak in packet_enqueue()

2020-03-24 Thread Zhang, Chen
> -Original Message- > From: Jing-Wei Su > Sent: Tuesday, March 24, 2020 10:47 AM > To: Zhang, Chen > Cc: qemu-devel@nongnu.org; lizhij...@cn.fujitsu.com; > jasow...@redhat.com; dere...@qnap.com > Subject: Re: [PATCH v2 1/1] net/colo-compare.c: Fix memory leak in > packet_enqueue() >

[Bug 1866892] Re: guest OS catches a page fault bug when running dotnet

2020-03-24 Thread Robert Henry
Peter: I think your intuition is right. The POPQ_RA (pop quad, passing through return address handle) is only called from helper_ret_protected, and it suspiciously calls cpu_ldq_kernel_ra which calls cpu_mmu_index_kernel which only is prepared for kernel space iretq (and of course the substring

Re: [PATCH v4 0/2] introduction of migration_version attribute for VFIO live migration

2020-03-24 Thread Yan Zhao
On Tue, Mar 24, 2020 at 10:49:54PM +0800, Alex Williamson wrote: > On Tue, 24 Mar 2020 09:23:31 + > "Dr. David Alan Gilbert" wrote: > > > * Yan Zhao (yan.y.z...@intel.com) wrote: > > > On Tue, Mar 24, 2020 at 05:29:59AM +0800, Alex Williamson wrote: > > > > On Mon, 3 Jun 2019 20:34:22

[Bug 1868116] Re: QEMU monitor no longer works

2020-03-24 Thread Egmont Koblinger
Thanks for this investigation so far! We've opened an upstream VTE issue at https://gitlab.gnome.org/GNOME/vte/issues/222 . We'd appreciate if QEMU developers joined us there. Apparently QEMU uses the "commit" signal in a way that it was not meant to be used, and thus it's unclear what the best

Re: [PATCH v16 QEMU 00/16] Add migration support for VFIO devices

2020-03-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/1585084154-29461-1-git-send-email-kwankh...@nvidia.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

Re: [PATCH 0/6] dwc-hsotg (aka dwc2) USB host contoller emulation

2020-03-24 Thread Paul Zimmerman
Thanks Gerd. I will switch over to using tracepoints, wait a few days to see if there are any more comments, then resubmit. Thanks, Paul On Mon, Mar 23, 2020 at 4:10 AM Gerd Hoffmann wrote: > Hi, > > > 1) I have used printf-based debug statements while developing the > >code, and have

[PATCH v9 11/14] iotests: add script_initialize

2020-03-24 Thread John Snow
Like script_main, but doesn't require a single point of entry. Replace all existing initialization sections with this drop-in replacement. This brings debug support to all existing script-style iotests. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/149| 3 +-

[PATCH v9 12/14] iotest 258: use script_main

2020-03-24 Thread John Snow
Since this one is nicely factored to use a single entry point, use script_main to run the tests. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Max Reitz --- tests/qemu-iotests/258 | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git

[PATCH v9 08/14] iotests: touch up log function signature

2020-03-24 Thread John Snow
Representing nested, recursive data structures in mypy is notoriously difficult; the best we can reliably do right now is denote the atom types as "Any" while describing the general shape of the data. Regardless, this fully annotates the log() function. Typing notes: TypeVar is a Type variable

[PATCH v9 05/14] iotests: add pylintrc file

2020-03-24 Thread John Snow
This allows others to get repeatable results with pylint. If you run `pylint iotests.py`, you should see a 100% pass. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/pylintrc | 22 ++ 1 file changed, 22 insertions(+) create mode 100644

[PATCH v9 03/14] iotests: ignore import warnings from pylint

2020-03-24 Thread John Snow
The right way to solve this is to come up with a virtual environment infrastructure that sets all the paths correctly, and/or to create installable python modules that can be imported normally. That's hard, so just silence this error for now. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Max

[PATCH v9 07/14] iotests: drop pre-Python 3.4 compatibility code

2020-03-24 Thread John Snow
We no longer need to accommodate 3.4, drop this code. (The lines were > 79 chars and it stood out.) Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py

[PATCH v9 10/14] iotests: add hmp helper with logging

2020-03-24 Thread John Snow
Just a mild cleanup while I was here. Although we now have universal qmp logging on or off, many existing callers to hmp functions don't expect that output to be logged, which causes quite a few changes in the test output. For now, just offer a use_log parameter. Signed-off-by: John Snow ---

[PATCH v9 14/14] iotests: use python logging for iotests.log()

2020-03-24 Thread John Snow
We can turn logging on/off globally instead of per-function. Remove use_log from run_job, and use python logging to turn on diffable output when we run through a script entry point. iotest 245 changes output order due to buffering reasons. An extended note on python logging: A NullHandler is

[PATCH v9 13/14] iotests: Mark verify functions as private

2020-03-24 Thread John Snow
Mark the verify functions as "private" with a leading underscore, to discourage their use. (Also, make pending patches not yet using the new entry points fail in a very obvious way.) Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 20 ++-- 1

[PATCH v9 06/14] iotests: alphabetize standard imports

2020-03-24 Thread John Snow
I had to fix a merge conflict, so do this tiny harmless thing while I'm here. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index

[PATCH v9 09/14] iotests: limit line length to 79 chars

2020-03-24 Thread John Snow
79 is the PEP8 recommendation. This recommendation works well for reading patch diffs in TUI email clients. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 64 +++ tests/qemu-iotests/pylintrc | 6 +++- 2 files changed, 47 insertions(+), 23

[PATCH v9 02/14] iotests: don't use 'format' for drive_add

2020-03-24 Thread John Snow
It shadows (with a different type) the built-in format. Use something else. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Max Reitz --- tests/qemu-iotests/055| 3 ++- tests/qemu-iotests/iotests.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-)

[PATCH v9 04/14] iotests: replace mutable list default args

2020-03-24 Thread John Snow
It's bad hygiene: if we modify this list, it will be modified across all invocations. (Remaining bad usages are fixed in a subsequent patch which changes the function signature anyway.) Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Max Reitz ---

[PATCH v9 01/14] iotests: do a light delinting

2020-03-24 Thread John Snow
This doesn't fix everything in here, but it does help clean up the pylint report considerably. This should be 100% style changes only; the intent is to make pylint more useful by working on establishing a baseline for iotests that we can gate against in the future. Signed-off-by: John Snow

[PATCH v9 00/14] iotests: use python logging

2020-03-24 Thread John Snow
This series uses python logging to enable output conditionally on iotests.log(). We unify an initialization call (which also enables debugging output for those tests with -d) and then make the switch inside of iotests. It will help alleviate the need to create logged/unlogged versions of all the

Re: Potential missing checks

2020-03-24 Thread Mansour Ahmadi
Thanks for the explanation. On Tue, Mar 24, 2020 at 5:17 PM Peter Maydell wrote: > On Tue, 24 Mar 2020 at 20:39, Mansour Ahmadi wrote: > > > > Thank you for looking into this, Peter. I agree that static analysis has > false positives; that's why I called them potential. Basically, they are >

Re: Potential missing checks

2020-03-24 Thread Mansour Ahmadi
Thank you for looking into this, Peter. I agree that static analysis has false positives; that's why I called them potential. Basically, they are found based on code similarity so I might be wrong and I need a second opinion from QEMU developers. I appreciate your effort. For the first case, I

Re: [PULL v2 0/5] Linux user for 5.0 patches

2020-03-24 Thread Laurent Vivier
Le 24/03/2020 à 14:14, Peter Maydell a écrit : > On Tue, 24 Mar 2020 at 12:32, Laurent Vivier wrote: >> OK, I think there is an existing problem in the build dependencies. >> >> Do you use enable all targets ("configure" without parameters)? >> Do you run make with "all" or

[ANNOUNCE] QEMU 5.0.0-rc0 is now available

2020-03-24 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the first release candidate for the QEMU 5.0 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu-project.org/qemu-5.0.0-rc0.tar.xz

Re: [PATCH v16 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Kirti Wankhede
On 3/25/2020 2:15 AM, Alex Williamson wrote: On Tue, 24 Mar 2020 14:37:16 -0600 Alex Williamson wrote: On Wed, 25 Mar 2020 01:02:36 +0530 Kirti Wankhede wrote: VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: - Start dirty pages tracking while migration is active - Stop dirty

[PATCH v16 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Kirti Wankhede
VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: - Start dirty pages tracking while migration is active - Stop dirty pages tracking. - Get dirty pages bitmap. Its user space application's responsibility to copy content of dirty pages from source to destination during migration. To

[PATCH v16 QEMU 16/16] vfio: Make vfio-pci device migration capable

2020-03-24 Thread Kirti Wankhede
If device is not failover primary device call vfio_migration_probe() and vfio_migration_finalize() functions for vfio-pci device to enable migration for vfio PCI device which support migration. Removed vfio_pci_vmstate structure. Removed migration blocker from VFIO PCI device specific structure

[PATCH v16 QEMU 08/16] vfio: Register SaveVMHandlers for VFIO device

2020-03-24 Thread Kirti Wankhede
Define flags to be used as delimeter in migration file stream. Added .save_setup and .save_cleanup functions. Mapped & unmapped migration region from these functions at source during saving or pre-copy phase. Set VFIO device state depending on VM's state. During live migration, VM is running when

[PATCH v16 QEMU 14/16] vfio: Add vfio_listener_log_sync to mark dirty pages

2020-03-24 Thread Kirti Wankhede
vfio_listener_log_sync gets list of dirty pages from container using VFIO_IOMMU_GET_DIRTY_BITMAP ioctl and mark those pages dirty when all devices are stopped and saving state. Return early for the RAM block section of mapped MMIO region. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia ---

[PATCH v16 QEMU 07/16] vfio: Add migration state change notifier

2020-03-24 Thread Kirti Wankhede
Added migration state change notifier to get notification on migration state change. These states are translated to VFIO device state and conveyed to vendor driver. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 29 +

[PATCH v16 QEMU 11/16] iommu: add callback to get address limit IOMMU supports

2020-03-24 Thread Kirti Wankhede
Add optional method to get address limit IOMMU supports Signed-off-by: Kirti Wankhede --- hw/i386/intel_iommu.c | 9 + include/exec/memory.h | 19 +++ memory.c | 11 +++ 3 files changed, 39 insertions(+) diff --git a/hw/i386/intel_iommu.c

[PATCH v16 QEMU 13/16] vfio: Add function to start and stop dirty pages tracking

2020-03-24 Thread Kirti Wankhede
Call VFIO_IOMMU_DIRTY_PAGES ioctl to start and stop dirty pages tracking for VFIO devices. Signed-off-by: Kirti Wankhede --- hw/vfio/migration.c | 36 1 file changed, 36 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index

[PATCH v16 QEMU 15/16] vfio: Add ioctl to get dirty pages bitmap during dma unmap.

2020-03-24 Thread Kirti Wankhede
With vIOMMU, IO virtual address range can get unmapped while in pre-copy phase of migration. In that case, unmap ioctl should return pages pinned in that range and QEMU should find its correcponding guest physical addresses and report those dirty. Note: This patch is not yet tested. I'm trying to

[PATCH v16 QEMU 06/16] vfio: Add VM state change handler to know state of VM

2020-03-24 Thread Kirti Wankhede
VM state change handler gets called on change in VM's state. This is used to set VFIO device state to _RUNNING. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 87 +++ hw/vfio/trace-events | 2 +

[PATCH v16 QEMU 10/16] vfio: Add load state functions to SaveVMHandlers

2020-03-24 Thread Kirti Wankhede
Sequence during _RESUMING device state: While data for this device is available, repeat below steps: a. read data_offset from where user application should write data. b. write data of data_size to migration region from data_offset. c. write data_size which indicates vendor driver that data is

[PATCH v16 QEMU 04/16] vfio: Add save and load functions for VFIO PCI devices

2020-03-24 Thread Kirti Wankhede
These functions save and restore PCI device specific data - config space of PCI device. Tested save and restore with MSI and MSIX type. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/pci.c | 163 ++

[PATCH v16 QEMU 09/16] vfio: Add save state functions to SaveVMHandlers

2020-03-24 Thread Kirti Wankhede
Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy functions. These functions handles pre-copy and stop-and-copy phase. In _SAVING|_RUNNING device state or pre-copy phase: - read pending_bytes. If pending_bytes > 0, go through below steps. - read data_offset - indicates

[PATCH v16 QEMU 12/16] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

2020-03-24 Thread Kirti Wankhede
Signed-off-by: Kirti Wankhede --- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory.c b/memory.c index acb7546971c3..285ca2ed6dd9 100644 --- a/memory.c +++ b/memory.c @@ -1788,7 +1788,7 @@ bool memory_region_is_ram_device(MemoryRegion *mr) uint8_t

[PATCH v16 QEMU 05/16] vfio: Add migration region initialization and finalize function

2020-03-24 Thread Kirti Wankhede
- Migration functions are implemented for VFIO_DEVICE_TYPE_PCI device in this patch series. - VFIO device supports migration or not is decided based of migration region query. If migration region query is successful and migration region initialization is successful then migration is

[PATCH v16 QEMU 00/16] Add migration support for VFIO devices

2020-03-24 Thread Kirti Wankhede
Hi, This Patch set adds migration support for VFIO devices in QEMU. This Patch set include patches as below: Patch 1: - Define KABI for VFIO device for migration support for device state and newly added ioctl definations to get dirty pages bitmap. This is a placeholder patch. Patch 2-4: -

[PATCH v16 QEMU 02/16] vfio: Add function to unmap VFIO region

2020-03-24 Thread Kirti Wankhede
This function will be used for migration region. Migration region is mmaped when migration starts and will be unmapped when migration is complete. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck --- hw/vfio/common.c | 20

[PATCH v16 QEMU 03/16] vfio: Add vfio_get_object callback to VFIODeviceOps

2020-03-24 Thread Kirti Wankhede
Hook vfio_get_object callback for PCI devices. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Suggested-by: Cornelia Huck Reviewed-by: Cornelia Huck --- hw/vfio/pci.c | 8 include/hw/vfio/vfio-common.h | 1 + 2 files changed, 9 insertions(+) diff --git

[PATCH v16 QEMU 01/16] vfio: KABI for migration interface - Kernel header placeholder

2020-03-24 Thread Kirti Wankhede
Kernel header patches are being reviewed along with kernel side changes. This patch is only for place holder. Link to Kernel patch set: https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg07429.html This patch include all changes in vfio.h from above patch set Signed-off-by: Kirti Wankhede

[PATCH] hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads

2020-03-24 Thread Peter Maydell
Coverity points out (CID 1421926) that the read code for REG_ADDR_HIGH reads off the end of the buffer, because it does a 32-bit read from byte 4 of a 6-byte buffer. The code also has an endianness issue for both REG_ADDR_HIGH and REG_ADDR_LOW, because it will do the wrong thing on a big-endian

Re: [PATCH] ext4: Give 32bit personalities 32bit hashes

2020-03-24 Thread Linus Walleij
On Tue, Mar 24, 2020 at 7:48 PM Theodore Y. Ts'o wrote: > On Tue, Mar 24, 2020 at 09:29:58AM +, Peter Maydell wrote: > > > > On the contrary, that would be a much better interface for QEMU. > > We always know when we're doing an open-syscall on behalf > > of the guest, and it would be trivial

Re: Potential missing checks

2020-03-24 Thread Peter Maydell
On Tue, 24 Mar 2020 at 20:39, Mansour Ahmadi wrote: > > Thank you for looking into this, Peter. I agree that static analysis has > false positives; that's why I called them potential. Basically, they are > found based on code similarity so I might be wrong and I need a second > opinion from

Re: [PULL 0/2] Ide patches

2020-03-24 Thread John Snow
On 3/24/20 3:55 PM, John Snow wrote: > The following changes since commit 736cf607e40674776d752acc201f565723e86045: > > Update version for v5.0.0-rc0 release (2020-03-24 17:50:00 +) > > are available in the Git repository at: > > https://github.com/jnsnow/qemu.git

[PATCH for-5.0 2/3] via-ide: use qdev gpio rather than qemu_allocate_irqs()

2020-03-24 Thread Mark Cave-Ayland
This prevents the memory from qemu_allocate_irqs() from being leaked which can in some cases be spotted by Coverity (CID 1421984). Signed-off-by: Mark Cave-Ayland --- hw/ide/via.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index

[PATCH for-5.0 3/3] cmd646-ide: use qdev gpio rather than qemu_allocate_irqs()

2020-03-24 Thread Mark Cave-Ayland
This prevents the memory from qemu_allocate_irqs() from being leaked which can in some cases be spotted by Coverity (CID 1421984). Signed-off-by: Mark Cave-Ayland --- hw/ide/cmd646.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c

Re: [PATCH v5 07/18] s390x: protvirt: Inhibit balloon when switching to protected mode

2020-03-24 Thread Brijesh Singh
On 3/20/20 1:43 PM, Halil Pasic wrote: > On Thu, 19 Mar 2020 18:31:11 +0100 > David Hildenbrand wrote: > >> [...] >> I asked this question already to Michael (cc) via a different channel, but hare is it again: Why does the balloon driver not support VIRTIO_F_IOMMU_PLATFORM?

[PATCH for-5.0 0/3] ide: fix potential memory leaks (plus one via-ide bugfix)

2020-03-24 Thread Mark Cave-Ayland
This was supposed to be a simple patchset to switch via-ide and cmd646-ide over to use qdev gpio in the same way as Peter's patch did for sil3112, but at the same time I spotted a silly mistake in my last set of via-ide patches which is included as patch 1. I'm not sure exactly why Coverity CID

[PATCH for-5.0 1/3] via-ide: don't use PCI level for legacy IRQs

2020-03-24 Thread Mark Cave-Ayland
The PCI level calculation was accidentally left in when rebasing from a previous patchset. Since both IRQs are driven separately, the value being passed into the IRQ handler should be used directly. Signed-off-by: Mark Cave-Ayland --- hw/ide/via.c | 1 - 1 file changed, 1 deletion(-) diff

Re: [PATCH] hw/ide/sii3112: Use qdev gpio rather than qemu_allocate_irqs()

2020-03-24 Thread John Snow
On 3/24/20 4:43 PM, Mark Cave-Ayland wrote: > On 23/03/2020 15:17, Peter Maydell wrote: > >> Coverity points out (CID 1421984) that we are leaking the >> memory returned by qemu_allocate_irqs(). We can avoid this >> leak by switching to using qdev_init_gpio_in(); the base >> class finalize

[Bug 1866892] Re: guest OS catches a page fault bug when running dotnet

2020-03-24 Thread Robert Henry
I've stepped/nexted from the helper_iret_protected, going deep into the bowels of the TLB, MMU and page table engine. None of which I understand. The helper_ret_protected faults in the first POPQ_RA. I'll investigate the value of sp at the time of the POPQ_RA. Here's the POPQ_RA in

Re: [PATCH v16 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Alex Williamson
On Tue, 24 Mar 2020 14:37:16 -0600 Alex Williamson wrote: > On Wed, 25 Mar 2020 01:02:36 +0530 > Kirti Wankhede wrote: > > > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > > - Start dirty pages tracking while migration is active > > - Stop dirty pages tracking. > > - Get dirty pages

Re: [PATCH] hw/ide/sii3112: Use qdev gpio rather than qemu_allocate_irqs()

2020-03-24 Thread Mark Cave-Ayland
On 23/03/2020 15:17, Peter Maydell wrote: > Coverity points out (CID 1421984) that we are leaking the > memory returned by qemu_allocate_irqs(). We can avoid this > leak by switching to using qdev_init_gpio_in(); the base > class finalize will free the irqs that this allocates under > the hood. >

Re: [PATCH v16 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Alex Williamson
On Wed, 25 Mar 2020 01:02:36 +0530 Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start dirty pages tracking while migration is active > - Stop dirty pages tracking. > - Get dirty pages bitmap. Its user space application's responsibility to > copy content

Re: [PATCH v15 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Dr. David Alan Gilbert
* Alex Williamson (alex.william...@redhat.com) wrote: > On Mon, 23 Mar 2020 23:01:18 -0400 > Yan Zhao wrote: > > > On Tue, Mar 24, 2020 at 02:51:14AM +0800, Dr. David Alan Gilbert wrote: > > > * Alex Williamson (alex.william...@redhat.com) wrote: > > > > On Mon, 23 Mar 2020 23:24:37 +0530 > >

[PATCH v16 Kernel 7/7] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-03-24 Thread Kirti Wankhede
Added a check such that only singleton IOMMU groups can pin pages. >From the point when vendor driver pins any pages, consider IOMMU group dirty page scope to be limited to pinned pages. To optimize to avoid walking list often, added flag pinned_page_dirty_scope to indicate if all of the

[PATCH v16 Kernel 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-03-24 Thread Kirti Wankhede
VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: - Start dirty pages tracking while migration is active - Stop dirty pages tracking. - Get dirty pages bitmap. Its user space application's responsibility to copy content of dirty pages from source to destination during migration. To

[PATCH v16 Kernel 3/7] vfio iommu: Add ioctl definition for dirty pages tracking.

2020-03-24 Thread Kirti Wankhede
IOMMU container maintains a list of all pages pinned by vfio_pin_pages API. All pages pinned by vendor driver through this API should be considered as dirty during migration. When container consists of IOMMU capable device and all pages are pinned and mapped, then all pages are marked dirty. Added

[PATCH v16 Kernel 5/7] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2020-03-24 Thread Kirti Wankhede
DMA mapped pages, including those pinned by mdev vendor drivers, might get unpinned and unmapped while migration is active and device is still running. For example, in pre-copy phase while guest driver could access those pages, host device or vendor driver can dirty these mapped pages. Such pages

[PATCH v16 Kernel 2/7] vfio iommu: Remove atomicity of ref_count of pinned pages

2020-03-24 Thread Kirti Wankhede
vfio_pfn.ref_count is always updated by holding iommu->lock, using atomic variable is overkill. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Eric Auger --- drivers/vfio/vfio_iommu_type1.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH v16 Kernel 6/7] vfio iommu: Adds flag to indicate dirty pages tracking capability support

2020-03-24 Thread Kirti Wankhede
Flag VFIO_IOMMU_INFO_DIRTY_PGS in VFIO_IOMMU_GET_INFO indicates that driver support dirty pages tracking. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- drivers/vfio/vfio_iommu_type1.c | 3 ++- include/uapi/linux/vfio.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)

[PATCH v16 Kernel 1/7] vfio: KABI for migration interface for device state

2020-03-24 Thread Kirti Wankhede
- Defined MIGRATION region type and sub-type. - Defined vfio_device_migration_info structure which will be placed at the 0th offset of migration region to get/set VFIO device related information. Defined members of structure and usage on read/write access. - Defined device states and state

[PATCH v16 Kernel 0/7] KABIs to support migration for VFIO devices

2020-03-24 Thread Kirti Wankhede
Hi, This patch set adds: * New IOCTL VFIO_IOMMU_DIRTY_PAGES to get dirty pages bitmap with respect to IOMMU container rather than per device. All pages pinned by vendor driver through vfio_pin_pages external API has to be marked as dirty during migration. When IOMMU capable device is

Re: [PATCH 6/6] qga/commands-posix: fix use after free of local_err

2020-03-24 Thread Eric Blake
On 3/24/20 10:36 AM, Vladimir Sementsov-Ogievskiy wrote: local_err is used several times in guest_suspend(). Setting non-NULL local_err will crash, so let's zero it after freeing. Also fix possible leak of local_err in final if(). Signed-off-by: Vladimir Sementsov-Ogievskiy ---

Re: [PATCH v1] mips/mips_malta: Allow more than 2G RAM

2020-03-24 Thread Aleksandar Markovic
18:38 Pon, 23.03.2020. Aurelien Jarno је написао/ла: > > Hi, > > Sorry for the delay, I just want to give some more details about the > Debian. > > On 2020-03-14 10:09, Philippe Mathieu-Daudé wrote: > > IIUC today all distributions supporting MIPS ports are building their MIPS > > packages on

[PULL 2/2] hw/ide/sii3112: Use qdev gpio rather than qemu_allocate_irqs()

2020-03-24 Thread John Snow
From: Peter Maydell Coverity points out (CID 1421984) that we are leaking the memory returned by qemu_allocate_irqs(). We can avoid this leak by switching to using qdev_init_gpio_in(); the base class finalize will free the irqs that this allocates under the hood. Signed-off-by: Peter Maydell

[PULL 1/2] fdc/i8257: implement verify transfer mode

2020-03-24 Thread John Snow
From: Sven Schnelle While working on the Tulip driver i tried to write some Teledisk images to a floppy image which didn't work. Turned out that Teledisk checks the written data by issuing a READ command to the FDC but running the DMA controller in VERIFY mode. As we ignored the DMA request in

[PULL 0/2] Ide patches

2020-03-24 Thread John Snow
The following changes since commit 736cf607e40674776d752acc201f565723e86045: Update version for v5.0.0-rc0 release (2020-03-24 17:50:00 +) are available in the Git repository at: https://github.com/jnsnow/qemu.git tags/ide-pull-request for you to fetch changes up to

Re: [PATCH v15 Kernel 3/7] vfio iommu: Add ioctl definition for dirty pages tracking.

2020-03-24 Thread Kirti Wankhede
On 3/24/2020 2:41 AM, Auger Eric wrote: Hi Kirti, On 3/19/20 9:16 PM, Kirti Wankhede wrote: IOMMU container maintains a list of all pages pinned by vfio_pin_pages API. All pages pinned by vendor driver through this API should be considered as dirty during migration. When container consists

[PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-24 Thread Philippe Mathieu-Daudé
Similarly to commit 807e2b6fce0 for Windows, kindly return a QMP error message instead of crashing the whole process. Cc: qemu-sta...@nongnu.org Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1594054 Reported-by: Fakhri Zulkifli Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH 5/6] migration/ram: fix use after free of local_err

2020-03-24 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > local_err is used again in migration_bitmap_sync_precopy() after > precopy_notify(), so we must zero it. Otherwise try to set > non-NULL local_err will crash. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- >

Re: [PATCH 4/6] migration/colo: fix use after free of local_err

2020-03-24 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > local_err is used again in secondary_vm_do_failover() after > replication_stop_all(), so we must zero it. Otherwise try to set > non-NULL local_err will crash. > > Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr.

Re: [PATCH v15 Kernel 2/7] vfio iommu: Remove atomicity of ref_count of pinned pages

2020-03-24 Thread Kirti Wankhede
On 3/24/2020 2:00 AM, Auger Eric wrote: Hi Kirti, On 3/19/20 9:16 PM, Kirti Wankhede wrote: vfio_pfn.ref_count is always updated by holding iommu->lock, using atomic variable is overkill. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Eric Auger Thanks. Kirti.

Re: [PATCH v2 4/4] sheepdog: Consistently set bdrv_has_zero_init_truncate

2020-03-24 Thread John Snow
On 3/24/20 1:42 PM, Eric Blake wrote: > block_int.h claims that .bdrv_has_zero_init must return 0 if > .bdrv_has_zero_init_truncate does likewise; but this is violated if > only the former callback is provided if .bdrv_co_truncate also exists. > When adding the latter callback, it was

Re: [PATCH v15 Kernel 1/7] vfio: KABI for migration interface for device state

2020-03-24 Thread Kirti Wankhede
On 3/24/2020 2:00 AM, Auger Eric wrote: Hi Kirti, On 3/19/20 9:16 PM, Kirti Wankhede wrote: - Defined MIGRATION region type and sub-type. - Defined vfio_device_migration_info structure which will be placed at the 0th offset of migration region to get/set VFIO device related

Re: [PATCH v14 Kernel 1/7] vfio: KABI for migration interface for device state

2020-03-24 Thread Kirti Wankhede
On 3/23/2020 5:15 PM, Auger Eric wrote: Hi Kirti, On 3/18/20 8:41 PM, Kirti Wankhede wrote: - Defined MIGRATION region type and sub-type. - Defined vfio_device_migration_info structure which will be placed at the 0th offset of migration region to get/set VFIO device related

Re: [PATCH for-5.0] vl.c: fix migration failure for 3.1 and older machine types

2020-03-24 Thread Dr. David Alan Gilbert
* Igor Mammedov (imamm...@redhat.com) wrote: > On Wed, 4 Mar 2020 12:27:48 -0500 > Igor Mammedov wrote: > > > Migration from QEMU(v4.0) fails when using 3.1 or older machine > > type. For example if one attempts to migrate > > QEMU-2.12 started as > > qemu-system-ppc64 -nodefaults -M

Re: [PATCH-for-5.0] tools/virtiofsd/passthrough_ll: Fix double close()

2020-03-24 Thread Dr. David Alan Gilbert
* Philippe Mathieu-Daudé (phi...@redhat.com) wrote: > On 3/21/20 1:06 PM, Philippe Mathieu-Daudé wrote: > > On success, the fdopendir() call closes fd. Later on the error > > path we try to close an already-closed fd. This can lead to > > use-after-free. Fix by only closing the fd if the

Re: [PATCH] hmp/vnc: Fix info vnc list leak

2020-03-24 Thread Dr. David Alan Gilbert
* Dr. David Alan Gilbert (git) (dgilb...@redhat.com) wrote: > From: "Dr. David Alan Gilbert" > > We're iterating the list, and then freeing the iteration pointer rather > than the list head. > > Fixes: 0a9667ecdb6d ("hmp: Update info vnc") > Reported-by: Coverity (CID 1421932) > Signed-off-by:

Re: [PATCH] ext4: Give 32bit personalities 32bit hashes

2020-03-24 Thread Theodore Y. Ts'o
On Tue, Mar 24, 2020 at 09:29:58AM +, Peter Maydell wrote: > > On the contrary, that would be a much better interface for QEMU. > We always know when we're doing an open-syscall on behalf > of the guest, and it would be trivial to make the fcntl() call then. > That would ensure that we don't

  1   2   3   4   >