Re: [Qemu-devel] [PATCH 00/13] Mac OS 9 compatibility improvements (upstream rework)

2015-11-10 Thread David Gibson
On Wed, Nov 11, 2015 at 06:29:09AM +, Mark Cave-Ayland wrote: > On 11/11/15 02:11, David Gibson wrote: > > > On Wed, Nov 04, 2015 at 11:32:02PM +, Mark Cave-Ayland wrote: > >> On 04/11/15 03:44, David Gibson wrote: > >> > >>> On Fri, Oct 30, 2015 at 04:48:12PM +, Mark Cave-Ayland wrote

[Qemu-devel] [PULL v2 00/15] Tracing patches

2015-11-10 Thread Stefan Hajnoczi
v2: * Fixed missing log.py file when merging "trace: convert stderr backend to log" [Peter] The following changes since commit a77067f6ac9b17beefea506ce5f514072fe3fcf4: Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20151110' into staging (2015-11-10

Re: [Qemu-devel] [Qemu-ppc] [RFC PATCH v1] spapr: Memory hot-unplug support

2015-11-10 Thread Bharata B Rao
On Wed, Nov 11, 2015 at 12:36:30PM +1100, David Gibson wrote: > On Mon, Oct 26, 2015 at 03:23:05PM +0530, Bharata B Rao wrote: > > Add support to hot remove pc-dimm memory devices. > > Sorry it's taken me so long to look at this. > > > TODO: In response to memory hot removal operation on a DIMM d

[Qemu-devel] [PATCH] tests/vhost-user-bridge: implement logging of dirty pages

2015-11-10 Thread Victor Kaplansky
During migration devices continue writing to the guest's memory. These writes have to be reported to QEMU. The change implements minimal support in vhost-user-bridge required for successful migration of a guest with virtio-net device. Signed-off-by: Victor Kaplansky --- tests/vhost-user-bridge.c

Re: [Qemu-devel] [PATCH v2 7/8] hw/arm/virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3

2015-11-10 Thread Wei Huang
On 10/29/2015 09:27 AM, Shannon Zhao wrote: > Currently mach-virt model doesn't support powerdown request. Guest VM > doesn't react to system_powerdown from monitor console (or QMP) because > there is no communication mechanism for such requests. This patch registers > GPIO Pin 3 with powerdown n

[Qemu-devel] [PATCH v11 21/28] qapi: Convert qtype_code into qapi enum type

2015-11-10 Thread Eric Blake
What's more meta than using qapi to define qapi? :) Convert qtype_code 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. Doing so is easiest when renaming it to qapi conventions, as QTypeCode. Fortunately,

[Qemu-devel] [PATCH v11 27/28] qapi: Move duplicate enum value checks to schema check()

2015-11-10 Thread Eric Blake
Similar to the previous commit, move the detection of a collision in enum values from parse time to QAPISchemaEnumType.check(). This happens to also detect collisions in union branch names mapping to the same enum value, even when the names do not collide case-wise. So for a decent error message,

[Qemu-devel] [PATCH v11 25/28] qapi: Simplify visits of optional fields

2015-11-10 Thread 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. Then, for less code, reflect the determined boolean value back to the caller instead of making the caller read the boolean afte

[Qemu-devel] [PATCH] vhost-user: set link down when the char device is closed

2015-11-10 Thread Wen Congyang
Signed-off-by: Wen Congyang --- net/vhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index 0ebd7df..5071602 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -188,7 +188,7 @@ static void net_vhost_user_event(void *opaque, i

[Qemu-devel] [PATCH v11 20/28] qapi: Forbid case-insensitive clashes

2015-11-10 Thread Eric Blake
In general, designing user interfaces that rely on case distinction is poor practice. Another benefit of enforcing a restriction against case-insensitive clashes is that we no longer have to worry about the situation of enum values that could be distinguished by case if mapped by c_name(), but whi

Re: [Qemu-devel] [PATCH] vhost-user: set link down when the char device is closed

2015-11-10 Thread Yuanhan Liu
Thanks. Reviewed-by: Yuanhan Liu --yliu On Wed, Nov 11, 2015 at 02:53:29PM +0800, Wen Congyang wrote: > Signed-off-by: Wen Congyang > --- > net/vhost-user.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/vhost-user.c b/net/vhost-user.c > index

[Qemu-devel] [PATCH v11 18/28] qerror: more error_setg() usage

2015-11-10 Thread Eric Blake
A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) have snuck in since c6bd8c706. Nuke them. Signed-off-by: Eric Blake --- v11: new patch --- block.c | 3 +-- docs/writing-qmp-commands.txt | 20 +--- hw/i386/pc.c | 2 +- hw/net/rocker/ro

[Qemu-devel] [PATCH v11 28/28] qapi: Detect base class loops

2015-11-10 Thread 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 was not prepared to c

[Qemu-devel] [PATCH v11 16/28] qapi: Detect collisions in C member names

2015-11-10 Thread 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 previously-broken args-name-

[Qemu-devel] [PATCH v11 19/28] qapi: Change munging of CamelCase enum values

2015-11-10 Thread 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_TWO). By changing th

[Qemu-devel] [PATCH v11 23/28] qapi: Fix alternates that accept 'number' but not 'int'

2015-11-10 Thread 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 this patch, we now

[Qemu-devel] [PATCH v11 14/28] qapi: Remove outdated tests related to QMP/branch collisions

2015-11-10 Thread 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 that any corner case

[Qemu-devel] [PATCH v11 26/28] qapi: Move duplicate member checks to schema check()

2015-11-10 Thread Eric Blake
With the previous commit, we have two different locations for detecting member name clashes - one at parse time, and another at QAPISchema*.check() time. Consolidate some of the checks into a single place, which is also in line with our TODO to eventually move all of the parse time semantic checki

[Qemu-devel] [PATCH v11 15/28] qapi: Track owner of each object member

2015-11-10 Thread 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 particular, when a

[Qemu-devel] [PATCH v11 13/28] qapi: Hoist tag collision check to Variants.check()

2015-11-10 Thread 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 no collisions). How

[Qemu-devel] [PATCH v11 22/28] qapi: Simplify visiting of alternate types

2015-11-10 Thread 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 couple of subtle bugs.

[Qemu-devel] [PATCH v11 09/28] qapi: Factor out QAPISchemaObjectTypeMember.check_clash()

2015-11-10 Thread Eric Blake
From: 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

[Qemu-devel] [PATCH v11 11/28] qapi: Check for qapi collisions of flat union branches

2015-11-10 Thread Eric Blake
Right now, our ad hoc parser ensures that we cannot have a flat union that introduces any qapi member names that would conflict with the non-variant qapi members already present from the union's base type (see flat-union-clash-member.json). We want QAPISchemaObjectType.check() to make the same chec

Re: [Qemu-devel] [PATCH 12/13] cuda.c: fix T2 timer and enable its interrupt

2015-11-10 Thread David Gibson
On Wed, Nov 04, 2015 at 11:25:43PM +, Mark Cave-Ayland wrote: > On 04/11/15 03:40, David Gibson wrote: > > > On Fri, Oct 23, 2015 at 02:56:37PM +0100, Mark Cave-Ayland wrote: > >> Fix the counter loading logic and enable the T2 interrupt when the timer > >> expires. > > > > A mention of what

[Qemu-devel] [PATCH v11 24/28] qapi: Add positive tests to qapi-schema-test

2015-11-10 Thread Eric Blake
Add positive tests to qapi-schema-test for things that were made possible by recent patches but which caused compile errors due to collisions prior to that point. The focus is mainly on collisions due to names we have reserved for qapi, even though it is unlikely that anyone will want to abuse the

[Qemu-devel] [PATCH v11 04/28] qapi: Drop obsolete tag value collision assertions

2015-11-10 Thread Eric Blake
From: 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> Sig

[Qemu-devel] [PATCH v11 12/28] qapi: Factor out QAPISchemaObjectType.check_clash()

2015-11-10 Thread 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 --- v11: don't lose isinstance check, and don't hide type.check() inside check_clash() v10: rebase on new Variants.check_clash(

[Qemu-devel] [PATCH v11 08/28] qapi: Eliminate QAPISchemaObjectType.check() variable members

2015-11-10 Thread Eric Blake
From: 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 --- v11: no change v10: redo closer to Markus' original proposal v9: new patch --

[Qemu-devel] [PATCH v11 17/28] cpu: Convert CpuInfo into flat union

2015-11-10 Thread 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 versions of qemu. Whe

[Qemu-devel] [PATCH v11 03/28] qapi-types: Simplify gen_struct_field[s]

2015-11-10 Thread 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 --- v11: no change v10: no change v9: new patch

[Qemu-devel] [PATCH v11 05/28] qapi: Simplify QAPISchemaObjectTypeMember.check()

2015-11-10 Thread Eric Blake
From: 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. A

[Qemu-devel] [PATCH v11 10/28] qapi: Simplify QAPISchemaObjectTypeVariants.check()

2015-11-10 Thread Eric Blake
From: 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 ch

[Qemu-devel] [PATCH v11 00/28] qapi member collision, alternate layout (post-introspection cleanups, subset D)

2015-11-10 Thread Eric Blake
No pending prerequisites; based on qemu.git master Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv11d 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 v11 notes: Firs

[Qemu-devel] [PATCH v11 01/28] qapi: Track simple union tag in object.local_members

2015-11-10 Thread 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 the local members

[Qemu-devel] [PATCH v11 02/28] qapi-types: Consolidate gen_struct() and gen_union()

2015-11-10 Thread 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_variants() to handle th

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

2015-11-10 Thread Eric Blake
From: 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 sel

[Qemu-devel] [PATCH v11 06/28] qapi: Clean up after previous commit

2015-11-10 Thread Eric Blake
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()

Re: [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log

2015-11-10 Thread Stefan Hajnoczi
On Tue, Nov 10, 2015 at 4:56 PM, Peter Maydell wrote: > On 10 November 2015 at 13:31, Stefan Hajnoczi wrote: >> From: Paolo Bonzini >> >> Signed-off-by: Paolo Bonzini >> Signed-off-by: Denis V. Lunev >> Acked-by: Christian Borntraeger >> Message-id: 1446151457-21157-10-git-send-email-...@open

Re: [Qemu-devel] [PATCH 00/13] Mac OS 9 compatibility improvements (upstream rework)

2015-11-10 Thread Mark Cave-Ayland
On 11/11/15 02:11, David Gibson wrote: > On Wed, Nov 04, 2015 at 11:32:02PM +, Mark Cave-Ayland wrote: >> On 04/11/15 03:44, David Gibson wrote: >> >>> On Fri, Oct 30, 2015 at 04:48:12PM +, Mark Cave-Ayland wrote: On 23/10/15 14:56, Mark Cave-Ayland wrote: > This is a rework

Re: [Qemu-devel] [PATCH v9 26/27] qapi: Remove dead visitor code

2015-11-10 Thread Eric Blake
On 11/05/2015 12:05 PM, Markus Armbruster wrote: > Eric Blake writes: > >> Commit cbc95538 removed unused start_handle() and end_handle(), >> but forgot got remove their declarations. >> >> Commit 4e27e819 introduced optional visitor callbacks for all >> sorts of int types, but except for type_ui

Re: [Qemu-devel] [PATCH v2 3/8] hw/arm/virt-acpi-build: Add power button device in ACPI DSDT table

2015-11-10 Thread Wei Huang
On 10/29/2015 09:27 AM, Shannon Zhao wrote: > Add power button device in ACPI DSDT table. > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > --- > hw/arm/virt-acpi-build.c | 13 + > 1 file changed, 13 insertions(+) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/v

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Benjamin Herrenschmidt
On Wed, 2015-11-11 at 15:41 +1100, Alexey Kardashevskiy wrote: > Another note. I tried to know what the default devices are and got > another > crash: > > (qemu) info qtree > bus: main-system-bus >    type System >    dev: phb3-msi, id "" > /home/aik/p/qemu-powernv/hw/core/sysbus.c:276:sysbus_dev

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Alexey Kardashevskiy
On 11/11/2015 03:16 PM, Benjamin Herrenschmidt wrote: On Wed, 2015-11-11 at 15:07 +1100, Alexey Kardashevskiy wrote: p/qemu-powernv/ppc64-softmmu/qemu-system-ppc64 -m 2048 -machine powernv \ -nographic -vga none -initrd t/le.cpio -kernel t/vml420le -bios \ skiboot.lid -smp 1,threads=1 just han

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Benjamin Herrenschmidt
On Wed, 2015-11-11 at 15:07 +1100, Alexey Kardashevskiy wrote: > > p/qemu-powernv/ppc64-softmmu/qemu-system-ppc64 -m 2048 -machine > powernv \ > -nographic -vga none -initrd t/le.cpio -kernel t/vml420le -bios \ > skiboot.lid -smp 1,threads=1 > > just hangs at: > > [1491287872,5] INIT: Waiting fo

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Alexey Kardashevskiy
On 11/11/2015 02:38 PM, Benjamin Herrenschmidt wrote: On Wed, 2015-11-11 at 14:27 +1100, Alexey Kardashevskiy wrote: On 11/11/2015 11:56 AM, Benjamin Herrenschmidt wrote: On Tue, 2015-11-10 at 17:50 -0700, Eric Blake wrote: It would be nice to include a diffstat (git defaults to doing this if

[Qemu-devel] [PATCH v10 13/15] blockdev: read-only-mode for blockdev-change-medium

2015-11-10 Thread Max Reitz
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may

[Qemu-devel] [PATCH v10 00/15] blockdev: BlockBackend and media

2015-11-10 Thread Max Reitz
I'm sorry for having singlehandedly stalled the block pull request twice now, and I sure hope everything is going to be fine this time. v9 was missing a change to patch 13: While it did (probably?) fix cocoa.m in patch 11 for patch 11, patch 13 changed the signature of the function in question yet

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Benjamin Herrenschmidt
On Wed, 2015-11-11 at 14:27 +1100, Alexey Kardashevskiy wrote: > On 11/11/2015 11:56 AM, Benjamin Herrenschmidt wrote: > > On Tue, 2015-11-10 at 17:50 -0700, Eric Blake wrote: > > > > > > It would be nice to include a diffstat (git defaults to doing > > > this if > > > you use 'git format-patch --

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Alexey Kardashevskiy
On 11/11/2015 11:56 AM, Benjamin Herrenschmidt wrote: On Tue, 2015-11-10 at 17:50 -0700, Eric Blake wrote: It would be nice to include a diffstat (git defaults to doing this if you use 'git format-patch --cover-letter' for generating the 0/77 letter), so that we can see at a glance how big this

Re: [Qemu-devel] [POC]colo-proxy in qemu

2015-11-10 Thread Jason Wang
On 11/11/2015 09:23 AM, Dong, Eddie wrote: >> - What's the plan for vhost? Userspace network in qemu is rather slow, most >> user will choose vhost. > [Dong, Eddie] Hi Jason: > How about we take staging approach? In general, COLO opens a door of > high performance HA solution, but it will

Re: [Qemu-devel] [PATCH v5 0/8] e1000: Various fixes and registers' implementation

2015-11-10 Thread Jason Wang
On 11/10/2015 09:19 PM, Leonid Bloch wrote: > On Tue, Nov 10, 2015 at 3:01 PM, Jason Wang wrote: >> >> On 11/10/2015 07:39 PM, Leonid Bloch wrote: >>> On Tue, Nov 10, 2015 at 8:21 AM, Jason Wang wrote: On 11/09/2015 10:59 PM, Leonid Bloch wrote: > This series fixes issues with packet/o

Re: [Qemu-devel] [POC]colo-proxy in qemu

2015-11-10 Thread Jason Wang
On 11/10/2015 05:41 PM, Dr. David Alan Gilbert wrote: > * Jason Wang (jasow...@redhat.com) wrote: >> >> On 11/10/2015 01:26 PM, Tkid wrote: >>> Hi,all >>> >>> We are planning to reimplement colo proxy in userspace (Here is in >>> qemu) to >>> cache and compare net packets.This module is one of th

[Qemu-devel] Ask for ACK (was Re: [PATCH v7 25/35] nvdimm acpi: init the resource used by NVDIMM ACPI)

2015-11-10 Thread Xiao Guangrong
On 11/09/2015 07:13 PM, Igor Mammedov wrote: On Fri, 6 Nov 2015 16:31:43 +0800 Xiao Guangrong wrote: On 11/05/2015 10:49 PM, Igor Mammedov wrote: On Thu, 5 Nov 2015 21:33:39 +0800 Xiao Guangrong wrote: On 11/05/2015 09:03 PM, Igor Mammedov wrote: On Thu, 5 Nov 2015 18:15:31 +0800 Xi

Re: [Qemu-devel] [POC]colo-proxy in qemu

2015-11-10 Thread Jason Wang
On 11/10/2015 05:35 PM, Tkid wrote: > > > On 11/10/2015 03:35 PM, Jason Wang wrote: >> On 11/10/2015 01:26 PM, Tkid wrote: >>> Hi,all >>> >>> We are planning to reimplement colo proxy in userspace (Here is in >>> qemu) to >>> cache and compare net packets.This module is one of the important >>> c

Re: [Qemu-devel] [PATCH v10 29/30] cpu: Convert CpuInfo into flat union

2015-11-10 Thread Eric Blake
On 11/09/2015 08:22 AM, Markus Armbruster wrote: > Eric Blake writes: > >> When qapi type CpuInfo was originally created for 0.14, we had >> no notion of a flat union, and instead just listed a bunch of >> optional fields with documentation about the mutually-exclusive >> choice of which instruct

Re: [Qemu-devel] [POC]colo-proxy in qemu

2015-11-10 Thread Zhang Chen
On 11/10/2015 06:54 PM, Dr. David Alan Gilbert wrote: * Tkid (zhangchen.f...@cn.fujitsu.com) wrote: Hi,all We are planning to reimplement colo proxy in userspace (Here is in qemu) to cache and compare net packets.This module is one of the important components of COLO project and now it is sti

[Qemu-devel] [PULL 4/4] spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl

2015-11-10 Thread David Gibson
From: Bharata B Rao KVM_PPC_ALLOCATE_HTAB ioctl can return -ENOMEM for KVM guests and QEMU never handled this correctly. But this didn't cause any problems till now as KVM_PPC_ALLOCATE_HTAB ioctl returned with smaller than requested HTAB when enough contiguous memory wasn't available in the host.

[Qemu-devel] [PULL 3/4] ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM

2015-11-10 Thread David Gibson
From: Bharata B Rao The !CONFIG_KVM implementation of kvmppc_reset_htab() returns -1 by default. Change this to return 0 so that we fall back to user space HTAB allocation for emulated guests. This fixes the make check failures for ppc64 emulated target. Signed-off-by: Bharata B Rao Signed-off

[Qemu-devel] [PULL 0/4] ppc-next queue 20151111

2015-11-10 Thread David Gibson
The following changes since commit a77067f6ac9b17beefea506ce5f514072fe3fcf4: Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20151110' into staging (2015-11-10 17:49:39 +) are available in the git repository at: git://github.com/dgibson/qemu.git tags/ppc-nex

[Qemu-devel] [PULL 1/4] ppc: Add/Re-introduce MMU model definitions needed by PR KVM

2015-11-10 Thread David Gibson
From: Bharata B Rao Commit aa4bb5875231 (ppc: Add mmu_model defines for arch 2.03 and 2.07) removed the mmu_model definition POWERPC_MMU_2_06a which is needed by PR KVM. Reintroduce it and also add POWERPC_MMU_2_07a. This fixes QEMU crash (qemu: fatal: Unknown MMU model) during booting of PR KVM

Re: [Qemu-devel] [POC]colo-proxy in qemu

2015-11-10 Thread Jason Wang
On 11/10/2015 04:30 PM, zhanghailiang wrote: > On 2015/11/10 15:35, Jason Wang wrote: >> >> >> On 11/10/2015 01:26 PM, Tkid wrote: >>> Hi,all >>> >>> We are planning to reimplement colo proxy in userspace (Here is in >>> qemu) to >>> cache and compare net packets.This module is one of the importa

Re: [Qemu-devel] [PATCH 00/13] Mac OS 9 compatibility improvements (upstream rework)

2015-11-10 Thread David Gibson
On Wed, Nov 04, 2015 at 11:32:02PM +, Mark Cave-Ayland wrote: > On 04/11/15 03:44, David Gibson wrote: > > > On Fri, Oct 30, 2015 at 04:48:12PM +, Mark Cave-Ayland wrote: > >> On 23/10/15 14:56, Mark Cave-Ayland wrote: > >> > >>> This is a rework of Cormac O'Brien's GSoC project to try and

Re: [Qemu-devel] [PATCH qemu v4] monitor/target-ppc: Define target_get_monitor_def

2015-11-10 Thread David Gibson
On Fri, Oct 02, 2015 at 04:16:13PM +1000, Alexey Kardashevskiy wrote: > At the moment get_monitor_def() returns only registers from statically > defined monitor_defs array. However there is a lot of BOOK3S SPRs > which are not in the list and cannot be printed from the monitor. > > This adds a new

Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-10 Thread David Gibson
On Tue, Nov 10, 2015 at 04:56:38PM -0800, Nishanth Aravamudan wrote: > On 11.11.2015 [11:17:58 +1100], David Gibson wrote: > > On Mon, Nov 09, 2015 at 08:22:32PM -0800, Sukadev Bhattiprolu wrote: > > > David Gibson [da...@gibson.dropbear.id.au] wrote: > > > | On Wed, Nov 04, 2015 at 03:06:05PM -080

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 3/3] arm: pmu: Add CPI checking

2015-11-10 Thread Andrew Jones
On Mon, Nov 02, 2015 at 09:58:14AM -0600, Andrew Jones wrote: > On Fri, Oct 30, 2015 at 03:32:43PM -0400, Christopher Covington wrote: > > Hi Drew, > > > > On 10/30/2015 09:00 AM, Andrew Jones wrote: > > > On Wed, Oct 28, 2015 at 03:12:55PM -0400, Christopher Covington wrote: > > >> Calculate the

[Qemu-devel] [PATCH v4] virtio-blk: trivial code optimization

2015-11-10 Thread arei.gonglei
From: Gonglei 1. avoid possible superflous checking 2. make code more robustness Signed-off-by: Gonglei --- v4: address possible integer underover [Stefan] please review again, thanks --- hw/block/virtio-blk.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletion

Re: [Qemu-devel] [PATCH v3] virtio-blk: trivial code optimization

2015-11-10 Thread Gonglei
On 2015/11/10 17:56, Stefan Hajnoczi wrote: > The C99 standard says: > > 6.3.1.1 Boolean, characters, and integers > > - The rank of a signed integer type shall be greater than the rank of > any signed integer type with less precision. > > ... > > - The rank of any unsigned integer type shall

Re: [Qemu-devel] [Qemu-ppc] [RFC PATCH v1] spapr: Memory hot-unplug support

2015-11-10 Thread David Gibson
On Mon, Oct 26, 2015 at 03:23:05PM +0530, Bharata B Rao wrote: > Add support to hot remove pc-dimm memory devices. Sorry it's taken me so long to look at this. > TODO: In response to memory hot removal operation on a DIMM device, > guest kernel might refuse to offline a few LMBs that are part of

[Qemu-devel] [PATCH 48/77] ppc/pnv: Add model for Power8 PHB3 PCIe Host bridge

2015-11-10 Thread Benjamin Herrenschmidt
This is a model of the PCIe host bridge found on Power8 chips, including IOMMU support, PCIe root complex etc... This implementation doesn't emulate the EEH error handling (and may never do). Signed-off-by: Benjamin Herrenschmidt --- hw/intc/xics.c |2 +- hw/pci-host/Ma

[Qemu-devel] [PATCH 37/77] ppc/xics: Split ICS into base class and "simple" implementation

2015-11-10 Thread Benjamin Herrenschmidt
The existing implementation becomes the "ics-simple" subclass of ICS, so there should be no change in behaviour for SPAPR. This will allow different implementations for the source controllers such as the MSI support of PHB3 on Power8 which uses in-memory state tables for example. Signed-off-by: B

[Qemu-devel] [PATCH 22/77] ppc: Add real mode CI load/store instructions for P7 and P8

2015-11-10 Thread Benjamin Herrenschmidt
Those instructions are only available in hypervisor real mode and allow cache inhibited garded access to devices in that mode. Signed-off-by: Benjamin Herrenschmidt --- target-ppc/cpu.h| 4 +++- target-ppc/translate.c | 56 +++-- target-p

[Qemu-devel] [PATCH 15/77] ppc: Fix sign extension issue in mtmsr(d) emulation

2015-11-10 Thread Benjamin Herrenschmidt
From: Michael Neuling Signed-off-by: Michael Neuling Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index bd5df40..3974cd2 100644 --- a/target-ppc/translate

[Qemu-devel] [PATCH 10/77] ppc: Fix hreg_store_msr() so that non-HV mode cannot alter MSR:HV

2015-11-10 Thread Benjamin Herrenschmidt
This helper is only used by the various instructions that can alter MSR and not interrupts. Add a comment to that effect to the interrupt code as well in case somebody wants to change this Signed-off-by: Benjamin Herrenschmidt --- target-ppc/excp_helper.c | 8 ++-- target-ppc/helper_regs.h |

[Qemu-devel] [PATCH 24/77] ppc: Move exception generation code out of line

2015-11-10 Thread Benjamin Herrenschmidt
There's no point inlining this, if you hit the exception case you exit anyway, and not inlining saves about 100K of code size (and cache footprint). Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/targe

[Qemu-devel] [PATCH 16/77] ppc: Get out of emulation on SMT "OR" ops

2015-11-10 Thread Benjamin Herrenschmidt
Otherwise tight loops at smt_low for example, which OPAL does, eat so much CPU that we can't boot a kernel anymore. With that, I can boot 8 CPUs just fine with powernv. Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate.c | 19 +-- 1 file changed, 17 insertions(+), 2

Re: [Qemu-devel] [PATCH v2 0/8] Add system_powerdown support on ARM for ACPI and DT

2015-11-10 Thread Shannon Zhao
On 2015/11/11 4:56, Wei Huang wrote: > >> >> Compared with v1, this version doesn't work with system_powerdown >> command. In my setup, the testing environment is exactly same for both >> v1 and v2. So something changed in v2 caused system_powerdown fail to work. >> > > I found this was caused

Re: [Qemu-devel] [POC]colo-proxy in qemu

2015-11-10 Thread Dong, Eddie
> - What's the plan for vhost? Userspace network in qemu is rather slow, most > user will choose vhost. [Dong, Eddie] Hi Jason: How about we take staging approach? In general, COLO opens a door of high performance HA solution, but it will take very long time to make everything perfect. As

Re: [Qemu-devel] [Qemu-ppc] [PATCH 04/77] target-ppc: Use sensible POWER8/POWER8E versions

2015-11-10 Thread Stewart Smith
Benjamin Herrenschmidt writes: > We never released anything older than POWER8 DD2.0 and POWER8E DD2.1, > so let's use these versions, without that some firmware or Linux code > might fail to use some HW features that were non functional in earlier > internal only spins of the chip. We were gettin

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2] taget-ppc: Fix read access to IBAT registers higher than IBAT3

2015-11-10 Thread David Gibson
On Fri, Nov 06, 2015 at 11:04:39AM +0300, Michael Tokarev wrote: > 14.10.2015 20:43, Julio Guerra wrote: > > Fix the index used to read the IBAT's vector which results in IBAT0..3 > > instead > > of IBAT4..N. > > > > The bug appeared by saving/restoring contexts including IBATs values. > > Appli

Re: [Qemu-devel] [PATCH] ppc: Add/Re-introduce MMU model definitions needed by PR KVM

2015-11-10 Thread David Gibson
On Tue, Nov 10, 2015 at 10:59:45AM +0530, Bharata B Rao wrote: > On Tue, Nov 10, 2015 at 12:13:50PM +1100, Alexey Kardashevskiy wrote: > > On 11/07/2015 08:12 AM, Benjamin Herrenschmidt wrote: > > >On Fri, 2015-11-06 at 13:12 +0530, Bharata B Rao wrote: > > >>Commit aa4bb5875231 (ppc: Add mmu_model

[Qemu-devel] [PATCH 75/77] ppc: Add dummy logmpp instruction

2015-11-10 Thread Benjamin Herrenschmidt
It's used by KVM for micropartition prefetch Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index b34d2c6..1e3996d 100644 --- a/target-ppc/translate.c +++ b/t

Re: [Qemu-devel] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Benjamin Herrenschmidt
On Tue, 2015-11-10 at 17:50 -0700, Eric Blake wrote: > > It would be nice to include a diffstat (git defaults to doing this if > you use 'git format-patch --cover-letter' for generating the 0/77 > letter), so that we can see at a glance how big this series is and > what files it touches. Right. I

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Stewart Smith
Benjamin Herrenschmidt writes: > This requires an OPAL firmware file which isn't included yet, > will emulate enough to boot existing distros and run KVM > inside TCG For anyone wanting to try out this patchset, to build skiboot.lid, grab https://github.com/open-power/skiboot.git and build. You'

[Qemu-devel] [PATCH 74/77] ppc: Print HSRR0/HSRR1 in "info registers"

2015-11-10 Thread Benjamin Herrenschmidt
They are generally useful when debugging HV mode stuff Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index f76a0c3..b34d2c6 100644 --- a/target-ppc/translate.c +++ b/targ

Re: [Qemu-devel] [PATCH] ppc: Add/Re-introduce MMU model definitions needed by PR KVM

2015-11-10 Thread Alexey Kardashevskiy
On 11/10/2015 04:29 PM, Bharata B Rao wrote: On Tue, Nov 10, 2015 at 12:13:50PM +1100, Alexey Kardashevskiy wrote: On 11/07/2015 08:12 AM, Benjamin Herrenschmidt wrote: On Fri, 2015-11-06 at 13:12 +0530, Bharata B Rao wrote: Commit aa4bb5875231 (ppc: Add mmu_model defines for arch 2.03 and 2.0

[Qemu-devel] [PATCH 70/77] ppc: Add dummy CIABR SPR

2015-11-10 Thread Benjamin Herrenschmidt
We should implement HW breakpoint/watchpoint, qemu supports them... Signed-off-by: Benjamin Herrenschmidt --- target-ppc/cpu.h| 1 + target-ppc/translate_init.c | 5 + 2 files changed, 6 insertions(+) diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 334fcfe..bf8892a 100644

Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-10 Thread Nishanth Aravamudan
On 11.11.2015 [11:17:58 +1100], David Gibson wrote: > On Mon, Nov 09, 2015 at 08:22:32PM -0800, Sukadev Bhattiprolu wrote: > > David Gibson [da...@gibson.dropbear.id.au] wrote: > > | On Wed, Nov 04, 2015 at 03:06:05PM -0800, Sukadev Bhattiprolu wrote: > > | > Implement RTAS_SYSPARM_PROCESSOR_MODULE

Re: [Qemu-devel] [Qemu-ppc] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Benjamin Herrenschmidt
On Wed, 2015-11-11 at 11:27 +1100, Benjamin Herrenschmidt wrote: > This requires an OPAL firmware file which isn't included yet, > will emulate enough to boot existing distros and run KVM > inside TCG Note that this doesn't migrate nor supports running under PR KVM, both are possible but will take

[Qemu-devel] [PATCH 77/77] ppc: Fix CFAR updates

2015-11-10 Thread Benjamin Herrenschmidt
We need to remove 4 from the NIP since it's already been moved by 4 by the dispatcher before the helper is called Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/trans

[Qemu-devel] [PATCH 76/77] ppc: Add slbfee. instruction

2015-11-10 Thread Benjamin Herrenschmidt
Used to lookup SLB entries by address, for some reason it was missing. Signed-off-by: Benjamin Herrenschmidt --- target-ppc/helper.h | 1 + target-ppc/mmu-hash64.c | 24 target-ppc/translate.c | 25 + 3 files changed, 50 insertions(+) diff

[Qemu-devel] [PATCH 59/77] ppc: Add placeholder SPRs for DPDES and DHDES on P8

2015-11-10 Thread Benjamin Herrenschmidt
We still need to eventually implement doorbells but at least this makes us not crash when the SPRs are accessed. Signed-off-by: Benjamin Herrenschmidt --- target-ppc/cpu.h| 2 ++ target-ppc/translate_init.c | 17 + 2 files changed, 19 insertions(+) diff --git a/targ

[Qemu-devel] [PATCH 69/77] ppc: Add dummy POWER8 PSPB SPR

2015-11-10 Thread Benjamin Herrenschmidt
On real hardware it allows temporary thread priority boosts, we don't do threads and implementing it would be fairly tricky, so we just dummy it or now. Signed-off-by: Benjamin Herrenschmidt --- target-ppc/cpu.h| 1 + target-ppc/translate_init.c | 11 +++ 2 files changed, 12

[Qemu-devel] [PATCH 58/77] ppc: Initial HDEC support

2015-11-10 Thread Benjamin Herrenschmidt
The current behaviour isn't completely right, as for the DEC, we don't properly re-arm when wrapping around, but I will fix this in a separate patch. Signed-off-by: Benjamin Herrenschmidt --- hw/ppc/ppc.c | 17 - target-ppc/excp_helper.c | 22 -

Re: [Qemu-devel] [PATCH 00/77] ppc: Add "native" POWER8 platform

2015-11-10 Thread Eric Blake
On 11/10/2015 05:27 PM, Benjamin Herrenschmidt wrote: > This requires an OPAL firmware file which isn't included yet, > will emulate enough to boot existing distros and run KVM > inside TCG [meta-comment] It would be nice to include a diffstat (git defaults to doing this if you use 'git format-pa

[Qemu-devel] [PATCH 73/77] ppc: Add KVM numbers to some P8 SPRs

2015-11-10 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate_init.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index bfdf028..fd084ca 100644 --- a/target-ppc/translate_init.c +++ b/target

[Qemu-devel] [PATCH 56/77] ppc: Fix conditions for delivering external interrupts to a guest

2015-11-10 Thread Benjamin Herrenschmidt
External interrupts can bypass the MSR_EE test if they occur in guest mode and LPES0 is clear. In that case they are directed to the hypervisor Signed-off-by: Benjamin Herrenschmidt --- target-ppc/excp_helper.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --gi

[Qemu-devel] [PATCH 64/77] ppc: Fix writing to AMR/UAMOR

2015-11-10 Thread Benjamin Herrenschmidt
The masks weren't chosen nor applied properly. The architecture specifies that writes to AMR are masked by UAMOR for PR=1, otherwise AMOR for HV=0. The writes to UAMOR are masked by AMOR for HV=0 Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate_init.c | 76

[Qemu-devel] [PATCH 71/77] ppc: Add dummy ACOP SPR

2015-11-10 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- target-ppc/cpu.h| 1 + target-ppc/translate_init.c | 4 2 files changed, 5 insertions(+) diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index bf8892a..aa328a7 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -1361,6 +1361,7 @@ s

[Qemu-devel] [PATCH 53/77] ppc: Add proper real mode translation support

2015-11-10 Thread Benjamin Herrenschmidt
This adds proper support for translating real mode addresses based on the combination of HV and LPCR bits. This handles HRMOR offset for hypervisor real mode, and both RMA and VRMA modes for guest real mode. PAPR mode adjusts the offsets appropriately to match the RMA used in TCG, but we need to li

[Qemu-devel] [PATCH 60/77] ppc: LPCR is a HV resource

2015-11-10 Thread Benjamin Herrenschmidt
Don't allow access in guest mode Signed-off-by: Benjamin Herrenschmidt --- target-ppc/translate_init.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index bfc7a6d..e3887e7 100644 --- a/target-ppc/translate_i

  1   2   3   4   5   6   >