[Qemu-devel] [RFC 0/8] VIRTIO-IOMMU device

2017-06-07 Thread Eric Auger
This series implements the virtio-iommu device. This is a proof of concept based on the virtio-iommu specification written by Jean-Philippe Brucker [1]. This was tested with a guest using the virtio-iommu driver [2] and exposed with a virtio-net-pci using dma ops. The device gets instantiated

[Qemu-devel] [RFC 1/8] update-linux-headers: import virtio_iommu.h

2017-06-07 Thread Eric Auger
Update the script to update the virtio_iommu.h header. Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 2f906c4..03f6712 100755 ---

[Qemu-devel] [RFC 2/8] linux-headers: Update for virtio-iommu

2017-06-07 Thread Eric Auger
This is a partial linux header update against Jean-Philippe's branch: git://linux-arm.org/linux-jpb.git virtio-iommu/base (unstable) Signed-off-by: Eric Auger --- include/standard-headers/linux/virtio_ids.h | 1 + include/standard-headers/linux/virtio_iommu.h | 142

Re: [Qemu-devel] [PATCHv2 02/04] colo-compare: Process pactkets in the IOThread of the primary

2017-06-07 Thread Jason Wang
On 2017年06月05日 18:44, Yong Wang wrote: From: Wang Yong Process pactkets in the IOThread which arrived over the socket. we use qio_channel_set_aio_fd_handler to set the handlers on the IOThread AioContext.then the packets from the primary and the secondary are

[Qemu-devel] [PATCH qemu v7] memory/iommu: QOM'fy IOMMU MemoryRegion

2017-06-07 Thread Alexey Kardashevskiy
This defines new QOM object - IOMMUMemoryRegion - with MemoryRegion as a parent. This moves IOMMU-related fields from MR to IOMMU MR. However to avoid dymanic QOM casting in fast path (address_space_translate, etc), this adds an @is_iommu boolean flag to MR and provides new helper to do simple

Re: [Qemu-devel] [PATCHv2 01/04] colo-compare: Use IOThread context timer to Check old packet regularly

2017-06-07 Thread Jason Wang
On 2017年06月05日 18:44, Yong Wang wrote: From: Wang Yong Remove the task which check old packet in the comparing thread, then use IOthread context timer to handle it. Signed-off-by: Wang Yong Signed-off-by: Wang Guang

Re: [Qemu-devel] [RFC PATCH 8/8] iommu: introduce hw/core/iommu

2017-06-07 Thread Peter Xu
On Wed, Jun 07, 2017 at 07:51:55AM +, Liu, Yi L wrote: > Hi Peter, > > Some updates on it. > > > -Original Message- > > From: Peter Xu [mailto:pet...@redhat.com] > > Sent: Thursday, April 27, 2017 5:34 PM > > To: qemu-devel@nongnu.org > > Cc: Lan, Tianyu ; Paolo

[Qemu-devel] [PATCH] hw/ppc/spapr: Adjust firmware name for PCI bridges

2017-06-07 Thread Thomas Huth
SLOF uses "pci" as name for PCI bridges nodes in the device tree instead of "pci-bridges", so booting via bootindex from a device behind a PCI bridge currently does not work since QEMU passes the wrong name in the "qemu,boot-list" property. Fix it by changing the name of the PCI bridge nodes to

Re: [Qemu-devel] [[PATCH V7] 03/11] migration: fix hardcoded function name in error report

2017-06-07 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Type: series Subject: [Qemu-devel] [[PATCH V7] 03/11] migration: fix hardcoded function name in error report Message-id:

Re: [Qemu-devel] [PATCH v3 11/16] virtio-scsi: Request BLK_PERM_AIO_CONTEXT_CHANGE for dataplane

2017-06-07 Thread Fam Zheng
On Wed, 05/24 10:52, Fam Zheng wrote: > blk_set_aio_context is audited by perm API, so follow the protocol and > request for permission first. > > Signed-off-by: Fam Zheng > --- > hw/scsi/virtio-scsi.c | 4 > 1 file changed, 4 insertions(+) > > diff --git

Re: [Qemu-devel] [PULL 01/17] migration: remove register_savevm()

2017-06-07 Thread Juan Quintela
Peter Maydell wrote: > On 6 June 2017 at 03:51, David Gibson wrote: >> From: Laurent Vivier >> >> We can replace the four remaining calls of register_savevm() by >> calls to register_savevm_live(). So we can remove the

[Qemu-devel] [PATCH] nvdimm acpi: fix region format interface code

2017-06-07 Thread Haozhong Zhang
Per ACPI 6.2, section 5.2.25.6 and JEDEC Annex L Release 3, the current region format interface code 0x201 indicates the block addressed function interface 1, rather than a byte addressable interface. Fix it by using 0x301 which indicates the byte addressable no energy backed function interface 1.

[Qemu-devel] [PATCH v5 1/2] spapr: Add a "no HPT" encoding to HTAB migration stream

2017-06-07 Thread Bharata B Rao
Add a "no HPT" encoding (using value -1) to the HTAB migration stream (in the place of HPT size) when the guest doesn't allocate HPT. This will help the target side to match target HPT with the source HPT and thus enable successful migration. Suggested-by: David Gibson

[Qemu-devel] [PATCH v5 2/2] spapr: Fix migration of Radix guests

2017-06-07 Thread Bharata B Rao
Fix migration of radix guests by ensuring that we issue KVM_PPC_CONFIGURE_V3_MMU for radix case post migration. Reported-by: Nageswara R Sastry Signed-off-by: Bharata B Rao Reviewed-by: Suraj Jitindar Singh ---

[Qemu-devel] [PATCH v5 0/2] ppc/spapr: Fix migration of radix guests

2017-06-07 Thread Bharata B Rao
This patchset fixes the migration of sPAPR radix guests. Changes in v5 - - Ensured that assert(kvm_enabled()) isn't touched in any HTAB savevm handlers except in htab_save_setup() where it is made conditional on htab_shift. v4:

Re: [Qemu-devel] [PATCH v4 1/2] spapr: Add a "no HPT" encoding to HTAB migration stream

2017-06-07 Thread Bharata B Rao
On Thu, Jun 01, 2017 at 02:54:48PM +1000, David Gibson wrote: > On Wed, May 31, 2017 at 04:56:44PM +0530, Bharata B Rao wrote: > > Add a "no HPT" encoding (using value -1) to the HTAB migration > > stream (in the place of HPT size) when the guest doesn't allocate HPT. > > This will help the target

Re: [Qemu-devel] [RFC PATCH 8/8] iommu: introduce hw/core/iommu

2017-06-07 Thread Liu, Yi L
Hi Peter, Some updates on it. > -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Thursday, April 27, 2017 5:34 PM > To: qemu-devel@nongnu.org > Cc: Lan, Tianyu ; Paolo Bonzini ; > Tian, Kevin ; Liu, Yi

[Qemu-devel] [PATCH 5/5] coccinelle: prefer glib g_new/g_renew macros

2017-06-07 Thread Marc-André Lureau
The g_new() familly of macros is simpler and safer than g_malloc(). "The return pointer is cast to the given type... Care is taken to avoid overflow when calculating the size of the allocated block." I left out the common g_malloc(sizeof(*ptr)) pattern, since alternative "g_new(typeof(*ptr))"

[Qemu-devel] [PATCH 3/5] arch: introduce ELF_NOTE_SIZE macro

2017-06-07 Thread Marc-André Lureau
Factour out a common pattern to compute the ELF note size. Signed-off-by: Marc-André Lureau --- target/i386/arch_dump.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c

[Qemu-devel] [PATCH 4/5] Replace g_malloc()+memcpy() with g_memdup()

2017-06-07 Thread Marc-André Lureau
I found these pattern via grepping the source tree. I don't have a coccinelle script for it! Signed-off-by: Marc-André Lureau --- hw/9pfs/9p-synth.c | 3 +-- hw/i386/multiboot.c | 3 +-- hw/net/eepro100.c | 3 +-- tests/test-iov.c| 3 +-- 4 files changed, 4

[Qemu-devel] [PATCH 2/5] coccinelle: use DIV_ROUND_UP

2017-06-07 Thread Marc-André Lureau
The coccinelle/round.cocci script doesn't catch hard coded values. I used the following script over qemu code base: ( - ((e1) + 3) / (4) + DIV_ROUND_UP(e1,4) | - ((e1) + (3)) / (4) + DIV_ROUND_UP(e1,4) | - ((e1) + 7) / (8) + DIV_ROUND_UP(e1,8) | - ((e1) + (7)) / (8) + DIV_ROUND_UP(e1,8) | -

[Qemu-devel] [PATCH 1/5] coccinelle: replace code with ROUND_UP macro

2017-06-07 Thread Marc-André Lureau
I used a the following coccinelle script: @@ expression e1; @@ - ((e1) + (3)) / (4) * (4) + ROUND_UP(e1,4) @@ expression e1; expression e2; @@ -(ROUND_UP(e1,e2)) +ROUND_UP(e1,e2) I tried with various other values (4, 8, 16, 32), but got only the matches in this patch. Signed-off-by: Marc-André

[Qemu-devel] [PATCH 0/5] Code cleanups with Coccinelle

2017-06-07 Thread Marc-André Lureau
Hi, Here is a few patches I came up with playing with some semantic patches. If necessary, I can split them further by unit/domains, but that will likely make a quite long series of patches. Marc-André Lureau (5): coccinelle: replace code with ROUND_UP macro coccinelle: use DIV_ROUND_UP

[Qemu-devel] [[PATCH V7] 05/11] migration: introduce postcopy-blocktime capability

2017-06-07 Thread Alexey Perevalov
Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Reviewed-by: Dr. David Alan Gilbert

Re: [Qemu-devel] [PATCH V6 08/10] migration: calculate vCPU blocktime on dst side

2017-06-07 Thread Alexey Perevalov
On 06/01/2017 01:57 PM, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: This patch provides blocktime calculation per vCPU, as a summary and as a overlapped value for all vCPUs. This approach was suggested by Peter Xu, as an improvements of previous approch

[Qemu-devel] [[PATCH V7] 09/11] migration: calculate vCPU blocktime on dst side

2017-06-07 Thread Alexey Perevalov
This patch provides blocktime calculation per vCPU, as a summary and as a overlapped value for all vCPUs. This approach was suggested by Peter Xu, as an improvements of previous approch where QEMU kept tree with faulted page address and cpus bitmask in it. Now QEMU is keeping array with faulted

[Qemu-devel] [[PATCH V7] 10/11] migration: add postcopy total blocktime into query-migrate

2017-06-07 Thread Alexey Perevalov
Postcopy total blocktime is available on destination side only. But query-migrate was possible only for source. This patch adds ability to call query-migrate on destination. To be able to see postcopy blocktime, need to request postcopy-blocktime capability. The query-migrate command will show

[Qemu-devel] [[PATCH V7] 08/11] migration: postcopy_place_page factoring out

2017-06-07 Thread Alexey Perevalov
Need to set copied bitmap as closer as possible to mark_postcopy_blocktime_end. So postcopy_place_page is proper place. RAMBlock argument here could avoid additional RAMBlock lookup as well as reduce number of arguments (no need to pass pointer to copied bitmap). Signed-off-by: Alexey Perevalov

[Qemu-devel] [[PATCH V7] 04/11] migration: split ufd_version_check onto receive/request features part

2017-06-07 Thread Alexey Perevalov
This modification is necessary for userfault fd features which are required to be requested from userspace. UFFD_FEATURE_THREAD_ID is a one of such "on demand" feature, which will be introduced in the next patch. QEMU have to use separate userfault file descriptor, due to userfault context has

[Qemu-devel] [[PATCH V7] 11/11] migration: postcopy_blocktime documentation

2017-06-07 Thread Alexey Perevalov
Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- docs/migration.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 1b940a8..4b625ca 100644 --- a/docs/migration.txt

[Qemu-devel] [[PATCH V7] 07/11] migration: add bitmap for copied page

2017-06-07 Thread Alexey Perevalov
This patch adds ability to track down already copied pages, it's necessary for calculation vCPU block time in postcopy migration feature, maybe for restore after postcopy migration failure. Also it's necessary to solve shared memory issue in postcopy livemigration. Information about copied pages

[Qemu-devel] [[PATCH V7] 03/11] migration: fix hardcoded function name in error report

2017-06-07 Thread Alexey Perevalov
Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 10d39a0..9963ce4 100644

[Qemu-devel] [[PATCH V7] 02/11] migration: pass MigrationIncomingState* into migration check functions

2017-06-07 Thread Alexey Perevalov
That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by: Alexey Perevalov --- migration/migration.c| 3 ++- migration/postcopy-ram.c |

[Qemu-devel] [[PATCH V7] 06/11] migration: add postcopy blocktime ctx into MigrationIncomingState

2017-06-07 Thread Alexey Perevalov
This patch adds request to kernel space for UFFD_FEATURE_THREAD_ID, in case when this feature is provided by kernel. PostcopyBlocktimeContext is incapsulated inside postcopy-ram.c, due to it's postcopy only feature. Also it defines PostcopyBlocktimeContext's instance live time. Information from

[Qemu-devel] [[PATCH V7] 01/11] userfault: add pid into uffd_msg & update UFFD_FEATURE_*

2017-06-07 Thread Alexey Perevalov
This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 4 1 file changed, 4 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h

[Qemu-devel] [[PATCH V7] 00/11] calculate blocktime for postcopy live migration

2017-06-07 Thread Alexey Perevalov
This is 7th version (V6 -> V7) 1. copied bitmap was placed into RAMBlock as another migration related bitmaps. 2. Ordering of mark_postcopy_blocktime_end call and ordering of checking copied bitmap were changed. 3. linewrap style defects 4. new patch "postcopy_place_page factoring

Re: [Qemu-devel] [PATCH] pseries: Correct panic behaviour for pseries machine type

2017-06-07 Thread Thomas Huth
On 07.06.2017 09:07, David Gibson wrote: > The pseries machine type doesn't usually use the 'pvpanic' device as such, > because it has a firmware/hypervisor facility with roughly the same > purpose. The 'ibm,os-term' RTAS call notifies the hypervisor that the > guest has crashed. > > Our

Re: [Qemu-devel] [PATCH] pseries: Correct panic behaviour for pseries machine type

2017-06-07 Thread Paolo Bonzini
- Original Message - > From: "David Gibson" > To: mdr...@linux.vnet.ibm.com, th...@redhat.com, lviv...@redhat.com > Cc: pbonz...@redhat.com, qemu-...@nongnu.org, qemu-devel@nongnu.org, "David > Gibson" > Sent: Wednesday, June

Re: [Qemu-devel] [PATCH v1 1/1] char-socket: Don't report TCP socket waiting as an error

2017-06-07 Thread Markus Armbruster
Paolo Bonzini writes: > On 06/06/2017 18:30, Alistair Francis wrote: >>> >>> This is somehow confusing. I don't think it is worth having another >>> qemu_log_stderr() function rather than using error_report() but this very >>> call might deserve a comment explaining this

Re: [Qemu-devel] [PATCH] Add chardev-send-break monitor command

2017-06-07 Thread Paolo Bonzini
- Original Message - > From: "Markus Armbruster" > To: "Paolo Bonzini" > Cc: "Stefan Fritsch" , qemu-devel@nongnu.org, "Dr. David > Alan Gilbert" , > "Marc-André Lureau" >

[Qemu-devel] [PATCH] pseries: Correct panic behaviour for pseries machine type

2017-06-07 Thread David Gibson
The pseries machine type doesn't usually use the 'pvpanic' device as such, because it has a firmware/hypervisor facility with roughly the same purpose. The 'ibm,os-term' RTAS call notifies the hypervisor that the guest has crashed. Our implementation of this call was sending a GUEST_PANICKED qmp

Re: [Qemu-devel] [PATCH] Add chardev-send-break monitor command

2017-06-07 Thread Markus Armbruster
Paolo Bonzini writes: >> >> Is there an obvious test that we can enhance to add coverage of the new >> >> QMP command? >> > >> > You could have a new test covering hw/char/serial.c, but I wouldn't let >> > that hold the patch. >> >> Holding patches is pretty much the only

Re: [Qemu-devel] [PATCH v3 5/7] pci: Make errp the last parameter of pci_add_capability()

2017-06-07 Thread Markus Armbruster
Mao Zhongyi writes: > Hi, Eduardo > > On 06/06/2017 10:52 PM, Eduardo Habkost wrote: >> On Tue, Jun 06, 2017 at 07:26:30PM +0800, Mao Zhongyi wrote: >>> Add Error argument for pci_add_capability() to leverage the errp >>> to pass info on errors. This way is helpful for

Re: [Qemu-devel] [PULL 0/2] Net patches

2017-06-07 Thread Jason Wang
On 2017年06月07日 12:31, no-re...@patchew.org wrote: Hi, This series seems to have some coding style problems. See output below for more information: Type: series Subject: [Qemu-devel] [PULL 0/2] Net patches Message-id: 1496806444-27910-1-git-send-email-jasow...@redhat.com === TEST SCRIPT

[Qemu-devel] [PATCH] iscsi: use scsi_create_task()

2017-06-07 Thread Marc-André Lureau
The function does the same initialization, and matches with scsi_free_scsi_task() usage, and qemu doesn't need to know the allocator details. Signed-off-by: Marc-André Lureau --- block/iscsi.c | 27 --- 1 file changed, 12 insertions(+), 15

<    1   2   3   4   5