Re: [Qemu-devel] [PATCH RFC v2 0/2] MSI/MSIX: fix to catch and report errors

2015-12-17 Thread Cao jin
Ping. About cleanup: 1. When realize()/init() fail, PCI device will free the config space memory, so the necessary cleanup I can find until now is: MemoryRegion object. Maybe I missed something to cleanup, hope for comments. 2. certain instance: move the msi/msxi init func to the beginning

Re: [Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices

2015-12-17 Thread Peter Maydell
On 16 December 2015 at 23:24, Paolo Bonzini wrote: > > > On 16/12/2015 22:45, Alistair Francis wrote: >> + >> +/* Rename each SPI bus after the SPI device to allow the board >> + * to access all of the busses from the SoC. >> + */ >> +spi_bus =

[Qemu-devel] [PULL 35/40] qapi: Shorter visits of optional fields

2015-12-17 Thread Markus Armbruster
From: Eric Blake For less code, reflect the determined boolean value of an optional visit back to the caller instead of making the caller read the boolean after the fact. The resulting generated code has the following diff: |-visit_optional(v, _fdset_id, "fdset-id"); |-

[Qemu-devel] [PATCH v2 0/3] virtio: cross-endian helpers fixes

2015-12-17 Thread Greg Kurz
This series tries to rework cross-endian helpers for better clarity. It does not change behaviour, except perhaps patch 3/3 even if I could not measure any performance gain. --- Greg Kurz (3): virtio: move cross-endian helper to vhost vhost: move virtio 1.0 check to cross-endian

[Qemu-devel] [PULL 30/40] qapi: Simplify visiting of alternate types

2015-12-17 Thread Markus Armbruster
From: Eric Blake Previously, working with alternates required two lookup arrays and some indirection: for type Foo, we created Foo_qtypes[] which maps each qtype to a value of the generated FooKind enum, then look up that value in FooKind_lookup[] like we do for other union

Re: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2015-12-17 Thread Alex Pyrgiotis
Hi Paolo, On 12/16/2015 08:16 PM, Paolo Bonzini wrote: > > > On 16/12/2015 17:55, Alex Pyrgiotis wrote: >> Hi all, >> >> This patch is an attempt to boost the performance of "scsi-generic" and >> "scsi-block" device types, by removing an extra data copy and reducing >> their memory footprint.

Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr/pci: populate PCI DT in reverse order

2015-12-17 Thread Greg Kurz
On Thu, 3 Dec 2015 15:53:17 +0100 Greg Kurz wrote: > On Tue, 1 Dec 2015 22:48:38 +0100 > Thomas Huth wrote: > > > On 30/11/15 11:45, Greg Kurz wrote: > > > Since commit 1d2d974244c6 "spapr_pci: enumerate and add PCI device tree", > > > QEMU > > >

[Qemu-devel] [PATCH v2 2/3] vhost: move virtio 1.0 check to cross-endian helper

2015-12-17 Thread Greg Kurz
Indeed vhost doesn't need to ask for vring endian fixing if the device is virtio 1.0, since it is already handled by the in-kernel vhost driver. This patch simply consolidates the logic into the existing helper. Signed-off-by: Greg Kurz Reviewed-by: Cornelia Huck

[Qemu-devel] [PATCH v2 3/3] virtio: optimize virtio_access_is_big_endian() for little-endian targets

2015-12-17 Thread Greg Kurz
When adding cross-endian support, we introduced the TARGET_IS_BIENDIAN macro and the virtio_access_is_big_endian() helper to have a branchless fast path in the virtio memory accessors for targets that don't switch endian. This was considered as a strong requirement at the time. Now we have added

[Qemu-devel] [PULL 1/6] fw_cfg: move internal function call docs to header file

2015-12-17 Thread Gerd Hoffmann
From: "Gabriel L. Somlo" Move documentation for fw_cfg functions internal to qemufrom docs/specs/fw_cfg.txt to the fw_cfg.h header file, next to their prototype declarations, formatted as doc-comments. NOTE: Documentation for fw_cfg_add_callback() is completely dropped by this

[Qemu-devel] [PULL 2/6] fw_cfg: amend callback behavior spec to once per select

2015-12-17 Thread Gerd Hoffmann
From: "Gabriel L. Somlo" Currently, the fw_cfg internal API specifies that if an item was set up with a read callback, the callback must be run each time a byte is read from the item. This behavior is both wasteful (most items do not have a read callback set), and impractical for

[Qemu-devel] [PULL 00/40] QAPI patches for 2015-12-17

2015-12-17 Thread Markus Armbruster
The following changes since commit a8c40fa2d667e585382080db36ac44e216b37a1c: Update version for v2.5.0 release (2015-12-16 16:10:14 +) are available in the git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-qapi-2015-12-17 for you to fetch changes up to

[Qemu-devel] [PULL 06/40] qapi: Clean up after previous commit

2015-12-17 Thread Markus Armbruster
QAPISchemaObjectTypeVariants.check() parameter members and QAPISchemaObjectTypeVariant.check() parameter seen are no longer used, drop them. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-3-git-send-email-arm...@redhat.com> [rebase to earlier changes that moved

[Qemu-devel] [PULL 09/40] qapi: Factor out QAPISchemaObjectTypeMember.check_clash()

2015-12-17 Thread Markus Armbruster
While there, stick in a TODO change key of seen from QAPI name to C name. Can't do it right away, because it would fail the assertion for tests/qapi-schema/args-has-clash.json. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-6-git-send-email-arm...@redhat.com>

[Qemu-devel] [PULL 07/40] qapi: Fix up commit 7618b91's clash sanity checking change

2015-12-17 Thread Markus Armbruster
This hunk @@ -964,6 +965,7 @@ class QAPISchemaObjectType(QAPISchemaType): members = [] seen = {} for m in members: +assert c_name(m.name) not in seen seen[m.name] = m for m in self.local_members:

[Qemu-devel] [PULL 19/40] blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum

2015-12-17 Thread Markus Armbruster
From: Eric Blake No need to keep two separate enums, where editing one is likely to forget the other. Now that we can specify a qapi enum prefix, we don't even have to change the bulk of the uses. get_event_by_name() could perhaps be replaced by qapi_enum_parse(), but I left

[Qemu-devel] [PULL 13/40] qapi: Hoist tag collision check to Variants.check()

2015-12-17 Thread Markus Armbruster
From: Eric Blake Checking that a given QAPISchemaObjectTypeVariant.name is a member of the corresponding QAPISchemaEnumType of the owning QAPISchemaObjectTypeVariants.tag_member ensures that there are no collisions in the generated C union for those tag values (since the enum

[Qemu-devel] [PULL 12/40] qapi: Factor out QAPISchemaObjectType.check_clash()

2015-12-17 Thread Markus Armbruster
From: Eric Blake Consolidate two common sequences of clash detection into a new QAPISchemaObjectType.check_clash() helper method. No change to generated code. Signed-off-by: Eric Blake Message-Id: <1447836791-369-13-git-send-email-ebl...@redhat.com>

[Qemu-devel] [PULL 04/40] qapi: Drop obsolete tag value collision assertions

2015-12-17 Thread Markus Armbruster
Union tag values can't clash with member names in generated C anymore since commit e4ba22b, but QAPISchemaObjectTypeVariants.check() still asserts they don't. Drop it. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-1-git-send-email-arm...@redhat.com>

[Qemu-devel] [PULL 02/40] qapi-types: Consolidate gen_struct() and gen_union()

2015-12-17 Thread Markus Armbruster
From: Eric Blake These two methods are now close enough that we can finally merge them, relying on the fact that simple unions now provide a reasonable local_members. Change gen_struct() to gen_object() that handles all forms of QAPISchemaObjectType, and rename and shrink

[Qemu-devel] [PULL 15/40] qapi: Track owner of each object member

2015-12-17 Thread Markus Armbruster
From: Eric Blake Future commits will migrate semantic checking away from parsing and over to the various QAPISchema*.check() methods. But to report an error message about an incorrect semantic use of a member of an object type, it helps to know which type, command, or event

[Qemu-devel] [PULL 21/40] qapi: Tighten the regex on valid names

2015-12-17 Thread Markus Armbruster
From: Eric Blake We already documented that qapi names should match specific patterns (such as starting with a letter unless it was an enum value or a downstream extension). Tighten that from a suggestion into a hard requirement, which frees up names beginning with a single

[Qemu-devel] [PULL 23/40] qapi: Remove obsolete tests for MAX collision

2015-12-17 Thread Markus Armbruster
From: Eric Blake Now that we no longer collide with an implicit _MAX enum member, we no longer need to reject it in the ad hoc parser, and can remove several tests that are no longer needed. Signed-off-by: Eric Blake Message-Id:

[Qemu-devel] [PULL 36/40] qapi: Prepare new QAPISchemaMember base class

2015-12-17 Thread Markus Armbruster
From: Eric Blake We want to share some clash detection code between enum values and object type members. To assist with that, split off part of QAPISchemaObjectTypeMember into a new base class QAPISchemaMember that tracks name, owner, and common clash detection code; while

[Qemu-devel] [PULL 28/40] qobject: Rename qtype_code to QType

2015-12-17 Thread Markus Armbruster
From: Eric Blake The name QType matches our CODING_STYLE conventions for type names in CamelCase. It also matches the fact that we are already naming all the enum members with a prefix of QTYPE, not QTYPE_CODE. And doing the rename will also make it easier for the next patch

[Qemu-devel] [PULL 17/40] qapi: Fix c_name() munging

2015-12-17 Thread Markus Armbruster
From: Eric Blake The method c_name() is supposed to do two different actions: munge '-' into '_', and add a 'q_' prefix to ticklish names. But it did these steps out of order, making it possible to submit input that is not ticklish until after munging, where the output then

[Qemu-devel] [PULL 37/40] qapi: Track enum values by QAPISchemaMember, not string

2015-12-17 Thread Markus Armbruster
From: Eric Blake Rather than using just an array of strings, make enum.values be an array of the new QAPISchemaMember type, and add a helper member_names() method to get back at the original list of names. Likewise, creating an enum requires wrapping strings, via a new

[Qemu-devel] [PULL 22/40] qapi: Don't let implicit enum MAX member collide

2015-12-17 Thread Markus Armbruster
From: Eric Blake Now that we guarantee the user doesn't have any enum values beginning with a single underscore, we can use that for our own purposes. Renaming ENUM_MAX to ENUM__MAX makes it obvious that the sentinel is generated. This patch was mostly generated by applying

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 08:17, Gonglei (Arei) wrote: >> On 16/12/2015 11:28, Gonglei (Arei) wrote: >>> I'll move the global nmi_disabled into RTCState, then I have to add a global >> RTCState >>> Variable so that other C files can use the rtc_state->external_nmi_disabled. >> >> Hmm, I think it should be

[Qemu-devel] [PULL 20/40] blkdebug: Avoid '.' in enum values

2015-12-17 Thread Markus Armbruster
From: Eric Blake Our qapi conventions document that '.' should only be used in the prefix of downstream names. BlkdebugEvent was a lone exception to this. Changing this is not backwards compatible to the 'blockdev-add' QMP command; however, that command is not yet fully

Re: [Qemu-devel] [PATCH v2] qom: change object property iterator API contract

2015-12-17 Thread Markus Armbruster
"Daniel P. Berrange" writes: > Currently the object property iterator API works as follows > > ObjectPropertyIterator *iter; > > iter = object_property_iter_init(obj); > while ((prop = object_property_iter_next(iter))) { > ... > } >

[Qemu-devel] [PULL 6/6] fw_cfg: replace ioport data read with generic method

2015-12-17 Thread Gerd Hoffmann
From: "Gabriel L. Somlo" IOPort read access is limited to one byte at a time by fw_cfg_comb_valid(). As such, fw_cfg_comb_read() may safely ignore its size argument (which will always be 1), and simply call its fw_cfg_read() helper function once, returning 8 bits via the least

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-17 Thread Gonglei (Arei)
> > From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo > Bonzini > Sent: Thursday, December 17, 2015 4:37 PM > > > On 17/12/2015 08:17, Gonglei (Arei) wrote: > >> On 16/12/2015 11:28, Gonglei (Arei) wrote: > >>> I'll move the global nmi_disabled into RTCState, then I have

[Qemu-devel] [PULL 08/40] qapi: Eliminate QAPISchemaObjectType.check() variable members

2015-12-17 Thread Markus Armbruster
We can use seen.values() instead if we make it an OrderedDict. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-5-git-send-email-arm...@redhat.com> Signed-off-by: Eric Blake Message-Id: <1447836791-369-9-git-send-email-ebl...@redhat.com> ---

[Qemu-devel] [PULL 24/40] cpu: Convert CpuInfo into flat union

2015-12-17 Thread Markus Armbruster
From: Eric Blake The CpuInfo struct is used only by the 'query-cpus' output command, so we are free to modify it by adding fields (clients are already supposed to ignore unknown output fields), or by changing optional members to mandatory, while still keeping QMP wire

[Qemu-devel] [PULL 14/40] qapi: Remove outdated tests related to QMP/branch collisions

2015-12-17 Thread Markus Armbruster
From: Eric Blake Now that branches are in a separate C namespace, we can remove the restrictions in the parser that claim a branch name would collide with QMP, and delete the negative tests that are no longer problematic. A separate patch can then add positive tests to

[Qemu-devel] [PULL 18/40] qapi: Remove dead visitor code

2015-12-17 Thread Markus Armbruster
From: Eric Blake Commit cbc95538 removed unused start_handle() and end_handle(), but forgot to remove their declarations. Signed-off-by: Eric Blake Message-Id: <1447836791-369-19-git-send-email-ebl...@redhat.com> Signed-off-by: Markus Armbruster

[Qemu-devel] [PULL 10/40] qapi: Simplify QAPISchemaObjectTypeVariants.check()

2015-12-17 Thread Markus Armbruster
Reduce the ugly flat union / simple union conditional by doing just the essential work here, namely setting self.tag_member. Move the rest to callers. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-7-git-send-email-arm...@redhat.com> [rebase to earlier changes

[Qemu-devel] [PULL 26/40] qapi: Change munging of CamelCase enum values

2015-12-17 Thread Markus Armbruster
From: Eric Blake When munging enum values, the fact that we were passing the entire prefix + value through camel_to_upper() meant that enum values spelled with CamelCase could be turned into CAMEL_CASE. However, this provides a potential collision (both OneTwo and One-Two

[Qemu-devel] [PULL 32/40] qapi: Inline _make_implicit_tag()

2015-12-17 Thread Markus Armbruster
From: Eric Blake Now that alternates no longer use an implicit tag, we can inline _make_implicit_tag() into its one caller, _def_union_type(). No change to generated code. Suggested-by: Markus Armbruster Signed-off-by: Eric Blake

[Qemu-devel] [PULL 16/40] qapi: Detect collisions in C member names

2015-12-17 Thread Markus Armbruster
From: Eric Blake Detect attempts to declare two object members that would result in the same C member name, by keying the 'seen' dictionary off of the C name rather than the qapi name. It also requires passing info through the check_clash() methods. This addresses a TODO and

[Qemu-devel] [PULL 27/40] qobject: Simplify QObject

2015-12-17 Thread Markus Armbruster
From: Eric Blake The QObject hierarchy is small enough, and unlikely to grow further (since we only use it to map to JSON and already cover all JSON types), that we can simplify things by not tracking a separate vtable, but just inline the code element of the vtable QType

Re: [Qemu-devel] [PATCH untested] mirror: start drained section earlier

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 03:14, Fam Zheng wrote: > @@ -388,7 +390,9 @@ static void mirror_exit(BlockJob *job, void *opaque) > bdrv_unref(s->target); > block_job_completed(>common, data->ret); > g_free(data); > -bdrv_drained_end(src); > +if (drained_begin) { > +

[Qemu-devel] [PULL 5/6] fw_cfg: add generic non-DMA read method

2015-12-17 Thread Gerd Hoffmann
From: "Gabriel L. Somlo" Introduce fw_cfg_data_read(), a generic read method which works on all access widths (1 through 8 bytes, inclusive), and can be used during both IOPort and MMIO read accesses. To maintain legibility, only fw_cfg_data_mem_read() (the MMIO data read method)

Re: [Qemu-devel] [PATCH v3 0/3] virtio-net/vhost-net: share cross-endian enablement

2015-12-17 Thread Greg Kurz
On Wed, 18 Nov 2015 22:46:55 +0100 Greg Kurz wrote: > On Wed, 18 Nov 2015 22:48:06 +0200 > "Michael S. Tsirkin" wrote: > > > On Wed, Nov 18, 2015 at 05:23:00PM +0100, Greg Kurz wrote: > > > Since QEMU 2.4.0, vhost-net uses the cross-endian support of

Re: [Qemu-devel] [PATCH 2/2] iotests: Don't mention bdrv_swap in comments

2015-12-17 Thread Kevin Wolf
Am 17.12.2015 um 06:09 hat Fam Zheng geschrieben: > Signed-off-by: Fam Zheng > --- > tests/qemu-iotests/094 | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/tests/qemu-iotests/094 b/tests/qemu-iotests/094 > index 27a2be2..d30c78d 100755 > ---

Re: [Qemu-devel] [PATCH v3 03/11] fdc: add disk field

2015-12-17 Thread Markus Armbruster
John Snow writes: > This allows us to distinguish between the current disk type and the > current drive type. The drive is what's reported to CMOS, the disk is > whatever the pick_geometry function suspects has been inserted. > > The drive field maintains the exact same meaning

[Qemu-devel] [PULL 01/40] qapi: Track simple union tag in object.local_members

2015-12-17 Thread Markus Armbruster
From: Eric Blake We were previously creating all unions with an empty list for local_members. However, it will make it easier to unify struct and union generation if we include the generated tag member in local_members. That way, we can have a common code pattern: visit the

[Qemu-devel] [PULL 03/40] qapi-types: Simplify gen_struct_field[s]

2015-12-17 Thread Markus Armbruster
From: Eric Blake Simplify gen_struct_fields() back to a single iteration over a list of fields (like it was prior to commit f87ab7f9), by moving the generated comments to gen_object(). Then, inline gen_struct_field() into its only caller. Signed-off-by: Eric Blake

[Qemu-devel] [PULL 25/40] qapi: Add alias for ErrorClass

2015-12-17 Thread Markus Armbruster
From: Eric Blake The qapi enum ErrorClass is unusual that it uses 'CamelCase' names, contrary to our documented convention of preferring 'lower-case'. However, this enum is entrenched in the API; we cannot change what strings QMP outputs. Meanwhile, we want to simplify how

[Qemu-devel] [PULL 05/40] qapi: Simplify QAPISchemaObjectTypeMember.check()

2015-12-17 Thread Markus Armbruster
QAPISchemaObjectTypeMember.check() currently does four things: 1. Compute self.type 2. Accumulate members in all_members Only one caller cares: QAPISchemaObjectType.check() uses it to compute self.members. The other callers pass a throw-away accumulator. 3. Accumulate a map from

[Qemu-devel] [PULL 11/40] qapi: Check for QAPI collisions involving variant members

2015-12-17 Thread Markus Armbruster
From: Eric Blake Right now, our ad hoc parser ensures that we cannot have a flat union that introduces any members that would clash with non-variant members inherited from the union's base type (see flat-union-clash-member.json). We want QAPISchemaObjectType.check() to make

[Qemu-devel] [PULL 40/40] qapi: Detect base class loops

2015-12-17 Thread Markus Armbruster
From: Eric Blake It should be fairly obvious that qapi base classes need to form an acyclic graph, since QMP cannot specify the same key more than once, while base classes are included as flat members alongside other members added by the child. But the old

[Qemu-devel] [PULL 34/40] qapi: Simplify visits of optional fields

2015-12-17 Thread Markus Armbruster
From: Eric Blake None of the visitor callbacks would set an error when testing if an optional field was present; make this part of the interface contract by eliminating the errp argument. The resulting generated code has a nice diff: |-visit_optional(v, _fdset_id,

[Qemu-devel] [PULL 31/40] qapi-types: Drop unnedeed ._fwdefn

2015-12-17 Thread Markus Armbruster
From: Eric Blake Previously, the generated code in qapi-types.c initialized all enum lookup tables first, prior to any other definitions. But there are no topological sorting requirements that mandate this layout, so we can drop the QAPISchemaGenTypeVisitor._fwdefn field and

[Qemu-devel] [PULL 39/40] qapi: Move duplicate collision checks to schema check()

2015-12-17 Thread Markus Armbruster
From: Eric Blake With the recent commit 'qapi: Detect collisions in C member names', we have two different locations for detecting clashes - one at parse time, and another at QAPISchema*.check() time. Remove all of the ad hoc parser checks, and delete associated code (for

[Qemu-devel] [PULL 29/40] qapi: Convert QType into QAPI built-in enum type

2015-12-17 Thread Markus Armbruster
From: Eric Blake What's more meta than using qapi to define qapi? :) Convert QType into a full-fledged[*] builtin qapi enum type, so that a subsequent patch can then use it as the discriminator type of qapi alternate types. Fortunately, the judicious use of 'prefix' in the

[Qemu-devel] [PULL 38/40] qapi: Enforce (or whitelist) case conventions on qapi members

2015-12-17 Thread Markus Armbruster
From: Eric Blake We document that members of enums and objects should be 'lower-case', although we were not enforcing it. We have to whitelist a few pre-existing entities that violate the norms. Add three new tests to expose the new error message, each of which first uses the

[Qemu-devel] [PULL 33/40] qapi: Fix alternates that accept 'number' but not 'int'

2015-12-17 Thread Markus Armbruster
From: Eric Blake The QMP input visitor allows integral values to be assigned by promotion to a QTYPE_QFLOAT. However, when parsing an alternate, we did not take this into account, such that an alternate that accepts 'number' and some other type, but not 'int', would reject

Re: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 01:59, Fam Zheng wrote: > On Wed, 12/16 19:33, Paolo Bonzini wrote: >> When called from a coroutine, bdrv_ioctl must be asynchronous just like >> e.g. bdrv_flush. The code was incorrectly making it synchronous, fix >> it. >> >> Signed-off-by: Paolo Bonzini >>

Re: [Qemu-devel] [PATCH] scsi: always call notifier on async cancellation

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 02:15, Fam Zheng wrote: >> > if (notifier) { >> > notifier_list_add(>cancel_notifiers, notifier); >> > } >> > -if (req->io_canceled) { >> > -return; >> > -} >> > scsi_req_ref(req); >> > scsi_req_dequeue(req); >> > req->io_canceled =

Re: [Qemu-devel] [PATCH v2] coverity: Model g_poll()

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 08:20, Markus Armbruster wrote: > In my testing, Coverity reported two more CHECKED_RETURN: > > * qemu-char.c:1248: fixed in commit c1f2448: "qemu-char: retry g_poll > on EINTR". > > * migration/qemu-file-unix.c:75: harmless, cleaned up in commit > 4e39f57 "migration: Clean up

[Qemu-devel] [PATCH v2 1/3] virtio: move cross-endian helper to vhost

2015-12-17 Thread Greg Kurz
If target is bi-endian (ppc64, arm), the virtio_legacy_is_cross_endian() indeed returns the runtime state of the virtio device. However, it returns false unconditionally in the general case. This sounds a bit strange given the name of the function. This helper is only useful for vhost actually,

[Qemu-devel] [PULL 4/6] fw_cfg: avoid calculating invalid current entry pointer

2015-12-17 Thread Gerd Hoffmann
From: "Gabriel L. Somlo" When calculating a pointer to the currently selected fw_cfg item, the following is used: FWCfgEntry *e = >entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK]; When s->cur_entry is FW_CFG_INVALID, we are calculating the address of a non-existent element in

[Qemu-devel] [PULL 3/6] fw_cfg: remove offset argument from callback prototype

2015-12-17 Thread Gerd Hoffmann
From: "Gabriel L. Somlo" Read callbacks are now only invoked at item selection, before any data is read. As such, the value of the offset argument passed to the callback will always be 0. Also, the two callback instances currently in use both leave their offset argument unused.

[Qemu-devel] [PULL 0/6] fw_cfg: doc updates, various optimizations.

2015-12-17 Thread Gerd Hoffmann
f05b42d3fd30bb9673cc1ac1ee8c2af8f669964e: Update version for v2.5.0-rc4 release (2015-12-11 16:37:55 +) are available in the git repository at: git://git.kraxel.org/qemu tags/pull-fw-cfg-20151217-1 for you to fetch changes up to 6c8d56a2e95712a6206a2671d2b04b2e59cabc0b: fw_cfg: replace ioport data read with generic

Re: [Qemu-devel] [PATCH v2] numa: Clean up query-memdev error handling

2015-12-17 Thread Markus Armbruster
Markus Armbruster writes: > "Michael S. Tsirkin" writes: > >> On Mon, Nov 23, 2015 at 09:35:31AM +0100, Markus Armbruster wrote: >>> qmp_query_memdev() has two error paths: >>> >>> * When object_get_objects_root() returns null. It never does, so >>>

Re: [Qemu-devel] [PATCH] target-mips: silence NaNs for cvt.s.d and cvt.d.s

2015-12-17 Thread Leon Alrae
On 06/12/15 16:11, Aurelien Jarno wrote: > cvt.s.d and cvt.d.s are FP operations and thus need to convert input > sNaN into corresponding qNaN. Explicitely use the floatXX_maybe_silence_nan > functions for that as the floatXX_to_floatXX functions do not do that. > > Cc: Leon Alrae

Re: [Qemu-devel] [PATCH v2] coverity: Model g_poll()

2015-12-17 Thread Markus Armbruster
Paolo Bonzini writes: > On 17/12/2015 08:20, Markus Armbruster wrote: >> In my testing, Coverity reported two more CHECKED_RETURN: >> >> * qemu-char.c:1248: fixed in commit c1f2448: "qemu-char: retry g_poll >> on EINTR". >> >> * migration/qemu-file-unix.c:75: harmless,

Re: [Qemu-devel] [PATCH 1/2] ohci: delay first SOF interrupt

2015-12-17 Thread Thomas Huth
On 16/12/15 14:39, Laurent Vivier wrote: > On overcommitted CPU, kernel can be so slow that an interrupt can > be triggered by the device whereas the driver is not ready to receive > it. This drives us into an infinite loop. > > This does not happen on real hardware because real hardware never

Re: [Qemu-devel] [PATCH 2/2] ohci: clear pending SOF on suspend

2015-12-17 Thread Thomas Huth
On 16/12/15 14:39, Laurent Vivier wrote: > On overcommitted CPU, kernel can be so slow that an interrupt can > be triggered by the device whereas the driver is not ready to receive > it. This drives us into an infinite loop. > > On suspend, if a SOF interrupt is raised between the stop of the >

Re: [Qemu-devel] [PATCH v2 11/14] pc: Remove PcGuestInfo.isapc_ram_fw field

2015-12-17 Thread Marcel Apfelbaum
On 12/16/2015 09:48 PM, Eduardo Habkost wrote: On Tue, Dec 15, 2015 at 04:27:51PM +0200, Marcel Apfelbaum wrote: On 12/11/2015 08:42 PM, Eduardo Habkost wrote: [...] @@ -131,8 +130,7 @@ static void pc_q35_init(MachineState *machine) rom_memory = get_system_memory(); } -

[Qemu-devel] [PATCH 4/4] tests: Use Python 2.6 "except E as ..." syntax

2015-12-17 Thread Markus Armbruster
PEP 8 calls for it, because it's forward compatibile with Python 3. Signed-off-by: Markus Armbruster --- tests/image-fuzzer/runner.py | 12 ++-- tests/qemu-iotests/qed.py| 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

[Qemu-devel] [PATCH 2/4] scripts/qmp: Use Python 2.6 "except E as ..." syntax

2015-12-17 Thread Markus Armbruster
PEP 8 calls for it, because it's forward compatibile with Python 3. Signed-off-by: Markus Armbruster --- scripts/qmp/qemu-ga-client | 2 +- scripts/qmp/qmp| 4 ++-- scripts/qmp/qmp-shell | 2 +- scripts/qmp/qmp.py | 4 ++-- 4 files changed, 6

Re: [Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 09:26, Peter Maydell wrote: >> > In any case, I would prefer qdev_bus_rename to stay in xlnx-zynqmp.c. > I disagree that it should be in xlnx-zynqmp.c. Either > (a) qdev already provides some reasonable mechanism for > SoC container like this to allow their users to get at > buses

Re: [Qemu-devel] [RFC PATCH v0 0/9] Generic cpu-core device

2015-12-17 Thread Peter Krempa
On Wed, Dec 16, 2015 at 16:11:08 +0100, Igor Mammedov wrote: > On Fri, 11 Dec 2015 09:27:57 +0530 > Bharata B Rao wrote: > > > On Thu, Dec 10, 2015 at 01:35:05PM +0100, Igor Mammedov wrote: > > > On Thu, 10 Dec 2015 11:45:35 +0530 > > > Bharata B Rao

Re: [Qemu-devel] [RESEND RFC 5/6] hw/arm/sysbus-fdt: helpers for clock node generation

2015-12-17 Thread Eric Auger
Hi Alex (B), On 11/26/2015 05:06 PM, Alex Bennée wrote: > > Eric Auger writes: > >> Some passthrough'ed devices depend on clock nodes. Those need to be >> generated in the guest device tree. This patch introduces some helpers >> to build a clock node from information

[Qemu-devel] [PATCH] virtio: use smp_load_acquire/smp_store_release

2015-12-17 Thread Michael S. Tsirkin
virtio ring entries have exactly the acquire/release semantics: - reading used index acquires a ring entry from host - updating the available index releases it to host Thus when using weak barriers and building for SMP (as most people do), smp_load_acquire and smp_store_release

Re: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 09:47, Alex Pyrgiotis wrote: >> > Which commands have large payloads and are on the data path, for >> > scsi-block? Or is the use case just scsi-generic (e.g. tape devices?)? >> > >> > (Just trying to understand before I dive into the patches). > Sure, no problem. The commands

[Qemu-devel] [PATCH 1/4] qapi: Use Python 2.6 "except E as ..." syntax

2015-12-17 Thread Markus Armbruster
PEP 8 calls for it, because it's forward compatibile with Python 3. Signed-off-by: Markus Armbruster --- scripts/qapi.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 7c50cc4..ba7151b 100644 ---

[Qemu-devel] [PATCH 3/4] Revert "tracetool: use Python 2.4-compatible exception handling syntax"

2015-12-17 Thread Markus Armbruster
This reverts commit 662da3854e3f490223373b40afdcfcc339d14aa5. Signed-off-by: Markus Armbruster --- scripts/tracetool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 83bde7b..7b82959 100755 ---

[Qemu-devel] [PATCH 0/4] Use Python 2.6 "except E as ..." syntax

2015-12-17 Thread Markus Armbruster
I can take this through my tree, but of course don't mind if a maintainer prefers to pick up "his" parts. Markus Armbruster (4): qapi: Use Python 2.6 "except E as ..." syntax scripts/qmp: Use Python 2.6 "except E as ..." syntax Revert "tracetool: use Python 2.4-compatible exception handling

[Qemu-devel] [PATCH] virtio_ring: use smp_store_mb

2015-12-17 Thread Michael S. Tsirkin
We need a full barrier after writing out event index, using smp_store_mb there seems better than open-coding. As usual, we need a wrapper to account for strong barriers/non smp. It's tempting to use this in vhost as well, for that, we'll need a variant of smp_store_mb that works on __user

[Qemu-devel] [PATCH 6/6] q35: skip q35-acpi-dsdt.aml load if not needed

2015-12-17 Thread Gerd Hoffmann
Only old machine types which don't use the acpi builder (qemu 1.7 + older) have to load that file for proper acpi support. Signed-off-by: Gerd Hoffmann --- hw/i386/pc_q35.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c

[Qemu-devel] [PATCH 0/6] seabios: update to release 1.9.0

2015-12-17 Thread Gerd Hoffmann
Hi, seabios 1.9.0 was released in November, missing hard freeze by a few days. Now 2.5 is out of the door and the master branch is open, time to care about the update now, so here we go. The patch series carries the seabios update itself, a few build and config adjustments and acpi cleanups.

[Qemu-devel] [PATCH] gtk: implement set_echo

2015-12-17 Thread Paolo Bonzini
Even without line editing, this makes -qmp vc more pleasant with the GTK+ backend. The only issue is that set_echo is invoked very early, long before a vc is actually associated with a VirtualConsole. To work around this, create a temporary VirtualConsole until then. Signed-off-by: Paolo

Re: [Qemu-devel] [PATCH v2 03/26] armv7m: Explicit error for bad vector table

2015-12-17 Thread Peter Maydell
On 3 December 2015 at 00:18, Michael Davidsaver wrote: > Give an explicit error and abort when a load > from VECBASE fails. Otherwise would likely > jump to 0, which for v7-m holds the reset stack > pointer address. > --- > target-arm/helper.c | 21 - >

Re: [Qemu-devel] [PATCH] virtio_ring: use smp_store_mb

2015-12-17 Thread Michael S. Tsirkin
On Thu, Dec 17, 2015 at 12:22:22PM +0100, Peter Zijlstra wrote: > On Thu, Dec 17, 2015 at 12:32:53PM +0200, Michael S. Tsirkin wrote: > > Seems to give a speedup on my box but I'm less sure about this one. E.g. as > > xchng faster than mfence on all/most intel CPUs? Anyone has an opinion? > >

Re: [Qemu-devel] [PATCH v2 09/13] isa: Trivially convert remaining PCI-ISA bridges to realize()

2015-12-17 Thread Michael S. Tsirkin
On Thu, Dec 17, 2015 at 01:19:51PM +0100, Markus Armbruster wrote: > These are "ICH9-LPC" and "ebus". > > Cc: "Michael S. Tsirkin" > Cc: Mark Cave-Ayland > Signed-off-by: Markus Armbruster > Reviewed-by: Marcel Apfelbaum

[Qemu-devel] [PULL v1 4/9] io: add QIOChannelSocket class

2015-12-17 Thread Daniel P. Berrange
Implement a QIOChannel subclass that supports sockets I/O. The implementation is able to manage a single socket file descriptor, whether a TCP/UNIX listener, TCP/UNIX connection, or a UDP datagram. It provides APIs which can listen and connect either asynchronously or synchronously. Since there is

[Qemu-devel] [PATCH] MAINTAINERS: Add the correct device_tree.h file

2015-12-17 Thread Thomas Huth
device_tree.h is not in the main directory, but under include/sysemu/ nowadays. Signed-off-by: Thomas Huth --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index e8cee1e..a341818 100644 --- a/MAINTAINERS +++

Re: [Qemu-devel] [PULL 00/25] target-arm queue

2015-12-17 Thread Peter Maydell
f11482288e185d856431f02f: > > Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-20151215-1' > into staging (2015-12-17 11:10:03 +) > > are available in the git repository at: > > > git://git.linaro.org/people/pmaydell/qemu-arm.git > tags/pull-target-

Re: [Qemu-devel] [PATCH v5 10/10] ARM: Virt: Add gpio-keys node for Poweroff using DT

2015-12-17 Thread Peter Maydell
On 11 December 2015 at 03:21, Shannon Zhao wrote: > From: Shannon Zhao > > Add a gpio-keys node. This is used for Poweroff for the systems which > use DT not ACPI. > > Signed-off-by: Shannon Zhao > Signed-off-by:

[Qemu-devel] [PULL v1 1/9] io: add abstract QIOChannel classes

2015-12-17 Thread Daniel P. Berrange
Start the new generic I/O channel framework by defining a QIOChannel abstract base class. This is designed to feel similar to GLib's GIOChannel, but with the addition of support for using iovecs, qemu error reporting, file descriptor passing, coroutine integration and use of the QOM framework for

Re: [Qemu-devel] [RESEND RFC 5/6] hw/arm/sysbus-fdt: helpers for clock node generation

2015-12-17 Thread Peter Maydell
On 17 December 2015 at 13:28, Alex Bennée wrote: > Usually I would expect to see a pre-declaration of a function at the > head of the file and only if it is used before the actual definition of > the function. It doesn't make sense to pre-declare right before the > actual

Re: [Qemu-devel] [PATCH v2 06/26] armv7m: fix I and F flag handling

2015-12-17 Thread Peter Maydell
On 3 December 2015 at 00:18, Michael Davidsaver wrote: > Despite having the same notation, these bits > have completely different meaning than -AR. > > Use armv7m_excp_running_prio() and the highest > pending exception priority to determine > if the pending exception can

Re: [Qemu-devel] [PULL 00/40] QAPI patches for 2015-12-17

2015-12-17 Thread Peter Maydell
On 17 December 2015 at 08:33, Markus Armbruster wrote: > The following changes since commit a8c40fa2d667e585382080db36ac44e216b37a1c: > > Update version for v2.5.0 release (2015-12-16 16:10:14 +) > > are available in the git repository at: > >

[Qemu-devel] [PULL v1 2/9] io: add helper module for creating watches on FDs

2015-12-17 Thread Daniel P. Berrange
A number of the channel implementations will require the ability to create watches on file descriptors / sockets. To avoid duplicating this code in each channel, provide a helper API for dealing with file descriptor watches. There are two watch implementations provided. The first is useful for

Re: [Qemu-devel] [PATCH 1/6] arm: use "struct ARMCPU" in header files

2015-12-17 Thread Paolo Bonzini
On 15/12/2015 17:05, Peter Maydell wrote: >> > >> > typedef struct { >> > -ARMCPU *cpu; >> > +struct ARMCPU *cpu; > > Couldn't we just put the typedef in typedefs.h instead ? Even better: we can put the typedef in cpu-qom.h and move the struct definition to cpu.h. Paolo

[Qemu-devel] [PULL v1 8/9] io: add QIOChannelCommand class

2015-12-17 Thread Daniel P. Berrange
Add a QIOChannel subclass that is capable of performing I/O to/from a separate process, via a pair of pipes. The command can be used for unidirectional or bi-directional I/O. Signed-off-by: Daniel P. Berrange --- include/io/channel-command.h| 91 ++

  1   2   3   4   5   6   >