[Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState

2015-07-02 Thread Denis V. Lunev
From: Andrey Smetanin CPUState->crash_occurred value inside CPUState marks that guest crash occurred. This value added into cpu common migration subsection. Signed-off-by: Andrey Smetanin Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Andreas Färber --- exec.c| 19 +

[Qemu-devel] [PULL v2 00/27] Migration pull request

2015-07-02 Thread Juan Quintela
fixed the compilation issues for linux-users - migration events (me) - optional secttions (me) - global configuration (me) Please, Apply. The following changes since commit 5317b0f6d4bb581c5c8f88f31138ee301ad2b7e5: Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20150702-v3&

[Qemu-devel] [PATCH 01/12] kvm/x86: move Hyper-V MSR's/hypercall code into hyperv.c file

2015-07-02 Thread Denis V. Lunev
From: Andrey Smetanin This patch introduce Hyper-V related source code file - hyperv.c and per vm and per vcpu hyperv context structures. All Hyper-V MSR's and hypercall code moved into hyperv.c. All Hyper-V kvm/vcpu fields moved into appropriate hyperv context structures. Copyrights and authors

[Qemu-devel] [PATCH 05/12] kvm: added KVM_REQ_HV_CRASH value to notify qemu about hyper-v crash

2015-07-02 Thread Denis V. Lunev
From: Andrey Smetanin Added KVM_REQ_HV_CRASH - vcpu request used for notify user space(QEMU) about Hyper-V crash. Signed-off-by: Andrey Smetanin Signed-off-by: Denis V. Lunev Reviewed-by: Peter Hornyack CC: Paolo Bonzini CC: Gleb Natapov --- include/linux/kvm_host.h | 1 + 1 file changed,

[Qemu-devel] [PULL 08/27] Rework ram block hash

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" RDMA uses a hash from block offset->RAM Block; this isn't needed on the destination, and it becomes harder to maintain after the next patch in the series that sorts the block list. Split the hash so that it's only generated on the source. Signed-off-by: Dr. David

[Qemu-devel] [PULL 02/27] Only try and read a VMDescription if it should be there

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" The VMDescription section maybe after the EOF mark, the current code does a 'qemu_get_byte' and either gets the header byte identifying the description or an error (which it ignores). Doing the 'get' upsets RDMA which hangs on old machine types without the VMDescri

[Qemu-devel] [PULL 01/27] rdma: fix memory leak

2015-07-02 Thread Juan Quintela
From: Gonglei Variable "r" going out of scope leaks the storage it points to in line 3268. Signed-off-by: Gonglei Reviewed-by: Amit Shah Signed-off-by: Juan Quintela --- migration/rdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/rdma.c b/migration/rdma.c

[Qemu-devel] [PATCH 12/12] qemu/kvm/x86: hyper-v crash msrs set/get'ers and migration

2015-07-02 Thread Denis V. Lunev
From: Andrey Smetanin KVM Hyper-V based guests can notify hypervisor about occurred guest crash by writing into Hyper-V crash MSR's. This patch does handling and migration of HV_X64_MSR_CRASH_P0-P4, HV_X64_MSR_CRASH_CTL msrs. User can enable these MSR's by 'hv-crash' option. Signed-off-by: Andre

[Qemu-devel] [PULL 13/27] runstate: Add runstate store

2015-07-02 Thread Juan Quintela
This allows us to store the current state to send it through migration. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/sysemu/sysemu.h | 1 + vl.c| 12 2 files changed, 13 insertions(+) diff --git a/include/sysemu/sysemu.h b/inclu

[Qemu-devel] [PULL 04/27] Store block name in local blocks structure

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" In a later patch the block name will be used to match up two views of the block list. Keep a copy of the block name with the local block list. (At some point it could be argued that it would be best just to let migration see the innards of RAMBlock and avoid the n

[Qemu-devel] [PULL 11/27] Fail more cleanly in mismatched RAM cases

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" If the number of RAMBlocks was different on the source from the destination, QEMU would hang waiting for a disconnect on the source and wouldn't release from that hang until the destination was manually killed. Mark the stream as being in error, this causes the des

[Qemu-devel] [PULL 06/27] Rework ram_control_load_hook to hook during block load

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" We need the names of RAMBlocks as they're loaded for RDMA, reuse a slightly modified ram_control_load_hook: a) Pass a 'data' parameter to use for the name in the block-reg case b) Only some hook types now require the presence of a hook function. Signed-off

[Qemu-devel] [PULL 07/27] Allow rdma_delete_block to work without the hash

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" In the next patch we remove the hash on the destination, rdma_delete_block does two things with the hash which can be avoided: a) The caller passes the offset and rdma_delete_block looks it up in the hash; fixed by getting the caller to pass the block b) Th

[Qemu-devel] [PULL 16/27] global_state: Make section optional

2015-07-02 Thread Juan Quintela
This section would be sent: a- for all new machine types b- for old machine types if section state is different form {running,paused} that were the only giving us troubles. So, in new qemus: it is alwasy there. In old qemus: they are only there if it an error has happened, basically stoping o

[Qemu-devel] [PULL 12/27] Fix older machine type compatibility on power with section footers

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" I forgot to add compatibility for Power when adding section footers. Signed-off-by: Dr. David Alan Gilbert Fixes: 37fb569c0198cba58e3e Signed-off-by: Juan Quintela --- hw/ppc/spapr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/

[Qemu-devel] [PULL 05/27] Translate offsets to destination address space

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" The 'offset' field in RDMACompress and 'current_addr' field in RDMARegister are commented as being offsets within a particular RAMBlock, however they appear to actually be offsets within the ram_addr_t space. The code currently assumes that the offsets on the sourc

[Qemu-devel] [PULL 23/27] migration: create migration event

2015-07-02 Thread Juan Quintela
We have one argument that tells us what event has happened. Signed-off-by: Juan Quintela Reviewed-by: Eric Blake --- docs/qmp/qmp-events.txt | 14 ++ migration/migration.c | 2 ++ qapi/event.json | 12 3 files changed, 28 insertions(+) diff --git a/docs/qmp/

[Qemu-devel] [PULL 17/27] vmstate: Create optional sections

2015-07-02 Thread Juan Quintela
To make sections optional, we need to do it at the beggining of the code. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/vmstate.h | 2 ++ migration/savevm.c | 8 migration/vmstate.c | 11 +++ trace-events

[Qemu-devel] [PULL 15/27] migration: create new section to store global state

2015-07-02 Thread Juan Quintela
This includes a new section that for now just stores the current qemu state. Right now, there are only one way to control what is the state of the target after migration. - If you run the target qemu with -S, it would start stopped. - If you run the target qemu without -S, it would run just after

[Qemu-devel] [PULL 10/27] Sanity check RDMA remote data

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" Perform some basic (but probably not complete) sanity checking on requests from the RDMA source. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael R. Hines Signed-off-by: Juan Quintela --- migration/rdma.c | 30 ++ 1 file ch

[Qemu-devel] [PULL 26/27] migration: protect migration_bitmap

2015-07-02 Thread Juan Quintela
From: Li Zhijian Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang Signed-off-by: Juan Quintela --- migration/ram.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 644f52a..9c0bcfe 100644 --- a/migration/

[Qemu-devel] [PULL 19/27] migration: Use cmpxchg correctly

2015-07-02 Thread Juan Quintela
cmpxchg returns the old value Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index edb4f3e..1e34aa5 100644 --- a/migration/migration.c ++

[Qemu-devel] [PULL 21/27] migration: Use always helper to set state

2015-07-02 Thread Juan Quintela
There were three places that were not using the migrate_set_state() helper, just fix that. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migra

[Qemu-devel] [PULL 09/27] Sort destination RAMBlocks to be the same as the source

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" Use the order of incoming RAMBlocks from the source to record an index number; that then allows us to sort the destination local RAMBlock list to match the source. Now that the RAMBlocks are known to be in the same order, this simplifies the RDMA Registration step

[Qemu-devel] (no subject)

2015-07-02 Thread Denis V. Lunev
The monivation of this set is simple. Recently we have proposed patch to monitor.c with specific x86 APIC HMP commands. The patchset was denied with the main motivation "No more arch specific code in monitor.c" This patchset is the first step to move arch specific code from monitor.c targets. So,

[Qemu-devel] [PULL 22/27] migration: No need to call trace_migrate_set_state()

2015-07-02 Thread Juan Quintela
We now use the helper everywhere, so no need to call this on this two places. See on previous commit that there were a place where we missed to mark the trace. Now all tracing is done in migrate_set_state(). Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/migrat

[Qemu-devel] [PULL 18/27] migration: Add configuration section

2015-07-02 Thread Juan Quintela
It needs to be the first one and it is not optional, that is the reason why it is opencoded. For new machine types, it is required that machine type name is the same in both sides. It is just done right now for pc's. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- hw/i386

Re: [Qemu-devel] [PATCH v4 4/9] Add virt-v3 machine that uses GIC-500

2015-07-02 Thread Daniel P. Berrange
On Thu, Jul 02, 2015 at 05:47:04PM +0300, Pavel Fedin wrote: > Hello! > > I already explained this earlier: > http://lists.nongnu.org/archive/html/qemu-devel/2015-05/msg04842.html, and i > tried to explain this in commit message. Current qemu architecture does not > allow doing this in a clea

[Qemu-devel] [PULL 14/27] runstate: migration allows more transitions now

2015-07-02 Thread Juan Quintela
Next commit would allow to move from incoming migration to error happening on source. Should we add more states to this transition? Luiz? Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- vl.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vl.c

[Qemu-devel] [PULL 25/27] check_section_footers: Check the correct section_id

2015-07-02 Thread Juan Quintela
From: "Dr. David Alan Gilbert" The section footers check was incorrectly checking the section_id in the SaveStateEntry not the LoadStateEntry. These can validly be different if the two QEMU instances have instantiated their devices in a different order. The test only cares that we're finishing

Re: [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState

2015-07-02 Thread Andreas Färber
Hi, This patch is clearly against QEMU, please name it "cpu: Add crash_...". (You may want to take a second look at the non-CPU patches, too.) Am 02.07.2015 um 18:07 schrieb Denis V. Lunev: > From: Andrey Smetanin > > CPUState->crash_occurred value inside CPUState marks "CPUState::crash_occurr

[Qemu-devel] [PATCH 07/12] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-07-02 Thread Denis V. Lunev
From: Andrey Smetanin Added hyper-v crash msr's(HV_X64_MSR_CRASH*) data and control geters and setters. Userspace should check that such msr's available by check of KVM_CAP_HYPERV_MSR_CRASH capability. User space allowed to setup Hyper-V crash ctl msr. This msr should be setup to HV_X64_MSR_CRAS

[Qemu-devel] [PULL 20/27] migration: ensure we start in NONE state

2015-07-02 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 1e34aa5..5c1233f 100644 --- a/migration/migration.c +++ b/migration/migration.c

Re: [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 18:18, Andreas Färber wrote: >> > +uint32_t crash_occurred; >> > volatile sig_atomic_t exit_request; >> > uint32_t interrupt_request; >> > int singlestep_enabled; > If you add this field to CPUState, you'll also need to reset it in > qom/cpu.c. Or is it intentiona

[Qemu-devel] [PATCH 1/3] hmp-commands-info: move info_cmds content out of monitor.c

2015-07-02 Thread Denis V. Lunev
From: Pavel Butsykin For moving target- and device-specific code from monitor.c, to beginning we move info_cmds content to hmp-commands-info.hx Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Luiz Capitulino CC: Paolo Bonzini CC: Peter Maydell --- Makefile.target |

[Qemu-devel] [PULL 24/27] migration: Add migration events on target side

2015-07-02 Thread Juan Quintela
We reuse the migration events from the source side, sending them on the appropiate place. Signed-off-by: Juan Quintela Reviewed-by: Eric Blake Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/migration/migrati

Re: [Qemu-devel] [PATCH 12/12] qemu/kvm/x86: hyper-v crash msrs set/get'ers and migration

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 18:07, Denis V. Lunev wrote: > +if (cpu->hyperv_crash && > +kvm_check_extension(cs->kvm_state, KVM_CAP_HYPERV_MSR_CRASH) > > 0) { > +c->edx |= HV_X64_GUEST_CRASH_MSR_AVAILABLE; > +has_msr_hv_crash = true; > +} > + Please patch kvm

[Qemu-devel] [PATCH] block: update bdrv_drain_all()/bdrv_drain() comments

2015-07-02 Thread Stefan Hajnoczi
The doc comments for bdrv_drain_all() and bdrv_drain() are outdated: * The bdrv_drain() comment is a poor man's bdrv_lock()/bdrv_unlock() which Fam Zheng is currently developing. Unfortunately this warning was never really enough because devices keep submitting I/O and op blockers don't

[Qemu-devel] [PULL 27/27] migration: extend migration_bitmap

2015-07-02 Thread Juan Quintela
From: Li Zhijian Prevously, if we hotplug a device(e.g. device_add e1000) during migration is processing in source side, qemu will add a new ram block but migration_bitmap is not extended. In this case, migration_bitmap will overflow and lead qemu abort unexpectedly. Signed-off-by: Li Zhijian S

[Qemu-devel] [PATCH 3/3] monitor: added generation of documentation for hmp-commands-info.hx

2015-07-02 Thread Denis V. Lunev
From: Pavel Butsykin It will be easier if you need to add info-commands to edit only hmp-commands-info.hx, before this had to edit monitor.c and hmp-commands.hx Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Luiz Capitulino CC: Paolo Bonzini CC: Peter Maydell --- .gitignor

Re: [Qemu-devel] [PATCH 07/12] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 18:07, Denis V. Lunev wrote: > From: Andrey Smetanin > > Added hyper-v crash msr's(HV_X64_MSR_CRASH*) data and control > geters and setters. Userspace should check that such msr's > available by check of KVM_CAP_HYPERV_MSR_CRASH capability. It should use the existing KVM_GET_SUPP

[Qemu-devel] [PATCH 2/3] monitor: remove target-specific code from monitor.c

2015-07-02 Thread Denis V. Lunev
From: Pavel Butsykin Move target-specific code out of /monitor.c to /target-*/monitor.c, this will avoid code cluttering and using random ifdeffery. The solution is quite simple, but solves the issue of the separation of target-specific code from monitor Signed-off-by: Pavel Butsykin Signed-of

Re: [Qemu-devel] [PATCH v3 1/5] cpu: Provide vcpu throttling interface

2015-07-02 Thread Jason J. Herne
On 07/01/2015 10:03 AM, Paolo Bonzini wrote: On 26/06/2015 20:07, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle the

[Qemu-devel] [PATCH v4 3/5] migration: Dynamic cpu throttling for auto-converge

2015-07-02 Thread Jason J. Herne
Remove traditional auto-converge static 30ms throttling code and replace it with a dynamic throttling algorithm. Additionally, be more aggressive when deciding when to start throttling. Previously we waited until four unproductive memory passes. Now we begin throttling after only two unproductive

[Qemu-devel] [PATCH v4 1/5] cpu: Provide vcpu throttling interface

2015-07-02 Thread Jason J. Herne
Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle the guest cpu the caller simply has to call the throttle set function and provide a percentage of throttle time. Signed-off-by: Jason J. Herne Reviewed-by:

Re: [Qemu-devel] [PATCH v3 1/5] cpu: Provide vcpu throttling interface

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 18:33, Jason J. Herne wrote: > I've made all of the changes you have suggested except adding atomics. I'm > having > a bit of trouble figuring out what is needed here. Perhaps I should be using > atomic_read() to read throttle_percentage? If so, I don't undertand why. > Rather >

[Qemu-devel] [PATCH v4 5/5] migration: Disambiguate MAX_THROTTLE

2015-07-02 Thread Jason J. Herne
Migration has a define for MAX_THROTTLE. Update comment to clarify that this is used for throttling transfer speed. Hopefully this will prevent it from being confused with a guest cpu throttling entity. Signed-off-by: Jason J. Herne Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c

[Qemu-devel] [PATCH v4 2/5] migration: Parameters for auto-converge cpu throttling

2015-07-02 Thread Jason J. Herne
Add migration parameters to allow the user to adjust the parameters that control cpu throttling when auto-converge is in effect. The added parameters are as follows: x-cpu-throttle-initial : Initial percantage of time guest cpus are throttled when migration auto-converge is activated. x-cpu-throt

[Qemu-devel] [PATCH v4 0/5] migration: Dynamic cpu throttling for auto-converge

2015-07-02 Thread Jason J. Herne
This patch set provides a new method for throttling a vcpu and makes use of said method to dynamically increase cpu throttling during an autoconverge migration until the migration completes. The method used here for throttling vcpus is likely not the best. However, I believe that it is preferable

[Qemu-devel] [PATCH v4 4/5] qmp/hmp: Add throttle ratio to query-migrate and info migrate

2015-07-02 Thread Jason J. Herne
Report throttle percentage in info migrate and query-migrate responses when cpu throttling is active. Signed-off-by: Jason J. Herne Reviewed-by: Dr. David Alan Gilbert --- hmp.c | 5 + migration/migration.c | 5 + qapi-schema.json | 7 ++- 3 files changed, 16 in

Re: [Qemu-devel] [PATCH v4 1/5] cpu: Provide vcpu throttling interface

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 18:36, Jason J. Herne wrote: > +static void cpu_throttle_thread(void *opaque) > +{ > +double pct = (double)throttle_percentage/100; > +double throttle_ratio = pct / (1 - pct); > +long sleeptime_ms = (long)(throttle_ratio * CPU_THROTTLE_TIMESLICE); > + > +if (!throttl

Re: [Qemu-devel] [PATCH] virtio-net: Drop net_virtio_info.can_receive

2015-07-02 Thread Michael S. Tsirkin
On Thu, Jul 02, 2015 at 01:46:26PM +0100, Stefan Hajnoczi wrote: > On Tue, Jun 30, 2015 at 04:35:24PM +0800, Jason Wang wrote: > > On 06/30/2015 11:06 AM, Fam Zheng wrote: > > > virtio_net_receive still does the check by calling > > > virtio_net_can_receive, if the device or driver is not ready, th

Re: [Qemu-devel] [PATCH v4 1/5] cpu: Provide vcpu throttling interface

2015-07-02 Thread Andreas Färber
Am 02.07.2015 um 18:36 schrieb Jason J. Herne: > Provide a method to throttle guest cpu execution. CPUState is augmented with > timeout controls and throttle start/stop functions. To throttle the guest cpu > the caller simply has to call the throttle set function and provide a > percentage > of th

Re: [Qemu-devel] [PATCH v4 1/5] cpu: Provide vcpu throttling interface

2015-07-02 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > > > On 02/07/2015 18:36, Jason J. Herne wrote: > > +static void cpu_throttle_thread(void *opaque) > > +{ > > +double pct = (double)throttle_percentage/100; > > +double throttle_ratio = pct / (1 - pct); > > +long sleeptime_ms = (long)(thro

Re: [Qemu-devel] [PATCH v2] thread-win32: fix GetThreadContext() permanently fails

2015-07-02 Thread Fabien Chouteau
On 07/01/2015 08:00 PM, Stefan Weil wrote: > Am 01.07.2015 um 18:49 schrieb Paolo Bonzini: >> >> On 01/07/2015 17:48, Zavadovsky Yan wrote: >>> Ping. >> Stefan, are you merging this? >> >> Paolo > > I can do so, but as the current code seems to fix the problems > with multi-processor systems, too

[Qemu-devel] [PATCH v4 0/5] migration: Dynamic cpu throttling for auto-converge

2015-07-02 Thread Jason J. Herne
This patch set provides a new method for throttling a vcpu and makes use of said method to dynamically increase cpu throttling during an autoconverge migration until the migration completes. The method used here for throttling vcpus is likely not the best. However, I believe that it is preferable

Re: [Qemu-devel] [PATCH 3/5] qapi: change Netdev and NetLegacy into a flat union

2015-07-02 Thread Markus Armbruster
"Kővágó, Zoltán" writes: > Signed-off-by: Kővágó, Zoltán [...] > diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c > index a3b1314..72e2f8f 100644 > --- a/hw/arm/musicpal.c > +++ b/hw/arm/musicpal.c > @@ -379,7 +379,7 @@ static void eth_cleanup(NetClientState *nc) > } > > static NetClientIn

[Qemu-devel] [PATCH v2] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Dmitry Osipenko
Timer, running in periodic mode, can't be stopped or coming one-shot tick won't be canceled because timer control code just doesn't handle timer disabling. Fix it by deleting timer if enable bit isn't set. Signed-off-by: Dmitry Osipenko --- v2: Avoid calling timer_del() if the timer was already

Re: [Qemu-devel] [PATCH 2/5] qapi: convert NumaOptions into a flat union

2015-07-02 Thread Markus Armbruster
"Kővágó, Zoltán" writes: > Signed-off-by: Kővágó, Zoltán > --- > numa.c | 2 +- > qapi-schema.json | 47 --- > 2 files changed, 37 insertions(+), 12 deletions(-) > > diff --git a/numa.c b/numa.c > index 91fc6c1..8b0755d 100644 > --- a/numa.

Re: [Qemu-devel] [PULL v2 00/27] Migration pull request

2015-07-02 Thread Peter Maydell
t; > > Please, Apply. > > The following changes since commit 5317b0f6d4bb581c5c8f88f31138ee301ad2b7e5: > > Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20150702-v3' into > staging (2015-07-02 15:20:55 +0100) > > are available in the git repository at: > &

Re: [Qemu-devel] [PATCH v2] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Peter Maydell
On 2 July 2015 at 18:20, Dmitry Osipenko wrote: > Timer, running in periodic mode, can't be stopped or coming one-shot tick > won't be canceled because timer control code just doesn't handle timer > disabling. Fix it by deleting timer if enable bit isn't set. > > Signed-off-by: Dmitry Osipenko >

Re: [Qemu-devel] [PATCH 4/5] qapi: support nested structs in OptsVisitor

2015-07-02 Thread Markus Armbruster
"Kővágó, Zoltán" writes: > The current OptsVisitor flattens the whole structure, if there are same > named fields under different paths the current visitor can't cope with > them (it'll just set the first field, leaving the others unspecified (if > they're optional) or erroring out (if they're re

Re: [Qemu-devel] [PATCH v2] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Dmitry Osipenko
02.07.2015 20:34, Peter Maydell пишет: On 2 July 2015 at 18:20, Dmitry Osipenko wrote: Timer, running in periodic mode, can't be stopped or coming one-shot tick won't be canceled because timer control code just doesn't handle timer disabling. Fix it by deleting timer if enable bit isn't set. S

Re: [Qemu-devel] [PATCH v2] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Dmitry Osipenko
02.07.2015 20:34, Peter Maydell пишет: This will now cause us to do the "reload the timer" logic if you write a 1 to the control bit when it was already 1, which we didn't do before. The logic I suggested in my previous review comment gets this right... -- PMM The problem with code you sugg

Re: [Qemu-devel] [PATCH 5/5] opts: produce valid command line in qemu_opts_print

2015-07-02 Thread Markus Armbruster
"Kővágó, Zoltán" writes: > This will let us print options in a format that the user would actually > write it on the command line (foo=bar,baz=asd,etc=def), without > prepending a spurious comma at the beginning of the list, or quoting > values unnecessarily. This patch provides the following ch

Re: [Qemu-devel] [PATCH 0/5] qapi flattening + some miscellaneous patches

2015-07-02 Thread Markus Armbruster
Gerd Hoffmann writes: > On Di, 2015-06-23 at 15:32 +0200, Kővágó, Zoltán wrote: >> I've cherry-picked the qapi related parts from my previous -audiodev >> patch series, we can hopefully concentrate on one thing at a time. The >> most important changes in this patch series are the flattening of t

Re: [Qemu-devel] [PATCH 00/16] implement vNVDIMM

2015-07-02 Thread Xiao Guangrong
Thanks for your review, Stefan and Paolo! On 07/02/2015 05:52 PM, Paolo Bonzini wrote: On 02/07/2015 11:20, Stefan Hajnoczi wrote: Currently, the NVDIMM driver has been merged into upstream Linux Kernel and this patchset tries to enable it in virtualization field From a device model persp

Re: [Qemu-devel] [PATCH 14/16] nvdimm: support NFIT_CMD_GET_CONFIG_SIZE function

2015-07-02 Thread Xiao Guangrong
On 07/02/2015 05:23 PM, Stefan Hajnoczi wrote: On Wed, Jul 01, 2015 at 10:50:30PM +0800, Xiao Guangrong wrote: +static uint32_t dsm_cmd_config_size(struct dsm_buffer *in, struct dsm_out *out) +{ +GSList *list = get_nvdimm_built_list(); +PCNVDIMMDevice *nvdimm = get_nvdimm_device_by_han

Re: [Qemu-devel] [PATCH v2] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Peter Maydell
On 2 July 2015 at 18:52, Dmitry Osipenko wrote: > 02.07.2015 20:34, Peter Maydell пишет: >> >> >> This will now cause us to do the "reload the timer" >> logic if you write a 1 to the control bit when it was >> already 1, which we didn't do before. >> >> The logic I suggested in my previous review

Re: [Qemu-devel] [PATCH 00/16] implement vNVDIMM

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 20:01, Xiao Guangrong wrote: > > Thanks for your review, Stefan and Paolo! > > On 07/02/2015 05:52 PM, Paolo Bonzini wrote: >> >> >> On 02/07/2015 11:20, Stefan Hajnoczi wrote: Currently, the NVDIMM driver has been merged into upstream Linux Kernel and this patchset

Re: [Qemu-devel] [PATCH v2] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Dmitry Osipenko
02.07.2015 21:09, Peter Maydell пишет: On 2 July 2015 at 18:52, Dmitry Osipenko wrote: 02.07.2015 20:34, Peter Maydell пишет: This will now cause us to do the "reload the timer" logic if you write a 1 to the control bit when it was already 1, which we didn't do before. The logic I suggested

Re: [Qemu-devel] [PATCH] virtio-pci: implement cfg capability

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 15:00, Michael S. Tsirkin wrote: > +cfg = (void *)(proxy->pci_dev.config + proxy->config_cap); > +off = le32_to_cpu(cfg->cap.offset); > +len = le32_to_cpu(cfg->cap.length); > + > +if ((len == 1 || len == 2 || len == 4)) { > +address_space_

Re: [Qemu-devel] [PATCH v2] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Dmitry Osipenko
02.07.2015 21:43, Dmitry Osipenko пишет: 02.07.2015 21:09, Peter Maydell пишет: TIMER_CONTROL_IT_ENABLE) to TIMER_CONTROL < it won't start, bug s/it won't start/it won't start periodic/ -- Dmitry

Re: [Qemu-devel] [Xen-devel] [PATCH RFC 1 6/8] xen/pt: Make xen_pt_unregister_device idempotent

2015-07-02 Thread Konrad Rzeszutek Wilk
> > @@ -858,15 +863,20 @@ static void xen_pt_unregister_device(PCIDevice *d) > > machine_irq, errno); > > } > > } > > +s->machine_irq = 0; > > } > > > > /* delete all emulated config registers */ > > xen_pt_config_delete(s);

Re: [Qemu-devel] [PATCH] virtio-pci: implement cfg capability

2015-07-02 Thread Michael S. Tsirkin
On Thu, Jul 02, 2015 at 08:48:14PM +0200, Paolo Bonzini wrote: > > > On 02/07/2015 15:00, Michael S. Tsirkin wrote: > > +cfg = (void *)(proxy->pci_dev.config + proxy->config_cap); > > +off = le32_to_cpu(cfg->cap.offset); > > +len = le32_to_cpu(cfg->cap.length); > > + > > +

Re: [Qemu-devel] [PATCH] virtio-pci: implement cfg capability

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 21:00, Michael S. Tsirkin wrote: > On Thu, Jul 02, 2015 at 08:48:14PM +0200, Paolo Bonzini wrote: >> >> >> On 02/07/2015 15:00, Michael S. Tsirkin wrote: >>> +cfg = (void *)(proxy->pci_dev.config + proxy->config_cap); >>> +off = le32_to_cpu(cfg->cap.offset); >>> +

Re: [Qemu-devel] [PATCH v2] thread-win32: fix GetThreadContext() permanently fails

2015-07-02 Thread Zavadovsky Yan
I tested this patch on my 4-cores cpu. Debug and release builds both. Win32 and Win64 binaries both. (I used old Fedora 17-18 with SJLJ mingw-w64 to crossbuild for Win64.) With default Qemu BIOS and with myself-builded OVMF(also debug and release) from EDK2. Also I did some synthetic tests with sa

[Qemu-devel] [PATCH v1 5/6] xen/pt/msi: Add the register value when printing logging and error messages

2015-07-02 Thread Konrad Rzeszutek Wilk
We would like to know what the MSI register value is to help in troubleshooting in the field. As such modify the logging logic to include such details in xen_pt_msgctrl_reg_write. Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt_config_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[Qemu-devel] [PATCH v1 3/6] xen/pt: xen_host_pci_config_read returns -errno, not -1 on failure

2015-07-02 Thread Konrad Rzeszutek Wilk
However the init routines assume that on errors the return code is -1 (as the libxc API is) - while those xen_host_* routines follow another paradigm - negative errno on return, 0 on success. Reviewed-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.c | 2 +- 1 file

[Qemu-devel] [PATCH v1 1/6] xen/pt: Update comments with proper function name.

2015-07-02 Thread Konrad Rzeszutek Wilk
It has changed but the comments still refer to the old names. Reviewed-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index ed5fcae..706e3d9 100644 --- a/hw

[Qemu-devel] [PATCH v1 2/6] xen/pt: Make xen_pt_msi_set_enable static

2015-07-02 Thread Konrad Rzeszutek Wilk
As we do not use it outside our code. Reviewed-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.h | 1 - hw/xen/xen_pt_msi.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index 393f36c..09358b1 100644 ---

[Qemu-devel] [PATCH v1 6/6] xen/pt: Use XEN_PT_LOG properly to guard against compiler warnings.

2015-07-02 Thread Konrad Rzeszutek Wilk
If XEN_PT_LOGGING_ENABLED is enabled the XEN_PT_LOG macros start using the first argument. Which means if within the function there is only one user of the argument ('d') and XEN_PT_LOGGING_ENABLED is not set, we get compiler warnings. This is not the case now but with the "xen/pt: Use xen_host_pci

[Qemu-devel] [PATCH v1 4/6] xen: use errno instead of rc for xc_domain_add_to_physmap

2015-07-02 Thread Konrad Rzeszutek Wilk
In Xen 4.6 commit cd2f100f0f61b3f333d52d1737dd73f02daee592 "libxc: Fix do_memory_op to return negative value on errors" made the libxc API less odd-ball: On errors, return value is -1 and error code is in errno. On success the return value is either 0 or an positive value. Since we could be runnin

[Qemu-devel] [PATCH v1] Cleanups + various fixes due to libxl ABI + more logging on errors.

2015-07-02 Thread Konrad Rzeszutek Wilk
Hey! since RFC [https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg07326.html] - Added Acks - Followed 'xen: Print and use errno where applicable.' suggestion by Stefano and added a wrapper. As I am in the process of syncing the 'dev.config' and Xen's internal cache of the PCI config s

[Qemu-devel] [PATCH v1 08/10] xen/pt: Make xen_pt_unregister_device idempotent

2015-07-02 Thread Konrad Rzeszutek Wilk
To deal with xen_host_pci_[set|get]_ functions returning error values and clearing ourselves in the init function we should make the .exit (xen_pt_unregister_device) function be idempotent in case the generic code starts calling .exit (or for fun does it before calling .init!). Signed-off-by: Konr

[Qemu-devel] [PATCH v1] Remove XenPTReg->data and use dev.config for guest configuration values.

2015-07-02 Thread Konrad Rzeszutek Wilk
Since RFC [https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg07350.html] - Added Acks - Fixed bugs This patchset is dependent on the "Cleanups + various fixes due to libxl ABI + more logging on errors." (http://lists.xen.org/archives/html/xen-devel/2015-07/msg00431.html) just poste

[Qemu-devel] [PATCH v1 01/10] xen/pt: Use xen_host_pci_get_[byte|word] instead of dev.config

2015-07-02 Thread Konrad Rzeszutek Wilk
During init time we treat the dev.config area as a cache of the host view. However during execution time we treat it as guest view (by the generic PCI API). We need to sync Xen's code to the generic PCI API view. This is the first step by replacing all of the code that uses dev.config or pci_get_[b

[Qemu-devel] [PATCH v1 10/10] xen/pt: Check for return values for xen_host_pci_[get|set] in init

2015-07-02 Thread Konrad Rzeszutek Wilk
and if we have failures we call xen_pt_destroy introduced in 'xen/pt: Move bulk of xen_pt_unregister_device in its own routine.' and free all of the allocated structures. Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.c | 24 1 file

[Qemu-devel] [PATCH v1 06/10] xen/pt: Log xen_host_pci_get in two init functions

2015-07-02 Thread Konrad Rzeszutek Wilk
To help with troubleshooting in the field. Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt_config_init.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 0a710a2..a2af415 100644 --- a

[Qemu-devel] [PATCH v1 03/10] xen/pt: Check if reg->init function sets the 'data' past the reg->size

2015-07-02 Thread Konrad Rzeszutek Wilk
It should never happen, but in case it does (an developer adds a new register and the 'init_val' expands past the register size) we want to report. The code will only write up to reg->size so there is no runtime danger of the register spilling across other ones - however to catch this sort of thing

[Qemu-devel] [PATCH v1 04/10] xen/pt: Use xen_host_pci_get_[byte, word, long] instead of xen_host_pci_get_long

2015-07-02 Thread Konrad Rzeszutek Wilk
Otherwise we get: xen_pt_config_reg_init: Offset 0x0004 mismatch! Emulated=0x, host=0x2300017, syncing to 0x2300014. xen_pt_config_reg_init: Error: Offset 0x0004:0x2300014 expands past register size(2)! which is not surprising. We read the value as an 32-bit (from host), then operate it as

[Qemu-devel] [PATCH v1 09/10] xen/pt: Move bulk of xen_pt_unregister_device in its own routine.

2015-07-02 Thread Konrad Rzeszutek Wilk
This way we can call it if we fail during init. This code movement introduces no changes. Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.c | 119 +--- 1 file changed, 62 insertions(+), 57 deletions(-) dif

[Qemu-devel] [PATCH v1 05/10] xen/pt: Remove XenPTReg->data field.

2015-07-02 Thread Konrad Rzeszutek Wilk
We do not want to have two entries to cache the guest configuration registers: XenPTReg->data and dev.config. Instead we want to use only the dev.config. To do without much complications we rip out the ->data field and replace it with an pointer to the dev.config. This way we have the type-checkin

[Qemu-devel] [PATCH v1 07/10] xen/pt: Log xen_host_pci_get/set errors in MSI code.

2015-07-02 Thread Konrad Rzeszutek Wilk
We seem to only use these functions when de-activating the MSI - so just log errors. Reviewed-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt_msi.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/

[Qemu-devel] [PATCH v1 02/10] xen/pt: Sync up the dev.config and data values.

2015-07-02 Thread Konrad Rzeszutek Wilk
For a passthrough device we maintain a state of emulated registers value contained within d->config. We also consult the host registers (and apply ro and write masks) whenever the guest access the registers. This is done in xen_pt_pci_write_config and xen_pt_pci_read_config. Also in this picture w

[Qemu-devel] [PATCH] target-ppc: fix hugepage support when using memory-backend-file

2015-07-02 Thread Michael Roth
Current PPC code relies on -mem-path being used in order for hugepage support to be detected. With the introduction of MemoryBackendFile we can now handle this via: -object memory-file-backend,mem-path=...,id=hugemem0 \ -numa node,id=mem0,memdev=hugemem0 Management tools like libvirt treat the

[Qemu-devel] arm_mptimer fixes

2015-07-02 Thread Dmitry Osipenko
Hello, this series fixes 3 arm_mptimer issues. All 3 patches were successfully tested on ARM Cortex-A9 QEMU machine booting Linux kernel and behavior was compared to real hw by running couple handcrafted mptimer tests. arm_mptimer: Fix timer shutdown arm_mptimer: Fix ONE-SHOT -> PERIODIC mode chan

[Qemu-devel] [PATCH 1/3 v3] arm_mptimer: Fix timer shutdown

2015-07-02 Thread Dmitry Osipenko
Timer, running in periodic mode, can't be stopped or coming one-shot tick won't be canceled because timer control code just doesn't handle timer disabling. Fix it by deleting timer if enable bit isn't set. Signed-off-by: Dmitry Osipenko --- v2: Avoid calling timer_del() if the timer was already

[Qemu-devel] [PATCH 3/3] arm_mptimer: Respect IT bit state

2015-07-02 Thread Dmitry Osipenko
Timer fires interrupt regardless of current IT(interrupt enable) bit state. Fix it by making timer to respect IT state. Signed-off-by: Dmitry Osipenko --- hw/timer/arm_mptimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c in

[Qemu-devel] [PATCH 2/3] arm_mptimer: Fix ONE-SHOT -> PERIODIC mode change

2015-07-02 Thread Dmitry Osipenko
Timer won't start periodic ticking if ONE-SHOT -> PERIODIC mode change happened after one-shot tick was completed. Fix it by starting ticking only if timer was disabled previously and isn't ticking right now. Signed-off-by: Dmitry Osipenko --- hw/timer/arm_mptimer.c | 9 +++-- 1 file changed

<    1   2   3   4   >