[Qemu-devel] [PATCH v10 20/25] qapi: Swap 'name' in visit_* callbacks to match public API

2016-01-29 Thread Eric Blake
As explained in the previous patches, matching argument order of 'name, ' to JSON's "name":value makes sense. However, while the last two patches were easy with Coccinelle, I ended up doing this one all by hand. Now all the visitor callbacks match the main interface. The compiler is able to

Re: [Qemu-devel] [PATCH v8 14/16] block: Rewrite bdrv_close_all()

2016-01-29 Thread Max Reitz
On 28.01.2016 05:17, Fam Zheng wrote: > On Wed, 01/27 18:59, Max Reitz wrote: >> This patch rewrites bdrv_close_all(): Until now, all root BDSs have been >> force-closed. This is bad because it can lead to cached data not being >> flushed to disk. >> >> Instead, try to make all reference holders

Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse

2016-01-29 Thread Peter Maydell
On 29 January 2016 at 14:46, Shannon Zhao wrote: > On 2016/1/29 22:35, Wei Huang wrote: >> On 01/29/2016 04:10 AM, Shannon Zhao wrote: >>> This makes ACPI work well but makes DT not work. The reason is systemd or >>> acpid open /dev/input/event0 failed. So the interrupt

Re: [Qemu-devel] [PATCH v9 35/37] qapi: Change visit_type_FOO() to no longer return partial objects

2016-01-29 Thread Eric Blake
On 01/29/2016 05:03 AM, Markus Armbruster wrote: > > With (1) don't assign, the caller can pick an error value by assigning > it before the visit, and it must not access the value on error unless it > does. > > With (2) assign zero, the caller can't pick an error value, but may > safely access

Re: [Qemu-devel] [Qemu-ppc] [PULL 03/39] macio: use the existing IDEDMA aiocb to hold the active DMA aiocb

2016-01-29 Thread Aurelien Jarno
On 2016-01-29 16:06, David Gibson wrote: > From: Mark Cave-Ayland > > Currently the aiocb is held within MACIOIDEState, however the IDE core code > assumes that the current actvie DMA aiocb is held in aiocb in a few places, > e.g. ide_bus_reset() and ide_reset(). >

Re: [Qemu-devel] [PATCH v8 00/16] block: Rework bdrv_close_all()

2016-01-29 Thread Kevin Wolf
Am 27.01.2016 um 18:59 hat Max Reitz geschrieben: > Currently, bdrv_close_all() force-closes all BDSs with a BlockBackend, > which can lead to data corruption (see the iotest added in the final > patch of this series) and is most certainly very ugly. > > This series reworks bdrv_close_all() to

Re: [Qemu-devel] [PATCH] usb: ehci: add capability mmio write function

2016-01-29 Thread Gerd Hoffmann
On Fr, 2016-01-29 at 18:30 +0530, P J P wrote: > From: Prasad J Pandit > > USB Ehci emulation supports host controller capability registers. > But its mmio '.write' function was missing, which lead to a null > pointer dereference issue. Add a do nothing 'ehci_caps_write'

[Qemu-devel] [PATCH v10 08/25] vl: Ensure qapi visitor properly ends struct visit

2016-01-29 Thread Eric Blake
Guarantee that visit_end_struct() is called if visit_start_struct() succeeded. This matches the behavior of most other uses of visitors, and is a step towards the possibility of a future patch that adds and enforces some tighter semantics to the visitor interface (namely, cleanup of the visitor

[Qemu-devel] [PATCH v10 14/25] qapi: Make all visitors supply uint64 callbacks

2016-01-29 Thread Eric Blake
Our qapi visitor contract supports multiple integer visitors, but left the type_uint64 visitor as optional (falling back on type_int64); which in turn can lead to awkward behavior with numbers larger than INT64_MAX (the user has to be aware of twos complement, and deal with negatives). This patch

[Qemu-devel] [PATCH v10 15/25] qapi: Consolidate visitor small integer callbacks

2016-01-29 Thread Eric Blake
Commit 4e27e819 introduced optional visitor callbacks for all sorts of int types, but no visitor has supplied any of the callbacks for sizes less than 64 bits. In other words, the generic implementation based on using type_[u]int64() followed by bounds-checking works just fine. In the interest of

[Qemu-devel] [PATCH v10 19/25] qom: Swap 'name' next to visitor in ObjectPropertyAccessor

2016-01-29 Thread Eric Blake
Similar to the previous patch, it's nice to have all functions in the tree that involve a visitor and a name for conversion to or from QAPI to consistently stick the 'name' parameter next to the Visitor parameter. Done by manually changing include/qom/object.h and qom/object.c, then running this

[Qemu-devel] [PATCH v10 23/25] qapi: Drop unused error argument for list and implicit struct

2016-01-29 Thread Eric Blake
No backend was setting an error when ending an implicit struct, or when iterating a list. Make the callers a bit easier to follow by making this a part of the contract, and removing the errp argument - callers can then unconditionally end an object as part of cleanup without having to think about

Re: [Qemu-devel] [PATCH v7 01/13] machine: Don't allow CPU toplogies with partially filled cores

2016-01-29 Thread Eduardo Habkost
On Fri, Jan 29, 2016 at 02:52:30PM +1100, David Gibson wrote: > On Thu, Jan 28, 2016 at 11:19:43AM +0530, Bharata B Rao wrote: > > Prevent guests from booting with CPU topologies that have partially > > filled CPU cores or can result in partially filled CPU cores after > > CPU hotplug like > > >

Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse

2016-01-29 Thread Shannon Zhao
On 2016/1/29 22:50, Wei Huang wrote: On 01/29/2016 08:46 AM, Shannon Zhao wrote: > > >On 2016/1/29 22:35, Wei Huang wrote: >> >> >>On 01/29/2016 04:10 AM, Shannon Zhao wrote: >>>Hi, >>> >>>This makes ACPI work well but makes DT not work. The reason is >>>systemd or >>>acpid open

Re: [Qemu-devel] [PATCH v8 06/16] nbd: Switch from close to eject notifier

2016-01-29 Thread Max Reitz
On 28.01.2016 04:26, Fam Zheng wrote: > On Wed, 01/27 18:59, Max Reitz wrote: >> The NBD code uses the BDS close notifier to determine when a medium is >> ejected. However, now it should use the BB's BDS removal notifier for >> that instead of the BDS's close notifier. >> >> Signed-off-by: Max

Re: [Qemu-devel] [PATCH v8 12/16] blockdev: Keep track of monitor-owned BDS

2016-01-29 Thread Max Reitz
On 28.01.2016 04:33, Fam Zheng wrote: > On Wed, 01/27 18:59, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >> blockdev.c | 26 ++ >> include/block/block_int.h | 4 >> stubs/Makefile.objs

[Qemu-devel] [PATCH v10 10/25] qapi: Improve generated event use of qapi visitor

2016-01-29 Thread Eric Blake
All other successful clients of visit_start_struct() were paired with an unconditional visit_end_struct(); but the generated code for events was relying on qmp_output_visitor_cleanup() to work on an incomplete visit. Alter the code to guarantee that the struct is completed, which will make a

[Qemu-devel] [PATCH v10 18/25] qapi: Swap visit_* arguments for consistent 'name' placement

2016-01-29 Thread Eric Blake
JSON uses "name":value, but many of our visitor interfaces were called with visit_type_FOO(v, , name, errp). This can be a bit confusing to have to mentally swap the parameter order to match JSON order. It's particularly bad for visit_start_struct(), where the 'name' parameter is smack in the

Re: [Qemu-devel] [PATCH] build: Add include check on syscall.h

2016-01-29 Thread Lluís Vilanova
Peter Maydell writes: > On 29 January 2016 at 13:30, Lluís Vilanova wrote: >> Peter Maydell writes: >>> Adding include guards is fine, but it sounds to me like what we >>> should actually do to fix this confusion is rename all the linux-user >>> local headers to

[Qemu-devel] [PATCH] arm: virt-acpi: each MADT.GICC entry as enabled unconditionally

2016-01-29 Thread Igor Mammedov
in current impl. condition build_madt() { ... if (test_bit(i, cpuinfo->found_cpus)) is always true since loop handles only present CPUs in range [0..smp_cpus). But to fill usless cpuinfo->found_cpus we do unnecessary scan over QOM tree to find the same CPUs. So mark GICC as present always

Re: [Qemu-devel] [PULL 00/39] ppc-for-2.6 queue 20160129

2016-01-29 Thread Peter Maydell
> > are available in the git repository at: > > git://github.com/dgibson/qemu.git tags/ppc-for-2.6-20160129 > > for you to fetch changes up to 1699679e699276c0538008f6ca74cd04e6c68b42: > > target-ppc: Make every FPSCR_ macro have a correspondi

Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse

2016-01-29 Thread Shannon Zhao
On 2016/1/29 22:35, Wei Huang wrote: On 01/29/2016 04:10 AM, Shannon Zhao wrote: Hi, This makes ACPI work well but makes DT not work. The reason is systemd or acpid open /dev/input/event0 failed. So the interrupt could be injected and could see under /proc/interrupts but guest doesn't have

Re: [Qemu-devel] help with understanding qcow2 file format

2016-01-29 Thread lspnet
hi,I have read 2015-qcow2-expanded.pdf and qcow2.txt, so I understand how to convert the offset in the virtual disk to the offset into the image file(qcow2). but I wish to know how to convert the block using ext4 to the offset in the virtual disk. Please help me. the file block information

Re: [Qemu-devel] [PATCH] build: Add include check on syscall.h

2016-01-29 Thread Lluís Vilanova
Peter Maydell writes: > On 28 January 2016 at 20:36, Lluís Vilanova wrote: >> The LTTng tracing backend includes the system's "syscall.h", but QEMU >> replaces it with its own for linux-user builds. This results in a double >> include on some targets (when LTTng is enabled).

[Qemu-devel] [PATCH v10 07/25] hmp: Cache use of qapi visitor

2016-01-29 Thread Eric Blake
Cache the visitor in a local variable instead of repeatedly calling the accessor. Signed-off-by: Eric Blake Reviewed-by: Marc-André Lureau --- v10: resplit 4/37 and 5/37 by action rather than file, retain R-b. v9: no change v8: no change v7:

[Qemu-devel] [PATCH v10 11/25] qapi: Track all failures between visit_start/stop

2016-01-29 Thread Eric Blake
Inside the generated code between visit_start_struct() and visit_end_struct(), we were blindly setting the error into the caller's errp parameter. But a future patch to split visit_end_struct() will require that we take action based on whether an error has occurred, which requires us to track all

[Qemu-devel] [PATCH v10 03/25] qapi: Drop dead dealloc visitor variable

2016-01-29 Thread Eric Blake
Commit 0b9d8542 added StackEntry.is_list_head, but forgot to delete the now-unused QapiDeallocVisitor.is_list_head. Signed-off-by: Eric Blake Reviewed-by: Marc-André Lureau --- v10: no change v9: no change v8: no change v7: new patch ---

[Qemu-devel] [PATCH v10 13/25] qapi: Prefer type_int64 over type_int in visitors

2016-01-29 Thread Eric Blake
The qapi builtin type 'int' is basically shorthand for the type 'int64'. In fact, since no visitor was providing the optional type_int64() callback, visit_type_int64() was just always falling back to type_int(), cementing the equivalence between the types. However, some visitors are providing a

[Qemu-devel] [PATCH v10 24/25] qmp: Fix reference-counting of qnull on empty output visit

2016-01-29 Thread Eric Blake
Commit 6c2f9a15 ensured that we would not return NULL when the caller used an output visitor but had nothing to visit. But in doing so, it added a FIXME about a reference count leak that could abort qemu in the (unlikely) case of SIZE_MAX such visits (more plausible on 32-bit). (Although that

[Qemu-devel] [PATCH v10 02/25] qapi: Avoid use of misnamed DO_UPCAST()

2016-01-29 Thread Eric Blake
The macro DO_UPCAST() is incorrectly named: it converts from a parent class to a derived class (which is a downcast). Better, and more consistent with some of the other qapi visitors, is to use the container_of() macro through a to_FOO() helper. Names like 'to_ov()' may be a bit short, but for a

Re: [Qemu-devel] [PATCH v8 05/16] virtio-scsi: Catch BDS-BB removal/insertion

2016-01-29 Thread Max Reitz
On 29.01.2016 13:41, Kevin Wolf wrote: > Am 27.01.2016 um 18:59 hat Max Reitz geschrieben: >> Make use of the BDS-BB removal and insertion notifiers to remove or set >> up, respectively, virtio-scsi's op blockers. >> >> Signed-off-by: Max Reitz >> --- >> hw/scsi/virtio-scsi.c

Re: [Qemu-devel] [PATCH] arm: virt-acpi: each MADT.GICC entry as enabled unconditionally

2016-01-29 Thread Shannon Zhao
On 2016/1/29 22:24, Igor Mammedov wrote: in current impl. condition build_madt() { ... if (test_bit(i, cpuinfo->found_cpus)) is always true since loop handles only present CPUs in range [0..smp_cpus). But to fill usless cpuinfo->found_cpus we do unnecessary scan over QOM tree to find

Re: [Qemu-devel] [PATCH v7 01/13] machine: Don't allow CPU toplogies with partially filled cores

2016-01-29 Thread Igor Mammedov
On Fri, 29 Jan 2016 12:24:18 -0200 Eduardo Habkost wrote: > On Fri, Jan 29, 2016 at 02:52:30PM +1100, David Gibson wrote: > > On Thu, Jan 28, 2016 at 11:19:43AM +0530, Bharata B Rao wrote: > > > Prevent guests from booting with CPU topologies that have partially > > >

Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse

2016-01-29 Thread Wei Huang
On 01/29/2016 08:50 AM, Peter Maydell wrote: > On 29 January 2016 at 14:46, Shannon Zhao wrote: >> On 2016/1/29 22:35, Wei Huang wrote: >>> On 01/29/2016 04:10 AM, Shannon Zhao wrote: This makes ACPI work well but makes DT not work. The reason is systemd or

Re: [Qemu-devel] [PATCH] build: Add include check on syscall.h

2016-01-29 Thread Peter Maydell
On 29 January 2016 at 13:30, Lluís Vilanova wrote: > Peter Maydell writes: >> Adding include guards is fine, but it sounds to me like what we >> should actually do to fix this confusion is rename all the linux-user >> local headers to target_syscall.h. > > Hmmm, I didn't know

[Qemu-devel] [PATCH v10 01/25] qobject: Document more shortcomings in our number handling

2016-01-29 Thread Eric Blake
We've already documented that our JSON parsing is locale dependent; but we should also document that our JSON output has the same problem. Additionally, JSON requires finite values (you have to upgrade to JSON5 to get support for Inf or NaN), and our output truncates floating point numbers to the

[Qemu-devel] [PATCH v10 00/25] qapi visitor cleanups part 1 (post-introspection cleanups subset E)

2016-01-29 Thread Eric Blake
Based on qemu.git master. No pending prerequisites Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv10e and will soon be part of my branch with the rest of the v5 series, at: http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi v10 notes:

[Qemu-devel] [PATCH v10 05/25] qapi: Drop dead parameter in gen_params()

2016-01-29 Thread Eric Blake
Commit 5cdc8831 reworked gen_params() to be simpler, but forgot to clean up a now-unused errp named argument. No change to generated code. Reported-by: Markus Armbruster Signed-off-by: Eric Blake --- v10: new patch --- scripts/qapi.py | 4 ++-- 1 file

[Qemu-devel] [PATCH v10 04/25] qapi: Dealloc visitor does not need a type_size()

2016-01-29 Thread Eric Blake
The intent of having the visitor type_size() callback differ from type_uint64() is to allow special handling for sizes; the visitor core gracefully falls back to type_uint64() if there is no need for the distinction. Since the dealloc visitor does nothing for any of the int visits, drop the

Re: [Qemu-devel] [PATCH v8 12/16] blockdev: Keep track of monitor-owned BDS

2016-01-29 Thread Kevin Wolf
Am 29.01.2016 um 14:44 hat Max Reitz geschrieben: > On 28.01.2016 04:33, Fam Zheng wrote: > > On Wed, 01/27 18:59, Max Reitz wrote: > >> Signed-off-by: Max Reitz > >> --- > >> blockdev.c | 26 ++ > >>

Re: [Qemu-devel] [PATCH] Fix virtio migration

2016-01-29 Thread Cornelia Huck
On Fri, 29 Jan 2016 13:18:56 + "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > I misunderstood the vmstate macro definition when I reworked the > virtio .get/.put. > The VMSTATE_STRUCT_VARRAY_KNOWN, was described as being

Re: [Qemu-devel] [PATCH] Fix virtio migration

2016-01-29 Thread Peter Maydell
On 29 January 2016 at 13:18, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > I misunderstood the vmstate macro definition when I reworked the > virtio .get/.put. > The VMSTATE_STRUCT_VARRAY_KNOWN, was described as being for "a >

Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse

2016-01-29 Thread Wei Huang
On 01/29/2016 04:10 AM, Shannon Zhao wrote: > Hi, > > This makes ACPI work well but makes DT not work. The reason is systemd or > acpid open /dev/input/event0 failed. So the interrupt could be injected and > could see under /proc/interrupts but guest doesn't have any action. I'll > investigate

Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse

2016-01-29 Thread Wei Huang
On 01/29/2016 08:46 AM, Shannon Zhao wrote: > > > On 2016/1/29 22:35, Wei Huang wrote: >> >> >> On 01/29/2016 04:10 AM, Shannon Zhao wrote: >>> Hi, >>> >>> This makes ACPI work well but makes DT not work. The reason is >>> systemd or >>> acpid open /dev/input/event0 failed. So the interrupt

Re: [Qemu-devel] [PATCH v5 5/5] doc: Introduce coding style for errors

2016-01-29 Thread Lluís Vilanova
Eric Blake writes: > On 01/28/2016 02:53 PM, Lluís Vilanova wrote: >> Gives some general guidelines for reporting errors in QEMU. >> >> Signed-off-by: Lluís Vilanova >> --- >> HACKING | 33 + >> 1 file changed, 33 insertions(+) > I'm not

Re: [Qemu-devel] [PATCH v5 2/5] util: Use new error_report_fatal/abort instead of error_setg(_fatal/abort)

2016-01-29 Thread Lluís Vilanova
David Gibson writes: > On Thu, Jan 28, 2016 at 10:53:43PM +0100, Lluís Vilanova wrote: >> Replaces all direct uses of 'error_setg(_fatal/abort)' with >> 'error_report_fatal/abort'. Also reimplements the former on top of the >> latter. >> >> Signed-off-by: Lluís Vilanova >

Re: [Qemu-devel] [PATCH v8 01/16] block: Release dirty bitmaps in bdrv_close()

2016-01-29 Thread Max Reitz
On 28.01.2016 04:01, Fam Zheng wrote: > On Wed, 01/27 18:59, Max Reitz wrote: >> bdrv_delete() is not very happy about deleting BlockDriverStates with >> dirty bitmaps still attached to them. In the past, we got around that >> very easily by relying on bdrv_close_all() bypassing bdrv_delete(), and

[Qemu-devel] [PATCH v10 17/25] qom: Use typedef for Visitor

2016-01-29 Thread Eric Blake
No need to repeat 'struct Visitor' when we already have it in typedefs.h. Omitting the redundant 'struct' also makes a later patch easier to search for all object property callbacks that are associated with a Visitor. Signed-off-by: Eric Blake Reviewed-by: Marc-André Lureau

[Qemu-devel] [PATCH v10 06/25] hmp: Drop pointless allocation during qapi visit

2016-01-29 Thread Eric Blake
The qapi visitor contract allows us to visit a virtual structure, where we don't have any corresponding qapi struct. Most such uses pass NULL for @obj; but these two callers were passing a dummy pointer, which then gets allocated to heap memory but then immediately freed without use. Clean this

[Qemu-devel] [PATCH v10 09/25] balloon: Improve use of qapi visitor

2016-01-29 Thread Eric Blake
Rework the control flow of balloon_stats_get_all() to make it easier for a later patch to split visit_end_struct(). Also switch to the uint64 visitor to match the data type. Signed-off-by: Eric Blake --- v10: defer out_nested label to later patch, drop Marc-Andre's R-b v9:

[Qemu-devel] [PATCH v10 16/25] qapi: Don't cast Enum* to int*

2016-01-29 Thread Eric Blake
C compilers are allowed to represent enums as a smaller type than int, if all enum values fit in the smaller type. There are even compiler flags that force the use of this smaller representation, although using them changes the ABI of a binary. Therefore, our generated code for visit_type_ENUM()

[Qemu-devel] [PATCH v10 21/25] qapi: Drop unused 'kind' for struct/enum visit

2016-01-29 Thread Eric Blake
visit_start_struct() and visit_type_enum() had a 'kind' argument that was usually set to either the stringized version of the corresponding qapi type name, or to NULL (although some clients didn't even get that right). But nothing ever used the argument. It's even hard to argue that it would be

[Qemu-devel] [PATCH v10 25/25] qmp: Don't abuse stack to track qmp-output root

2016-01-29 Thread Eric Blake
The previous commit documented an inconsistency in how we are using the stack of qmp-output-visitor. Normally, pushing a single top-level object puts the object on the stack twice: once as the root, and once as the current container being appended to; but popping that struct only pops once.

[Qemu-devel] [PATCH v10 22/25] qapi: Tighten qmp_input_end_list()

2016-01-29 Thread Eric Blake
The only way that qmp_input_pop() will set errp is if a dictionary was the most recent thing pushed. Since we don't have any push(struct)/pop(list) or push(list)/pop(struct) mismatches (such a mismatch is a programming bug), we therefore cannot set errp inside qmp_input_end_list(). Make this

[Qemu-devel] [PATCH v10 12/25] qapi-visit: Kill unused visit_end_union()

2016-01-29 Thread Eric Blake
The generated code can call visit_end_union() without having called visit_start_union(). Example: if (!*obj) { goto out_obj; } visit_type_CpuInfoBase_fields(v, (CpuInfoBase **)obj, ); if (err) { goto out_obj; // if we go from here...

Re: [Qemu-devel] [PATCH] qdev: Use GList for global properties

2016-01-29 Thread Eduardo Habkost
On Thu, Jan 28, 2016 at 07:01:12PM +0200, Michael S. Tsirkin wrote: > On Thu, Jan 28, 2016 at 01:02:26PM -0200, Eduardo Habkost wrote: > > If the same GlobalProperty struct is registered twice, the list > > entry gets corrupted, making tqe_next points to itself, and > > qdev_prop_set_globals()

[Qemu-devel] [RFC v7 01/16] exec.c: Add new exclusive bitmap to ram_list

2016-01-29 Thread Alvise Rigo
The purpose of this new bitmap is to flag the memory pages that are in the middle of LL/SC operations (after a LL, before a SC). For all these pages, the corresponding TLB entries will be generated in such a way to force the slow-path for all the VCPUs (see the following patches). When the system

[Qemu-devel] [RFC v7 14/16] target-arm: translate: Use ld/st excl for atomic insns

2016-01-29 Thread Alvise Rigo
Use the new LL/SC runtime helpers to handle the ARM atomic instructions in softmmu_llsc_template.h. In general, the helper generator gen_{ldrex,strex}_{8,16a,32a,64a}() calls the function helper_{le,be}_{ldlink,stcond}{ub,uw,ul,q}_mmu() implemented in softmmu_llsc_template.h, doing an alignment

[Qemu-devel] [RFC v7 05/16] softmmu: Add new TLB_EXCL flag

2016-01-29 Thread Alvise Rigo
Add a new TLB flag to force all the accesses made to a page to follow the slow-path. The TLB entries referring guest pages with the DIRTY_MEMORY_EXCLUSIVE bit clean will have this flag set. Suggested-by: Jani Kokkonen Suggested-by: Claudio Fontana

[Qemu-devel] [RFC v7 03/16] softmmu: Simplify helper_*_st_name, wrap MMIO code

2016-01-29 Thread Alvise Rigo
Attempting to simplify the helper_*_st_name, wrap the MMIO code into an inline function. Based on this work, Alex proposed the following patch series https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg01136.html that reduces code duplication of the softmmu_helpers. Suggested-by: Jani

Re: [Qemu-devel] [PATCH v8 05/16] virtio-scsi: Catch BDS-BB removal/insertion

2016-01-29 Thread Kevin Wolf
Am 27.01.2016 um 18:59 hat Max Reitz geschrieben: > Make use of the BDS-BB removal and insertion notifiers to remove or set > up, respectively, virtio-scsi's op blockers. > > Signed-off-by: Max Reitz > --- > hw/scsi/virtio-scsi.c | 55 >

Re: [Qemu-devel] [PATCH v8 02/16] iotests: Add test for eject under NBD server

2016-01-29 Thread Max Reitz
On 27.01.2016 21:56, Eric Blake wrote: > On 01/27/2016 10:59 AM, Max Reitz wrote: >> This patch adds a test for ejecting the BlockBackend an NBD server is >> connected to (the NBD server is supposed to stop). >> >> Signed-off-by: Max Reitz >> --- >> tests/qemu-iotests/140

Re: [Qemu-devel] [PATCH 2/2] migration/virtio: Remove simple .get/.put use

2016-01-29 Thread Dr. David Alan Gilbert
* Cornelia Huck (cornelia.h...@de.ibm.com) wrote: > On Thu, 21 Jan 2016 21:56:22 +0100 > Sascha Silbe wrote: > > > "Dr. David Alan Gilbert" writes: > > > > Thanks I've reused a chunk of that; I'll post the fix soon. > > > Thanks for your help on

Re: [Qemu-devel] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-29 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 01/29/2016 06:07 PM, Dr. David Alan Gilbert wrote: > > * Wen Congyang (we...@cn.fujitsu.com) wrote: > >> On 01/27/2016 07:03 PM, Dr. David Alan Gilbert wrote: > >>> Hi, > >>> I've got a block error if I kill the secondary. > >>> > >>> Start both

[Qemu-devel] [PATCH] Fix virtio migration

2016-01-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I misunderstood the vmstate macro definition when I reworked the virtio .get/.put. The VMSTATE_STRUCT_VARRAY_KNOWN, was described as being for "a variable length array (i.e. _type *_field) but we know the length". However it actually specified

[Qemu-devel] [PATCH v4] Add optionrom compatible with fw_cfg DMA version

2016-01-29 Thread Marc Marí
This optionrom is based on linuxboot.S. Added changes proposed by Gerd Hoffman, Stefan Hajnoczi and Kevin O'Connor. All optionroms are now compiled in 32 bits. This also forces to not use any standard C header because this would need cross-compiling support check and a big modification on the

Re: [Qemu-devel] [PATCH v9 35/37] qapi: Change visit_type_FOO() to no longer return partial objects

2016-01-29 Thread Markus Armbruster
Eric Blake writes: > On 01/28/2016 08:24 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Returning a partial object on error is an invitation for a careless >>> caller to leak memory. As no one outside the testsuite was actually >>> relying on

Re: [Qemu-devel] [PATCH v19 7/9] machine: add properties to compat_props incrementaly

2016-01-29 Thread Cornelia Huck
On Thu, 28 Jan 2016 11:58:08 +0100 Igor Mammedov wrote: > Switch to adding compat properties incrementaly instead of > completly overwriting compat_props per machine type. > That removes data duplication which we have due to nested > [PC|SPAPR]_COMPAT_* macros. We'll try to

[Qemu-devel] [PATCH] usb: ehci: add capability mmio write function

2016-01-29 Thread P J P
From: Prasad J Pandit USB Ehci emulation supports host controller capability registers. But its mmio '.write' function was missing, which lead to a null pointer dereference issue. Add a do nothing 'ehci_caps_write' definition to avoid it; Do nothing because capability

[Qemu-devel] [Bug 1538541] Re: qcow2 rejects request to use preallocation with backing file

2016-01-29 Thread Max Reitz
It is not exactly trivial, and it being in qemu does not make it simpler. http://git.qemu.org/?p=qemu.git;a=blob;f=block/qcow2.c;h=fd8436c5f8b13ab0e8c605147ce76e6b6a8e5f95;hb=HEAD#l2105 is the code that calculates the size; as you can see, it is pretty self- contained. Max -- You received this

Re: [Qemu-devel] [PATCH] build: Add include check on syscall.h

2016-01-29 Thread Peter Maydell
On 28 January 2016 at 20:36, Lluís Vilanova wrote: > The LTTng tracing backend includes the system's "syscall.h", but QEMU > replaces it with its own for linux-user builds. This results in a double > include on some targets (when LTTng is enabled). > > Signed-off-by: Lluís

Re: [Qemu-devel] [PATCH 2/2] migration/virtio: Remove simple .get/.put use

2016-01-29 Thread Cornelia Huck
On Thu, 21 Jan 2016 21:56:22 +0100 Sascha Silbe wrote: > "Dr. David Alan Gilbert" writes: > > Thanks I've reused a chunk of that; I'll post the fix soon. > > Thanks for your help on this. > > Thanks, looking forward to the next version of your

Re: [Qemu-devel] [PATCH COLO-Frame v13 10/39] COLO: Implement colo checkpoint protocol

2016-01-29 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > We need communications protocol of user-defined to control the checkpoint > process. > > The new checkpoint request is started by Primary VM, and the interactive > process > like below: > Checkpoint synchronizing points: > >

Re: [Qemu-devel] [PATCH v4 0/5] ARM: Add NUMA support for machine virt

2016-01-29 Thread Andrew Jones
On Fri, Jan 29, 2016 at 02:52:35PM +0800, Shannon Zhao wrote: > > > On 2016/1/29 14:32, Ashok Kumar wrote: > > Hi, > > > > On Sat, Jan 23, 2016 at 07:36:41PM +0800, Shannon Zhao wrote: > >> > From: Shannon Zhao > >> > > >> > Add NUMA support for machine virt. Tested

Re: [Qemu-devel] [PATCH v3] blockjob: Fix hang in block_job_finish_sync

2016-01-29 Thread Stefan Hajnoczi
On Fri, Jan 29, 2016 at 10:19:49AM +0800, Fam Zheng wrote: > @@ -402,6 +407,10 @@ typedef void BlockJobDeferToMainLoopFn(BlockJob *job, > void *opaque); > * AioContext acquired. Block jobs must call bdrv_unref(), bdrv_close(), and > * anything that uses bdrv_drain_all() in the main loop. >

Re: [Qemu-devel] [PATCH v19 3/9] pc: add a Virtual Machine Generation ID device

2016-01-29 Thread Igor Mammedov
On Thu, 28 Jan 2016 14:59:25 +0200 "Michael S. Tsirkin" wrote: > On Thu, Jan 28, 2016 at 01:03:16PM +0100, Igor Mammedov wrote: > > On Thu, 28 Jan 2016 13:13:04 +0200 > > "Michael S. Tsirkin" wrote: > > > > > On Thu, Jan 28, 2016 at 11:54:25AM +0100, Igor

Re: [Qemu-devel] [PATCH 1/2] block: fix assert in qcow2_get_specific_info

2016-01-29 Thread Denis V. Lunev
On 01/20/2016 10:12 AM, Denis V. Lunev wrote: There is a possibility to hit assert qcow2_get_specific_info that s->qcow_version is undefined. This happens when VM in starting from suspended state, i.e. it processes incoming migration, and in the same time 'info block' is called. The problem is

Re: [Qemu-devel] [PATCH v9 36/37] RFC: qapi: Adjust layout of FooList types

2016-01-29 Thread Markus Armbruster
Eric Blake writes: > On 01/28/2016 08:34 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> By sticking the next pointer first, we don't need a union with >>> 64-bit padding for smaller types. On 32-bit platforms, this >>> can reduce the size of

[Qemu-devel] [RFC v7 09/16] softmmu: Include MMIO/invalid exclusive accesses

2016-01-29 Thread Alvise Rigo
Enable exclusive accesses when the MMIO/invalid flag is set in the TLB entry. In case a LL access is done to MMIO memory, we treat it differently from a RAM access in that we do not rely on the EXCL bitmap to flag the page as exclusive. In fact, we don't even need the TLB_EXCL flag to force the

[Qemu-devel] [RFC v7 02/16] softmmu: Simplify helper_*_st_name, wrap unaligned code

2016-01-29 Thread Alvise Rigo
Attempting to simplify the helper_*_st_name, wrap the do_unaligned_access code into an inline function. Remove also the goto statement. Based on this work, Alex proposed the following patch series https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg01136.html that reduces code duplication of

[Qemu-devel] [RFC v7 07/16] softmmu: Add helpers for a new slowpath

2016-01-29 Thread Alvise Rigo
The new helpers rely on the legacy ones to perform the actual read/write. The LoadLink helper (helper_ldlink_name) prepares the way for the following StoreCond operation. It sets the linked address and the size of the access. The LoadLink helper also updates the TLB entry of the page involved in

[Qemu-devel] [RFC v7 06/16] qom: cpu: Add CPUClass hooks for exclusive range

2016-01-29 Thread Alvise Rigo
The excl_protected_range is a hwaddr range set by the VCPU at the execution of a LoadLink instruction. If a normal access writes to this range, the corresponding StoreCond will fail. Each architecture can set the exclusive range when issuing the LoadLink operation through a CPUClass hook. This

Re: [Qemu-devel] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-29 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 01/27/2016 07:03 PM, Dr. David Alan Gilbert wrote: > > Hi, > > I've got a block error if I kill the secondary. > > > > Start both primary & secondary > > kill -9 secondary qemu > > x_colo_lost_heartbeat on primary > > > > The guest sees a block

Re: [Qemu-devel] [PATCH 0/8] ivshmem: test msi=off, remove CharDriver

2016-01-29 Thread Marc-André Lureau
ping On Thu, Jan 7, 2016 at 4:52 PM, Marc-André Lureau wrote: > Hi > > On Mon, Dec 21, 2015 at 12:30 PM, wrote: >> From: Marc-André Lureau >> >> This is a ivshmem series with various bits: >> - add a test

Re: [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct

2016-01-29 Thread Aurelien Jarno
On 2016-01-25 17:40, Peter Maydell wrote: > The r4k_tlb_t structure uses the uint_fast*_t types. Most of these > uses are in bitfields and are thus pointless, because the bitfield > itself specifies the width of the type; just use 'unsigned int' > instead. (On glibc uint_fast16_t is defined as

Re: [Qemu-devel] [iGVT-g] VFIO based vGPU(was Re: [Announcement] 2015-Q3 release of XenGT - a Mediated ...)

2016-01-29 Thread Jike Song
On 01/29/2016 03:20 PM, Jike Song wrote: > This discussion becomes a little difficult for a newbie like me :( > > On 01/28/2016 11:23 PM, Alex Williamson wrote: >> On Thu, 2016-01-28 at 14:00 +0800, Jike Song wrote: >>> On 01/28/2016 12:19 AM, Alex Williamson wrote: On Wed, 2016-01-27 at

Re: [Qemu-devel] [PATCH 0/4] fpu: Remove use of int_fast*_t types

2016-01-29 Thread Aurelien Jarno
On 2016-01-26 11:30, Peter Maydell wrote: > This patchset removes the uses of int_fast*_t types from the > softfloat code: > * the return types for the "convert to 16 bit integer" functions >are changed to int16_t > * uses of int_fast*_t for a shift count or an exponent value >are

[Qemu-devel] [RFC v7 15/16] target-arm: cpu64: use custom set_excl hook

2016-01-29 Thread Alvise Rigo
In aarch64 the LDXP/STXP instructions allow to perform up to 128 bits exclusive accesses. However, due to a softmmu limitation, such wide accesses are not allowed. To workaround this limitation, we need to support LoadLink instructions that cover at least 128 consecutive bits (see the next patch

[Qemu-devel] [RFC v7 16/16] target-arm: aarch64: add atomic instructions

2016-01-29 Thread Alvise Rigo
Use the new LL/SC runtime helpers to handle the aarch64 atomic instructions in softmmu_llsc_template.h. The STXP emulation required a dedicated helper to handle the paired doubleword case. Suggested-by: Jani Kokkonen Suggested-by: Claudio Fontana

Re: [Qemu-devel] [PATCH v5] qom, qmp, hmp, qapi: create qom-type-prop-list for class properties

2016-01-29 Thread Valentin Rakush
Hi Eduardo, hi Daniel, I checked most of the classes that are used for x86_64 qemu simulation with this command line: x86_64-softmmu/qemu-system-x86_64 -qmp tcp:localhost:,server,nowait -machine pc -cpu core2duo Here are some of the classes that cannot provide properties with

Re: [Qemu-devel] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-29 Thread Wen Congyang
On 01/29/2016 06:07 PM, Dr. David Alan Gilbert wrote: > * Wen Congyang (we...@cn.fujitsu.com) wrote: >> On 01/27/2016 07:03 PM, Dr. David Alan Gilbert wrote: >>> Hi, >>> I've got a block error if I kill the secondary. >>> >>> Start both primary & secondary >>> kill -9 secondary qemu >>>

[Qemu-devel] [RFC v7 08/16] softmmu: Honor the new exclusive bitmap

2016-01-29 Thread Alvise Rigo
The pages set as exclusive (clean) in the DIRTY_MEMORY_EXCLUSIVE bitmap have to have their TLB entries flagged with TLB_EXCL. The accesses to pages with TLB_EXCL flag set have to be properly handled in that they can potentially invalidate an open LL/SC transaction. Modify the TLB entries

[Qemu-devel] [RFC v7 11/16] tcg: Create new runtime helpers for excl accesses

2016-01-29 Thread Alvise Rigo
Introduce a set of new runtime helpers to handle exclusive instructions. These helpers are used as hooks to call the respective LL/SC helpers in softmmu_llsc_template.h from TCG code. The helpers ending with an "a" make an alignment check. Suggested-by: Jani Kokkonen

Re: [Qemu-devel] [PATCH] MAINTAINERS: Add section for FPU emulation

2016-01-29 Thread Aurelien Jarno
On 2016-01-26 13:27, Peter Maydell wrote: > Add an entry to the MAINTAINERS file for our softfloat FPU > emulation code. This code is only 'odd fixes' but it's useful to > record who to cc on patches to it. > > Signed-off-by: Peter Maydell > --- > Would anybody else

[Qemu-devel] [RFC v7 04/16] softmmu: Simplify helper_*_st_name, wrap RAM code

2016-01-29 Thread Alvise Rigo
Attempting to simplify the helper_*_st_name, wrap the code relative to a RAM access into an inline function. Based on this work, Alex proposed the following patch series https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg01136.html that reduces code duplication of the softmmu_helpers.

[Qemu-devel] [RFC v7 10/16] softmmu: Protect MMIO exclusive range

2016-01-29 Thread Alvise Rigo
As for the RAM case, also the MMIO exclusive ranges have to be protected by other CPU's accesses. In order to do that, we flag the accessed MemoryRegion to mark that an exclusive access has been performed and is not concluded yet. This flag will force the other CPUs to invalidate the exclusive

[Qemu-devel] [RFC v7 00/16] Slow-path for atomic instruction translation

2016-01-29 Thread Alvise Rigo
This is the seventh iteration of the patch series which applies to the upstream branch of QEMU (v2.5.0-rc4). Changes versus previous versions are at the bottom of this cover letter. The code is also available at following repository: https://git.virtualopensystems.com/dev/qemu-mt.git branch:

[Qemu-devel] [RFC v7 12/16] configure: Use slow-path for atomic only when the softmmu is enabled

2016-01-29 Thread Alvise Rigo
Use the new slow path for atomic instruction translation when the softmmu is enabled. At the moment only arm and aarch64 use the new LL/SC backend. It is possible to disable such backed with --disable-arm-llsc-backend. Suggested-by: Jani Kokkonen Suggested-by: Claudio

[Qemu-devel] [RFC v7 13/16] softmmu: Add history of excl accesses

2016-01-29 Thread Alvise Rigo
Add a circular buffer to store the hw addresses used in the last EXCLUSIVE_HISTORY_LEN exclusive accesses. When an address is pop'ed from the buffer, its page will be set as not exclusive. In this way, we avoid: - frequent set/unset of a page (causing frequent flushes as well) - the possibility

Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse

2016-01-29 Thread Shannon Zhao
Hi, This makes ACPI work well but makes DT not work. The reason is systemd or acpid open /dev/input/event0 failed. So the interrupt could be injected and could see under /proc/interrupts but guest doesn't have any action. I'll investigate why it opens failed later. 2016年1月29日星期五,Wei Huang

  1   2   3   4   >