Re: [Qemu-devel] [PATCH for-2.10 2/8] ppc/xics: add an ics_eoi() handler to XICSFabric

2017-03-13 Thread David Gibson
On Wed, Mar 08, 2017 at 11:52:45AM +0100, Cédric Le Goater wrote: > This handler will be required by PowerPC machines using multiple ICS > objects, like this is the case for PowerNV. Also update the sPAPR > machine to use the new handler. > > Signed-off-by: Cédric Le Goater I

Re: [Qemu-devel] [PATCH for-2.10 5/8] ppc/pnv: map the ICP memory regions

2017-03-13 Thread David Gibson
On Wed, Mar 08, 2017 at 11:52:48AM +0100, Cédric Le Goater wrote: > and populate the device tree accordingly for the guest to start using > interrupts. This also links the ICP object to its associated CPUState > (only used by KVM to control the kernel vCPU). > > Signed-off-by: Cédric Le Goater

Re: [Qemu-devel] [PATCH for-2.10 4/8] ppc/pnv: add memory regions for the ICP registers

2017-03-13 Thread David Gibson
On Wed, Mar 08, 2017 at 11:52:47AM +0100, Cédric Le Goater wrote: > This provides to a PowerNV chip (POWER8) access to the Interrupt > Management area, which contains the registers of the Interrupt Control > Presenters of each thread. These are used to accept, return, forward > interrupts in the

Re: [Qemu-devel] [PATCH for-2.10 1/8] ppc/xics: add a xics_get_cpu_index_by_pir() helper

2017-03-13 Thread David Gibson
On Wed, Mar 08, 2017 at 11:52:44AM +0100, Cédric Le Goater wrote: > This helper will be used to translate the server number of the XIVE > (which is a PIR) into an ICPState index number (which is a cpu index). > > Signed-off-by: Cédric Le Goater This seems a slightly roundabout

[Qemu-devel] [PATCHv2 for-2.10 5/5] pseries: Allow HPT resizing with KVM

2017-03-13 Thread David Gibson
So far, qemu implements the PAPR Hash Page Table (HPT) resizing extension with TCG. The same implementation will work with KVM PR, but we don't currently allow that. For KVM HV we can only implement resizing with the assistance of the host kernel, which needs a new capability and ioctl()s. This

[Qemu-devel] [PATCHv2 for-2.10 0/5] HPT resizing for PAPR guests

2017-03-13 Thread David Gibson
These patches implement a PAPR extension to allow 'pseries' machine type guests to resize their hashed page table (HPT). This allows for more flexible memory hotplug, because we don't need to size the initial HPT for the maximum memory size. That's particularly valuable with (HV) KVM, since the

[Qemu-devel] [PATCHv2 for-2.10 4/5] pseries: Use smaller default hash page tables when guest can resize

2017-03-13 Thread David Gibson
We've now implemented a PAPR extension allowing PAPR guest to resize their hash page table (HPT) during runtime. This patch makes use of that facility to allocate smaller HPTs by default. Specifically when a guest is aware of the HPT resize facility, qemu sizes the HPT to the initial memory size,

[Qemu-devel] [PATCHv2 for-2.10 2/5] pseries: Implement HPT resizing

2017-03-13 Thread David Gibson
This patch implements hypercalls allowing a PAPR guest to resize its own hash page table. This will eventually allow for more flexible memory hotplug. The implementation is partially asynchronous, handled in a special thread running the hpt_prepare_thread() function. The state of a pending

[Qemu-devel] [PATCHv2 for-2.10 1/5] pseries: Stubs for HPT resizing

2017-03-13 Thread David Gibson
This introduces stub implementations of the H_RESIZE_HPT_PREPARE and H_RESIZE_HPT_COMMIT hypercalls which we hope to add in a PAPR extension to allow run time resizing of a guest's hash page table. It also adds a new machine property for controlling whether this new facility is available. For

[Qemu-devel] [PATCHv2 for-2.10 3/5] pseries: Enable HPT resizing for 2.10

2017-03-13 Thread David Gibson
We've now implemented a PAPR extensions which allows PAPR guests (i.e. "pseries" machine type) to resize their hash page table during runtime. However, that extension is only enabled if explicitly chosen on the command line. This patch enables it by default for spapr-2.10, but leaves it disabled

Re: [Qemu-devel] [PATCH v1 2/2] reduce qemu's heap Rss size from 12252kB to 2752KB

2017-03-13 Thread Xu, Anthony
> > > Subpages never have subregions, so the loop never runs. The > begin/commit > > > pair then becomes: > > > > > > ++memory_region_transaction_depth; > > > --memory_region_transaction_depth; > > > if (!memory_region_transaction_depth) { > > > if

Re: [Qemu-devel] [PATCH for-2.10 2/5] pseries: Implement HPT resizing

2017-03-13 Thread David Gibson
On Fri, Mar 10, 2017 at 03:37:16PM +0530, Bharata B Rao wrote: > On Fri, Mar 10, 2017 at 6:43 AM, David Gibson > wrote: > > > This patch implements hypercalls allowing a PAPR guest to resize its own > > hash page table. This will eventually allow for more flexible

Re: [Qemu-devel] [RFC PATCH qemu] dtc: Allow compiling with old gcc

2017-03-13 Thread David Gibson
On Thu, Mar 09, 2017 at 07:43:07AM +0100, Peter Maydell wrote: > On 9 March 2017 at 02:31, David Gibson wrote: > > Yes. I've now fixed this in upstream libfdt, at Paolo's suggestion. > > Unfortunately, it came just after the 1.4.3 release. I was just leery > > about

[Qemu-devel] [PULL 3/4] pseries: Don't expose PCIe extended config space on older machine types

2017-03-13 Thread David Gibson
bb9986452 "spapr_pci: Advertise access to PCIe extended config space" allowed guests to access the extended config space of PCI Express devices via the PAPR interfaces, even though the paravirtualized bus mostly acts like plain PCI. However, that patch enabled access unconditionally, including

[Qemu-devel] [PULL 0/4] ppc-for-2.9 queue 20170314

2017-03-13 Thread David Gibson
The following changes since commit 5bac3c39c82e149515c10643acafd1d292433775: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2017-03-13 15:08:01 +) are available in the git repository at: git://github.com/dgibson/qemu.git tags/ppc-for-2.9-20170314 for you

[Qemu-devel] [PULL 1/4] target/ppc: Fix wrong number of UAMR register

2017-03-13 Thread David Gibson
From: Thomas Huth The SPR UAMR has the number 13, and not 12. (Fortunately it seems like Linux is not using this register yet - only the privileged version with number 29 ... that's why nobody noticed this problem yet) Signed-off-by: Thomas Huth

[Qemu-devel] [PULL 4/4] dtc: Update submodule to avoid build errors

2017-03-13 Thread David Gibson
The currently included version of the dtc/libfdt submodule has some build errors on certain distributions (including RHEL7). This is due to some poorly named macros in libfdt.h; they're designed for use with the sparse static checker, but use reserved names which conflict with some symbols in the

[Qemu-devel] [PULL 2/4] target/ppc: fix cpu_ov setting for 32-bit

2017-03-13 Thread David Gibson
From: Nikunj A Dadhania A bug was introduced in following commit: dc0ad84 target/ppc: update overflow flags for add/sub As for 32-bit ppc target extracting bit 63 for overflow is not correct. Made it dependent on TARGET_LOG_BITS. This had broken booting MacOS

[Qemu-devel] [PATCH for-2.10 1/1] scripts/update-linux-headers.sh: refactor extra files

2017-03-13 Thread Sam Bobroff
update-linux-headers.sh now has enough code in it to suggest some refactoring. Parameterize some of it to make adding new files a bit easier. Signed-off-by: Sam Bobroff --- scripts/update-linux-headers.sh | 44 ++--- 1 file changed,

[Qemu-devel] [PATCH for-2.10 0/1] scripts/update-linux-headers.sh: refactor extra files

2017-03-13 Thread Sam Bobroff
Hi QEMU devs, While doing some other work, I needed to update the update-linux-headers.sh script to handle some new files and it seemed like it was getting big enough to need a little refactoring. The actual files have already been added (on master) but here's the refactoring because it might

[Qemu-devel] [PATCH Risu v2 0/3] PPC64 Improvements

2017-03-13 Thread Programmingkid
On Mar 9, 2017, at 3:08 PM, qemu-devel-requ...@nongnu.org wrote: > v2: > - applied code review > > This patchset include initial support to PPC64 (Big-Endian), that is pretty > much the same: only some fixes in configure and risugen. > Also, it adds a better random initialization of VSX

Re: [Qemu-devel] [PATCH RFC 1/1] block: Handle NULL options correctly in raw_open

2017-03-13 Thread Dong Jia Shi
* Kevin Wolf [2017-03-13 11:15:22 +0100]: > Am 13.03.2017 um 04:31 hat Dong Jia Shi geschrieben: > > * Dong Jia Shi [2017-03-08 17:31:05 +0800]: > > > > > * Kevin Wolf [2017-03-08 10:13:46 +0100]: > > > > > > > Am 08.03.2017 um

[Qemu-devel] [PATCH V3 3/3] virtio: validate address space cache during init

2017-03-13 Thread Jason Wang
We don't check the return value of address_space_cache_init(), this may lead buggy driver use incorrect region caches. Instead of triggering an assert, catch and warn this early in virtio_init_region_cache(). Cc: Cornelia Huck Cc: Paolo Bonzini

[Qemu-devel] [PATCH V3 1/3] virtio: guard against NULL pfn

2017-03-13 Thread Jason Wang
To avoid access stale memory region cache after reset, this patch check the existence of virtqueue pfn for all exported virtqueue access helpers before trying to use them. Cc: Cornelia Huck Cc: Paolo Bonzini Signed-off-by: Jason Wang

[Qemu-devel] [PATCH V3 2/3] virtio: destroy region cache during reset

2017-03-13 Thread Jason Wang
We don't destroy region cache during reset which can make the maps of previous driver leaked to a buggy or malicious driver that don't set vring address before starting to use the device. Fix this by destroy the region cache during reset and validate it before trying to see them. Cc: Cornelia

[Qemu-devel] [PATCH V3 0/3] Several fixes for virito region caches

2017-03-13 Thread Jason Wang
Hi: This series contains several fixes for virito region caches, please review. Thanks. Jason Wang (3): virtio: guard against NULL pfn virtio: destroy region cache during reset virtio: validate address space cache during init hw/virtio/virtio.c | 105

Re: [Qemu-devel] [PATCH 0/3] ide: ahci: fix memory leak in device unit

2017-03-13 Thread Li Qiang
Hello John, Does this patch go to upstream? Thanks. 2017-03-04 6:48 GMT+08:00 John Snow : > > > On 03/02/2017 05:08 AM, Li Qiang wrote: > > As the pci ahci can be hotplug and unplug, in the ahci unrealize > > function it should free all the resource once allocated in the > >

[Qemu-devel] [PATCH RFC 3/3] qemu-io: Add --unsafe-read option

2017-03-13 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-io.c | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 427cbae..f3616ee 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -53,7 +53,8 @@ static const cmdinfo_t close_cmd = {

[Qemu-devel] [PATCH RFC 0/3] block: Backdoor to skip image locking in qemu-io/qemu-img

2017-03-13 Thread Fam Zheng
Hi Kevin, This tries to capture your idea to add a explicit command option in qemu-io and qemu-img for user to specify "expect inconsistent data when reading image". It's stored as a BDRV_O_ flag internally, I don't know if there is a cleaner way or not. It's depended on by image locking series

[Qemu-devel] [PATCH RFC 2/3] qemu-img: Add --unsafe-read option to subcommands

2017-03-13 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-img.c | 148 +++-- 1 file changed, 114 insertions(+), 34 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 98b836b..3aaa254 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -273,12

[Qemu-devel] [PATCH RFC 1/3] block: Introduce BDRV_O_UNSAFE_READ

2017-03-13 Thread Fam Zheng
This flag clears out the "consistent read" permission that blk_new_open requests. Signed-off-by: Fam Zheng --- block/block-backend.c | 2 +- include/block/block.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c

Re: [Qemu-devel] [PATCH V2 1/3] virtio: guard against NULL pfn

2017-03-13 Thread Jason Wang
On 2017年03月13日 18:18, Paolo Bonzini wrote: On 13/03/2017 10:55, Cornelia Huck wrote: On Mon, 13 Mar 2017 14:29:41 +0800 Jason Wang wrote: To avoid access stale memory region cache after reset, this patch check the existence of virtqueue pfn for all exported virtqueue

[Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-13 Thread Fam Zheng
bdrv_child_set_perm alone is not very usable because the caller must call bdrv_child_check_perm first. This is already encapsulated conveniently in bdrv_child_try_set_perm, so remove the other prototypes from the header and fix the one wrong caller, block/mirror.c. Signed-off-by: Fam Zheng

Re: [Qemu-devel] [PATCH V2 2/3] virtio: destroy region cache during reset

2017-03-13 Thread Jason Wang
On 2017年03月13日 18:20, Paolo Bonzini wrote: On 13/03/2017 11:05, Cornelia Huck wrote: On Mon, 13 Mar 2017 14:29:42 +0800 Jason Wang wrote: We don't destroy region cache during reset which can make the maps of previous driver leaked to a buggy or malicious driver that

Re: [Qemu-devel] [PATCH V2 2/3] virtio: destroy region cache during reset

2017-03-13 Thread Jason Wang
On 2017年03月13日 18:05, Cornelia Huck wrote: On Mon, 13 Mar 2017 14:29:42 +0800 Jason Wang wrote: We don't destroy region cache during reset which can make the maps of previous driver leaked to a buggy or malicious driver that don't set vring address before starting to

Re: [Qemu-devel] [PATCH V2 1/3] virtio: guard against NULL pfn

2017-03-13 Thread Jason Wang
On 2017年03月13日 17:55, Cornelia Huck wrote: On Mon, 13 Mar 2017 14:29:41 +0800 Jason Wang wrote: To avoid access stale memory region cache after reset, this patch check the existence of virtqueue pfn for all exported virtqueue access helpers before trying to use them.

[Qemu-devel] [PATCH v2] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Chao Fan
In function cpu_physical_memory_sync_dirty_bitmap, file include/exec/ram_addr.h: if (src[idx][offset]) { unsigned long bits = atomic_xchg([idx][offset], 0); unsigned long new_dirty; new_dirty = ~dest[k]; dest[k] |= bits; new_dirty &= bits; num_dirty += ctpopl(new_dirty); }

Re: [Qemu-devel] [PATCH] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Chao Fan
On Tue, Mar 14, 2017 at 09:41:30AM +0800, Li Zhijian wrote: > > >On 03/14/2017 09:26 AM, Chao Fan wrote: >> In function cpu_physical_memory_sync_dirty_bitmap, file >> include/exec/ram_addr.h: >> >> if (src[idx][offset]) { >> unsigned long bits = atomic_xchg([idx][offset], 0); >> unsigned

Re: [Qemu-devel] [PATCH] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Li Zhijian
On 03/14/2017 09:26 AM, Chao Fan wrote: In function cpu_physical_memory_sync_dirty_bitmap, file include/exec/ram_addr.h: if (src[idx][offset]) { unsigned long bits = atomic_xchg([idx][offset], 0); unsigned long new_dirty; new_dirty = ~dest[k]; dest[k] |= bits; new_dirty &=

[Qemu-devel] [PATCH] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Chao Fan
In function cpu_physical_memory_sync_dirty_bitmap, file include/exec/ram_addr.h: if (src[idx][offset]) { unsigned long bits = atomic_xchg([idx][offset], 0); unsigned long new_dirty; new_dirty = ~dest[k]; dest[k] |= bits; new_dirty &= bits; num_dirty += ctpopl(new_dirty); }

Re: [Qemu-devel] [PULL 15/17] spapr_pci: Advertise access to PCIe extended config space

2017-03-13 Thread David Gibson
On Fri, Mar 10, 2017 at 04:25:21PM +0100, Andrea Bolognani wrote: > On Fri, 2017-03-03 at 14:25 +1100, David Gibson wrote: > > The (paravirtual) PCI host bridge on the 'pseries' machine in most > > regards acts like a regular PCI bus, rather than a PCIe bus.  Despite > > this, though, it does

Re: [Qemu-devel] [PATCH fix for-2.9] target/ppc: fix cpu_ov setting for 32-bit

2017-03-13 Thread David Gibson
On Mon, Mar 13, 2017 at 03:01:04PM +0530, Nikunj A Dadhania wrote: > A bug was introduced in following commit: > > dc0ad84 target/ppc: update overflow flags for add/sub > > As for 32-bit ppc target extracting bit 63 for overflow is not correct. > Made it dependent on TARGET_LOG_BITS. This

Re: [Qemu-devel] [PATCH v3] xen: don't save/restore the physmap on VM save/restore

2017-03-13 Thread Igor Druzhinin
On 13/03/17 21:15, Stefano Stabellini wrote: > On Mon, 13 Mar 2017, Igor Druzhinin wrote: >> Saving/restoring the physmap to/from xenstore was introduced to >> QEMU majorly in order to cover up the VRAM region restore issue. >> The sequence of restore operations implies that we should know >> the

[Qemu-devel] [PATCH v2 8/9] xen/9pfs: send responses back to the frontend

2017-03-13 Thread Stefano Stabellini
Once a request is completed, xen_9pfs_push_and_notify gets called. In xen_9pfs_push_and_notify, update the indexes (data has already been copied to the sg by the common code) and send a notification to the frontend. Schedule the bottom-half to check if we already have any other requests pending.

[Qemu-devel] [PATCH v2 6/9] xen/9pfs: receive requests from the frontend

2017-03-13 Thread Stefano Stabellini
Upon receiving an event channel notification from the frontend, schedule the bottom half. From the bottom half, read one request from the ring, create a pdu and call pdu_submit to handle it. For now, only handle one request per ring at a time. Signed-off-by: Stefano Stabellini

[Qemu-devel] [PATCH v2 7/9] xen/9pfs: implement in/out_iov_from_pdu and vmarshal/vunmarshal

2017-03-13 Thread Stefano Stabellini
Implement xen_9pfs_init_in/out_iov_from_pdu and xen_9pfs_pdu_vmarshal/vunmarshall by creating new sg pointing to the data on the ring. This is safe as we only handle one request per ring at any given time. Signed-off-by: Stefano Stabellini CC: anthony.per...@citrix.com CC:

[Qemu-devel] [PATCH v2 4/9] xen/9pfs: introduce Xen 9pfs backend

2017-03-13 Thread Stefano Stabellini
Introduce the Xen 9pfs backend: add struct XenDevOps to register as a Xen backend and add struct V9fsTransport to register as v9fs transport. All functions are empty stubs for now. Signed-off-by: Stefano Stabellini Reviewed-by: Greg Kurz CC:

[Qemu-devel] [PATCH v2 2/9] xen: import ring.h from xen

2017-03-13 Thread Stefano Stabellini
Do not use the ring.h header installed on the system. Instead, import the header into the QEMU codebase. This avoids problems when QEMU is built against a Xen version too old to provide all the ring macros. Signed-off-by: Stefano Stabellini CC: anthony.per...@citrix.com CC:

[Qemu-devel] [PATCH v2 9/9] xen/9pfs: build and register Xen 9pfs backend

2017-03-13 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini Reviewed-by: Greg Kurz CC: anthony.per...@citrix.com CC: jgr...@suse.com CC: Aneesh Kumar K.V CC: Greg Kurz --- hw/9pfs/Makefile.objs| 1 + hw/xen/xen_backend.c

[Qemu-devel] [PATCH v2 1/9] configure: change CONFIG_XEN_BACKEND to be a target property

2017-03-13 Thread Stefano Stabellini
CONFIG_XEN_BACKEND is currently set when the host supports Xen, regardless of the chosen targets. As a consequence, Xen backends can be enabled even on targets that don't support Xen. Fix the issue by setting CONFIG_XEN_BACKEND only for targets that support Xen. Signed-off-by: Stefano Stabellini

[Qemu-devel] [PATCH v2 5/9] xen/9pfs: connect to the frontend

2017-03-13 Thread Stefano Stabellini
Write the limits of the backend to xenstore. Connect to the frontend. Upon connection, allocate the rings according to the protocol specification. Initialize a QEMUBH to schedule work upon receiving an event channel notification from the frontend. Signed-off-by: Stefano Stabellini

[Qemu-devel] [PATCH v2 3/9] xen: introduce the header file for the Xen 9pfs transport protocol

2017-03-13 Thread Stefano Stabellini
It uses the new ring.h macros to declare rings and interfaces. Signed-off-by: Stefano Stabellini CC: anthony.per...@citrix.com CC: jgr...@suse.com --- hw/9pfs/xen_9pfs.h | 20 1 file changed, 20 insertions(+) create mode 100644 hw/9pfs/xen_9pfs.h diff

[Qemu-devel] [PATCH v2 0/9] xen/9pfs: introduce the Xen 9pfs backend

2017-03-13 Thread Stefano Stabellini
Hi all, This patch series implements a new transport for 9pfs, aimed at Xen systems. The transport is based on a traditional Xen frontend and backend drivers pair. This patch series implements the backend, which typically runs in Dom0. I sent another series to implement the frontend in Linux

Re: [Qemu-devel] [PATCH 3/8] xen/9pfs: introduce Xen 9pfs backend

2017-03-13 Thread Stefano Stabellini
On Fri, 10 Mar 2017, Greg Kurz wrote: > On Thu, 9 Mar 2017 18:54:26 +0100 > Greg Kurz wrote: > > > On Mon, 6 Mar 2017 18:12:43 -0800 > > Stefano Stabellini wrote: > > > > > Introduce the Xen 9pfs backend: add struct XenDevOps to register as a > > > Xen

Re: [Qemu-devel] [PATCH for-2.9 06/47] qapi: Have each QAPI schema declare its name rule violations

2017-03-13 Thread Eric Blake
On 03/13/2017 01:18 AM, Markus Armbruster wrote: > qapi.py has a hardcoded white-list of type names that may violate the > rule on use of upper and lower case. Add a new pragma directive > 'name-case-whitelist', and use it to replace the hard-coded > white-list. > > Signed-off-by: Markus

Re: [Qemu-devel] [PATCH for-2.9 05/47] qapi: Have each QAPI schema declare its returns white-list

2017-03-13 Thread Eric Blake
On 03/13/2017 01:18 AM, Markus Armbruster wrote: > qapi.py has a hardcoded white-list of command names that may violate > the rules on permitted return types. Add a new pragma directive > 'returns-whitelist', and use it to replace the hard-coded white-list. So now the list is per-client, rather

Re: [Qemu-devel] [PATCH v6 09/10] blkdebug: Add ability to override unmap geometries

2017-03-13 Thread Max Reitz
On 08.03.2017 03:54, Eric Blake wrote: > Make it easier to simulate various unusual hardware setups (for > example, recent commits 3482b9b and b8d0a98 affect the Dell > Equallogic iSCSI with its 15M preferred and maximum unmap and > write zero sizing, or b2f95fe deals with the Linux loopback >

Re: [Qemu-devel] [PATCH v6 07/10] blkdebug: Add pass-through write_zero and discard support

2017-03-13 Thread Max Reitz
On 08.03.2017 03:54, Eric Blake wrote: > In order to test the effects of artificial geometry constraints > on operations like write zero or discard, we first need blkdebug > to manage these actions. It also allows us to inject errors on > those operations, just like we can for read/write/flush. >

Re: [Qemu-devel] [PATCH for-2.9 04/47] docs/qapi-code-gen.txt: Drop confusing reference to 'gen'

2017-03-13 Thread Eric Blake
On 03/13/2017 01:18 AM, Markus Armbruster wrote: > Section "Commands" qualifies its rules on permitted argument and > return types "with one exception noted below when 'gen' is used". The > note went away in commit 2d21291. Clean up the dangling references. > > Signed-off-by: Markus Armbruster

Re: [Qemu-devel] [PATCH v6 06/10] blkdebug: Refactor error injection

2017-03-13 Thread Max Reitz
On 08.03.2017 03:54, Eric Blake wrote: > Rather than repeat the logic at each caller of checking if a Rule > exists that warrants an error injection, fold that logic into > inject_error(); and rename it to rule_check() for legibility. > This will help the next patch, which adds two more callers

Re: [Qemu-devel] [PATCH v6 03/10] qcow2: Assert that cluster operations are aligned

2017-03-13 Thread Max Reitz
On 08.03.2017 03:54, Eric Blake wrote: > qcow2_discard_clusters() is set up to silently ignore sub-cluster > head or tail on unaligned requests. However, it is easy to audit > the various callers: qcow2_snapshot_create() has always passed > aligned data since the call was introduced in 1ebf561; >

Re: [Qemu-devel] [PATCH] vfio pci: kernel support of error recovery only for non fatal error

2017-03-13 Thread Alex Williamson
On Mon, 27 Feb 2017 15:28:43 +0800 Cao jin wrote: > 0. What happens now (PCIE AER only) >Fatal errors cause a link reset. >Non fatal errors don't. >All errors stop the VM eventually, but not immediately >because it's detected and reported asynchronously.

Re: [Qemu-devel] [PATCH v6 02/10] iotests: Improve image-clear tests on non-aligned image

2017-03-13 Thread Max Reitz
On 08.03.2017 03:54, Eric Blake wrote: > Tweak 097 and 176 to operate on an image that is not cluster-aligned, > to give further coverage of clearing out an entire image. > > Signed-off-by: Eric Blake > > --- > v6: new patch > --- > tests/qemu-iotests/097 | 7 --- >

[Qemu-devel] [PATCH for-2.10 15/16] iotests: Add preallocated resize test for raw

2017-03-13 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/106 | 92 ++ tests/qemu-iotests/106.out | 50 + tests/qemu-iotests/group | 1 + 3 files changed, 143 insertions(+) create mode 100755

[Qemu-devel] [PATCH for-2.10 14/16] block/qcow2: falloc/full preallocating growth

2017-03-13 Thread Max Reitz
Implement the preallocation modes falloc and full for growing qcow2 images. Signed-off-by: Max Reitz --- block/qcow2.c | 36 +++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index

Re: [Qemu-devel] Dual userfaultfd behavior

2017-03-13 Thread Andrea Arcangeli
Hello, On Mon, Mar 13, 2017 at 10:53:39AM +, Dr. David Alan Gilbert wrote: > * Alexey Perevalov (a.pereva...@samsung.com) wrote: > > Hi, David, Andrea and Mike > > Hi Alexey, > > > The problem I want to discuss it's 1G hugepage based VM and post copy live > > migration. > > > > I would

[Qemu-devel] [PATCH for-2.10 12/16] block/qcow2: Extract qcow2_calc_size_usage()

2017-03-13 Thread Max Reitz
We will need very similar functionality for full/falloc preallocation in qcow2_truncate(). Although we will not be able to reuse much of the actual code, it still makes sense to keep all of this in one place. Signed-off-by: Max Reitz --- block/qcow2.c | 126

[Qemu-devel] [PATCH for-2.10 13/16] block/qcow2: qcow2_calc_size_usage() for truncate

2017-03-13 Thread Max Reitz
This patch extends qcow2_calc_size_usage() so it can calculate the additional space needed for preallocating image growth. Signed-off-by: Max Reitz --- block/qcow2.c | 137 +- 1 file changed, 98 insertions(+), 39

[Qemu-devel] [PATCH for-2.10 16/16] iotests: Add preallocated growth test for qcow2

2017-03-13 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/125 | 130 +++ tests/qemu-iotests/125.out | 386 + tests/qemu-iotests/group | 1 + 3 files changed, 517 insertions(+) create mode 100755 tests/qemu-iotests/125

[Qemu-devel] [PATCH for-2.10 11/16] block/qcow2: Metadata preallocation for truncate

2017-03-13 Thread Max Reitz
We can support PREALLOC_MODE_METADATA by invoking preallocate() in qcow2_truncate(). Signed-off-by: Max Reitz --- block/qcow2.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index

[Qemu-devel] [PATCH for-2.10 09/16] block/qcow2: Generalize preallocate()

2017-03-13 Thread Max Reitz
This patch adds two new parameters to the preallocate() function so we will be able to use it not just for preallocating a new image but also for preallocated image growth. The offset parameter allows the caller to specify a virtual offset from which to start preallocating. For newly created

[Qemu-devel] [PATCH for-2.10 06/16] block/file-posix: Extract raw_regular_truncate()

2017-03-13 Thread Max Reitz
This functionality is part of raw_create() which we will be able to reuse nicely in raw_truncate(). Signed-off-by: Max Reitz --- block/file-posix.c | 144 + 1 file changed, 78 insertions(+), 66 deletions(-) diff --git

[Qemu-devel] [PATCH for-2.10 10/16] block/qcow2: Lock s->lock in preallocate()

2017-03-13 Thread Max Reitz
preallocate() is and will be called only from places that do not lock s->lock: Currently that is qcow2_create2(), as of a future patch it will be called from qcow2_truncate(), too. It therefore makes sense to move locking that mutex into preallocate() itself. Signed-off-by: Max Reitz

[Qemu-devel] [PATCH for-2.10 03/16] block: Add PreallocMode to blk_truncate()

2017-03-13 Thread Max Reitz
blk_truncate() itself will pass that value to bdrv_truncate(), and all callers of blk_truncate() just set the parameter to PREALLOC_MODE_OFF for now. Signed-off-by: Max Reitz --- include/sysemu/block-backend.h | 3 ++- block/block-backend.c | 5 +++-- block/commit.c

[Qemu-devel] [PATCH for-2.10 08/16] block/file-posix: Preallocation for truncate

2017-03-13 Thread Max Reitz
By using raw_regular_truncate() in raw_truncate(), we can now easily support preallocation. Signed-off-by: Max Reitz --- block/file-posix.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c

[Qemu-devel] [PATCH for-2.10 05/16] block/file-posix: Small fixes in raw_create()

2017-03-13 Thread Max Reitz
Variables should be declared at the start of a block, and if a certain parameter value is not supported it may be better to return -ENOTSUP instead of -EINVAL. Signed-off-by: Max Reitz --- block/file-posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH for-2.10 02/16] block: Add PreallocMode to bdrv_truncate()

2017-03-13 Thread Max Reitz
For block drivers that just pass a truncate request to the underlying protocol, we can now pass the preallocation mode instead of aborting if it is not PREALLOC_MODE_OFF. Signed-off-by: Max Reitz --- include/block/block.h | 3 ++- block.c| 12 +---

[Qemu-devel] [PATCH for-2.10 04/16] qemu-img: Expose PreallocMode for resizing

2017-03-13 Thread Max Reitz
Add a --preallocation command line option to qemu-img resize which can be used to set the PreallocMode parameter of blk_truncate(). Signed-off-by: Max Reitz --- qemu-img.c| 33 ++--- qemu-img.texi | 7 ++- 2 files changed, 36

[Qemu-devel] [PATCH for-2.10 07/16] block/file-posix: Generalize raw_regular_truncate

2017-03-13 Thread Max Reitz
Currently, raw_regular_truncate() is intended for setting the size of a newly created file. However, we also want to use it for truncating an existing file in which case only the newly added space (when growing) should be preallocated. This also means that if resizing failed, we should try to

[Qemu-devel] [PATCH for-2.10 00/16] block: Preallocated truncate

2017-03-13 Thread Max Reitz
=== Series dependencies === This series is based on Kevin's block-next branch rebased onto master with v2 of my "block: Add errp to b{lk,drv}_truncate()" series applied on top. === Actual cover letter === This series adds preallocation to bdrv_truncate() and subsequently qemu-img resize. This

[Qemu-devel] [PATCH for-2.10 01/16] block: Add PreallocMode to BD.bdrv_truncate()

2017-03-13 Thread Max Reitz
Add a PreallocMode parameter to the bdrv_truncate() function implemented by each block driver. Currently, we always pass PREALLOC_MODE_OFF and no driver accepts anything else. Signed-off-by: Max Reitz --- include/block/block_int.h | 3 ++- block.c | 2 +-

Re: [Qemu-devel] qemu-system-ppc video artifacts since "tcg: drop global lock during TCG code execution"

2017-03-13 Thread Mark Cave-Ayland
On 13/03/17 21:25, Mark Cave-Ayland wrote: > I've recently noticed some video artifacts appearing in the form of > horizontal lines whilst testing OpenBIOS boot on some qemu-system-ppc > images (see https://www.ilande.co.uk/tmp/qemu/macos9-stripe.png for an > example) which I've finally bisected

Re: [Qemu-devel] [PATCH v3] xen: don't save/restore the physmap on VM save/restore

2017-03-13 Thread Stefano Stabellini
On Mon, 13 Mar 2017, Igor Druzhinin wrote: > Saving/restoring the physmap to/from xenstore was introduced to > QEMU majorly in order to cover up the VRAM region restore issue. > The sequence of restore operations implies that we should know > the effective guest VRAM address *before* we have the

Re: [Qemu-devel] [PATCH for-2.9 03/47] qapi: Back out doc comments added just to please qapi.py

2017-03-13 Thread Eric Blake
On 03/13/2017 01:18 AM, Markus Armbruster wrote: > This reverts commit 3313b61's changes to tests/qapi-schema/, except > for tests/qapi-schema/doc-*. > > Signed-off-by: Markus Armbruster > --- Tested by doing: $ git checkout 3313b61 $ git cherry-pick 07c7b92 # the current id

Re: [Qemu-devel] [Qemu-ppc] [PATCH fix for-2.9] target/ppc: fix cpu_ov setting for 32-bit

2017-03-13 Thread Mark Cave-Ayland
On 13/03/17 12:54, Mark Cave-Ayland wrote: > With the patch above I'll try bisecting again later today to try and > understand where these lines are coming from. So far I've spotted them > in MacOS 9 and OS X during tests... Okay - I've completed the bisection, and the artifacts I'm seeing

Re: [Qemu-devel] [PATCH for-2.9 02/47] qapi: Make doc comments optional where we don't need them

2017-03-13 Thread Eric Blake
On 03/13/2017 01:18 AM, Markus Armbruster wrote: > Since we added the documentation generator in commit 3313b61, doc > comments are mandatory. That's a very good idea for a schema that > needs to be documented, but has proven to be annoying for testing. As I've found out while rebasing my JSON

Re: [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures

2017-03-13 Thread Richard Henderson
On 03/14/2017 12:09 AM, Helge Deller wrote: But the main intention of my patch was not to fix MAP_STACK or MAP_HUGETLB, but more to ensure that those flags are avoided to be handed over to the host. For example, TARGET_MAP_STACK is 0x4 on hppa, and if it's not filtered out in e.g. a mmap()

[Qemu-devel] [Bug 1257352] Re: kvm hangs occasionally when switching out of the qemu console

2017-03-13 Thread Edoardo Tirtarahardja
It seems the issue is sdl related to change in sdl window size. If I started qemu and set the monitor (and serial & parallel) to the same VC size, it works much better. Instead of hangs on a 2-3 switches, it may hang after rapid switch of more than 10 times. Btw, it can hang in any windows, i.e.

Re: [Qemu-devel] [PULL RESEND 12/19] vmxnet3: Convert ring values to uint32_t's

2017-03-13 Thread Laurent Vivier
On 06/03/2017 06:25, Jason Wang wrote: > From: "Dr. David Alan Gilbert" > > The index's in the Vmxnet3Ring were migrated as 32bit ints > yet are declared as size_t's. They appear to be derived > from 32bit values loaded from guest memory, so actually > store them as that. >

Re: [Qemu-devel] [PATCH v2 06/30] trace: Fix parameter types in migration

2017-03-13 Thread Eric Blake
On 03/13/2017 03:07 PM, Dr. David Alan Gilbert wrote: > * Eric Blake (ebl...@redhat.com) wrote: >> An upcoming patch will let the compiler warn us when we are silently >> losing precision in traces; update the trace definitions to pass >> through the full value at the callsite. >> >>

[Qemu-devel] [RFC PATCH v2 30/30] trace: Force compiler warnings on trace parameter type mismatches

2017-03-13 Thread Eric Blake
Our traces are processed through a function call (even though the function is static inline). While we could turn up compiler warnings to flag cases of implicit narrowing through a function parameter (such as a caller doing foo(my_uint64_t) to a function prototyped as void foo(int)), it would

[Qemu-devel] [PATCH v2 26/30] trace: Fix parameter types in hw/timer

2017-03-13 Thread Eric Blake
An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite, as well as updating callers to use a consistent type. Signed-off-by: Eric Blake ---

[Qemu-devel] [PATCH v2 24/30] trace: Fix parameter types in hw/sd

2017-03-13 Thread Eric Blake
An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite. Signed-off-by: Eric Blake --- hw/sd/trace-events | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [Qemu-devel] [PATCH v2 06/30] trace: Fix parameter types in migration

2017-03-13 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > An upcoming patch will let the compiler warn us when we are silently > losing precision in traces; update the trace definitions to pass > through the full value at the callsite. > > Signed-off-by: Eric Blake > --- >

[Qemu-devel] [PATCH v2 23/30] trace: Fix parameter types in hw/ppc

2017-03-13 Thread Eric Blake
An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite. Signed-off-by: Eric Blake --- hw/ppc/trace-events | 16 1 file changed, 8

Re: [Qemu-devel] Host kernel panic when shutdown the pass-through QLogic HBA Card VM

2017-03-13 Thread Alex Williamson
On Wed, 8 Mar 2017 10:05:20 + "Gaofeng (GaoFeng, Euler)" wrote: > The pass-through VM make the host kernel panic when it shutdown. > I read the kernel code and find the reason of panic is : > BUG_ON(domain_type_is_vm_or_si(domain)); > in domain_get_iommu function. So

[Qemu-devel] [PATCH v2 16/30] trace: Fix parameter types in hw/i386

2017-03-13 Thread Eric Blake
An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite. Signed-off-by: Eric Blake --- hw/i386/trace-events | 2 +- 1 file changed, 1 insertion(+), 1

[Qemu-devel] [PATCH v2 25/30] trace: Fix parameter types in hw/scsi

2017-03-13 Thread Eric Blake
An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite. Also update some callers to avoid variable-sized dma_addr_t (which cannot be easily used in trace headers) and needless

[Qemu-devel] [PATCH v2 29/30] trace: Fix parameter types in hw/virtio

2017-03-13 Thread Eric Blake
An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite. Signed-off-by: Eric Blake --- hw/virtio/trace-events | 2 +- 1 file changed, 1 insertion(+), 1

[Qemu-devel] [PATCH v2 14/30] trace: Fix parameter types in hw/display

2017-03-13 Thread Eric Blake
An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite. Signed-off-by: Eric Blake --- hw/display/trace-events | 20 ++-- 1 file changed, 10

  1   2   3   4   >