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 of

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 TAP devices > > > to > > > fix vnet headers

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 > --- a/tests/qemu-iotests/094 >

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 = qdev_get_child_bus(DE

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 as it did previous

[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> Signed-off-by: Eric

[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 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 tag_member.check()

[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 bac5429ccb4f41d421ec64

[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> --- scripts/qapi.py | 14 +- 1

[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> Signed-off-by: Markus Armbruster --- scrip

[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> Signed-off-by: Eric Blake Me

[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 gen_union() to gen_vari

[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 that for another da

[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 itself should have n

[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 Message-Id: <1447836791-369-4

[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 base (if any), visit

[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 --- include/qapi/visitor.h | 3 --- 1 file chan

[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 that moved tag_membe

[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 compatibility with older ver

[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 qapi-schema-test to test t

[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 names

[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 c_enum_const() is used

[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 owns the member. In

[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 underscore for qapi i

[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 the former keeps the a

[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 to use QAPI for pro

[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 lacked the desired pr

[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: <1447836791-369-24-git-send-email-ebl...@redhat.com> [Commit messa

[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 just generate all de

[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 check_member_clash() parser function wa

[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 the same check, so we

[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, &has_fdset_id, "fdset-id", &err); |-

[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 directly into QObject (r

[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 would munge into ONE_TW

[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 Message-Id: <1449033659-25497-7-git-send-email-ebl...@redhat.co

[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 fixes the previousl

[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 whitelisted name 'U

[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 example, the global chec

[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 qapi definition avoid

[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, &has_fdset_id, "fdset-id"); |-if (has_fdset

[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 stable. It can also be

[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 a temporary patch:

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 do

[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 QAPISchema._make_enum_membe

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 >> --- >> Fam, a

[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 integral values. With

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(&req->cancel_notifiers, notifier); >> > } >> > -if (req->io_canceled) { >> > -return; >> > -} >> > scsi_req_ref(req); >> > scsi_req_dequeue(req); >> > req->io_cancel

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. Mo

[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 helpe

[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 types. This has a cou

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 u

[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, wh

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 > > > populates the PCI device tree in the opposite o

[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 --- hw/virtio/vhost.c |9 ++

[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

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))) { > ... > } > object_property_iter_free(iter); > > This has the

[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 = &s->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 s->entries[ar

[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. This patch remove

[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

[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 patch, as that fun

[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 bulk transfers (

[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) is replaced by

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(&s->common, data->ret); > g_free(data); > -bdrv_drained_end(src); > +if (drained_begin) { > +bdrv_drained_

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 >>> simply drop the useless error handling. >>

[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 significant byte of

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 to

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 > Signed-off-by

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 wrote: [...] > > > For initial conversion o

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, cleaned up in commit >>

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 sen

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 retrieved from host device t

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 > de

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(); } -gue

[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 --- a/scripts/tracetool.py +++

[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 --- a/scripts/qapi.py +++ b/scripts

[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 a/tests/image-fuzzer/runner.py b/tests/image

[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 insertions(+), 6 deletions(-

[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

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 p

[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 wil

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 tha

[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 pointers

[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 3/6] seabios: use new EXTRAVERSION to tag qemu builds

2015-12-17 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- roms/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roms/Makefile b/roms/Makefile index 09e33b5..01f2701 100644 --- a/roms/Makefile +++ b/roms/Makefile @@ -35,7 +35,7 @@ powerpc_cross_prefix := $(call find-cross-prefix,powerpc)

[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 b/hw/i386/pc_q35.c index 133bc68..

[Qemu-devel] [PATCH 2/6] seabios: update 128k bios config

2015-12-17 Thread Gerd Hoffmann
Turn off OHCI + TPM support to keep the size below 128k. Signed-off-by: Gerd Hoffmann --- roms/config.seabios-128k | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roms/config.seabios-128k b/roms/config.seabios-128k index c719ba6..0a9da77 100644 --- a/roms/config.seabios-128k +++ b/roms/con

[Qemu-devel] [PATCH 4/6] seabios: stop updating aml files

2015-12-17 Thread Gerd Hoffmann
ACPI aml files traditionally have been managed in the seabios repo. In qemu version 2.0 we've switched over to have qemu generate the acpi tables and provide them to the firmware via fw_cfg. The old aml files are still there and used for old machine types. Well, actually the q35 file only, the pii

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

2015-12-17 Thread Gerd Hoffmann
Highlights / user visible changes in seabios: * boot menu key is ESC now. * virtio 1.0 support. * sdcard support. * fw_cfg dma suport. * usual share of bugfixes ;) In vgabios: * Emulates leal instruction. Works around a bug in old x86emu versions, which makes old xorg vesa drivers work (

[Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change

2015-12-17 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" x-blockdev-change has no HMP equivalent, so add x_block_change. Example useages are: x_block_change foo -a bah to add the node bah to the parent foo x_block_change foo -d bah to delete the node bah from the parent foo Signed-off-by: Dr. David Alan Gilbert

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

2015-12-17 Thread Peter Zijlstra
On Thu, Dec 17, 2015 at 12:32:53PM +0200, Michael S. Tsirkin wrote: > +static inline void virtio_store_mb(bool weak_barriers, > +__virtio16 *p, __virtio16 v) > +{ > +#ifdef CONFIG_SMP > + if (weak_barriers) > + smp_store_mb(*p, v); > + else > +#en

Re: [Qemu-devel] [PATCH COLO-Frame v12 00/38] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2015-12-17 Thread Dr. David Alan Gilbert
* Hailiang Zhang (zhang.zhanghaili...@huawei.com) wrote: > On 2015/12/15 20:14, Dr. David Alan Gilbert wrote: > >* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > >>This is the 12th version of COLO. > >> > >>As usual, this version of COLO is only support periodic checkpoint, > >>just like M

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

2015-12-17 Thread Peter Zijlstra
On Thu, Dec 17, 2015 at 12:29:03PM +0200, Michael S. Tsirkin wrote: > +static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 > *p) > +{ > + if (!weak_barriers) { > + rmb(); > + return READ_ONCE(*p); > + } > +#ifdef CONFIG_SMP > + return smp

Re: [Qemu-devel] [PULL 0/5] usb: ehci idt fix, event support for mtp

2015-12-17 Thread Peter Maydell
On 15 December 2015 at 10:02, Gerd Hoffmann wrote: > Hi, > > Qemu 2.5 is almost out of the door, /me starts picking up patches which > had to wait due to the freeze, to clear my queues before I disappear > into my xmas family vacation next week. > > First is the usb patch queue, featuring mtp ev

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

2015-12-17 Thread Peter Maydell
On 17 December 2015 at 10:28, Paolo Bonzini wrote: > > > 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

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

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 12:11, Peter Maydell wrote: > > It's a hack and I don't want it to become a sanctioned way to do it. > > It's already messing around pretty heavily with qdev internals, see the > > line right after QLIST_INSERT_HEAD: > > > > QLIST_INSERT_HEAD(&dev->child_bus, spi_bus, siblin

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

2015-12-17 Thread Peter Zijlstra
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? Would help if you Cc people who would actually know this :-) Yes, we've rece

Re: [Qemu-devel] [PATCH v6 0/5] Add an i.MX25 specific CCM driver

2015-12-17 Thread Peter Maydell
On 7 December 2015 at 22:53, Jean-Christophe Dubois wrote: > i.MX25 SOC has a different CCM device than i.MX31. > > Qemu i.MX25 emulation was built with i.MX31 CCM driver. This allows > Linux to work on top of the i.MX25 emultion but this is not correct. > > Furthermore, other SOC we could emulat

Re: [Qemu-devel] [PULL 0/5] coreaudio: use new-in-OSX-10.6 APIs, cleanups.

2015-12-17 Thread Peter Maydell
On 15 December 2015 at 10:18, Gerd Hoffmann wrote: > Hi, > > Next in line: coreaudio modernization. Use newer APIs id possible, > some cleanups. Builds fine on my linux box, so it must be good ;) > > please pull, > Gerd > > The following changes since commit f05b42d3fd30bb9673cc1ac1ee8c2af8

Re: [Qemu-devel] proposal: drop support for OSX 10.5 hosts from QEMU 2.6

2015-12-17 Thread Peter Maydell
On 28 November 2015 at 22:22, Alexander Graf wrote: >> Am 28.11.2015 um 23:10 schrieb Peter Maydell : >> My suggested plan would be: >> * in the 2.5 release notes, announce that support for OSX 10.5 and PPC >> hosts is deprecated and will be removed from QEMU 2.6 unless somebody >> steps forwa

  1   2   3   4   5   6   >