[PATCH 06/13] Synchronize VCPU states before reset

2011-02-15 Thread Jan Kiszka
This is required to support keeping VCPU states across a system reset. If we do not read the current state before the reset, cpu_synchronize_all_post_reset may write back incorrect state information. The first user of this will be MCE MSR synchronization which currently works around the missing cp

[PATCH 13/13] KVM, MCE, unpoison memory address across reboot

2011-02-15 Thread Jan Kiszka
From: Huang Ying In Linux kernel HWPoison processing implementation, the virtual address in processes mapping the error physical memory page is marked as HWPoison. So that, the further accessing to the virtual address will kill corresponding processes with SIGBUS. If the error physical memory p

[PATCH 12/13] Add qemu_ram_remap

2011-02-15 Thread Jan Kiszka
From: Huang Ying qemu_ram_remap() unmaps the specified RAM pages, then re-maps these pages again. This is used by KVM HWPoison support to clear HWPoisoned page tables across guest rebooting, so that a new page may be allocated later to recover the memory error. [ Jan: style fixlets ] Signed-of

[PATCH 11/13] kvm: x86: Fail kvm_arch_init_vcpu if MCE initialization fails

2011-02-15 Thread Jan Kiszka
There is no reason to continue if the kernel claims to support MCE but then fails to process our request. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming --- target-i386/kvm.c | 30 +- 1 files changed, 17 insertions(+), 13 deletions(-

[PATCH 03/13] x86: Small cleanups of MCE helpers

2011-02-15 Thread Jan Kiszka
Fix some code style issues, use proper headers, and align to cpu_x86 naming scheme. No functional changes. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming --- cpu-all.h|4 monitor.c|2 +- target-i386/cpu.h|5 + targ

[PATCH 07/13] kvm: x86: Move MCE functions together

2011-02-15 Thread Jan Kiszka
Pure function suffling to avoid multiple #ifdef KVM_CAP_MCE sections, no functional changes. While at it, annotate some #ifdef sections. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming --- target-i386/kvm.c | 346 ++

[PATCH 09/13] kvm: x86: Consolidate TCG and KVM MCE injection code

2011-02-15 Thread Jan Kiszka
This switches KVM's MCE injection path to cpu_x86_inject_mce, both for SIGBUS and monitor initiated events. This means we prepare the MCA MSRs in the VCPUState also for KVM. We have to drop the MSRs writeback restrictions for this purpose which is now safe as every uncoordinated MSR injection is r

[PATCH 04/13] x86: Refine error reporting of MCE injection services

2011-02-15 Thread Jan Kiszka
As this service is used by the human monitor, make sure that errors get reported to the right channel, and also raise the verbosity. This requires to move Monitor typedef in qemu-common.h to resolve the include dependency. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Don

[PATCH 05/13] x86: Optionally avoid injecting AO MCEs while others are pending

2011-02-15 Thread Jan Kiszka
Allow to tell cpu_x86_inject_mce that it should ignore Action Optional MCE events when the target VCPU is still processing another one. This will be used by KVM soon. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming --- monitor.c|7 +-- target-i

[PATCH 08/13] kvm: x86: Inject pending MCE events on state writeback

2011-02-15 Thread Jan Kiszka
The current way of injecting MCE events without updating of and synchronizing with the CPUState is broken and causes spurious corruptions of the MCE-related parts of the CPUState. As a first step towards a fix, enhance the state writeback code with support for injecting events that are pending in

[PATCH 01/13] x86: Account for MCE in cpu_has_work

2011-02-15 Thread Jan Kiszka
MCEs can be injected asynchronously, so they can also terminate the halt state. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming --- target-i386/exec.h | 15 ++- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/target-i386/exec.h b/targe

[PATCH 00/13] [uq/master] Patch queue, part IV (MCE edition)

2011-02-15 Thread Jan Kiszka
And the show goes on: This 4th round contains a rework of the MCE handling, mostly for KVM, but also few bits used in emulation mode are affected. Major contributions are: - fixed MCE injection race with other events - kick VCPU out of halt on asynchronous MCEs - unified TCG and KVM MCE injectio

[PATCH 02/13] x86: Perform implicit mcg_status reset

2011-02-15 Thread Jan Kiszka
Reorder mcg_status in CPUState to achive automatic clearing on reset. Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming --- target-i386/cpu.h|3 ++- target-i386/helper.c |2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/target-i386/cp

[PATCH 10/13] kvm: x86: Clean up kvm_setup_mce

2011-02-15 Thread Jan Kiszka
There is nothing to abstract here. Fold kvm_setup_mce into its caller and fix up the error reporting (return code of kvm_vcpu_ioctl holds the error value). Signed-off-by: Jan Kiszka CC: Huang Ying CC: Hidetoshi Seto CC: Jin Dongming --- target-i386/kvm.c | 11 --- 1 files changed, 4

Re: nbd block device backend - 'improvements'

2011-02-15 Thread Avi Kivity
On 02/14/2011 07:28 PM, Nicholas Thomas wrote: I'm interested in getting the changes merged upstream, so I thought I'd get in early and ask if you'd be interested in the patch, in principle; whether the old behaviour would need to be preserved, making the new behaviour accessible via a config opt

Re: Slow disk IO on virtio kvm guests with Centos 5.5 as hypervisor

2011-02-15 Thread Stefan Hajnoczi
On Mon, Feb 14, 2011 at 6:15 PM, Thomas Broda wrote: > dd'ing /dev/zero to a testfile gives me a throughput of about 400MB/s when > done directly on the hypervisor. If I try this from within a virtual guest, > it's only 19MB/s to 24MB/s if the guest is on the LVM volume (raw device, > not qcow2 or

Re: Slow disk IO on virtio kvm guests with Centos 5.5 as hypervisor

2011-02-15 Thread Thomas Broda
On Tue, 15 Feb 2011 09:19:23 +, Stefan Hajnoczi wrote: > Did you run dd with O_DIRECT? > dd if=/dev/zero of= oflag=direct bs=64k Using O_DIRECT, performance went down to 11 MB/s on the hypervisor... -- Thomas -- ICQ: 7122237 Jabber: t...@bassfimass.de Web:www.bassfimass

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Amit Shah
On (Mon) 14 Feb 2011 [16:18:10], Anthony Liguori wrote: > On 02/14/2011 11:56 AM, Chris Wright wrote: > >Please send in any agenda items you are interested in covering. > > -rc2 is tagged and waiting for announcement. Please take a look at > -rc2 and make sure there is nothing critical missing.

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Avi Kivity
On 02/15/2011 12:18 AM, Anthony Liguori wrote: On 02/14/2011 11:56 AM, Chris Wright wrote: Please send in any agenda items you are interested in covering. -rc2 is tagged and waiting for announcement. Please take a look at -rc2 and make sure there is nothing critical missing. Will tag 0.14.0

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Markus Armbruster
Anthony Liguori writes: > On 02/14/2011 11:56 AM, Chris Wright wrote: >> Please send in any agenda items you are interested in covering. >> > > - QAPI and QMP events > - qdev future Do we need a qdev tree and a maintainer for it? > > I don't really have a coherent plan for the second on

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Gleb Natapov
On Mon, Feb 14, 2011 at 01:54:41PM -0600, Anthony Liguori wrote: > On 02/14/2011 11:56 AM, Chris Wright wrote: > >Please send in any agenda items you are interested in covering. > > - QAPI and QMP events > - qdev future > Making new Seabios stable release for qemu-0.14? --

Re: [PATCH 2/2] KVM: Convert read-only users of vm_list to RCU

2011-02-15 Thread Marcelo Tosatti
On Tue, Feb 08, 2011 at 12:55:39PM +0100, Jan Kiszka wrote: > Only for walking the list of VMs, we do not need to hold the preemption > disabling kvm_lock. Convert stat services, the cpufreq callback and > mmu_shrink to RCU. For the latter, special care is required to > synchronize its list_move_ta

Re: [PATCH] qemu-kvm: Update kvm_check_many_ioeventfds for qemu-kvm use

2011-02-15 Thread Marcelo Tosatti
On Tue, Feb 08, 2011 at 11:10:57PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > qemu-kvm does not (yet) have CONFIG_IOTHREAD enabled. Without it, > kvm_check_many_ioeventfds will always fail although there is no reason. > > Signed-off-by: Jan Kiszka > --- > kvm-all.c |2 +- > 1 files ch

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Anthony Liguori
On 02/15/2011 04:44 AM, Avi Kivity wrote: On 02/15/2011 12:18 AM, Anthony Liguori wrote: On 02/14/2011 11:56 AM, Chris Wright wrote: Please send in any agenda items you are interested in covering. -rc2 is tagged and waiting for announcement. Please take a look at -rc2 and make sure there is

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Anthony Liguori
On 02/15/2011 06:11 AM, Markus Armbruster wrote: Anthony Liguori writes: On 02/14/2011 11:56 AM, Chris Wright wrote: Please send in any agenda items you are interested in covering. - QAPI and QMP events - qdev future Do we need a qdev tree and a maintainer for

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Avi Kivity
On 02/15/2011 03:58 PM, Anthony Liguori wrote: On 02/15/2011 04:44 AM, Avi Kivity wrote: On 02/15/2011 12:18 AM, Anthony Liguori wrote: On 02/14/2011 11:56 AM, Chris Wright wrote: Please send in any agenda items you are interested in covering. -rc2 is tagged and waiting for announcement. Pl

Re: [PATCH 2/2] KVM: Convert read-only users of vm_list to RCU

2011-02-15 Thread Jan Kiszka
On 2011-02-15 13:32, Marcelo Tosatti wrote: > On Tue, Feb 08, 2011 at 12:55:39PM +0100, Jan Kiszka wrote: >> Only for walking the list of VMs, we do not need to hold the preemption >> disabling kvm_lock. Convert stat services, the cpufreq callback and >> mmu_shrink to RCU. For the latter, special c

Re: [PATCH v3 1/6] KVM-HDR: KVM Steal time implementation

2011-02-15 Thread Avi Kivity
On 02/11/2011 08:19 PM, Glauber Costa wrote: To implement steal time, we need the hypervisor to pass the guest information about how much time was spent running other processes outside the VM. This is per-vcpu, and using the kvmclock structure for that is an abuse we decided not to make. In this

Re: [PATCH v3 2/6] KVM-HV: KVM Steal time implementation

2011-02-15 Thread Avi Kivity
On 02/11/2011 08:19 PM, Glauber Costa wrote: To implement steal time, we need the hypervisor to pass the guest information about how much time was spent running other processes outside the VM. This is per-vcpu, and using the kvmclock structure for that is an abuse we decided not to make. In this

Re: [PATCH v3 4/6] KVM-GST: KVM Steal time registration

2011-02-15 Thread Avi Kivity
On 02/11/2011 08:19 PM, Glauber Costa wrote: Register steal time within KVM. Everytime we sample the steal time information, we update a local variable that tells what was the last time read. We then account the difference. +static int kvm_register_steal_time(void) +{ + int cpu = smp_pro

Re: [PATCH v3 3/6] KVM-GST: KVM Steal time accounting

2011-02-15 Thread Peter Zijlstra
On Tue, 2011-02-15 at 16:35 +0200, Avi Kivity wrote: > On 02/11/2011 08:19 PM, Glauber Costa wrote: > > This patch accounts steal time time in kernel/sched. > > I kept it from last proposal, because I still see advantages > > in it: Doing it here will give us easier access from scheduler > > variab

Re: [PATCH v3 3/6] KVM-GST: KVM Steal time accounting

2011-02-15 Thread Avi Kivity
On 02/11/2011 08:19 PM, Glauber Costa wrote: This patch accounts steal time time in kernel/sched. I kept it from last proposal, because I still see advantages in it: Doing it here will give us easier access from scheduler variables such as the cpu rq. The next patch shows an example of usage for

Re: [PATCH v3 3/6] KVM-GST: KVM Steal time accounting

2011-02-15 Thread Avi Kivity
On 02/15/2011 04:45 PM, Peter Zijlstra wrote: On Tue, 2011-02-15 at 16:35 +0200, Avi Kivity wrote: On 02/11/2011 08:19 PM, Glauber Costa wrote: This patch accounts steal time time in kernel/sched. I kept it from last proposal, because I still see advantages in it: Doing it here will give us eas

Re: [PATCH v3 3/6] KVM-GST: KVM Steal time accounting

2011-02-15 Thread Rik van Riel
On 02/15/2011 10:17 AM, Avi Kivity wrote: Ah, so we're all set. Do you know if any user tools process this information? Top and vmstat have been displaying steal time for maybe 4 or 5 years now. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to major

Re: [PATCH v3 3/6] KVM-GST: KVM Steal time accounting

2011-02-15 Thread Avi Kivity
On 02/15/2011 05:24 PM, Rik van Riel wrote: On 02/15/2011 10:17 AM, Avi Kivity wrote: Ah, so we're all set. Do you know if any user tools process this information? Top and vmstat have been displaying steal time for maybe 4 or 5 years now. Excellent, thanks. -- To unsubscribe from this list:

Re: [PATCH v3 3/6] KVM-GST: KVM Steal time accounting

2011-02-15 Thread Peter Zijlstra
On Tue, 2011-02-15 at 17:17 +0200, Avi Kivity wrote: > > Ah, so we're all set. Do you know if any user tools process this > information? I suppose there are, I bet Jeremy knows, Xen after all supports this stuff ;-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body

Re: [PATCH v3 4/6] KVM-GST: KVM Steal time registration

2011-02-15 Thread Peter Zijlstra
On Tue, 2011-02-15 at 16:41 +0200, Avi Kivity wrote: > > +static int kvm_register_steal_time(void) > > +{ > > + int cpu = smp_processor_id(); > > + int low, high, ret; > > + struct kvm_steal_time *st =&per_cpu(steal_time, cpu); > > + > > + if (!hypervisor_steal_time) > > +

Re: Slow disk IO on virtio kvm guests with Centos 5.5 as hypervisor

2011-02-15 Thread Stefan Hajnoczi
On Tue, Feb 15, 2011 at 10:15 AM, Thomas Broda wrote: > On Tue, 15 Feb 2011 09:19:23 +, Stefan Hajnoczi > wrote: > >> Did you run dd with O_DIRECT? > >> dd if=/dev/zero of= oflag=direct bs=64k > > Using O_DIRECT, performance went down to 11 MB/s on the hypervisor... Hmm...can you restate tha

Re: [Qemu-devel] KVM call agenda for Feb 15

2011-02-15 Thread Stefan Hajnoczi
On Mon, Feb 14, 2011 at 10:18 PM, Anthony Liguori wrote: > On 02/14/2011 11:56 AM, Chris Wright wrote: >> >> Please send in any agenda items you are interested in covering. >> > > -rc2 is tagged and waiting for announcement.  Please take a look at -rc2 and > make sure there is nothing critical mis

KVM call minutes for Feb 15

2011-02-15 Thread Chris Wright
QAPI and QMP - Anthony adding a new wiki page to describe all of this - specified in formal schema using JSON - includes documenation in javadoc-like syntax - can generate api (possibly protocol) docs - documenting each command and expected errors - creates marshalling functions and C interfa

Re: [PATCH] KVM: Start lock documentation

2011-02-15 Thread Marcelo Tosatti
On Wed, Feb 09, 2011 at 03:11:28PM +0100, Jan Kiszka wrote: > The goal of this document shall be > - overview of all locks used in KVM core > - provide details on the scope of each lock > - explain the lock type, specifically of a raw spin locks > - provide a lock ordering guide > > Start with one

Converting QEMU Harddisk to native Partition

2011-02-15 Thread Erik Rull
Hi all, I have currently virtualized two partitions (/dev/sda2 and /dev/sda3) that are exposed as QEMU Harddisks to the Windows XP Guest (Drive C and D there). Are there possibilities to convert or adapt those to native partitions or native disks so that I could theoretically boot the Windows t

Re: [PATCH] KVM: Start lock documentation

2011-02-15 Thread Avi Kivity
On 02/15/2011 06:44 PM, Marcelo Tosatti wrote: On Wed, Feb 09, 2011 at 03:11:28PM +0100, Jan Kiszka wrote: The goal of this document shall be - overview of all locks used in KVM core - provide details on the scope of each lock - explain the lock type, specifically of a raw spin locks - provide a

Re: [PATCH] KVM: Start lock documentation

2011-02-15 Thread Jan Kiszka
On 2011-02-15 17:44, Marcelo Tosatti wrote: > On Wed, Feb 09, 2011 at 03:11:28PM +0100, Jan Kiszka wrote: >> The goal of this document shall be >> - overview of all locks used in KVM core >> - provide details on the scope of each lock >> - explain the lock type, specifically of a raw spin locks >>

Re: [Qemu-devel] KVM call minutes for Feb 8

2011-02-15 Thread Blue Swirl
On Mon, Feb 14, 2011 at 11:47 PM, Anthony Liguori wrote: > On 02/14/2011 03:25 PM, Blue Swirl wrote: >> >> I'd still like to have the inline wrapper over the factory interface, >> probably with similar signature to isa_serial_new. Then there would be >> two functions, one going through qdev and th

Re: EPT: Misconfiguration

2011-02-15 Thread Marcelo Tosatti
On Sun, Feb 13, 2011 at 03:03:40PM +0200, Avi Kivity wrote: > On 02/13/2011 04:07 AM, Ruben Kerkhof wrote: > >And tonight we had another one of those errors we had a few weeks ago: > > > >2011-02-13T02:56:28.694496+01:00 phy005 kernel: EPT: Misconfiguration. > >2011-02-13T02:56:28.694908+01:00 phy0

Re: EPT: Misconfiguration

2011-02-15 Thread Ruben Kerkhof
Hi Marcelo, On Tue, Feb 15, 2011 at 18:16, Marcelo Tosatti wrote: > On Sun, Feb 13, 2011 at 03:03:40PM +0200, Avi Kivity wrote: >> On 02/13/2011 04:07 AM, Ruben Kerkhof wrote: >> >And tonight we had another one of those errors we had a few weeks ago: >> > >> >2011-02-13T02:56:28.694496+01:00 phy0

Re: [PATCH] qemu-kvm: Clean up IOAPIC after upstream merge

2011-02-15 Thread Marcelo Tosatti
On Mon, Feb 14, 2011 at 10:35:54AM +0100, Jan Kiszka wrote: > Drop base_address from the vmstate, upstream decided against managing it > at device level. Continuing to interpret the vmstate field would break > compatibility with upstream. Instead, fetch the base addres from the > sysbus device stat

Re: Converting QEMU Harddisk to native Partition

2011-02-15 Thread David Mair
On 02/15/2011 10:06 AM, Erik Rull wrote: Hi all, I have currently virtualized two partitions (/dev/sda2 and /dev/sda3) that are exposed as QEMU Harddisks to the Windows XP Guest (Drive C and D there). Are there possibilities to convert or adapt those to native partitions or native disks so that

Re: [PATCH 2/3] KVM: VMX: Short circuit STI; HLT while an interrupt is pending

2011-02-15 Thread Marcelo Tosatti
On Mon, Feb 14, 2011 at 04:42:16PM +0200, Avi Kivity wrote: > Short-circuit an STI; HLT sequence while an interrupt is pending: > instead of halting, re-entering the guest, and exiting immediately > on an interrupt window exit, go directly to the last step. > > Saves a vmexit on workloads where in

Re: Converting QEMU Harddisk to native Partition

2011-02-15 Thread Erik Rull
David Mair wrote: I have currently virtualized two partitions (/dev/sda2 and /dev/sda3) that are exposed as QEMU Harddisks to the Windows XP Guest (Drive C and D there). Are there possibilities to convert or adapt those to native partitions or native disks so that I could theoretically boot the

Re: Converting QEMU Harddisk to native Partition

2011-02-15 Thread David Mair
On 02/15/2011 01:54 PM, Erik Rull wrote: David Mair wrote: I have currently virtualized two partitions (/dev/sda2 and /dev/sda3) that are exposed as QEMU Harddisks to the Windows XP Guest (Drive C and D there). Are there possibilities to convert or adapt those to native partitions or native di

Re: [Qemu-devel] KVM call minutes for Feb 8

2011-02-15 Thread Anthony Liguori
On 02/15/2011 11:11 AM, Blue Swirl wrote: On Mon, Feb 14, 2011 at 11:47 PM, Anthony Liguori wrote: Any device we expose to the user through -device needs to maintain a compatible interface forever. For our own sanity, I think we should try to expose as little as possible. Restrictin

Re: [Qemu-devel] KVM call minutes for Feb 15

2011-02-15 Thread Anthony Liguori
On 02/15/2011 10:26 AM, Chris Wright wrote: QAPI and QMP - Anthony adding a new wiki page to describe all of this http://wiki.qemu.org/Features/QAPI - specified in formal schema using JSON - includes documenation in javadoc-like syntax - can generate api (possibly protocol) docs

Re: virtio_net sometimes didn't work

2011-02-15 Thread lidong chen
because of some other work, i could not focus on this problem last month. now i find the wrong vaule of isr cause this problem. in function vp_interrupt, the isr is 0, and the virtio_balloon pci device have 10 times initerrupts. then IRQ #11 disabled. static irqreturn_t vp_interrupt(int irq,

Re: virtio_net sometimes didn't work

2011-02-15 Thread Michael S. Tsirkin
On Wed, Feb 16, 2011 at 09:53:25AM +0800, lidong chen wrote: > because of some other work, i could not focus on this problem last month. > > now i find the wrong vaule of isr cause this problem. > in function vp_interrupt, the isr is 0, and the virtio_balloon pci > device have 10 times initerr