Re: [Qemu-devel] [PATCH v2] virtio: Move memory_listener_unregister to .unrealize

2017-05-16 Thread Paolo Bonzini
> On Tue, 05/16 14:44, Paolo Bonzini wrote: > > On 16/05/2017 14:25, Fam Zheng wrote: > > > You are right. Having had another look, I think it's because of this: > > > VirtIODevice is an embeded member of VirtIOSCSIPCI therefore it is never > > > "finalized" through QOM reference directly. Am I r

[Qemu-devel] [RFC 0/2] pseries: Correct behaviour change for older machine types

2017-05-16 Thread David Gibson
152ef80 "pseries: Rewrite CAS PVR compatibility logic" incorrectly introduced a guest-visible behaviour change into existing versioned machine type. Patch 2/2 corrects this change, while 1/2 is a preliminary clean up to make that easier. Unfortunately, this bug is already in the released qemu-2.9

[Qemu-devel] [RFC 2/2] pseries: Restore PVR negotiation logic for pre-2.9 machine types

2017-05-16 Thread David Gibson
"pseries" guests go through a hypervisor<->guest feature negotiation during early boot. Part of this is finding a CPU compatibility mode which works for both. In 152ef80 "pseries: Rewrite CAS PVR compatibility logic" this logic was changed to strongly prefer architecture defined CPU compatibility

[Qemu-devel] [RFC 1/2] pseries: Split CAS PVR negotiation out into a separate function

2017-05-16 Thread David Gibson
Guests of the qemu machine type go through a feature negotiation process known as "client architecture support" (CAS) during early boot. This does a number of things, one of which is finding a CPU compatibility mode which can be supported by both guest and host. In fact the CPU negotiation is pro

Re: [Qemu-devel] [PATCH V3 0/3] Optimize filter-mirror and filter-rewriter

2017-05-16 Thread Jason Wang
On 2017年05月17日 10:09, Zhang Chen wrote: Fix some duplicate codes and remove unused codes. v3: - Remove the ',' in patch 3/3 v2: - Address Eric's comment fix typo and keep a long lien on patch 3. Zhang Chen (3): net/filter-mirror.c: Remove duplicate check code. net/filter-mirror.c:

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-16 Thread Jason Wang
On 2017年05月17日 14:16, Jason Wang wrote: On 2017年05月16日 15:12, Wei Wang wrote: Hi: Care to post the driver codes too? OK. It may take some time to clean up the driver code before post it out. You can first have a check of the draft at the repo here: https://github.com/wei-w-wang/vhost-

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-16 Thread Jason Wang
On 2017年05月16日 15:12, Wei Wang wrote: Hi: Care to post the driver codes too? OK. It may take some time to clean up the driver code before post it out. You can first have a check of the draft at the repo here: https://github.com/wei-w-wang/vhost-pci-driver Best, Wei Interesting, looks

Re: [Qemu-devel] 答复: Re: [RFC] virtio-fc: draft idea of virtual fibre channel HBA

2017-05-16 Thread Hannes Reinecke
On 05/16/2017 06:22 PM, Paolo Bonzini wrote: > Pruning to sort out the basic disagreements. > > On 16/05/2017 17:22, Hannes Reinecke wrote: >>> That depends on how you would like to do controller passthrough in >>> general. iSCSI doesn't have the 64-bit target ID, and doesn't have >>> (AFAIK) hot

Re: [Qemu-devel] [PATCH 0/4] exec: address space translation cleanups

2017-05-16 Thread Peter Xu
On Wed, May 17, 2017 at 12:23:42PM +0800, Peter Xu wrote: > On Tue, May 16, 2017 at 06:51:03PM +0200, Maxime Coquelin wrote: > > Hi Peter, > > > > On 05/16/2017 03:24 PM, Maxime Coquelin wrote: > > > > > > > > >On 05/15/2017 10:50 AM, Peter Xu wrote: > > >>The problem is that, address_space_get_io

Re: [Qemu-devel] [PULL 19/48] spapr: allocate the ICPState object from under sPAPRCPUCore

2017-05-16 Thread Cédric Le Goater
On 05/16/2017 06:10 PM, Greg Kurz wrote: > On Tue, 16 May 2017 17:18:27 +0200 > Cédric Le Goater wrote: > >> On 05/16/2017 02:55 PM, Laurent Vivier wrote: >>> On 16/05/2017 14:50, Cédric Le Goater wrote: On 05/16/2017 02:03 PM, Laurent Vivier wrote: > On 26/04/2017 09:00, David Gibso

Re: [Qemu-devel] About QEMU BQL and dirty log switch in Migration

2017-05-16 Thread Wanpeng Li
Hi Zhoujian, 2017-05-17 10:20 GMT+08:00 Zhoujian (jay) : > Hi Wanpeng, > >> > On 11/05/2017 14:07, Zhoujian (jay) wrote: >> >> -* Scan sptes if dirty logging has been stopped, dropping those >> >> -* which can be collapsed into a single large-page spte. Later >> >> -* page

Re: [Qemu-devel] [PATCH 06/13] vvfat: fix field names in FAT12/FAT16 boot sector

2017-05-16 Thread Hervé Poussineau
Le 16/05/2017 à 16:39, Kevin Wolf a écrit : Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: Specification: "FAT: General overview of on-disk format" v1.03, page 11 Signed-off-by: Hervé Poussineau --- block/vvfat.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

Re: [Qemu-devel] [PATCH 05/13] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir

2017-05-16 Thread Hervé Poussineau
Le 16/05/2017 à 16:16, Kevin Wolf a écrit : Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: - offset_to_bootsector is the number of sectors up to FAT bootsector - offset_to_fat is the number of sectors up to first File Allocation Table - offset_to_root_dir is the number of sectors up to

Re: [Qemu-devel] [PATCH 03/13] vvfat: fix typos

2017-05-16 Thread Hervé Poussineau
Le 16/05/2017 à 15:21, Kevin Wolf a écrit : Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: @@ -806,7 +806,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index) (ROOT_ENTRIES - cur) * sizeof(direntry_t)); } - /* reget the mapping, since s->mapp

Re: [Qemu-devel] [Qemu devel v5 PATCH 0/5] Add support for Smartfusion2 SoC

2017-05-16 Thread Philippe Mathieu-Daudé
Hi Sundeep, This patchset is way cleaner! I had a fast look and I like it, I'll try to make some time soon to review details and test it. Is your work interested on U-Boot or more focused in Linux kernel? If you compile QEMU with libfdt support you can use the -dtb option to pass the blob to

Re: [Qemu-devel] [PATCH 0/4] exec: address space translation cleanups

2017-05-16 Thread Peter Xu
On Tue, May 16, 2017 at 06:51:03PM +0200, Maxime Coquelin wrote: > Hi Peter, > > On 05/16/2017 03:24 PM, Maxime Coquelin wrote: > > > > > >On 05/15/2017 10:50 AM, Peter Xu wrote: > >>The problem is that, address_space_get_iotlb_entry() shares a lot with > >>address_space_translate(). This patch tr

Re: [Qemu-devel] [PATCH 6/6] spapr: fix migration of ICP objects from/to older QEMU

2017-05-16 Thread David Gibson
On Mon, May 15, 2017 at 02:22:32PM +0200, Cédric Le Goater wrote: > On 05/15/2017 01:40 PM, Greg Kurz wrote: > > Commit 5bc8d26de20c ("spapr: allocate the ICPState object from under > > sPAPRCPUCore") moved ICP objects from the machine to CPU cores. This > > is an improvement since we no longer all

Re: [Qemu-devel] [PATCH 6/6] spapr: fix migration of ICP objects from/to older QEMU

2017-05-16 Thread David Gibson
On Mon, May 15, 2017 at 06:20:06PM +0200, Greg Kurz wrote: > On Mon, 15 May 2017 18:09:04 +0200 > Cédric Le Goater wrote: > > > On 05/15/2017 03:16 PM, Greg Kurz wrote: > > > On Mon, 15 May 2017 14:22:32 +0200 > > > Cédric Le Goater wrote: > > > > > >> On 05/15/2017 01:40 PM, Greg Kurz wrote:

Re: [Qemu-devel] [PATCH 6/6] spapr: fix migration of ICP objects from/to older QEMU

2017-05-16 Thread David Gibson
On Mon, May 15, 2017 at 06:11:27PM +0200, Cédric Le Goater wrote: > >>> +int smt = kvmppc_smt_threads(); > >>> +int nr_servers = DIV_ROUND_UP(max_cpus * smt, smp_threads); > >> > >> may be we should reintroduce nr_servers at the machine level ? > >> > > > > I had reintroduced it

Re: [Qemu-devel] [PATCH 6/6] spapr: fix migration of ICP objects from/to older QEMU

2017-05-16 Thread David Gibson
On Mon, May 15, 2017 at 03:16:02PM +0200, Greg Kurz wrote: > On Mon, 15 May 2017 14:22:32 +0200 > Cédric Le Goater wrote: > > > On 05/15/2017 01:40 PM, Greg Kurz wrote: [snip] > > > + > > > +object_initialize(obj, sizeof(ICPState), spapr->icp_type); > > > +object_property_

Re: [Qemu-devel] [PATCH v3] net/rocker: Convert to realize

2017-05-16 Thread Mao Zhongyi
Hi, Markus On 05/16/2017 11:29 PM, Markus Armbruster wrote: Mao Zhongyi writes: The rocker device still implements the old PCIDeviceClass .init() instead of the new .realize(). All devices need to be converted to .realize(). Thanks for chipping in! .init() reports errors with fprintf() an

[Qemu-devel] [RFC PATCH v1 6/6] spapr: Fix migration of Radix guests

2017-05-16 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 --- hw/ppc/spapr.c | 15 +++ hw/ppc/spapr_hcall.c | 1 + include/hw/ppc/spapr.h | 1 + 3 files cha

[Qemu-devel] [RFC PATCH v1 2/6] migration: Introduce unregister_savevm_live()

2017-05-16 Thread Bharata B Rao
Introduce a new function unregister_savevm_live() to unregister the vmstate handlers registered via register_savevm_live(). register_savevm() allocates SaveVMHandlers while register_savevm_live() gets passed with SaveVMHandlers. During unregistration, we want to free SaveVMHandlers in the former

[Qemu-devel] [RFC PATCH v1 5/6] spapr: Unregister HPT savevm handlers for radix guests

2017-05-16 Thread Bharata B Rao
HPT gets created by default and later when the guest turns out to be a radix guest, the HPT is destroyed when guest does H_REGISTER_PROC_TBL hcall. Let HTAB savevm handlers registration and unregistration follow the same model so that we don't end up having unrequired HTAB savevm handlers for radix

[Qemu-devel] [RFC PATCH v1 4/6] spapr: Consolidate HPT freeing code into a routine

2017-05-16 Thread Bharata B Rao
Consolidate the code that frees HPT into a separate routine spapr_free_hpt() as the same chunk of code is called from two places. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 13 + hw/ppc/spapr_hcall.c | 5 + include/hw/ppc/spapr.h | 1 + 3 files changed, 11 inse

[Qemu-devel] [RFC PATCH v1 3/6] spapr: Make h_register_process_table hcall flags global

2017-05-16 Thread Bharata B Rao
The flags used in h_register_process_table hcall are needed in spapr.c and hence move them to a header file. While doing so, give them slightly specific names. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- hw/ppc/spapr_hcall.c | 31 ++- include/hw/ppc/

[Qemu-devel] [RFC PATCH v1 1/6] migration: Fix unregister_savevm()

2017-05-16 Thread Bharata B Rao
In unregister_savevm(), free se->compat only if it was allocated earlier. Signed-off-by: Bharata B Rao --- migration/savevm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index 352a8f2..7a268ec 100644 --- a/migration/savevm.c +++

[Qemu-devel] [RFC PATCH v1 0/6] ppc/spapr: Fix migration of radix guests

2017-05-16 Thread Bharata B Rao
This patchset fixes the migration of sPAPR radix guests. Changes in v1: -- - Added two patches to fix generic savevm unregistration issues. - HTAB savevm handlers are now registered/unregistered when HTAB is created/destroyed instead of doing this in CAS call (as in v0). TODO: - I h

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

2017-05-16 Thread Bharata B Rao
On Thu, May 11, 2017 at 11:02:20AM +1000, David Gibson wrote: > On Mon, May 08, 2017 at 02:36:17PM +0530, Bharata B Rao wrote: > > Currently HTAB savevm handlers get registered by default and migration > > of radix guest will fail. > > > > - Ensure that HTAB savevm handlers are not registered for

Re: [Qemu-devel] [PATCH 6/6] spec/vhost-user spec: Add IOMMU support

2017-05-16 Thread Jason Wang
On 2017年05月16日 23:16, Michael S. Tsirkin wrote: On Mon, May 15, 2017 at 01:45:28PM +0800, Jason Wang wrote: On 2017年05月13日 08:02, Michael S. Tsirkin wrote: On Fri, May 12, 2017 at 04:21:58PM +0200, Maxime Coquelin wrote: On 05/11/2017 08:25 PM, Michael S. Tsirkin wrote: On Thu, May 11, 201

Re: [Qemu-devel] [PATCH] nvme: Add support for Controller Memory Buffers

2017-05-16 Thread Stephen Bates
> Awesome, this looks great! > > Acked-by: Keith Busch Thanks Keith! I still seem to be having issues getting my patches onto the qemu-* mailing lists. Does anyone have any idea how I go about rectifying that? Stephen

Re: [Qemu-devel] About QEMU BQL and dirty log switch in Migration

2017-05-16 Thread Zhoujian (jay)
Hi Wanpeng, > > On 11/05/2017 14:07, Zhoujian (jay) wrote: > >> -* Scan sptes if dirty logging has been stopped, dropping those > >> -* which can be collapsed into a single large-page spte. Later > >> -* page faults will create the large-page sptes. > >> +* Reset e

Re: [Qemu-devel] [PATCH] iotests: 147: Don't test inet6 if not available

2017-05-16 Thread Fam Zheng
On Fri, 05/05 18:21, Fam Zheng wrote: > This is the case in our docker tests, as we use --net=none there. Skip > this method. Ping. Is this patch okay? > > Signed-off-by: Fam Zheng > --- > tests/qemu-iotests/147 | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/tests/qemu-iotest

[Qemu-devel] [PATCH V3 2/3] net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle

2017-05-16 Thread Zhang Chen
Because filter_mirror_receive_iov() and filter_redirector_receive_iov() both use the filter_mirror_send() to send packet, so I change filter_mirror_send() to filter_send() that looks more common. And fix some codestyle. Signed-off-by: Zhang Chen --- net/filter-mirror.c | 29 -

[Qemu-devel] [PATCH V3 3/3] net/filter-rewriter: Remove unused option in filter-rewriter

2017-05-16 Thread Zhang Chen
Signed-off-by: Zhang Chen --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index f806af9..cbec279 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4038,7 +4038,7 @@ Create a filter-redirector we need to differ outdev i

[Qemu-devel] [PATCH V3 0/3] Optimize filter-mirror and filter-rewriter

2017-05-16 Thread Zhang Chen
Fix some duplicate codes and remove unused codes. v3: - Remove the ',' in patch 3/3 v2: - Address Eric's comment fix typo and keep a long lien on patch 3. Zhang Chen (3): net/filter-mirror.c: Remove duplicate check code. net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle

[Qemu-devel] [PATCH V3 1/3] net/filter-mirror.c: Remove duplicate check code.

2017-05-16 Thread Zhang Chen
The s->outdev have checked in filter_mirror_set_outdev(). Signed-off-by: Zhang Chen --- net/filter-mirror.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 72fa7c2..fd0322f 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -194

Re: [Qemu-devel] [Qemu-ppc] [PATCH v9 3/6] hw/ppc: migrating the DRC state of hotplugged devices

2017-05-16 Thread David Gibson
On Tue, May 16, 2017 at 10:46:23AM -0300, Daniel Henrique Barboza wrote: > > > On 05/12/2017 03:11 AM, David Gibson wrote: > > On Fri, May 05, 2017 at 05:47:43PM -0300, Daniel Henrique Barboza wrote: > > > In pseries, a firmware abstraction called Dynamic Reconfiguration > > > Connector (DRC) is

Re: [Qemu-devel] [Qemu-ppc] [PATCH v9 4/6] hw/ppc/spapr.c: migrate pending_dimm_unplugs of spapr state

2017-05-16 Thread David Gibson
On Fri, May 12, 2017 at 04:54:57PM -0300, Daniel Henrique Barboza wrote: > > > On 05/12/2017 03:12 AM, David Gibson wrote: > > On Fri, May 05, 2017 at 05:47:44PM -0300, Daniel Henrique Barboza wrote: > > > To allow for a DIMM unplug event to resume its work if a migration > > > occurs in the midd

Re: [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter

2017-05-16 Thread Zhang Chen
On 05/16/2017 10:42 PM, Eric Blake wrote: On 05/16/2017 03:22 AM, Zhang Chen wrote: What's the difference compared with V2? I think I should apply this series? In V2 I forgot remove "," in patch 3/3, Yes, please apply this series. If you changed the patches, even just to add a ',', then it'

Re: [Qemu-devel] [PATCH v2] virtio: Move memory_listener_unregister to .unrealize

2017-05-16 Thread Fam Zheng
On Tue, 05/16 14:44, Paolo Bonzini wrote: > > > On 16/05/2017 14:25, Fam Zheng wrote: > > You are right. Having had another look, I think it's because of this: > > VirtIODevice is an embeded member of VirtIOSCSIPCI therefore it is never > > "finalized" through QOM reference directly. Am I right?

Re: [Qemu-devel] [PATCH 4/5] target/sh4: ignore interrupts in a delay slot

2017-05-16 Thread Philippe Mathieu-Daudé
On 05/16/2017 07:47 PM, Aurelien Jarno wrote: Delay slots are indivisible, therefore avoid scheduling an interrupt in the delay slot. However exceptions are possible. Signed-off-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daudé --- target/sh4/helper.c | 12 ++-- 1 file change

Re: [Qemu-devel] [PATCH 3/5] target/sh4: introduce DELAY_SLOT_MASK

2017-05-16 Thread Philippe Mathieu-Daudé
On 05/16/2017 07:47 PM, Aurelien Jarno wrote: This will make easier the introduction of a new flag in the next patches. This makes code cleaner / easier to read, no need further explanation ;) Signed-off-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daudé --- target/sh4/cpu.h

Re: [Qemu-devel] [PATCH 3/4] target/cris: optimize swap

2017-05-16 Thread Philippe Mathieu-Daudé
On 05/16/2017 08:01 PM, Aurelien Jarno wrote: Use the same mask to avoid having to load two different constants, as suggest by Richard Henderson. Also use one less temp. Signed-off-by: Aurelien Jarno --- target/cris/translate.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions

Re: [Qemu-devel] [PATCH 1/5] target/sh4: log unauthorized accesses using qemu_log_mask

2017-05-16 Thread Philippe Mathieu-Daudé
On 05/16/2017 07:47 PM, Aurelien Jarno wrote: qemu_log_mask() is preferred over fprintf() for logging errors. Signed-off-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daudé --- target/sh4/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sh4/helper.c b

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/4] target/arm: simplify and optimize aarch64 rev16

2017-05-16 Thread Philippe Mathieu-Daudé
On 05/16/2017 08:01 PM, Aurelien Jarno wrote: Instead of byteswapping individual 16-bit words one by one, work on the whole register at the same time using shifts and mask. This is the same strategy than the aarch32 version of rev16 and is much more efficient in the case sf=1. Signed-off-by: Aur

[Qemu-devel] [PATCH v8 12/13] vfio/ccw: update sense data if a unit check is pending

2017-05-16 Thread Dong Jia Shi
Concurrent-sense data is currently not delivered. This patch stores the concurrent-sense data to the subchannel if a unit check is pending and the concurrent-sense bit is enabled. Then a TSCH can retreive the right IRB data back to the guest. Acked-by: Alex Williamson Signed-off-by: Dong Jia Shi

[Qemu-devel] [PATCH v8 09/13] vfio/ccw: get irqs info and set the eventfd fd

2017-05-16 Thread Dong Jia Shi
vfio-ccw resorts to the eventfd mechanism to communicate with userspace. We fetch the irqs info via the ioctl VFIO_DEVICE_GET_IRQ_INFO, register a event notifier to get the eventfd fd which is sent to kernel via the ioctl VFIO_DEVICE_SET_IRQS, then we can implement read operation once kernel sends

Re: [Qemu-devel] [Qemu-arm] [PATCH 1/4] target/arm: optimize aarch32 rev16

2017-05-16 Thread Philippe Mathieu-Daudé
Hi Aurelien, On 05/16/2017 08:01 PM, Aurelien Jarno wrote: Use the same mask to avoid having to load two different constants, as suggested by Richard Henderson. What about Suggested-by: Richard Henderson ? Signed-off-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daudé --- targe

[Qemu-devel] [PATCH v8 06/13] s390x/css: device support for s390-ccw passthrough

2017-05-16 Thread Dong Jia Shi
In order to support subchannels pass-through, we introduce a s390 subchannel device called "s390-ccw" to hold the real subchannel info. The s390-ccw devices inherit from the abstract CcwDevice which connect to the existing virtual-css-bus. Reviewed-by: Eric Auger Signed-off-by: Dong Jia Shi ---

[Qemu-devel] [PATCH v8 13/13] MAINTAINERS: Add vfio-ccw maintainer

2017-05-16 Thread Dong Jia Shi
Add Cornelia Huck as the vfio-ccw maintainer. Acked-by: Alex Williamson Signed-off-by: Dong Jia Shi --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index efdec47319..a4ae36b411 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -997,6 +997,13 @@ S

[Qemu-devel] [PATCH v8 07/13] vfio/ccw: vfio based subchannel passthrough driver

2017-05-16 Thread Dong Jia Shi
From: Xiao Feng Ren We use the IOMMU_TYPE1 of VFIO to realize the subchannels passthrough, implement a vfio based subchannels passthrough driver called "vfio-ccw". Support qemu parameters in the style of: "-device vfio-ccw,sysfsdev=$mdev_file_path,devno=xx.x.' Reviewed-by: Eric Auger Acked

[Qemu-devel] [PATCH v8 05/13] s390x/css: realize css_create_sch

2017-05-16 Thread Dong Jia Shi
The S390 virtual css support already has a mechanism to create a virtual subchannel and provide it to the guest. However, to pass-through subchannels to a guest, we need to introduce a new mechanism to create the subchannel according to the real device information. Thus we reconstruct css_create_vi

[Qemu-devel] [PATCH v8 10/13] s390x/css: introduce and realize ccw-request callback

2017-05-16 Thread Dong Jia Shi
From: Xiao Feng Ren Introduce a new callback on subchannel to handle ccw-request. Realize the callback in vfio-ccw device. Besides, resort to the event notifier handler to handling the ccw-request results. 1. Pread the I/O results via MMIO region. 2. Update the scsw info to guest. 3. Inject an I/

[Qemu-devel] [PATCH v8 08/13] vfio/ccw: get io region info

2017-05-16 Thread Dong Jia Shi
vfio-ccw provides an MMIO region for I/O operations. We fetch its information via ioctls here, then we can use it performing I/O instructions and retrieving I/O results later on. Reviewed-by: Eric Auger Acked-by: Alex Williamson Signed-off-by: Dong Jia Shi --- hw/vfio/ccw.c | 54 ++

[Qemu-devel] [PATCH v8 04/13] s390x/css: realize css_sch_build_schib

2017-05-16 Thread Dong Jia Shi
From: Xiao Feng Ren The S390 virtual css support already has a mechanism to build a virtual subchannel information block (schib) and provide virtual subchannels to the guest. However, to pass-through subchannels to a guest, we need to introduce a new mechanism to build its schib according to the

[Qemu-devel] [PATCH v8 01/13] update-linux-headers: update for vfio-ccw

2017-05-16 Thread Dong Jia Shi
Add vfio_ccw.h. Signed-off-by: Dong Jia Shi --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 6a370a8669..2f906c4d16 100755 --- a/scripts/update-linux-headers.sh +++ b/sc

[Qemu-devel] [PATCH v8 11/13] s390x/css: ccw translation infrastructure

2017-05-16 Thread Dong Jia Shi
From: Xiao Feng Ren Implement a basic infrastructure of handling channel I/O instruction interception for passed through subchannels: 1. Branch the code path of instruction interception handling by SubChannel type. 2. For a passed-through subchannel, issue the ORB to kernel to do ccw transl

[Qemu-devel] [PATCH v8 03/13] s390x/css: add s390-squash-mcss machine option

2017-05-16 Thread Dong Jia Shi
From: Xiao Feng Ren We want to support real (i.e. not virtual) channel devices even for guests that do not support MCSS-E (where guests may see devices from any channel subsystem image at once). As all virtio-ccw devices are in css 0xfe (and show up in the default css 0 for guests not activating

[Qemu-devel] [PATCH v8 00/13] basic channel IO passthrough infrastructure based on vfio

2017-05-16 Thread Dong Jia Shi
The patch series introduce a basic channel I/O passthrough infrastructure based on vfio. - Focus on supporting dasd-eckd(cu_type/dev_type = 0x3990/0x3390) as the target device. - Support new qemu parameters in the style of: -machine s390-ccw-virtio(,s390-squash-mcss=on|off) \ -device vfi

[Qemu-devel] [PATCH v8 02/13] vfio: linux-headers update for vfio-ccw

2017-05-16 Thread Dong Jia Shi
This is a placeholder for a linux-headers update. Signed-off-by: Dong Jia Shi --- linux-headers/linux/vfio.h | 17 + linux-headers/linux/vfio_ccw.h | 28 2 files changed, 45 insertions(+) create mode 100644 linux-headers/linux/vfio_ccw.h diff --

[Qemu-devel] [PATCH 2/4] target/arm: simplify and optimize aarch64 rev16

2017-05-16 Thread Aurelien Jarno
Instead of byteswapping individual 16-bit words one by one, work on the whole register at the same time using shifts and mask. This is the same strategy than the aarch32 version of rev16 and is much more efficient in the case sf=1. Signed-off-by: Aurelien Jarno --- target/arm/translate-a64.c | 2

[Qemu-devel] [PATCH 1/4] target/arm: optimize aarch32 rev16

2017-05-16 Thread Aurelien Jarno
Use the same mask to avoid having to load two different constants, as suggested by Richard Henderson. Signed-off-by: Aurelien Jarno --- target/arm/translate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 0b5a0bca0

[Qemu-devel] [PATCH 3/4] target/cris: optimize swap

2017-05-16 Thread Aurelien Jarno
Use the same mask to avoid having to load two different constants, as suggest by Richard Henderson. Also use one less temp. Signed-off-by: Aurelien Jarno --- target/cris/translate.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/cris/translate.c b/targ

[Qemu-devel] [PATCH 0/4] target/arm, cris, mips: optimize "swap bytes within words"

2017-05-16 Thread Aurelien Jarno
This patchset optimizes the "swap bytes within words" instructions on the arm, cris and mips targets. It all started with the patchset from Philippe Mathieu-Daudé optimizing TCG code by using the extract op. Looking at the patch I have found that the aarch64 rev16 function can be optimized even mor

[Qemu-devel] [PATCH 4/4] target/mips: optimize WSBH, DSBH and DSHD

2017-05-16 Thread Aurelien Jarno
Use the same mask to avoid having to load two different constants, as suggested by Richard Henderson. Signed-off-by: Aurelien Jarno --- target/mips/translate.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.

[Qemu-devel] [PATCH 3/5] target/sh4: introduce DELAY_SLOT_MASK

2017-05-16 Thread Aurelien Jarno
This will make easier the introduction of a new flag in the next patches. Signed-off-by: Aurelien Jarno --- target/sh4/cpu.h | 3 ++- target/sh4/helper.c| 4 ++-- target/sh4/translate.c | 17 - 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target/sh

[Qemu-devel] [PATCH 0/5] target/sh4: system emulation improvement

2017-05-16 Thread Aurelien Jarno
This patch series fix two issues with the SH4 system emulation: - reboot does not work when using -kernel and -initrd - the RTE instruction is not correctly emulated in some very rare cases, causing userland processes to receive a segmentation fault. Aurelien Jarno (5): target/sh4: log unautho

[Qemu-devel] [PATCH 5/5] target/sh4: fix RTE instruction delay slot

2017-05-16 Thread Aurelien Jarno
The ReTurn from Exception (RTE) instruction loads the system register (SR) with the saved system register (SSR). It has a delay slot, and behaves specially according to the SH4 manual: The SR value accessed by the instruction in the RTE delay slot is the value restored from SSR by the RTE inst

[Qemu-devel] [PATCH 4/5] target/sh4: ignore interrupts in a delay slot

2017-05-16 Thread Aurelien Jarno
Delay slots are indivisible, therefore avoid scheduling an interrupt in the delay slot. However exceptions are possible. Signed-off-by: Aurelien Jarno --- target/sh4/helper.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target/sh4/helper.c b/target/sh4/helper

[Qemu-devel] [PATCH 2/5] target/sh4: fix reset when using a kernel and an initrd

2017-05-16 Thread Aurelien Jarno
When a masked exception happens, the SH4 CPU generates a non-masked reset exception, which then jumps to the reset vector at address 0xA000. While this is emulated correctly in QEMU, this does not work when using a kernel and initrd as this address then contain an illegal instruction (and there

[Qemu-devel] [PATCH 1/5] target/sh4: log unauthorized accesses using qemu_log_mask

2017-05-16 Thread Aurelien Jarno
qemu_log_mask() is preferred over fprintf() for logging errors. Signed-off-by: Aurelien Jarno --- target/sh4/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 8f8ce81401..4c024f9529 100644 --- a/target/sh4/helper.c +++ b/

Re: [Qemu-devel] [virtio-dev] [PATCH v18 1/2] virtio-crypto: Add virtio crypto device specification

2017-05-16 Thread Halil Pasic
On 05/16/2017 05:33 PM, Stefan Hajnoczi wrote: > On Sat, Apr 22, 2017 at 02:23:50PM +0800, Gonglei wrote: >> +Dataq requests for both session and stateless modes are as follows: >> + >> +\begin{lstlisting} >> +struct virtio_crypto_op_data_req_mux { >> +struct virtio_crypto_op_header header; >

Re: [Qemu-devel] [PATCH] target/i386: enable A20 automatically in system management mode

2017-05-16 Thread Xu, Anthony
> > > > With the above change, I got below data > > > > > > > > Platformaccel count of restoring A20 to 0 > > > > Q35 kvm 96 > > > > Q35 tcg 271 > > > > PC kvm 3 > > > > PC tcg 3 >

Re: [Qemu-devel] [RFC v1 6/9] virtio-crypto: rework virtio_crypto_handle_request

2017-05-16 Thread Halil Pasic
On 05/16/2017 04:52 AM, Gonglei (Arei) wrote: >> >> On 05/13/2017 03:16 AM, Gonglei (Arei) wrote: >>> From: Halil Pasic [mailto:pa...@linux.vnet.ibm.com] Sent: Friday, May 12, 2017 7:02 PM On 05/08/2017 01:38 PM, Gonglei wrote: > According to the new spec, we should u

[Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory

2017-05-16 Thread Anthony Xu
If cpu-memory address space is same as memory address space, use memory address space for cpu-memory address space. any memory region change causeaddress space to rebuild PhysPageMap, rebuilding PhysPageMap is very expensive. removing cpu-memory address space reduces the guest boot time and memor

Re: [Qemu-devel] [PATCH 06/10] virtio-ccw: use vmstate way for config migration

2017-05-16 Thread Halil Pasic
On 05/15/2017 09:07 PM, Dr. David Alan Gilbert wrote: > * Halil Pasic (pa...@linux.vnet.ibm.com) wrote: >> >> >> On 05/08/2017 08:42 PM, Dr. David Alan Gilbert wrote: >>> * Halil Pasic (pa...@linux.vnet.ibm.com) wrote: On 05/08/2017 07:59 PM, Dr. David Alan Gilbert wrote: [..]

Re: [Qemu-devel] [PATCH] target/i386: enable A20 automatically in system management mode

2017-05-16 Thread Kevin O'Connor
On Tue, May 16, 2017 at 08:00:28PM +, Xu, Anthony wrote: > > On Sat, May 13, 2017 at 01:24:30AM +, Xu, Anthony wrote: > > > I think it is related to accel and platform, the result I gave before is > > > for q35 > > tcg, > > > > > > With the above change, I got below data > > > > > > Plat

Re: [Qemu-devel] [PATCH] qapi-schema: Remove obsolete note from ObjectTypeInfo

2017-05-16 Thread Eric Blake
On 05/16/2017 03:53 PM, Eduardo Habkost wrote: > The "This command is experimental" note in ObjectTypeInfo is obsolete > since 2012. Commit 5192082097549c5b3aa7c913c6853d97a68172cb removed the > warning from the qom-list-types command documentation, but we forgot to > remove the warning from Objec

[Qemu-devel] [PATCH v2 09/12] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes

2017-05-16 Thread Eric Blake
Some of the callers were already scaling bytes to sectors; others can be easily converted to pass byte offsets, all in our shift towards a consistent byte interface everywhere. Making the change will also make it easier to write the hold-out callers to use byte rather than sectors for their iterat

[Qemu-devel] [PATCH v2 11/12] dirty-bitmap: Switch bdrv_set_dirty() to bytes

2017-05-16 Thread Eric Blake
Both callers already had bytes available, but were scaling to sectors. Move the scaling to internal code. In the case of bdrv_aligned_pwritev(), we are now passing the exact offset rather than a rounded sector-aligned value, but that's okay as long as dirty bitmap widens start/bytes to granularit

[Qemu-devel] [PATCH] qapi-schema: Remove obsolete note from ObjectTypeInfo

2017-05-16 Thread Eduardo Habkost
The "This command is experimental" note in ObjectTypeInfo is obsolete since 2012. Commit 5192082097549c5b3aa7c913c6853d97a68172cb removed the warning from the qom-list-types command documentation, but we forgot to remove the warning from ObjectTypeInfo. Signed-off-by: Eduardo Habkost --- qapi-s

[Qemu-devel] [PATCH v2 07/12] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes

2017-05-16 Thread Eric Blake
Thanks to recent cleanups, all callers were scaling a return value of sectors into bytes; do the scaling internally instead. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v2: no change --- block/dirty-bitmap.c | 4 ++-- block/mirror.c | 13 + migration/block.c| 2

[Qemu-devel] [PATCH v2 08/12] dirty-bitmap: Change bdrv_get_dirty() to take bytes

2017-05-16 Thread Eric Blake
Half the callers were already scaling bytes to sectors; the other half can eventually be simplified to use byte iteration. Both callers were already using the result as a bool, so make that explicit. Making the change also makes it easier for a future dirty-bitmap patch to offload scaling over to

[Qemu-devel] [PATCH v2 06/12] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset

2017-05-16 Thread Eric Blake
Thanks to recent cleanups, all callers were scaling a return value of sectors into bytes; do the scaling internally instead. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v2: no change --- block/backup.c | 2 +- block/dirty-bitmap.c | 2 +- block/mirror.c | 8 3 fil

[Qemu-devel] [PATCH v2 02/12] migration: Don't lose errno across aio context changes

2017-05-16 Thread Eric Blake
set_dirty_tracking() was assuming that the errno value set by bdrv_create_dirty_bitmap() would not be corrupted by either blk_get_aio_context() or aio_context_release(). Rather than audit whether this assumption is safe, rewrite the code to just grab the value of errno sooner. CC: qemu-sta...@non

[Qemu-devel] [PATCH v2 12/12] dirty-bitmap: Convert internal hbitmap size/granularity

2017-05-16 Thread Eric Blake
Now that all callers are using byte-based interfaces, there's no reason for our internal hbitmap to remain with sector-based granularity. It also simplifies our internal scaling, since we already know that hbitmap widens requests out to granularity boundaries. Signed-off-by: Eric Blake Reviewed-

[Qemu-devel] [PATCH v2 05/12] dirty-bitmap: Set iterator start by offset, not sector

2017-05-16 Thread Eric Blake
All callers to bdrv_dirty_iter_new() passed 0 for their initial starting point, drop that parameter. All callers to bdrv_set_dirty_iter() were scaling an offset to a sector number; move the scaling to occur internally to dirty bitmap code instead. Signed-off-by: Eric Blake Reviewed-by: John Snow

[Qemu-devel] [PATCH v2 00/12] make dirty-bitmap byte-based

2017-05-16 Thread Eric Blake
There are patches floating around to add NBD_CMD_BLOCK_STATUS, but NBD wants to report status on byte granularity (even if the reporting will probably be naturally aligned to sectors or even much higher levels). I've therefore started the task of converting our block status code to report at a byt

[Qemu-devel] [PATCH v2 10/12] mirror: Switch mirror_dirty_init() to byte-based iteration

2017-05-16 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v2: no change --- block/mirror.c | 35 ++--

[Qemu-devel] [PATCH v2 04/12] dirty-bitmap: Track size in bytes

2017-05-16 Thread Eric Blake
We are still using an internal hbitmap that tracks a size in sectors, with the granularity scaled down accordingly, because it lets us use a shortcut for our iterators which are currently sector-based. But there's no reason we can't track the dirty bitmap size in bytes, since it is an internal-only

[Qemu-devel] [PATCH v2 03/12] dirty-bitmap: Drop unused functions

2017-05-16 Thread Eric Blake
We had several functions that no one is currently using, and which use sector-based interfaces. I'm trying to convert towards byte-based interfaces, so it's easier to just drop the unused functions: bdrv_dirty_bitmap_size bdrv_dirty_bitmap_get_meta bdrv_dirty_bitmap_reset_meta bdrv_dirty_bitmap_m

[Qemu-devel] [PATCH v2 01/12] dirty-bitmap: Report BlockDirtyInfo.count in bytes, as documented

2017-05-16 Thread Eric Blake
We've been documenting the value in bytes since its introduction in commit b9a9b3a4 (v1.3), where it was actually reported in bytes. Commit e4654d2 (v2.0) then removed things from block/qapi.c, in preparation for a rewrite to a list of dirty sectors in the next commit 21b5683 in block.c, but the n

Re: [Qemu-devel] [PATCH] nvme: Add support for Controller Memory Buffers

2017-05-16 Thread Keith Busch
On Tue, May 16, 2017 at 01:10:59PM -0600, sba...@raithlin.com wrote: > From: Stephen Bates > > Implement NVMe Controller Memory Buffers (CMBs) which were added in > version 1.2 of the NVMe Specification. This patch adds an optional > argument (cmb_size_mb) which indicates the size of the CMB (in

Re: [Qemu-devel] [PATCH] SMM: disable smram region if smm is disabled

2017-05-16 Thread Xu, Anthony
> On 16/05/2017 03:21, Anthony Xu wrote: > > when smm is disabled, smram is not used, so disable it > > > > Signed-off-by: Anthony Xu > > What is the benefit? This patch removes 1 memory region for i440 platform and 3 memory regions for q35 platform. That makes functions which iterates memory reg

Re: [Qemu-devel] [PATCH] target/i386: enable A20 automatically in system management mode

2017-05-16 Thread Xu, Anthony
> On Sat, May 13, 2017 at 01:24:30AM +, Xu, Anthony wrote: > > I think it is related to accel and platform, the result I gave before is > > for q35 > tcg, > > > > With the above change, I got below data > > > > Platformaccel count of restoring A20 to 0 > > Q35 kvm

[Qemu-devel] [PULL 4/4] xen: call qemu_set_cloexec instead of fcntl

2017-05-16 Thread Stefano Stabellini
Use the common utility function, which contains checks on return values and first calls F_GETFD as recommended by POSIX.1-2001, instead of manually calling fcntl. CID: 1374831 Signed-off-by: Stefano Stabellini Reviewed-by: Eric Blake Reviewed-by: Greg Kurz CC: anthony.per...@citrix.com CC: gr.

[Qemu-devel] [PULL 3/4] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity

2017-05-16 Thread Stefano Stabellini
CID: 1374836 Signed-off-by: Stefano Stabellini Reviewed-by: Eric Blake Reviewed-by: Greg Kurz CC: anthony.per...@citrix.com CC: gr...@kaod.org CC: aneesh.ku...@linux.vnet.ibm.com --- hw/9pfs/xen-9p-backend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9p

[Qemu-devel] [PULL 2/4] configure: Remove -lxencall for Xen detection

2017-05-16 Thread Stefano Stabellini
From: Anthony PERARD QEMU does not depends on libxencall, it was added because it was a missing link dependency of libxendevicemodel, but now the later should be built properly. Signed-off-by: Anthony PERARD Reviewed-by: Stefano Stabellini --- configure | 2 +- 1 file changed, 1 insertion(+),

[Qemu-devel] [PULL 1/4] xen/mapcache: store dma information in revmapcache entries for debugging

2017-05-16 Thread Stefano Stabellini
The Xen mapcache is able to create long term mappings, they are called "locked" mappings. The third parameter of the xen_map_cache call specifies if a mapping is a "locked" mapping. >From the QEMU point of view there are two kinds of long term mappings: [a] device memory mappings, such as option

  1   2   3   >