[Qemu-devel] [PULL 0/3] input patch queue

2017-05-03 Thread Gerd Hoffmann
Hi, Input patch queue, with a new tracepoint and two bugfixes (one of them cve). please pull, Gerd The following changes since commit e619b14746e5d8c0e53061661fd0e1da01fd4d60: Merge remote-tracking branch 'sthibault/tags/samuel-thibault' into staging (2017-05-02 15:16:29 +0100) are

[Qemu-devel] [PULL 3/3] input: Add trace event for empty keyboard queue

2017-05-03 Thread Gerd Hoffmann
From: Alexander Graf When driving QEMU from the outside, we have basically no chance to determine how quickly the guest OS picks up key events, so we usually have to limit ourselves to very slow keyboard presses to make sure the guest always has enough chance to pick them up.

[Qemu-devel] [PULL 2/3] input: don't queue delay if paused

2017-05-03 Thread Gerd Hoffmann
From: Marc-André Lureau qemu_input_event_send() discards key event when the guest is paused, but not the delay. The delay ends up in the input queue, and qemu_input_event_send_key() will further fill the queue with upcoming events. VNC uses

[Qemu-devel] [PULL 1/3] input: limit kbd queue depth

2017-05-03 Thread Gerd Hoffmann
Apply a limit to the number of items we accept into the keyboard queue. Impact: Without this limit vnc clients can exhaust host memory by sending keyboard events faster than qemu feeds them to the guest. Fixes: CVE-2017-8379 Cc: P J P Cc: Huawei PSIRT

Re: [Qemu-devel] [PATCH 1/5] hw/ppc: setting spapr_drc_detach_cb in spapr_dr_connector_new

2017-05-03 Thread David Gibson
On Sun, Apr 30, 2017 at 02:25:43PM -0300, Daniel Henrique Barboza wrote: > The idea of moving the detach callback functions to the constructor > of the dr_connector is to set them statically at init time, avoiding > any post-load hooks to restore it (after a migration, for example). > > Summary

[Qemu-devel] [PATCH v2] Fix the -accel parameter and the documentation for 'hax'

2017-05-03 Thread Thomas Huth
Since 'hax' is a possible accelerator nowadays, too, the '-accel' option should support it and we should mention this accelerator in the documentation, too. Signed-off-by: Thomas Huth --- v2: - Use qemu_opt_set() instead of qemu_opts_parse_noisily() - Improve the

Re: [Qemu-devel] [PATCH 0/7] KVM: MMU: fast write protect

2017-05-03 Thread Xiao Guangrong
On 05/03/2017 10:57 PM, Paolo Bonzini wrote: On 03/05/2017 16:50, Xiao Guangrong wrote: Furthermore, userspace has no knowledge about if PML is enable (it can be required from sysfs, but it is a good way in QEMU), so it is difficult for the usespace to know when to use write-protect-all.

[Qemu-devel] 答复: [PATCH v2 05/18] COLO: Handle shutdown command for VMin COLO state

2017-05-03 Thread wang.guang55
hi The patch may cause qemu_system_reset_request call qemu_notify_event() twice. old: void qemu_system_reset_request(void) { if (no_reboot) { shutdown_requested = 1 } else { reset_requested = 1 } cpu_stop_current() qemu_notify_event() } new:

Re: [Qemu-devel] [PATCH 1/5] mc146818rtc: update periodic timer only if it is needed

2017-05-03 Thread Xiao Guangrong
On 05/03/2017 11:42 PM, Paolo Bonzini wrote: On 12/04/2017 11:51, guangrong.x...@gmail.com wrote: From: Xiao Guangrong Currently, the timer is updated whenever RegA or RegB is written even if the periodic timer related configuration is not changed This patch

Re: [Qemu-devel] [PATCH 4/5] mc146818rtc: move x86 specific code out of periodic_timer_update

2017-05-03 Thread Xiao Guangrong
On 05/03/2017 11:39 PM, Paolo Bonzini wrote: On 12/04/2017 11:51, guangrong.x...@gmail.com wrote: From: Xiao Guangrong Move the x86 specific code in periodic_timer_update() to a common place, the actual logic is not changed Signed-off-by: Xiao Guangrong

[Qemu-devel] [PATCH v12 08/10] qcow2: Optimize write zero of unaligned tail cluster

2017-05-03 Thread Eric Blake
We've already improved discards to operate efficiently on the tail of an unaligned qcow2 image; it's time to make a similar improvement to write zeroes. The special case is only valid at the tail cluster of a file, where we must recognize that any sectors beyond the image end would implicitly

[Qemu-devel] [PATCH v12 10/10] qcow2: Discard/zero clusters by byte count

2017-05-03 Thread Eric Blake
Passing a byte offset, but sector count, when we ultimately want to operate on cluster granularity, is madness. Clean up the external interfaces to take both offset and count as bytes, while still keeping the assertion added previously that the caller must align the values to a cluster. Then

[Qemu-devel] [PATCH v12 07/10] iotests: Add test 179 to cover write zeroes with unmap

2017-05-03 Thread Eric Blake
No tests were covering write zeroes with unmap. Additionally, I needed to prove that my previous patches for correct status reporting and write zeroes optimizations actually had an impact. The test works for cluster_size between 8k and 2M (for smaller sizes, it fails because our allocation

[Qemu-devel] [PATCH v12 09/10] qcow2: Assert that cluster operations are aligned

2017-05-03 Thread Eric Blake
We already audited (in commit 0c1bd469) that qcow2_discard_clusters() is only passed cluster-aligned start values; but we can further tighten the assertion that the only unaligned end value is at EOF. Recent commits have taken advantage of an unaligned tail cluster, for both discard and write

[Qemu-devel] [PATCH v12 05/10] qcow2: Optimize zero_single_l2() to minimize L2 churn

2017-05-03 Thread Eric Blake
Similar to discard_single_l2(), we should try to avoid dirtying the L2 cache when the cluster we are changing already has the right characteristics. Note that by the time we get to zero_single_l2(), BDRV_REQ_MAY_UNMAP is a requirement to unallocate a cluster (this is because the block layer

[Qemu-devel] [PATCH v12 01/10] qcow2: Use consistent switch indentation

2017-05-03 Thread Eric Blake
Fix a couple of inconsistent indentations, before an upcoming patch further tweaks the switch statements. While at it, make some tweaks for shorter lines to keep checkpatch happy (best viewed with 'git diff -b'). Signed-off-by: Eric Blake --- v12: new patch ---

[Qemu-devel] [PATCH v12 06/10] iotests: Improve _filter_qemu_img_map

2017-05-03 Thread Eric Blake
Although _filter_qemu_img_map documents that it scrubs offsets, it was only doing so for human mode. Of the existing tests using the filter (97, 122, 150, 154, 176), two of them are affected, but it does not hurt the validity of the tests to not require particular mappings (another test, 66, uses

[Qemu-devel] [PATCH v12 02/10] block: Update comments on BDRV_BLOCK_* meanings

2017-05-03 Thread Eric Blake
We had some conflicting documentation: a nice 8-way table that described all possible combinations of DATA, ZERO, and OFFSET_VALID, contrasted with text that implied that OFFSET_VALID always meant raw data could be read directly. Furthermore, the text refers a lot to bs->file, even though the

[Qemu-devel] [PATCH v12 00/10] qcow2 zero-cluster tweaks [was add blkdebug tests]

2017-05-03 Thread Eric Blake
I've collected several improvements for qcow2 zero-cluster handling. Available as a tag at: git fetch git://repo.or.cz/qemu/ericb.git nbd-blkdebug-v12 Marked as v12 for "hysterical raisins", since it it the half of v10 [1] that was not resubmitted as v11 [2]. Depends on Max's block tree:

[Qemu-devel] [PATCH v12 03/10] qcow2: Correctly report status of preallocated zero clusters

2017-05-03 Thread Eric Blake
We were throwing away the preallocation information associated with zero clusters. But we should be matching the well-defined semantics in bdrv_get_block_status(), where (BDRV_BLOCK_ZERO | BDRV_BLOCK_OFFSET_VALID) informs the user which offset is reserved, while still reminding the user that

[Qemu-devel] [PATCH v12 04/10] qcow2: Make distinction between zero cluster types obvious

2017-05-03 Thread Eric Blake
Treat plain zero clusters differently from allocated ones, so that we can simplify the logic of checking whether an offset is present. Do this by splitting QCOW2_CLUSTER_ZERO into two new enums, QCOW2_CLUSTER_ZERO_PLAIN and QCOW2_CLUSTER_ZERO_ALLOC. I tried to arrange the enum so that we could

Re: [Qemu-devel] [PATCH] tests: acpi: extend cphp and memhp testcase with numa distance check

2017-05-03 Thread He Chen
On Wed, May 03, 2017 at 04:33:04PM -0300, Eduardo Habkost wrote: > On Wed, May 03, 2017 at 03:07:05PM +0200, Igor Mammedov wrote: > > On Wed, 3 May 2017 17:17:16 +0800 > > He Chen wrote: > > > > > Signed-off-by: He Chen > > Reviewed-by: Igor

Re: [Qemu-devel] [PATCH 3/5] mc146818rtc: properly count the time for the next interrupt

2017-05-03 Thread Xiao Guangrong
On 05/03/2017 11:32 PM, Paolo Bonzini wrote: On 12/04/2017 11:51, guangrong.x...@gmail.com wrote: +#ifdef TARGET_I386 +/* + * if more than period clocks were passed, i.e, the timer interrupt + * has been lost, we should catch up the time. + */ +

Re: [Qemu-devel] [PATCH 1/3] colo-compare: serialize compare thread's initialization with main thread

2017-05-03 Thread Hailiang Zhang
Hi Jason, On 2017/4/25 19:33, Jason Wang wrote: On 2017年04月25日 17:59, Hailiang Zhang wrote: On 2017/4/25 16:41, Jason Wang wrote: On 2017年04月24日 14:03, Hailiang Zhang wrote: On 2017/4/24 12:10, Jason Wang wrote: On 2017年04月20日 15:46, zhanghailiang wrote: We call qemu_chr_fe_set_handlers()

Re: [Qemu-devel] [PATCH 2/5] mc146818rtc: fix clock lost after scaling coalesced irq

2017-05-03 Thread Xiao Guangrong
On 05/03/2017 11:15 PM, Paolo Bonzini wrote: On 12/04/2017 11:51, guangrong.x...@gmail.com wrote: +int current_irq_coalesced = s->irq_coalesced; + +s->irq_coalesced = (current_irq_coalesced * s->period) / period; + +/* + * calculate the lost

Re: [Qemu-devel] [PATCH v10 09/17] qcow2: Optimize write zero of unaligned tail cluster

2017-05-03 Thread Eric Blake
On 04/28/2017 04:24 PM, Eric Blake wrote: >>> +echo >>> +echo == unaligned image tail cluster, no allocation needed == >>> + >>> +CLUSTER_SIZE=1024 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024)) >> >> Any reason for the CLUSTER_SIZE? It passes with 64 kB as well, and I >> actually

Re: [Qemu-devel] [PATCH 3/4] qcow2: Discard preallocated zero clusters

2017-05-03 Thread Eric Blake
On 05/03/2017 06:11 PM, Max Reitz wrote: > In discard_single_l2(), we completely discard normal clusters instead of > simply turning them into preallocated zero clusters. That means we > should probably do the same with such preallocated zero clusters: > Discard them instead of keeping them

Re: [Qemu-devel] [PATCH 4/4] iotests: Extend test 066

2017-05-03 Thread Eric Blake
On 05/03/2017 06:11 PM, Max Reitz wrote: > 066 was supposed to be a test "for discarding preallocated zero > clusters", but it did so incompletely: While it did check the image > file's integrity after the operation, it did not confirm that the > clusters are indeed freed. This patch adds this

Re: [Qemu-devel] [PATCH v5 1/5] test-keyval: fix leaks

2017-05-03 Thread Eric Blake
On 05/03/2017 05:38 PM, Marc-André Lureau wrote: > Spotted by ASAN. > > Signed-off-by: Marc-André Lureau > --- > tests/test-keyval.c | 4 > 1 file changed, 4 insertions(+) Reviewed-by: Eric blake > > diff --git a/tests/test-keyval.c

Re: [Qemu-devel] [PATCH 2/4] qcow2: Reuse preallocated zero clusters

2017-05-03 Thread Eric Blake
On 05/03/2017 06:11 PM, Max Reitz wrote: > Instead of just freeing preallocated zero clusters and completely > allocating them from scratch, reuse them. > > We cannot do this in handle_copied(), however, since this is a COW > operation. Therefore, we have to add the new logic to handle_alloc()

Re: [Qemu-devel] [PATCH 1/4] qcow2: Fix preallocation size formula

2017-05-03 Thread Eric Blake
On 05/03/2017 06:11 PM, Max Reitz wrote: > When calculating the number of reftable entries, we should actually use > the number of refblocks and not (wrongly[1]) re-calculate it. > > [1] "Wrongly" means: Dividing the number of clusters by the number of > entries per refblock and rounding down

[Qemu-devel] [PULL v2 07/11] target/openrisc: implement shadow registers

2017-05-03 Thread Stafford Horne
Shadow registers are part of the openrisc spec along with sr[cid], as part of the fast context switching feature. When exceptions occur, instead of having to save registers to the stack if enabled the CID will increment and a new set of registers will be available. This patch only implements

[Qemu-devel] [PULL v2 11/11] target/openrisc: Support non-busy idle state using PMR SPR

2017-05-03 Thread Stafford Horne
The OpenRISC architecture has the Power Management Register (PMR) special purpose register to manage cpu power states. The interesting modes are: * Doze Mode (DME) - Stop cpu except timer & pic - wake on interrupt * Sleep Mode (SME) - Stop cpu and all units - wake on interrupt * Suspend Model

[Qemu-devel] [PULL v2 09/11] target/openrisc: Implement full vmstate serialization

2017-05-03 Thread Stafford Horne
Previously serialization did not persist the tlb, timer, pic and other key state items. This meant snapshotting and restoring a running os would crash. After adding these I am able to take snapshots of a running linux os and restore at a later time. I am currently not trying to maintain

[Qemu-devel] [PULL v2 02/11] target/openrisc: Implement EVBAR register

2017-05-03 Thread Stafford Horne
From: Tim 'mithro' Ansell Exception Vector Base Address Register (EVBAR) - This optional register can be used to apply an offset to the exception vector addresses. The significant bits (31-12) of the vector offset address for each exception depend on the setting of the

[Qemu-devel] [PULL v2 08/11] migration: Add VMSTATE_STRUCT_2DARRAY()

2017-05-03 Thread Stafford Horne
For openrisc we implement tlb state as a 2d array of tlb entry structs. This is added to allow easy storing of state of 2d arrays. Signed-off-by: Stafford Horne --- include/migration/vmstate.h | 18 ++ 1 file changed, 18 insertions(+) diff --git

[Qemu-devel] [PULL v2 10/11] target/openrisc: Remove duplicate features property

2017-05-03 Thread Stafford Horne
The features property has stored the exact same thing as the cpucfgr spr. Remove the feature enum and property as it is not needed. In order to preserve the behavior or keeping features accross reset this patch moves cpucfgr into the non reset region of the state struct. Since the cpucfgr is

[Qemu-devel] [PULL v2 06/11] migration: Add VMSTATE_UINTTL_2DARRAY()

2017-05-03 Thread Stafford Horne
In openRISC we are implementing the shadow registers as a 2d array. Using this target long method rather than direct 32-bit alternatives is consistent with the rest of our vm state serialization logic. Signed-off-by: Stafford Horne --- include/migration/cpu.h | 7 +++ 1

[Qemu-devel] [PULL v2 00/11] Fixes and features for OpenRISC

2017-05-03 Thread Stafford Horne
Hello, This are the openrisc patches I have been circulating on the mailing list of the last few months. We have had help from a few new people and added the following: * Fixes for gdb memory debugging * Added support for Shadow Registers, EVBAR, EPH * Added support for idle state, no more

[Qemu-devel] [PULL v2 04/11] target/openrisc: Fixes for memory debugging

2017-05-03 Thread Stafford Horne
When debugging in gdb you might want to inspect instructions in mapped pages or in exception vectors like 0x800 etc. This was previously not possible in qemu since the *get_phys_page_debug() routine only looked into the data tlb. Change to fall back to look into instruction tlb and plain

[Qemu-devel] [PULL v2 05/11] target/openrisc: add numcores and coreid support

2017-05-03 Thread Stafford Horne
These are used to identify the processor in SMP system. Their definition has been defined in verilog cores but it not yet part of the spec but it will be soon. The proposal for this is available: https://openrisc.io/proposals/core-identifier-and-number-of-cores Reviewed-by: Richard Henderson

[Qemu-devel] [PULL v2 03/11] target/openrisc: Implement EPH bit

2017-05-03 Thread Stafford Horne
From: Tim 'mithro' Ansell Exception Prefix High (EPH) control bit of the Supervision Register (SR). The significant bits (31-12) of the vector offset address for each exception depend on the setting of the Supervision Register (SR)'s EPH bit and the Exception Vector Base

[Qemu-devel] [PULL v2 01/11] MAINTAINERS: Add myself as openrisc maintainer

2017-05-03 Thread Stafford Horne
Jia has claimed he is no longer able to maintain. I have fixing bugs here and there and getting familiar with the code base. Orignal thread from Jia: https://lists.librecores.org/pipermail/openrisc/2017-January/000321.html Signed-off-by: Stafford Horne Reviewed-by: Alex

Re: [Qemu-devel] migration: add incremental drive-mirror and blockdev-mirror with dirtymap

2017-05-03 Thread John Snow
On 05/03/2017 03:56 AM, Daniel Kučera wrote: > Hi all, > > this patch adds possibility to start mirroring since specific dirtyblock > bitmap. > The use-case is, for live migrations with ZFS volume used as block device: > 1. make dirtyblock bitmap in qemu A "block dirty bitmap," I assume you

Re: [Qemu-devel] [Qemu-devel RFC v3 3/5] msf2: Add Smartfusion2 SPI controller

2017-05-03 Thread Alistair Francis
(_On Fri, Apr 28, 2017 at 9:51 AM, Subbaraya Sundeep wrote: > Modelled Microsemi's Smartfusion2 SPI controller. > > Signed-off-by: Subbaraya Sundeep > --- > Hi Peter and Alistair, > > I created two SPI controllers as per SoC spec > in

Re: [Qemu-devel] [Qemu-devel RFC v3 1/5] msf2: Add Smartfusion2 System timer

2017-05-03 Thread Alistair Francis
On Tue, May 2, 2017 at 10:11 PM, sundeep subbaraya wrote: > Hi Alistair, > > On Wed, May 3, 2017 at 3:25 AM, Alistair Francis wrote: >> On Fri, Apr 28, 2017 at 9:51 AM, Subbaraya Sundeep >> wrote: >>> Modelled System Timer in

Re: [Qemu-devel] [PATCH v5 3/5] audio: fix WAVState leak

2017-05-03 Thread Philippe Mathieu-Daudé
On 05/03/2017 07:38 PM, Marc-André Lureau wrote: Spotted by ASAN. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- audio/wavcapture.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/wavcapture.c

Re: [Qemu-devel] [PATCH v5 2/5] audio: fix capture buffer leaks

2017-05-03 Thread Philippe Mathieu-Daudé
Gerd already sent this one few days ago ;) http://lists.nongnu.org/archive/html/qemu-devel/2017-04/msg05587.html On 05/03/2017 07:38 PM, Marc-André Lureau wrote: Spotted by ASAN. Signed-off-by: Marc-André Lureau --- audio/audio.c | 2 ++ 1 file changed, 2

[Qemu-devel] [PATCH 4/4] iotests: Extend test 066

2017-05-03 Thread Max Reitz
066 was supposed to be a test "for discarding preallocated zero clusters", but it did so incompletely: While it did check the image file's integrity after the operation, it did not confirm that the clusters are indeed freed. This patch adds this test. In addition, new cases for writing to

[Qemu-devel] [PATCH 3/4] qcow2: Discard preallocated zero clusters

2017-05-03 Thread Max Reitz
In discard_single_l2(), we completely discard normal clusters instead of simply turning them into preallocated zero clusters. That means we should probably do the same with such preallocated zero clusters: Discard them instead of keeping them allocated. Reported-by: Eric Blake

[Qemu-devel] [PATCH 2/4] qcow2: Reuse preallocated zero clusters

2017-05-03 Thread Max Reitz
Instead of just freeing preallocated zero clusters and completely allocating them from scratch, reuse them. We cannot do this in handle_copied(), however, since this is a COW operation. Therefore, we have to add the new logic to handle_alloc() and simply return the existing offset if it exists.

[Qemu-devel] [PATCH 1/4] qcow2: Fix preallocation size formula

2017-05-03 Thread Max Reitz
When calculating the number of reftable entries, we should actually use the number of refblocks and not (wrongly[1]) re-calculate it. [1] "Wrongly" means: Dividing the number of clusters by the number of entries per refblock and rounding down instead of up. Reported-by: Eric Blake

[Qemu-devel] [PATCH 0/4] qcow2: Some fixes

2017-05-03 Thread Max Reitz
This series contains some fixes for issues reported by Eric. Max Reitz (4): qcow2: Fix preallocation size formula qcow2: Reuse preallocated zero clusters qcow2: Discard preallocated zero clusters iotests: Extend test 066 block/qcow2.h | 3 ++ block/qcow2-cluster.c |

Re: [Qemu-devel] [PATCH v5 0/5] Memory leak fixes

2017-05-03 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Qemu-devel] [PATCH v5 0/5] Memory leak fixes Message-id: 20170503223846.6559-1-marcandre.lur...@redhat.com Type: series === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git log

[Qemu-devel] [PATCH v5 4/5] slirp: fix leak

2017-05-03 Thread Marc-André Lureau
Spotted by ASAN: /x86_64/hmp/pc-0.12: = ==22538==ERROR: LeakSanitizer: detected memory leaks Direct leak of 224 byte(s) in 1 object(s) allocated from: #0 0x7f0f63cdee60 in malloc (/lib64/libasan.so.3+0xc6e60) #1

[Qemu-devel] [PATCH v5 5/5] dump: fix memory_mapping_filter leak

2017-05-03 Thread Marc-André Lureau
Spotted by ASAN. Signed-off-by: Marc-André Lureau --- memory_mapping.c | 1 + 1 file changed, 1 insertion(+) diff --git a/memory_mapping.c b/memory_mapping.c index 6a39d71da2..a5d38552a6 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -337,6 +337,7 @@ void

[Qemu-devel] [PATCH v5 3/5] audio: fix WAVState leak

2017-05-03 Thread Marc-André Lureau
Spotted by ASAN. Signed-off-by: Marc-André Lureau --- audio/wavcapture.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/wavcapture.c b/audio/wavcapture.c index 8bfb9e7654..5863803584 100644 --- a/audio/wavcapture.c +++ b/audio/wavcapture.c @@ -88,6 +88,7

Re: [Qemu-devel] [PATCH v5 0/5] Memory leak fixes

2017-05-03 Thread Marc-André Lureau
This is actually v1 (confused with git-publish) - Original Message - > Hi, > > A new series of leaks spotted by ASAN. Mostly after introducing of the > test-hmp. Would it be useful having a configure --enable-asan, and > enabled by default with --enable-debug? > > Marc-André Lureau

[Qemu-devel] [PATCH v5 2/5] audio: fix capture buffer leaks

2017-05-03 Thread Marc-André Lureau
Spotted by ASAN. Signed-off-by: Marc-André Lureau --- audio/audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index c8898d8422..beafed209b 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -2028,6 +2028,8 @@ void

[Qemu-devel] [PATCH v5 1/5] test-keyval: fix leaks

2017-05-03 Thread Marc-André Lureau
Spotted by ASAN. Signed-off-by: Marc-André Lureau --- tests/test-keyval.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/test-keyval.c b/tests/test-keyval.c index ba19560a22..c556b1b117 100644 --- a/tests/test-keyval.c +++ b/tests/test-keyval.c @@

[Qemu-devel] [PATCH v5 0/5] Memory leak fixes

2017-05-03 Thread Marc-André Lureau
Hi, A new series of leaks spotted by ASAN. Mostly after introducing of the test-hmp. Would it be useful having a configure --enable-asan, and enabled by default with --enable-debug? Marc-André Lureau (5): test-keyval: fix leaks audio: fix capture buffer leaks audio: fix WAVState leak

[Qemu-devel] [PULL 3/3] vfio/pci: Fix incorrect error message

2017-05-03 Thread Alex Williamson
From: Dong Jia Shi When the "No host device provided" error occurs, the hint message that starts with "Use -vfio-pci," makes no sense, since "-vfio-pci" is not a valid command line parameter. Correct this by replacing "-vfio-pci" with "-device vfio-pci".

[Qemu-devel] [PULL 2/3] vfio: enable 8-byte reads/writes to vfio

2017-05-03 Thread Alex Williamson
From: Jose Ricardo Ziviani This patch enables 8-byte writes and reads to VFIO. Such implemention is already done but it's missing the 'case' to handle such accesses in both vfio_region_write and vfio_region_read and the MemoryRegionOps: impl.max_access_size and

[Qemu-devel] [PULL 1/3] vfio: Set MemoryRegionOps:max_access_size and min_access_size

2017-05-03 Thread Alex Williamson
From: Jose Ricardo Ziviani Sets valid.max_access_size and valid.min_access_size to ensure safe 8-byte accesses to vfio. Today, 8-byte accesses are broken into pairs of 4-byte calls that goes unprotected: qemu_mutex_lock locked mutex 0x10905ad8 vfio_region_write

[Qemu-devel] [PULL 0/3] VFIO fixes 2017-05-03

2017-05-03 Thread Alex Williamson
The following changes since commit e619b14746e5d8c0e53061661fd0e1da01fd4d60: Merge remote-tracking branch 'sthibault/tags/samuel-thibault' into staging (2017-05-02 15:16:29 +0100) are available in the git repository at: git://github.com/awilliam/qemu-vfio.git tags/vfio-updates-20170503.0

Re: [Qemu-devel] [PATCH 06/13] arm: Don't let no-MPU PMSA cores write to SCTLR.M

2017-05-03 Thread Alistair Francis
On Tue, Apr 25, 2017 at 5:07 AM, Peter Maydell wrote: > If the CPU is a PMSA config with no MPU implemented, then the > SCTLR.M bit should be RAZ/WI, so that the guest can never > turn on the non-existent MPU. > > Signed-off-by: Peter Maydell

Re: [Qemu-devel] [PATCH 08/13] armv7m: Improve "-d mmu" tracing for PMSAv7 MPU

2017-05-03 Thread Alistair Francis
On Tue, Apr 25, 2017 at 5:07 AM, Peter Maydell wrote: > From: Michael Davidsaver > > Improve the "-d mmu" tracing for the PMSAv7 MPU translation > process as an aid in debugging guest MPU configurations: > * fix a missing newline for a

[Qemu-devel] [PATCH v2] xen/mapcache: store dma information in revmapcache entries for debugging

2017-05-03 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

Re: [Qemu-devel] QEMU build breakage on ARM against Xen 4.9 caused by libxendevicemodel

2017-05-03 Thread Stefano Stabellini
On Wed, 3 May 2017, Stefano Stabellini wrote: > On Wed, 3 May 2017, Anthony PERARD wrote: > > On Wed, May 03, 2017 at 10:20:59AM -0700, Stefano Stabellini wrote: > > > On Wed, 3 May 2017, Anthony PERARD wrote: > > > > On Thu, Apr 20, 2017 at 11:05:33AM -0700, Stefano Stabellini wrote: > > > > > On

[Qemu-devel] [PATCH RESEND v2 18/21] sysbus-ohci: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
sysbus-ohci needs to be mapped and wired by device or board code, and won't work with -device. Remove the user_creatable flag from the device class. Cc: Marcel Apfelbaum Cc: Gerd Hoffmann Acked-by: Marcel Apfelbaum Signed-off-by: Eduardo

[Qemu-devel] [PATCH RESEND v2 19/21] virtio-mmio: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
virtio-mmio needs to be wired and mapped by other device or board code, and won't work with -device. Remove the user_creatable flag from the device class. Cc: Laszlo Ersek Cc: Marcel Apfelbaum Cc: Peter Maydell Cc: Shannon Zhao

[Qemu-devel] [PATCH RESEND v2 17/21] hpet: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
hpet needs to be mapped and wired by the board code and won't work with -device. Remove the user_creatable flag from the device class. Cc: Marcel Apfelbaum Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Acked-by: Marcel Apfelbaum

Re: [Qemu-devel] [PATCH RESEND v2 04/21] iommu: Remove FIXME comment about user_creatable=true

2017-05-03 Thread Michael S. Tsirkin
On Wed, May 03, 2017 at 05:35:47PM -0300, Eduardo Habkost wrote: > amd-iommu and intel-iommu are really meant to be used with > -device, so they need user_creatable=true. Remove the FIXME > comment. > > Cc: Marcel Apfelbaum > Cc: "Michael S. Tsirkin" >

[Qemu-devel] [PATCH RESEND v2 14/21] fw_cfg: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
fw_cfg won't work with -device, as: * fw_cfg_init1() won't get called for the device; * The device won't appear at /machine/fw_cfg, and won't work with the -fw_cfg command-line option. Remove the user_creatable flag from the device class. Cc: Marcel Apfelbaum Cc: "Michael

Re: [Qemu-devel] [PATCH RESEND v2 14/21] fw_cfg: Remove user_creatable flag

2017-05-03 Thread Michael S. Tsirkin
On Wed, May 03, 2017 at 05:35:57PM -0300, Eduardo Habkost wrote: > fw_cfg won't work with -device, as: > * fw_cfg_init1() won't get called for the device; > * The device won't appear at /machine/fw_cfg, and won't work with > the -fw_cfg command-line option. > > Remove the user_creatable flag

Re: [Qemu-devel] [PATCH RESEND v2 19/21] virtio-mmio: Remove user_creatable flag

2017-05-03 Thread Michael S. Tsirkin
On Wed, May 03, 2017 at 05:36:02PM -0300, Eduardo Habkost wrote: > virtio-mmio needs to be wired and mapped by other device or board > code, and won't work with -device. Remove the user_creatable flag > from the device class. > > Cc: Laszlo Ersek > Cc: Marcel Apfelbaum

[Qemu-devel] [PATCH RESEND v2 12/21] isabus-bridge: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
isabus-bridge needs to be created by isa_bus_new(), and won't work with -device, as it won't create the TYPE_ISA_BUS bus itself. Remove the user_creatable flag from the device class. Cc: Marcel Apfelbaum Cc: "Michael S. Tsirkin" Acked-by: Marcel Apfelbaum

[Qemu-devel] [PATCH RESEND v2 21/21] s390-pcibus: No need to set user_creatable=false explicitly

2017-05-03 Thread Eduardo Habkost
TYPE_S390_PCI_HOST_BRIDGE is a subclass of TYPE_PCI_HOST_BRIDGE, which is a subclass of TYPE_SYS_BUS_DEVICE. TYPE_SYS_BUS_DEVICE already sets user_creatable=false, so we don't require an explicit user_creatable=false assignment in s390_pcihost_class_init(). Cc: Alexander Graf Cc:

[Qemu-devel] [PATCH RESEND v2 15/21] esp: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
esp devices aren't going to work with -device, as they need IRQs to be connected and mmio to be mapped (this is done by esp_init()). Remove the user_creatable flag from the device class. Cc: Marcel Apfelbaum Cc: Paolo Bonzini Acked-by: Marcel Apfelbaum

[Qemu-devel] [PATCH RESEND v2 13/21] unimplemented-device: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
unimplemented-device needs to be created and mapped using create_unimplemented_device() (or equivalent code), and won't work with -device. Remove the user_creatable flag from the device class. Cc: Marcel Apfelbaum Cc: Peter Maydell Cc: Philippe

[Qemu-devel] [PATCH RESEND v2 07/21] kvmclock: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
kvmclock should be used by guests only when the appropriate CPUID feature flags are set on the VCPU, and it is automatically created by kvmclock_create() when those feature flags are set. This means creating a kvmclock device using -device is useless. Remove user_creatable from its device class.

[Qemu-devel] [PATCH RESEND v2 20/21] xen-sysdev: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
TYPE_XENSYSDEV is only used internally by xen_be_init(), and is not supposed to be plugged/unplugged dynamically. Remove the user_creatable flag from the device class. Cc: Juergen Gross , Cc: Peter Maydell , Cc: Thomas Huth Cc:

[Qemu-devel] [PATCH RESEND v2 10/21] sysbus-ahci: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
The sysbus-ahci devices are supposed to be created and wired by code from other devices, like calxeda_init() and xlnx_zynqmp_realize(), and won't work with -device. Remove the user_creatable flag from the device class. Cc: John Snow Cc: qemu-bl...@nongnu.org Cc: Rob Herring

[Qemu-devel] [PATCH RESEND v2 16/21] generic-sdhci: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
generic-sdhci needs to be wired by other devices' code, so it can't be used with -device. Remove the user_creatable flag from the device class. Cc: Peter Maydell Cc: "Edgar E. Iglesias" Cc: David Gibson Cc:

[Qemu-devel] [PATCH RESEND v2 06/21] pflash_cfi01: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
TYPE_CFI_PFLASH01 devices need to be mapped by pflash_cfi01_register() (or equivalent) and can't be used with -device. Remove user_creatable from the device class. Cc: Kevin Wolf Cc: Max Reitz Cc: qemu-bl...@nongnu.org Cc: Laszlo Ersek

[Qemu-devel] [PATCH RESEND v2 09/21] kvmvapic: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
The kvmvapic device is only usable when created by apic_common_realize(), not using -device. Remove the user_creatable flag from the device class. Cc: Igor Mammedov Cc: Marcel Apfelbaum Cc: Paolo Bonzini Cc: Richard Henderson

[Qemu-devel] [PATCH RESEND v2 11/21] allwinner-ahci: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
allwinner-ahci needs its IRQ to be connected and mmio to be mapped (this is done by the alwinner-a10 device realize method), and won't work with -device. Remove the user_creatable flag from the device class. Cc: John Snow Cc: qemu-bl...@nongnu.org Cc: Beniamino Galvani

[Qemu-devel] [PATCH RESEND v2 08/21] ioapic: Remove user_creatable flag

2017-05-03 Thread Eduardo Habkost
An ioapic device is already created by the q35 initialization code, and using "-device ioapic" or "-device kvm-ioapic" will always fail with "Only 1 ioapics allowed". Remove the user_creatable flag from the ioapic device classes. Cc: Igor Mammedov Cc: Marcel Apfelbaum

[Qemu-devel] [PATCH RESEND v2 04/21] iommu: Remove FIXME comment about user_creatable=true

2017-05-03 Thread Eduardo Habkost
amd-iommu and intel-iommu are really meant to be used with -device, so they need user_creatable=true. Remove the FIXME comment. Cc: Marcel Apfelbaum Cc: "Michael S. Tsirkin" Reviewed-by: Marcel Apfelbaum Acked-by: Marcel Apfelbaum

[Qemu-devel] [PATCH RESEND v2 02/21] sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE

2017-05-03 Thread Eduardo Habkost
commit 33cd52b5d7b9adfd009e95f07e6c64dd88ae2a31 unset cannot_instantiate_with_device_add_yet in TYPE_SYSBUS, making all sysbus devices appear on "-device help" and lack the "no-user" flag in "info qdm". To fix this, we can set user_creatable=false by default on TYPE_SYS_BUS_DEVICE, but this

[Qemu-devel] [PATCH RESEND v2 05/21] fdc: Remove user_creatable flag from sysbus-fdc & SUNW, fdtwo

2017-05-03 Thread Eduardo Habkost
sysbus-fdc and SUNW,fdtwo devices need IRQs to be wired and mmio to be mapped, and can't be used with -device. Unset user_creatable on their device classes. Cc: John Snow Cc: Kevin Wolf Cc: Marcel Apfelbaum Cc: Max Reitz

[Qemu-devel] [PATCH RESEND v2 03/21] xen-backend: Remove FIXME comment about user_creatable flag

2017-05-03 Thread Eduardo Habkost
xen-backend can be plugged/unplugged dynamically when using the Xen accelerator, so keep the user_creatable flag on the device class and remove the FIXME comment. Cc: Juergen Gross , Cc: Peter Maydell , Cc: Thomas Huth Cc:

[Qemu-devel] [PATCH RESEND v2 01/21] qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable

2017-05-03 Thread Eduardo Habkost
cannot_instantiate_with_device_add_yet was introduced by commit efec3dd631d94160288392721a5f9c39e50fb2bc to replace no_user. It was supposed to be a temporary measure. When it was introduced, we had 54 cannot_instantiate_with_device_add_yet=true lines in the code. Today (3 years later) this

[Qemu-devel] [PATCH RESEND v2 00/21] qdev/sysbus: Set user_creatable=false by default on sysbus

2017-05-03 Thread Eduardo Habkost
No code changes since v2, just a rebase to latest qemu.git master, a trivial commit message fix at patch 1, and added Acked-by and Reviewed-by tags. Changes v1 -> v2 * Rewrote series name and cover letter completely to not pretend we're fixing the q35 lack-of-sysbus-whitelist

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/5] hw/ppc: removing spapr_drc_detach_cb opaques

2017-05-03 Thread Daniel Henrique Barboza
Update: I have talked with Michael Roth about the spapr_release_lmb callback, the flow of the LMB releases and so on. He clarified to me that it is not possible to get rid of the callback and put its code in the spapr_del_lmbs function. The reason is that the callback is being executed by the

Re: [Qemu-devel] QEMU build breakage on ARM against Xen 4.9 caused by libxendevicemodel

2017-05-03 Thread Stefano Stabellini
On Wed, 3 May 2017, Anthony PERARD wrote: > On Wed, May 03, 2017 at 10:20:59AM -0700, Stefano Stabellini wrote: > > On Wed, 3 May 2017, Anthony PERARD wrote: > > > On Thu, Apr 20, 2017 at 11:05:33AM -0700, Stefano Stabellini wrote: > > > > On Thu, 20 Apr 2017, Paul Durrant wrote: > > > > > I think

Re: [Qemu-devel] [PATCH v5 10/10] test-qga: Actually test 0xff sync bytes

2017-05-03 Thread Michael Roth
Quoting Markus Armbruster (2017-05-03 03:57:41) > Michael Roth writes: > > > Quoting Michael Roth (2017-05-02 11:46:36) > >> Quoting Eric Blake (2017-04-27 16:58:21) > >> > Commit 62c39b3 introduced test-qga, and at face value, appears > >> > to be testing the

Re: [Qemu-devel] [PATCH v7 3/4] qemu-img: introduce --target-image-opts for 'convert' command

2017-05-03 Thread Max Reitz
On 02.05.2017 16:47, Daniel P. Berrange wrote: > The '--image-opts' flag indicates whether the source filename > includes options. The target filename has to remain in the > plain filename format though, since it needs to be passed to > bdrv_create(). When using --skip-create though, it would be

Re: [Qemu-devel] [PATCH] tests: acpi: extend cphp and memhp testcase with numa distance check

2017-05-03 Thread Eduardo Habkost
On Wed, May 03, 2017 at 03:07:05PM +0200, Igor Mammedov wrote: > On Wed, 3 May 2017 17:17:16 +0800 > He Chen wrote: > > > Signed-off-by: He Chen > Reviewed-by: Igor Mammedov Thanks! > > Eduardo, > > could you take it

Re: [Qemu-devel] [PATCH v2] libvhost-user: fix crash when rings aren't ready

2017-05-03 Thread Philippe Mathieu-Daudé
On 05/03/2017 01:54 PM, Marc-André Lureau wrote: Calling libvhost-user functions like vu_queue_get_avail_bytes() when the queue doesn't yet have addresses will result in the crashes like the following: Program received signal SIGSEGV, Segmentation fault. 0x55c414112ce4 in vring_avail_idx

  1   2   3   4   >