Re: [PATCH v2 19/20] nvme: make lba data size configurable

2019-11-12 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:24:00PM +, Beata Michalska wrote: > Hi Klaus, > > On Tue, 15 Oct 2019 at 11:50, Klaus Jensen wrote: > > #define DEFINE_NVME_NS_PROPERTIES(_state, _props) \ > > -DEFINE_PROP_UINT32("nsid", _state, _props.nsid, 0) > > +DEFINE_PROP_UINT32("nsid", _state,

Re: [PATCH v1 0/2] TCG plugin doc updates

2019-11-12 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191112164051.16404-1-alex.ben...@linaro.org/ Hi, This series failed the docker-mingw@fedora 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: virtio,iommu_platform=on

2019-11-12 Thread Alexey Kardashevskiy
On 13/11/2019 17:23, Alexey Kardashevskiy wrote: > > > On 13/11/2019 16:54, Michael Roth wrote: >> Quoting Alexey Kardashevskiy (2019-11-11 21:53:49) >>> Hi! >>> >>> I am enabling IOMMU for virtio in the pseries firmware (SLOF) and seeing >>> problems, one of them is SLOF does SCSI bus scan,

Re: virtio,iommu_platform=on

2019-11-12 Thread Alexey Kardashevskiy
On 13/11/2019 16:54, Michael Roth wrote: > Quoting Alexey Kardashevskiy (2019-11-11 21:53:49) >> Hi! >> >> I am enabling IOMMU for virtio in the pseries firmware (SLOF) and seeing >> problems, one of them is SLOF does SCSI bus scan, then it stops the >> virtio-scsi by clearing MMIO|IO|BUSMASTER

Re: [PATCH v2 04/20] nvme: populate the mandatory subnqn and ver fields

2019-11-12 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:04:45PM +, Beata Michalska wrote: > Hi Klaus > > On Tue, 15 Oct 2019 at 11:42, Klaus Jensen wrote: > > +n->bar.vs = 0x00010201; > > Very minor: > > The version number is being set twice in the patch series already. > And it is being set in two places. > It

Re: [PATCH v2 06/20] nvme: add support for the abort command

2019-11-12 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:04:38PM +, Beata Michalska wrote: > Hi Klaus > Hi Beata, Thank you very much for your thorough reviews! I'll start going through them one by one :) You might have seen that I've posted a v3, but I will make sure to consolidate between v2 and v3! > On Tue, 15 Oct

Re: virtio,iommu_platform=on

2019-11-12 Thread Michael Roth
Quoting Alexey Kardashevskiy (2019-11-11 21:53:49) > Hi! > > I am enabling IOMMU for virtio in the pseries firmware (SLOF) and seeing > problems, one of them is SLOF does SCSI bus scan, then it stops the > virtio-scsi by clearing MMIO|IO|BUSMASTER from PCI_COMMAND (as SLOF > stopped using the

[PATCH RFC] virtio-pci: disable vring processing when bus-mastering is disabled

2019-11-12 Thread Michael Roth
Currently the SLOF firmware for pseries guests will disable/re-enable a PCI device multiple times via IO/MEM/MASTER bits of PCI_COMMAND register after the initial probe/feature negotiation, as it tends to work with a single device at a time at various stages like probing and running block/network

Re: virtio,iommu_platform=on

2019-11-12 Thread Alexey Kardashevskiy
On 12/11/2019 20:06, Laszlo Ersek wrote: > On 11/12/19 04:53, Alexey Kardashevskiy wrote: >> Hi! >> >> I am enabling IOMMU for virtio in the pseries firmware (SLOF) and seeing >> problems, one of them is SLOF does SCSI bus scan, then it stops the >> virtio-scsi by clearing MMIO|IO|BUSMASTER

Re: virtio,iommu_platform=on

2019-11-12 Thread Alexey Kardashevskiy
On 12/11/2019 18:08, Michael S. Tsirkin wrote: > On Tue, Nov 12, 2019 at 02:53:49PM +1100, Alexey Kardashevskiy wrote: >> Hi! >> >> I am enabling IOMMU for virtio in the pseries firmware (SLOF) and seeing >> problems, one of them is SLOF does SCSI bus scan, then it stops the >> virtio-scsi by

Re: [PATCH v9 QEMU 14/15] vfio: Add ioctl to get dirty pages bitmap during dma unmap.

2019-11-12 Thread Yan Zhao
On Wed, Nov 13, 2019 at 01:05:23AM +0800, Kirti Wankhede wrote: > 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

Re: [PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-12 Thread Yan Zhao
On Wed, Nov 13, 2019 at 06:30:05AM +0800, Alex Williamson wrote: > On Tue, 12 Nov 2019 22:33:36 +0530 > Kirti Wankhede wrote: > > > - Defined MIGRATION region type and sub-type. > > - Used 3 bits to define VFIO device states. > > Bit 0 => _RUNNING > > Bit 1 => _SAVING > > Bit 2 =>

Re: [PATCH v9 QEMU 13/15] vfio: Add vfio_listener_log_sync to mark dirty pages

2019-11-12 Thread Yan Zhao
On Wed, Nov 13, 2019 at 01:05:22AM +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 v14 03/11] tests: Add test for QAPI builtin type time

2019-11-12 Thread Tao Xu
On 11/13/2019 4:15 AM, Eduardo Habkost wrote: On Fri, Nov 08, 2019 at 09:05:52AM +0100, Markus Armbruster wrote: Tao Xu writes: On 11/7/2019 9:31 PM, Eduardo Habkost wrote: On Thu, Nov 07, 2019 at 02:24:52PM +0800, Tao Xu wrote: On 11/7/2019 4:53 AM, Eduardo Habkost wrote: On Mon, Oct 28,

[PATCH v2 4/4] watchdog/aspeed: Fix AST2600 frequency behaviour

2019-11-12 Thread Joel Stanley
The AST2600 control register sneakily changed the meaning of bit 4 without anyone noticing. It no longer controls the 1MHz vs APB clock select, and instead always runs at 1MHz. The AST2500 was always 1MHz too, but it retained bit 4, making it read only. We can model both using the same fixed 1MHz

[PATCH v2 1/4] aspeed/sdmc: Make ast2600 default 1G

2019-11-12 Thread Joel Stanley
Most boards have this much. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley --- hw/misc/aspeed_sdmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index f3a63a2e01db..2df3244b53c8 100644 ---

[PATCH v2 3/4] watchdog/aspeed: Improve watchdog timeout message

2019-11-12 Thread Joel Stanley
Users benefit from knowing which watchdog timer has expired. The address of the watchdog's registers unambiguously indicates which has expired, so log that. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley --- v2: Use HWADDR_PRIx --- hw/watchdog/wdt_aspeed.c | 3 ++- 1 file changed, 2

[PATCH v2 2/4] aspeed/scu: Fix W1C behavior

2019-11-12 Thread Joel Stanley
This models the clock write one to clear registers, and fixes up some incorrect behavior in all of the write to clear registers. There was also a typo in one of the register definitions. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley --- hw/misc/aspeed_scu.c | 11 --- 1

[PATCH v2 0/4] arm/aspeed: Watchdog and SDRAM fixes

2019-11-12 Thread Joel Stanley
Three of these are fixes for ast2600 models that I found when testing master. The forth is a usability improvement that is helpful when diagnosing why a watchdog is biting. v2 fixes some review comments from Cédric and adds his r-b. Joel Stanley (4): aspeed/sdmc: Make ast2600 default 1G

Re: [PATCH 4/4] watchdog/aspeed: Fix AST2600 frequency behaviour

2019-11-12 Thread Joel Stanley
On Tue, 12 Nov 2019 at 07:56, Cédric Le Goater wrote: > > On 12/11/2019 07:40, Joel Stanley wrote: > > The AST2600 control register sneakily changed the meaning of bit 4 > > without anyone noticing. It no longer controls the 1MHz vs APB clock > > select, and instead always runs at 1MHz. > > > >

Re: [PATCH 00/55] Patch Round-up for stable 4.1.1, freeze on 2019-11-12

2019-11-12 Thread Michael Roth
Quoting Michael Roth (2019-11-12 12:05:14) > Quoting Michael Roth (2019-11-05 14:51:48) > > Hi everyone, > > > > The following new patches are queued for QEMU stable v4.1.1: > > > > https://github.com/mdroth/qemu/commits/stable-4.1-staging > > > > The release is tentatively planned for

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-12 Thread Gurchetan Singh
On Tue, Nov 12, 2019 at 5:56 AM Liam Girdwood wrote: > > On Mon, 2019-11-11 at 16:54 -0800, Gurchetan Singh wrote: > > On Tue, Nov 5, 2019 at 2:55 AM Gerd Hoffmann > > wrote: > > > Each buffer also has some properties to carry metadata, some fixed > > > (id, size, application), but > > > also

RE: QEMU for Qualcomm Hexagon - KVM Forum talk and code available

2019-11-12 Thread Taylor Simpson
I had discussions with several people at the KVM Forum, and I’ve been thinking about how to divide up the code for community review. Here is my proposal for the steps. 1. linux-user changes + linux-user/hexagon + skeleton of target/hexagon This is the minimum amount to build and run a very

Re: [PATCH v3 0/8] blockdev: avoid acquiring AioContext lock twice at do_drive_backup and do_blockdev_backup

2019-11-12 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191112113012.71136-1-...@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 v9 Kernel 3/5] vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap

2019-11-12 Thread Alex Williamson
On Tue, 12 Nov 2019 22:33:38 +0530 Kirti Wankhede wrote: > With vIOMMU, during pre-copy phase of migration, while CPUs are still > running, IO virtual address unmap can happen while device still keeping > reference of guest pfns. Those pages should be reported as dirty before > unmap, so that

Re: [PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-12 Thread Alex Williamson
On Tue, 12 Nov 2019 22:33:36 +0530 Kirti Wankhede wrote: > - Defined MIGRATION region type and sub-type. > - Used 3 bits to define VFIO device states. > Bit 0 => _RUNNING > Bit 1 => _SAVING > Bit 2 => _RESUMING > Combination of these bits defines VFIO device's state during

Re: [PATCH v9 Kernel 5/5] vfio iommu: Implementation of ioctl to get dirty bitmap before unmap

2019-11-12 Thread Alex Williamson
On Tue, 12 Nov 2019 22:33:40 +0530 Kirti Wankhede wrote: > If pages are pinned by external interface for requested IO virtual address > range, bitmap of such pages is created and then that range is unmapped. > To get bitmap during unmap, user should set flag >

Re: [PATCH v9 Kernel 2/5] vfio iommu: Add ioctl defination to get dirty pages bitmap.

2019-11-12 Thread Alex Williamson
On Tue, 12 Nov 2019 22:33:37 +0530 Kirti Wankhede wrote: > All pages pinned by vendor driver through vfio_pin_pages API should be > considered as dirty during migration. IOMMU container maintains a list of > all such pinned pages. Added an ioctl defination to get bitmap of such definition >

Re: [PATCH v9 Kernel 4/5] vfio iommu: Implementation of ioctl to get dirty pages bitmap.

2019-11-12 Thread Alex Williamson
On Tue, 12 Nov 2019 22:33:39 +0530 Kirti Wankhede wrote: > IOMMU container maintains list of external pinned pages. Bitmap of pinned > pages for input IO virtual address range is created and returned. > IO virtual address range should be from a single mapping created by > map request. Input

[ANNOUNCE] QEMU 4.2.0-rc1 is now available

2019-11-12 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the second release candidate for the QEMU 4.2 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu-project.org/qemu-4.2.0-rc1.tar.xz

Re: [PATCH 00/55] Patch Round-up for stable 4.1.1, freeze on 2019-11-12

2019-11-12 Thread Bruce Rogers
On Tue, 2019-11-05 at 14:51 -0600, Michael Roth wrote: > Hi everyone, > > The following new patches are queued for QEMU stable v4.1.1: > > https://github.com/mdroth/qemu/commits/stable-4.1-staging > > The release is tentatively planned for 2019-11-14: > > https://wiki.qemu.org/Planning/4.1

Re: [PATCH for 4.2 v1 1/1] riscv/virt: Increase flash size

2019-11-12 Thread Alistair Francis
On Mon, Nov 11, 2019 at 7:30 AM Bin Meng wrote: > > On Thu, Nov 7, 2019 at 8:54 AM Alistair Francis > wrote: > > > > Coreboot developers have requested that they have at least 32MB of flash > > to load binaries. We currently have 32MB of flash, but it is split in > > two to allow loading two

Re: [PATCH 1/5] MAINTAINERS: Add a section on git infrastructure

2019-11-12 Thread Aleksandar Markovic
On Tuesday, November 12, 2019, Alex Bennée wrote: > > Aleksandar Markovic writes: > > > From: Aleksandar Markovic > > > > There should be a patient person maintaining gory details of > > git-related files, and there is no better person for that role > > than Philippe. Alex should be the

Re: [PATCH v14 03/11] tests: Add test for QAPI builtin type time

2019-11-12 Thread Eduardo Habkost
On Fri, Nov 08, 2019 at 09:05:52AM +0100, Markus Armbruster wrote: > Tao Xu writes: > > > On 11/7/2019 9:31 PM, Eduardo Habkost wrote: > >> On Thu, Nov 07, 2019 at 02:24:52PM +0800, Tao Xu wrote: > >>> On 11/7/2019 4:53 AM, Eduardo Habkost wrote: > On Mon, Oct 28, 2019 at 03:52:12PM +0800,

Re: [PATCH] WHPX: refactor load library

2019-11-12 Thread Eduardo Habkost
On Tue, Nov 12, 2019 at 06:42:00PM +, Sunil Muthuswamy wrote: > > > > -Original Message- > > From: Sunil Muthuswamy > > Sent: Friday, November 8, 2019 12:32 PM > > To: 'Paolo Bonzini' ; 'Richard Henderson' > > ; 'Eduardo Habkost' ; 'Stefan > > Weil' > > Cc: 'qemu-devel@nongnu.org'

Re: [PATCH v1 3/5] Add use of RCU for qemu_logfile.

2019-11-12 Thread Robert Foley
On Tue, 12 Nov 2019 at 12:36, Alex Bennée wrote: > > > > } > > +atomic_rcu_set(_logfile, logfile); > > } > > -qemu_mutex_unlock(_logfile_mutex); > > +logfile = qemu_logfile; > > Isn't this read outside of the protection of both rcu_read_lock() and > the mutex? Could

Re: [PATCH v4 15/20] fuzz: add fuzzer skeleton

2019-11-12 Thread Alexander Bulekov
On 11/7/19 7:55 AM, Stefan Hajnoczi wrote: On Wed, Oct 30, 2019 at 02:50:00PM +, Oleinik, Alexander wrote: diff --git a/tests/fuzz/fuzz.c b/tests/fuzz/fuzz.c new file mode 100644 index 00..0e38f81c48 --- /dev/null +++ b/tests/fuzz/fuzz.c @@ -0,0 +1,177 @@ +/* + * fuzzing driver + *

RE: [PATCH v2] WHPX: support for xcr0

2019-11-12 Thread Sunil Muthuswamy
> -Original Message- > From: Sunil Muthuswamy > Sent: Thursday, November 7, 2019 11:49 AM > To: Paolo Bonzini ; Richard Henderson > ; Eduardo Habkost > Cc: qemu-devel@nongnu.org > Subject: [PATCH v2] WHPX: support for xcr0 > > Support for xcr0 to be able to enable xsave/xrstor. This

RE: [PATCH] WHPX: refactor load library

2019-11-12 Thread Sunil Muthuswamy
> -Original Message- > From: Sunil Muthuswamy > Sent: Friday, November 8, 2019 12:32 PM > To: 'Paolo Bonzini' ; 'Richard Henderson' > ; 'Eduardo Habkost' ; 'Stefan > Weil' > Cc: 'qemu-devel@nongnu.org' ; Justin Terry (VM) > > Subject: [PATCH] WHPX: refactor load library > > This

Re: [PULL 0/2] Linux user for 4.2 patches

2019-11-12 Thread Peter Maydell
On Tue, 12 Nov 2019 at 16:18, Laurent Vivier wrote: > > The following changes since commit 2a7e7c3e103a5c29af7c583390c243d85a2527e8: > > Merge remote-tracking branch > 'remotes/stsquad/tags/pull-testing-and-tcg-121119-1' into staging (2019-11-12 > 14:51:00 +) > > are available in the Git

Re: [PATCH v1 5/5] Fix double free issue in qemu_set_log_filename().

2019-11-12 Thread Alex Bennée
Robert Foley writes: > After freeing the logfilename, we set logfilename to NULL, in case of an > error which returns without setting logfilename. > > Signed-off-by: Robert Foley As this fixes an existing bug I would put this at the start of the series. Otherwise: Reviewed-by: Alex Bennée

Re: [PATCH v1 4/5] Added tests for close and change of logfile.

2019-11-12 Thread Alex Bennée
Robert Foley writes: > One test ensures that the logfile handle is still valid even if > the logfile is changed during logging. > The other test validates that the logfile handle remains valid under > the logfile lock even if the logfile is closed. > > Signed-off-by: Robert Foley

Re: [PATCH v7 8/8] Acceptance test: add "boot_linux" tests

2019-11-12 Thread Philippe Mathieu-Daudé
On 11/4/19 4:13 PM, Cleber Rosa wrote: This acceptance test, validates that a full blown Linux guest can successfully boot in QEMU. In this specific case, the guest chosen is Fedora version 31. * x86_64, pc and q35 machine types, with and without kvm as an accellerator typo

Re: [PATCH v7 4/8] Acceptance tests: use relative location for tests

2019-11-12 Thread Philippe Mathieu-Daudé
On 11/11/19 11:11 PM, Cleber Rosa wrote: On Mon, Nov 04, 2019 at 07:26:23PM +0100, Philippe Mathieu-Daudé wrote: On 11/4/19 4:13 PM, Cleber Rosa wrote: An Avocado Test ID[1] is composed by a number of components, but it starts with the Test Name, usually a file system location that was given

Re: [PATCH v7 3/8] Acceptance tests: use avocado tags for machine type

2019-11-12 Thread Philippe Mathieu-Daudé
On 11/12/19 2:59 AM, Cleber Rosa wrote: On Fri, Nov 08, 2019 at 02:20:45PM +0100, Philippe Mathieu-Daudé wrote: On 11/4/19 4:13 PM, Cleber Rosa wrote: """ -self.vm.set_machine('none') self.vm.add_args('-S') self.vm.launch() diff --git

Re: [PATCH v7 3/8] Acceptance tests: use avocado tags for machine type

2019-11-12 Thread Philippe Mathieu-Daudé
On 11/11/19 10:49 PM, Cleber Rosa wrote: On Fri, Nov 08, 2019 at 02:20:45PM +0100, Philippe Mathieu-Daudé wrote: @@ -310,7 +302,7 @@ class BootLinuxConsole(Test): def test_arm_emcraft_sf2(self): """ :avocado: tags=arch:arm -:avocado: tags=machine:emcraft_sf2

Re: [PATCH 00/55] Patch Round-up for stable 4.1.1, freeze on 2019-11-12

2019-11-12 Thread Michael Roth
Quoting Michael Roth (2019-11-05 14:51:48) > Hi everyone, > > The following new patches are queued for QEMU stable v4.1.1: > > https://github.com/mdroth/qemu/commits/stable-4.1-staging > > The release is tentatively planned for 2019-11-14: > > https://wiki.qemu.org/Planning/4.1 > > Please

Re: [PATCH] microvm: fix memory leak in microvm_fix_kernel_cmdline

2019-11-12 Thread Paolo Bonzini
On 12/11/19 17:34, Sergio Lopez wrote: > In microvm_fix_kernel_cmdline(), fw_cfg_modify_string() is duplicating > cmdline instead of taking ownership of it. Free it afterwards to avoid > leaking it. > > Reported-by: Coverity (CID 1407218) > Suggested-by: Peter Maydell > Signed-off-by: Sergio

[PATCH v9 QEMU 12/15] vfio: Add load state functions to SaveVMHandlers

2019-11-12 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 v9 QEMU 15/15] vfio: Make vfio-pci device migration capable.

2019-11-12 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 v9 QEMU 09/15] vfio: Add migration state change notifier

2019-11-12 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 | 28

[PATCH v9 QEMU 06/15] vfio: Add save and load functions for VFIO PCI devices

2019-11-12 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 | 168 ++

[PATCH v9 QEMU 13/15] vfio: Add vfio_listener_log_sync to mark dirty pages

2019-11-12 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 v9 QEMU 05/15] vfio: Add vfio_get_object callback to VFIODeviceOps

2019-11-12 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

Re: [PULL v1 0/3] MicroBlaze fixes

2019-11-12 Thread Peter Maydell
On Tue, 12 Nov 2019 at 16:04, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > The following changes since commit 039e285e095c20a88e623b927654b161aaf9d914: > > Merge remote-tracking branch > 'remotes/vivier2/tags/trivial-branch-pull-request' into staging (2019-11-12 > 12:09:19

[PATCH v9 QEMU 10/15] vfio: Register SaveVMHandlers for VFIO device

2019-11-12 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 v9 QEMU 04/15] vfio: Add function to unmap VFIO region

2019-11-12 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 v9 QEMU 14/15] vfio: Add ioctl to get dirty pages bitmap during dma unmap.

2019-11-12 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 v9 QEMU 08/15] vfio: Add VM state change handler to know state of VM

2019-11-12 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 | 69 +++ hw/vfio/trace-events | 2 ++

[PATCH v9 Qemu 00/15] Add migration support for VFIO devices

2019-11-12 Thread Kirti Wankhede
Hi, This Patch set adds migration support for VFIO devices in QEMU. This Patch set include patches as below: Patch 1-3: - Define KABI for VFIO device for migration support for device state and newly added ioctl definations to get dirty pages bitmap. These 3 patches are same as the first 2

[PATCH v9 QEMU 11/15] vfio: Add save state functions to SaveVMHandlers

2019-11-12 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 v9 QEMU 01/15] vfio: KABI for migration interface for device state

2019-11-12 Thread Kirti Wankhede
- Defined MIGRATION region type and sub-type. - Used 3 bits to define VFIO device states. Bit 0 => _RUNNING Bit 1 => _SAVING Bit 2 => _RESUMING Combination of these bits defines VFIO device's state during migration _RUNNING => Normal VFIO device running state. When its reset, it

[PATCH v9 QEMU 07/15] vfio: Add migration region initialization and finalize function

2019-11-12 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

Re: [PATCH v4 12/20] libqtest: add in-process qtest.c tx/rx handlers

2019-11-12 Thread Alexander Bulekov
On 11/6/19 11:56 AM, Stefan Hajnoczi wrote: On Wed, Oct 30, 2019 at 02:49:58PM +, Oleinik, Alexander wrote: From: Alexander Oleinik Signed-off-by: Alexander Oleinik --- There's a particularily ugly line here: qtest_client_set_tx_handler(qts, (void (*)(QTestState *s, const char*,

[PATCH v9 Kernel 4/5] vfio iommu: Implementation of ioctl to get dirty pages bitmap.

2019-11-12 Thread Kirti Wankhede
IOMMU container maintains list of external pinned pages. Bitmap of pinned pages for input IO virtual address range is created and returned. IO virtual address range should be from a single mapping created by map request. Input bitmap_size is validated by calculating the size of requested range.

[PATCH v9 QEMU 03/15] vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap

2019-11-12 Thread Kirti Wankhede
With vIOMMU, during pre-copy phase of migration, while CPUs are still running, IO virtual address unmap can happen while device still keeping reference of guest pfns. Those pages should be reported as dirty before unmap, so that VFIO user space application can copy content of those pages from

[PATCH v9 Kernel 5/5] vfio iommu: Implementation of ioctl to get dirty bitmap before unmap

2019-11-12 Thread Kirti Wankhede
If pages are pinned by external interface for requested IO virtual address range, bitmap of such pages is created and then that range is unmapped. To get bitmap during unmap, user should set flag VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP, bitmap memory should be allocated and bitmap_size should be set.

[PATCH v9 Kernel 0/5] Add KABIs to support migration for VFIO devices

2019-11-12 Thread Kirti Wankhede
Hi Alex, To keep kernel and QEMU patches in sync, keeping v9 version for this patch set. Till v8 version, KABI was being discussed from QEMU patch series[1]. In earlier version mail and as per in person discussion at KVM forum, this patch set adds: * New IOCTL VFIO_IOMMU_GET_DIRTY_BITMAP to get

[PATCH v9 Kernel 3/5] vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap

2019-11-12 Thread Kirti Wankhede
With vIOMMU, during pre-copy phase of migration, while CPUs are still running, IO virtual address unmap can happen while device still keeping reference of guest pfns. Those pages should be reported as dirty before unmap, so that VFIO user space application can copy content of those pages from

[PATCH v9 QEMU 02/15] vfio iommu: Add ioctl defination to get dirty pages bitmap.

2019-11-12 Thread Kirti Wankhede
All pages pinned by vendor driver through vfio_pin_pages API should be considered as dirty during migration. IOMMU container maintains a list of all such pinned pages. Added an ioctl defination to get bitmap of such pinned pages for requested IO virtual address range. Signed-off-by: Kirti

[PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-12 Thread Kirti Wankhede
- Defined MIGRATION region type and sub-type. - Used 3 bits to define VFIO device states. Bit 0 => _RUNNING Bit 1 => _SAVING Bit 2 => _RESUMING Combination of these bits defines VFIO device's state during migration _RUNNING => Normal VFIO device running state. When its reset,

[PATCH v9 Kernel 2/5] vfio iommu: Add ioctl defination to get dirty pages bitmap.

2019-11-12 Thread Kirti Wankhede
All pages pinned by vendor driver through vfio_pin_pages API should be considered as dirty during migration. IOMMU container maintains a list of all such pinned pages. Added an ioctl defination to get bitmap of such pinned pages for requested IO virtual address range. Signed-off-by: Kirti

Re: [PATCH v1 3/5] Add use of RCU for qemu_logfile.

2019-11-12 Thread Alex Bennée
Robert Foley writes: > This now allows changing the logfile while logging is active, > and also solves the issue of a seg fault while changing the logfile. > > Any read access to the qemu_logfile handle will use > the rcu_read_lock()/unlock() around the use of the handle. > To fetch the handle

Re: [PATCH v1 2/5] qemu_log_lock/unlock now preserves the qemu_logfile handle.

2019-11-12 Thread Alex Bennée
Robert Foley writes: > qemu_log_lock() now returns a handle and qemu_log_unlock() receives a > handle to unlock. This allows for changing the handle during logging > and ensures the lock() and unlock() are for the same file. > > Signed-off-by: Robert Foley > --- > v1 > - Moved this up in

Re: [PATCH v1 1/5] Add a mutex to guarantee single writer to qemu_logfile handle.

2019-11-12 Thread Alex Bennée
Robert Foley writes: > Also added qemu_logfile_init() for initializing the logfile mutex. > > Signed-off-by: Robert Foley Reviewed-by: Alex Bennée > --- > v1 > - changed qemu_logfile_init() to use __constructor__. > --- > util/log.c | 14 ++ > 1 file changed, 14

Re: [PATCH v1 1/2] docs/devel: rename plugins.rst to tcg-plugins.rst

2019-11-12 Thread Peter Maydell
On Tue, 12 Nov 2019 at 16:42, Alex Bennée wrote: > > This makes it a bit clearer what this is about. > > Signed-off-by: Alex Bennée > --- > MAINTAINERS | 1 + > docs/devel/{plugins.rst => tcg-plugins.rst} | 0 > 2 files changed, 1 insertion(+) > rename

Re: [PATCH v2] s390x: Properly fetch the short psw on diag308 subc 0/1

2019-11-12 Thread David Hildenbrand
> Am 12.11.2019 um 17:58 schrieb Cornelia Huck : > > On Mon, 11 Nov 2019 10:28:08 -0500 > Janosch Frank wrote: > >> We need to actually fetch the cpu mask and set it. As we invert the >> short psw indication in the mask, SIE will report a specification >> exception, if it wasn't present in

Re: [PATCH v1 2/2] docs/devel: update tcg-plugins.rst with API versioning details

2019-11-12 Thread Peter Maydell
On Tue, 12 Nov 2019 at 16:41, Alex Bennée wrote: > > Signed-off-by: Alex Bennée > --- > docs/devel/tcg-plugins.rst | 16 > 1 file changed, 16 insertions(+) > > diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst > index b18fb6729e3..8d619fd44ef 100644 > ---

Re: [PATCH v2] s390x: Properly fetch the short psw on diag308 subc 0/1

2019-11-12 Thread Cornelia Huck
On Mon, 11 Nov 2019 10:28:08 -0500 Janosch Frank wrote: > We need to actually fetch the cpu mask and set it. As we invert the > short psw indication in the mask, SIE will report a specification > exception, if it wasn't present in the reset psw. > > Signed-off-by: Janosch Frank > --- >

Re: [PATCH 1/5] MAINTAINERS: Add a section on git infrastructure

2019-11-12 Thread Alex Bennée
Aleksandar Markovic writes: > From: Aleksandar Markovic > > There should be a patient person maintaining gory details of > git-related files, and there is no better person for that role > than Philippe. Alex should be the reviewer for some relations > with gitdm. I'm not sure about this. The

Re: [PATCH v4 01/20] softmmu: split off vl.c:main() into main.c

2019-11-12 Thread Alexander Bulekov
On 11/5/19 11:41 AM, Darren Kenny wrote: On Wed, Oct 30, 2019 at 02:49:48PM +, Oleinik, Alexander wrote: From: Alexander Oleinik A program might rely on functions implemented in vl.c, but implement its own main(). By placing main into a separate source file, there are no complaints about

[PATCH v1 1/2] docs/devel: rename plugins.rst to tcg-plugins.rst

2019-11-12 Thread Alex Bennée
This makes it a bit clearer what this is about. Signed-off-by: Alex Bennée --- MAINTAINERS | 1 + docs/devel/{plugins.rst => tcg-plugins.rst} | 0 2 files changed, 1 insertion(+) rename docs/devel/{plugins.rst => tcg-plugins.rst} (100%) diff --git a/MAINTAINERS

[PATCH v1 2/2] docs/devel: update tcg-plugins.rst with API versioning details

2019-11-12 Thread Alex Bennée
Signed-off-by: Alex Bennée --- docs/devel/tcg-plugins.rst | 16 1 file changed, 16 insertions(+) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index b18fb6729e3..8d619fd44ef 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -25,6

[PATCH v1 0/2] TCG plugin doc updates

2019-11-12 Thread Alex Bennée
Hi, A few minor tweaks to the TCG plugin documentation. Alex Bennée (2): docs/devel: rename plugins.rst to tcg-plugins.rst docs/devel: update tcg-plugins.rst with API versioning details MAINTAINERS | 1 + docs/devel/{plugins.rst => tcg-plugins.rst} | 16

[PATCH] microvm: fix memory leak in microvm_fix_kernel_cmdline

2019-11-12 Thread Sergio Lopez
In microvm_fix_kernel_cmdline(), fw_cfg_modify_string() is duplicating cmdline instead of taking ownership of it. Free it afterwards to avoid leaking it. Reported-by: Coverity (CID 1407218) Suggested-by: Peter Maydell Signed-off-by: Sergio Lopez --- hw/i386/microvm.c | 2 ++ 1 file changed, 2

Re: [PULL 0/8] testing and tcg plugin api ver

2019-11-12 Thread Alex Bennée
Peter Maydell writes: > On Tue, 12 Nov 2019 at 14:50, Alex Bennée wrote: >> >> The following changes since commit 039e285e095c20a88e623b927654b161aaf9d914: >> >> Merge remote-tracking branch >> 'remotes/vivier2/tags/trivial-branch-pull-request' into staging (2019-11-12 >> 12:09:19 +)

[PULL 1/2] linux-user: fix missing break

2019-11-12 Thread Laurent Vivier
Reported by Coverity (CID 1407221) Fixes: a2d866827bd8 ("linux-user: Support for NETLINK socket options") cc: Josh Kunz Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191112105055.32269-1-laur...@vivier.eu> --- linux-user/syscall.c | 1 + 1 file changed, 1

[PULL 0/2] Linux user for 4.2 patches

2019-11-12 Thread Laurent Vivier
The following changes since commit 2a7e7c3e103a5c29af7c583390c243d85a2527e8: Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-tcg-121119-1' into staging (2019-11-12 14:51:00 +) are available in the Git repository at: git://github.com/vivier/qemu.git

[PULL 2/2] linux-user: remove host stime() syscall

2019-11-12 Thread Laurent Vivier
stime() has been withdrawn from glibc (12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.") Implement the target stime() syscall using host clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc. Tested qemu-ppc/x86_64 with: #include #include

Re: [PATCH] linux-user: remove host stime() syscall

2019-11-12 Thread Laurent Vivier
Le 12/11/2019 à 15:25, Laurent Vivier a écrit : > stime() has been withdrawn from glibc > (12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.") > > Implement the target stime() syscall using host > clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc. > > Tested

Re: [PATCH] linux-user: fix missing break

2019-11-12 Thread Laurent Vivier
Le 12/11/2019 à 11:50, Laurent Vivier a écrit : > Reported by Coverity (CID 1407221) > Fixes: a2d866827bd8 ("linux-user: Support for NETLINK socket options") > cc: Josh Kunz > Signed-off-by: Laurent Vivier > --- > linux-user/syscall.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git

[PULL v1 3/3] target/microblaze: Plug temp leak around eval_cond_jmp()

2019-11-12 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Plug temp leak around eval_cond_jmp(). Reviewed-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Edgar E. Iglesias --- target/microblaze/translate.c | 5 - 1 file changed, 4

Re: [PATCH 2/2] iotests: Test multiple blockdev-snapshot calls

2019-11-12 Thread Peter Krempa
On Fri, Nov 08, 2019 at 09:53:12 +0100, Kevin Wolf wrote: > Test that doing a second blockdev-snapshot doesn't make the first > overlay's backing file go away. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/273 | 76 + > tests/qemu-iotests/273.out | 337

[PULL v1 2/3] target/microblaze: Plug temp leaks with delay slot setup

2019-11-12 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Plug temp leaks with delay slot setup. Reviewed-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Edgar E. Iglesias --- target/microblaze/translate.c | 26 ++ 1

[PULL v1 0/3] MicroBlaze fixes

2019-11-12 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" The following changes since commit 039e285e095c20a88e623b927654b161aaf9d914: Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging (2019-11-12 12:09:19 +) are available in the Git repository at:

[PULL v1 1/3] target/microblaze: Plug temp leaks for loads/stores

2019-11-12 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Simplify endian reversion of address also plugging TCG temp leaks for loads/stores. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Luc Michel Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias ---

Re: [PATCH 1/2] block: Remove 'backing': null from bs->{explicit_,}options

2019-11-12 Thread Peter Krempa
On Fri, Nov 08, 2019 at 09:53:11 +0100, Kevin Wolf wrote: > bs->options and bs->explicit_options shouldn't contain any options for > child nodes. bdrv_open_inherited() takes care to remove any options that > match a child name after opening the image and the same is done when > reopening. > >

Re: [PULL 0/8] testing and tcg plugin api ver

2019-11-12 Thread Peter Maydell
On Tue, 12 Nov 2019 at 14:50, Alex Bennée wrote: > > The following changes since commit 039e285e095c20a88e623b927654b161aaf9d914: > > Merge remote-tracking branch > 'remotes/vivier2/tags/trivial-branch-pull-request' into staging (2019-11-12 > 12:09:19 +) > > are available in the Git

Re: [RFC v5 000/126] error: auto propagated local_err

2019-11-12 Thread Vladimir Sementsov-Ogievskiy
12.11.2019 16:46, Cornelia Huck wrote: > On Fri, 8 Nov 2019 22:57:25 +0400 > Marc-André Lureau wrote: > >> Hi >> >> On Fri, Nov 8, 2019 at 7:31 PM Vladimir Sementsov-Ogievskiy >> wrote: >>> >>> Finally, what is the plan? >>> >>> Markus what do you think? >>> >>> Now a lot of patches are

Re: [RFC v5 023/126] hw/vfio/ap: drop local_err from vfio_ap_realize

2019-11-12 Thread Vladimir Sementsov-Ogievskiy
12.11.2019 16:06, Cornelia Huck wrote: > On Fri, 11 Oct 2019 19:04:09 +0300 > Vladimir Sementsov-Ogievskiy wrote: > >> No reason for local_err here, use errp directly instead. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> --- >> hw/vfio/ap.c | 16 +++- >> 1 file changed, 3

  1   2   3   >