[kvm-devel] VNC segfault

2008-05-16 Thread Marcelo Tosatti
Hi Anthony, We're experiencing qemu segfaults when using VNC over high latency links. (gdb) bt #0 0x003a8ec838d3 in memcpy () from /lib64/libc.so.6 #1 0x004b9aff in vnc_update_client (opaque=0x3514140) at vnc.c:223 #2 0x0040822d in qemu_run_timers (ptimer_head=0x8e9500,

Re: [kvm-devel] Protected mode transitions and big real mode... still an issue

2008-05-14 Thread Marcelo Tosatti
Hi Guillaume, On Wed, May 14, 2008 at 09:29:11AM +0200, Guillaume Thouvenin wrote: On Tue, 6 May 2008 20:05:39 +0300 Mohammed Gamal [EMAIL PROTECTED] wrote: WinXP fails with the patch applied too. Ubuntu 7.10 live CD and FreeDOS don't boot but complain about instruction mov

Re: [kvm-devel] pinning, tsc and apic

2008-05-14 Thread Marcelo Tosatti
On Mon, May 12, 2008 at 02:19:24PM -0500, Ryan Harper wrote: I've been digging into some of the instability we see when running larger numbers of guests at the same time. The test I'm currently using involves launching 64 1vcpu guests on an 8-way AMD box. With the latest kvm-userspace git

Re: [kvm-devel] KVM: kvm_vcpu_block task state race

2008-05-13 Thread Marcelo Tosatti
On Sun, May 11, 2008 at 05:26:06PM +0300, Avi Kivity wrote: So do you want to give wait_event_interruptible() a try or wait for that change until userspace never issues vcpu ioctl's to a possibly busy vcpu (and go with the patch above)? Do we have anything critical that issues vcpu

[kvm-devel] KVM: LAPIC: ignore pending timers if LVTT is disabled

2008-05-13 Thread Marcelo Tosatti
Only use the APIC pending timers count to break out of HLT emulation if the timer vector is enabled. Certain configurations of Windows simply mask out the vector without disabling the timer. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-05-12 Thread Marcelo Tosatti
On Sat, May 10, 2008 at 10:12:02AM +0800, Yang, Sheng wrote: Did you have kvm.git commit 8ae6dc90ac84d9734e343210c8ec709f50cd9d89 when testing this? I believe it should fix that issue, because ps-inject_pending won't be set by kvm_pit_timer_intr_post() if the IRQ is masked. Please

Re: [kvm-devel] KVM: kvm_vcpu_block task state race

2008-05-09 Thread Marcelo Tosatti
On Fri, May 09, 2008 at 10:40:47AM +0300, Avi Kivity wrote: Unfortunately it can't use wait_event_interruptible() due to vcpu_put/vcpu_load. schedule() will call vcpu_put()/vcpu_load() for us through preempt notifiers. I feel a little uneasy about it, but no concreate reason why

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-05-09 Thread Marcelo Tosatti
On Fri, May 09, 2008 at 03:49:20PM +0800, Yang, Sheng wrote: On Sunday 13 April 2008 17:28:22 Avi Kivity wrote: Marcelo Tosatti wrote: On Fri, Apr 11, 2008 at 03:12:41PM +0300, Avi Kivity wrote: This breaks ia64 (and shouldn't s390 use this too?) * We will block until

Re: [kvm-devel] [PATCH] qemu-kvm: fix guest resetting

2008-05-09 Thread Marcelo Tosatti
On Fri, May 09, 2008 at 10:13:33AM +0200, Jan Kiszka wrote: Hmm, need to think a bit more about it as I don't see the benefit yet (code suggestions are welcome in the meantime :)!). Doing the reset from two different contexes is confusing and more complicated. The changes to vl.c are actually

Re: [kvm-devel] KVM: kvm_vcpu_block task state race

2008-05-09 Thread Marcelo Tosatti
On Fri, May 09, 2008 at 06:09:41PM +0300, Avi Kivity wrote: Marcelo Tosatti wrote: On Fri, May 09, 2008 at 10:40:47AM +0300, Avi Kivity wrote: Unfortunately it can't use wait_event_interruptible() due to vcpu_put/vcpu_load. schedule() will call vcpu_put()/vcpu_load() for us

Re: [kvm-devel] KVM: kvm_vcpu_block task state race

2008-05-09 Thread Marcelo Tosatti
On Fri, May 09, 2008 at 04:22:08PM -0300, Marcelo Tosatti wrote: For things like register dumps I don't believe its worthwhile. Much simpler to stop the vcpu with SIG_IPI, retrieve registers, and run it again (now that you mention the busy-spin, it is broken right now, if a vcpu is spinning

[kvm-devel] KVM: kvm_vcpu_block task state race

2008-05-08 Thread Marcelo Tosatti
prepare_to_wait() which sets the task state before testing for the wait condition. Unfortunately it can't use wait_event_interruptible() due to vcpu_put/vcpu_load. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 0846d3d..fcc08c2 100644

Re: [kvm-devel] [PATCH 0/4] paravirt clock patches

2008-05-08 Thread Marcelo Tosatti
On Wed, May 07, 2008 at 08:45:12PM +0200, Gerd Hoffmann wrote: Ok folks, here is the band aid fix for testing from the odd bugs department. Goes on top of the four patches of this series. A real, clean solution is TBD. Tomorrow I hope (some urgent private problems are in the queue too ...).

Re: [kvm-devel] [PATCH] qemu-kvm: fix guest resetting

2008-05-08 Thread Marcelo Tosatti
Hi Jan, On Thu, May 08, 2008 at 10:29:32AM +0200, Jan Kiszka wrote: Resetting guests used to be racy, deadlock-prone, or simply broken (for SMP). This patch fixes the issues - at least for me on x86 (tested on Intel SMP host, UP and SMP guest, in-kernel und user space irqchip, guest- and

[kvm-devel] KVM: PIT: take inject_pending into account when emulating hlt

2008-05-06 Thread Marcelo Tosatti
Otherwise hlt emulation fails if PIT is not injecting IRQ's. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 1646102..07f9ff1 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -216,7 +216,7 @@ int

Re: [kvm-devel] problems running many guests

2008-05-06 Thread Marcelo Tosatti
Hi Karl, On Mon, May 05, 2008 at 08:40:22PM -0500, Karl Rister wrote: On Thursday 01 May 2008 7:16:53 pm Marcelo Tosatti wrote: Does -no-kvm-irqchip or -no-kvm-pit makes a difference? If not, please grab kvm_stat --once output when that happens. Per some suggestions I have moved up to kvm

[kvm-devel] QEMU/KVM: fix copypaste bug in ACPI IRQ routing tables

2008-05-06 Thread Marcelo Tosatti
Slots 9 and 25 were using the identifier of the previous slot. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index d2e33f4..c145c4b 100755 --- a/bios/acpi-dsdt.dsl +++ b/bios/acpi-dsdt.dsl @@ -269,10 +269,10 @@ DefinitionBlock

Re: [kvm-devel] [PATCH 1/4] Replace SIGUSR1 in io-thread with eventfd() (v2)

2008-05-06 Thread Marcelo Tosatti
Looks good (the whole series). Needs some good testing of course... Have you tested migration/loadvm? On Mon, May 05, 2008 at 08:47:12AM -0500, Anthony Liguori wrote: It's a little odd to use signals to raise a notification on a file descriptor when we can just work directly with a file

Re: [kvm-devel] [PATCH 0/4] paravirt clock patches

2008-05-05 Thread Marcelo Tosatti
On Mon, May 05, 2008 at 09:47:59AM +0200, Gerd Hoffmann wrote: Marcelo Tosatti wrote: On Thu, Apr 24, 2008 at 10:37:04AM +0200, Gerd Hoffmann wrote: Hi folks, My first attempt to send out a patch series with git ... The patches fix the kvm paravirt clocksource code to be compatible

Re: [kvm-devel] [PATCH] [ACPI] Enable direct GSI mapping for APIC

2008-05-02 Thread Marcelo Tosatti
On Fri, May 02, 2008 at 04:55:24PM +0200, Alexander Graf wrote: Hi, in the DSDT there are two different ways of defining, how an interrupt is supposed to be routed. Currently we are using the LNKA - LNKD method, which afaict is for legacy support. The other method is to directly tell the

[kvm-devel] [patch 1/3] QEMU/KVM: add 3 PCI bridges to ACPI table

2008-05-02 Thread Marcelo Tosatti
breaks PCI hotplug for older userspace, hopefully not an issue (trivial enough to upgrade the BIOS). Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.pci3/bios/acpi-dsdt.dsl === --- kvm-userspace.pci3.orig/bios/acpi

[kvm-devel] [patch 2/3] QEMU/KVM: ACPI PCI hotplug multiple bus support

2008-05-02 Thread Marcelo Tosatti
Support more than one bus in the ACPI PCI hotplug code. Currently 4 buses are supported, but can be easily extended. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.pci3/qemu/hw/acpi.c === --- kvm

[kvm-devel] [patch 0/3] QEMU/KVM: add support for 128 PCI slots (v2)

2008-05-02 Thread Marcelo Tosatti
Add three PCI bridges to support 128 slots. Changes since v1: - Remove I/O address range support (so standard PCI I/O space is used). - Verify that there's no special quirks for 82801 PCI bridge. - Introduce separate flat IRQ mapping function for non-SPARC targets. --

[kvm-devel] [patch 3/3] QEMU/KVM: add 3 PCI bridges

2008-05-02 Thread Marcelo Tosatti
SPARC, a separate pci_set_irq function is introduced to handle the flat IRQ space. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.pci3/qemu/hw/pci.c === --- kvm-userspace.pci3.orig/qemu/hw/pci.c +++ kvm

Re: [kvm-devel] KVM-66: FreeBSD guest takes all CPU when idle

2008-05-02 Thread Marcelo Tosatti
On Fri, May 02, 2008 at 10:39:25PM +0200, Aurelien Jarno wrote: Hi, Since commit a0d22c57fbf0c67d73ab7ca3416841030e0bc22f, FreeBSD guests takes all host CPU even when they are idle. Reverting this patch in kvm-67 or git tree fixes (or workarounds?) the problem. Using -no-kvm-pit also

Re: [kvm-devel] Protected mode transitions and big real mode... still an issue

2008-05-01 Thread Marcelo Tosatti
Hi Guillaume, On Tue, Apr 29, 2008 at 03:02:36PM +0200, Guillaume Thouvenin wrote: Hello, snip -hda ~/disk_images/hd_50G.qcow2 -cdrom /images_iso/openSUSE-10.3-GM-x86_64-mini.iso -boot d -s -m 1024 exception 13 (33) rax 0673 rbx 0080 rcx rdx

Re: [kvm-devel] problems running many guests

2008-05-01 Thread Marcelo Tosatti
On Thu, May 01, 2008 at 06:00:44PM -0500, Karl Rister wrote: Hi I have been trying to do some testing of a large number of guests (72) on a big multi-node IBM box (8 sockets, 32 cores, 128GB) and I am having various issues with the guests. I can get the guests to boot, but then I start to

[kvm-devel] KVM: PIT: support mode 4

2008-04-30 Thread Marcelo Tosatti
counting immediately, so add a FIXME to enhance precision. Fixes https://sourceforge.net/tracker/?func=detailatid=893831aid=1952988group_id=180599 Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Acked-by: Sheng Yang [EMAIL PROTECTED] diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index

[kvm-devel] cirrusfb division by zero

2008-04-30 Thread Marcelo Tosatti
Anthony, The following sequence crashes F9 guests, when using VNC: # modprobe cirrusfb # vbetool post Results in Floating point exception at: cirrus_do_copy() { depth = s-get_bpp((VGAState *)s) / 8 ... sx = (src % (width * depth)) / depth; ... } Problem is that -get_bpp

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Marcelo Tosatti
Hi Anthony, How is -no-kvm-irqchip working with the patch? On Tue, Apr 29, 2008 at 09:28:14AM -0500, Anthony Liguori wrote: This patch eliminates the use of sigtimedwait() in the IO thread. To avoid the signal/select race condition, we use a pipe that we write to in the signal handlers.

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Marcelo Tosatti
On Tue, Apr 29, 2008 at 06:15:58PM -0500, Anthony Liguori wrote: Marcelo Tosatti wrote: Problem is if the IO thread _receives_ SIGIPI instead of some vcpu thread. So there is potential harm in not blocking it. Hrm, aren't SIG_IPIs delivered to a particular thread-id though? When

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Marcelo Tosatti
On Tue, Apr 29, 2008 at 06:44:29PM -0500, Anthony Liguori wrote: Marcelo Tosatti wrote: Why? If you leave data in the pipe the next select() won't block. Isnt there the possibility that this loop can be stuck for significant amounts of time? If you're receiving lots of notifications through

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Marcelo Tosatti
On Tue, Apr 29, 2008 at 07:22:53PM -0500, Anthony Liguori wrote: Marcelo Tosatti wrote: True. Either way, this starvation due to signals can't happen with the current scheme because signals are blocked. It seems a significant drawback. Practically speaking, I don't see signal starving

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Marcelo Tosatti
On Tue, Apr 29, 2008 at 07:47:54PM -0500, Anthony Liguori wrote: Marcelo Tosatti wrote: Moving the signal handling + pipe write to a separate thread should get rid of it. Yeah, but then you just introduce buffering problems since if you're getting that many signals, the pipe

Re: [kvm-devel] mmu notifier #v14

2008-04-28 Thread Marcelo Tosatti
Hi Andrea, Looks good. Acked-by: Marcelo Tosatti [EMAIL PROTECTED] - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority

Re: [kvm-devel] performance with guests running 2.4 kernels (specifically RHEL3)

2008-04-28 Thread Marcelo Tosatti
On Fri, Apr 25, 2008 at 11:33:18AM -0600, David S. Ahern wrote: Most of the cycles (~80% of that 54k+) are spent in paging64_prefetch_page(): for (i = 0; i PT64_ENT_PER_PAGE; ++i) { gpa_t pte_gpa = gfn_to_gpa(sp-gfn); pte_gpa += (i+offset) *

Re: [kvm-devel] [PATCH 0/4] paravirt clock patches

2008-04-28 Thread Marcelo Tosatti
On Thu, Apr 24, 2008 at 10:37:04AM +0200, Gerd Hoffmann wrote: Hi folks, My first attempt to send out a patch series with git ... The patches fix the kvm paravirt clocksource code to be compatible with xen and they also factor out some code which can be shared into a separate source

Re: [kvm-devel] QEMU/KVM [RFC]: add support for 128 PCI slots

2008-04-25 Thread Marcelo Tosatti
On Fri, Apr 25, 2008 at 11:38:21AM +0200, Alexander Graf wrote: On Apr 25, 2008, at 3:01 AM, Marcelo Tosatti wrote: Add three PCI bridges to support 128 slots. Vendor and device_id have been stolen from my test box. I/O port addresses behind each bridge are statically allocated

[kvm-devel] libkvm: initialize no_pit_creation

2008-04-25 Thread Marcelo Tosatti
: kvm_qemu_create_context (qemu-kvm.c:616) ==11754==by 0x412031: main (vl.c:9653) Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 329f29f..adf09a5 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -249,6 +249,7 @@ kvm_context_t kvm_init(struct

Re: [kvm-devel] KVM Test result, kernel 873c05f.., userspace d102d75..

2008-04-24 Thread Marcelo Tosatti
On Thu, Apr 24, 2008 at 04:44:27PM +0300, Avi Kivity wrote: Chris Lalancette wrote: Avi Kivity wrote: Ok. __pit_timer_fn() is called from an interrupt, which then calls smp_call_function_single(), which calls spin_lock(). If we've already taken the lock, we hang. Ah. Just

Re: [kvm-devel] [PATCH] Make virtio devices multi-function

2008-04-23 Thread Marcelo Tosatti
It sounds reasonable to expect so. ACPI has objects for devices, not functions (IIRC). So what I dislike about multifunction devices is the fact that a single slot shares an IRQ, and that special code is required in the QEMU drivers (virtio guest capability might not always be present).

[kvm-devel] KVM: PIT: make last_injected_time per-guest

2008-04-22 Thread Marcelo Tosatti
Otherwise multiple guests use the same variable and boom. Also use kvm_vcpu_kick() to make sure that if a timer triggers on a different CPU the event won't be missed. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Tested-and-Acked-by: Alex Davis [EMAIL PROTECTED] diff --git a/arch/x86/kvm

Re: [kvm-devel] [PATCH] Make virtio devices multi-function

2008-04-22 Thread Marcelo Tosatti
On Tue, Apr 22, 2008 at 05:32:45PM +0300, Avi Kivity wrote: Anthony Liguori wrote: This patch changes virtio devices to be multi-function devices whenever possible. This increases the number of virtio devices we can support now by a factor of 8. With this patch, I've been able to

Re: [kvm-devel] [PATCH] Make virtio devices multi-function

2008-04-22 Thread Marcelo Tosatti
On Tue, Apr 22, 2008 at 11:31:11AM -0500, Anthony Liguori wrote: Avi Kivity wrote: Anthony Liguori wrote: I think we need to decide what we want to target in terms of upper limits. With a bridge or two, we can probably easily do 128. If we really want to push things, I think we should

Re: [kvm-devel] Bug 1895893 inquiry (KVM-60+ halts, when using SCSI)

2008-04-22 Thread Marcelo Tosatti
On Tue, Apr 22, 2008 at 12:39:57PM -0600, Alberto TreviƱo wrote: Thanks for all those who work on KVM. It is a wonderful product and I have been very impressed with its features, performance, and the level of activity in this project. Back in February a bug was filed. I've been hit by

Re: [kvm-devel] KVM console dying

2008-04-21 Thread Marcelo Tosatti
On Mon, Apr 21, 2008 at 01:24:00PM -0500, Anthony Liguori wrote: Marcelo Tosatti wrote: From: Alan Pevec [EMAIL PROTECTED] - add serial console, workaround for F9 livecd KVM guest dying with standard console only. VNC console will go blank but node will continue to boot

Re: [kvm-devel] [patch 00/13] RFC: split the global mutex

2008-04-20 Thread Marcelo Tosatti
On Sun, Apr 20, 2008 at 02:16:52PM +0300, Avi Kivity wrote: The iperf numbers are pretty good. Performance of UP guests increase slightly but SMP is quite significant. I expect you're seeing contention induced by memcpy()s and inefficient emulation. With the dma api, I expect the benefit

Re: [kvm-devel] paravirt clock stil causing hangs in kvm-65

2008-04-19 Thread Marcelo Tosatti
On Mon, Apr 07, 2008 at 06:34:57PM -0300, Marcelo Tosatti wrote: On Mon, Apr 07, 2008 at 01:53:36PM +0200, Nikola Ciprich wrote: Hi, I also tried paravirt clock again in latest git with kvm-65 patch applied, and problem with cpu-lockups persists: [10813.654806] BUG: soft lockup

Re: [kvm-devel] paravirt clock stil causing hangs in kvm-65

2008-04-19 Thread Marcelo Tosatti
On Sat, Apr 19, 2008 at 12:29:47PM -0300, Marcelo Tosatti wrote: I just reproduced this on a UP guest. Were you seeing the exact same stack trace in the guest with kvm-64 ? I've been able to reproduce the problem. Symptoms are that when using NOHZ vcpu0 LAPIC timer is ticking far less than

Re: [kvm-devel] paravirt clock stil causing hangs in kvm-65

2008-04-19 Thread Marcelo Tosatti
On Sat, Apr 19, 2008 at 01:22:28PM -0300, Glauber Costa wrote: I've been able to reproduce the problem. Symptoms are that when using NOHZ vcpu0 LAPIC timer is ticking far less than the others (apparently vcpu0 is the only one ticking correctly): nohz=on with kvmclock [EMAIL

Re: [kvm-devel] Second KVM process hangs eating 80-100% CPU on host during startup

2008-04-19 Thread Marcelo Tosatti
the following. KVM: PIT: make last_injected_time per-guest Otherwise multiple guests use the same variable and boom. Also use kvm_vcpu_kick() to make sure that if a timer triggers on a different CPU the event won't be missed. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/arch

Re: [kvm-devel] [PATCH 3/3] Implement linux-aio backend

2008-04-18 Thread Marcelo Tosatti
On Thu, Apr 17, 2008 at 02:26:52PM -0500, Anthony Liguori wrote: This patch introduces a Linux-aio backend that is disabled by default. To use this backend effectively, the user should disable caching and select it with the appropriate -aio option. For instance: qemu-system-x86_64 -drive

Re: [kvm-devel] [PATCH 3/3] Implement linux-aio backend

2008-04-18 Thread Marcelo Tosatti
On Fri, Apr 18, 2008 at 10:18:33AM -0500, Anthony Liguori wrote: Sleeping in the context of vcpu's is extremely bad (eg virtio-block blocks in write() throttling which kills performance). It should wait on IO completions instead (qemu-kvm.c creates a pthread waitqueue to resolve that issue).

Re: [kvm-devel] disappointing speed with virtio_blk

2008-04-18 Thread Marcelo Tosatti
Hi Gerd, On Fri, Apr 18, 2008 at 11:27:58PM +0200, Gerd von Egidy wrote: Hi Marcelo, http://www.mail-archive.com/kvm-devel@lists.sourceforge.net/msg14732.html I tried it this evening with kvm 66 - which should include your patch, right? No its not included. The issue is

[kvm-devel] [patch 0/2] virtio-blk async IO

2008-04-18 Thread Marcelo Tosatti
Use the asynchronous version of block IO functions, otherwise guests can block for long periods of time waiting for the operations to complete. -- - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't

[kvm-devel] [patch 1/2] QEMU/KVM: provide a reset method for virtio

2008-04-18 Thread Marcelo Tosatti
So drivers can do whatever necessary on reset. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.aio/qemu/hw/virtio.c === --- kvm-userspace.aio.orig/qemu/hw/virtio.c +++ kvm-userspace.aio/qemu/hw/virtio.c

[kvm-devel] [patch 2/2] QEMU/KVM: virtio-blk async IO

2008-04-18 Thread Marcelo Tosatti
. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.aio/qemu/hw/virtio-blk.c === --- kvm-userspace.aio.orig/qemu/hw/virtio-blk.c +++ kvm-userspace.aio/qemu/hw/virtio-blk.c @@ -77,54 +77,117 @@ static VirtIOBlock

[kvm-devel] [patch 00/13] RFC: split the global mutex

2008-04-17 Thread Marcelo Tosatti
Introduce QEMUDevice, making the ioport/iomem-device relationship visible. At the moment it only contains a lock, but could be extended. With it the following is possible: - vcpu's to read/write via ioports/iomem while the iothread is working on some unrelated device, or just copying

[kvm-devel] [patch 01/13] QEMU: get rid of global cpu_single_env

2008-04-17 Thread Marcelo Tosatti
cpu_single_env is a global variable, so there is an assumption that only one vcpu can execute QEMU at the same time. Provide a get_cpu_env() wrapper allowing KVM to use its thread local storage vcpu info. It simplifies IO thread handling. Index: kvm-userspace.io/qemu/block-raw-posix.c

[kvm-devel] [patch 02/13] QEMU: introduce QEMUDevice

2008-04-17 Thread Marcelo Tosatti
Introduce a QEMUDevice type to allow global knowledge of present devices. At the moment its only used for locking purposes, but not limited to that. Index: kvm-userspace.io/qemu/qemu-common.h === ---

[kvm-devel] [patch 05/13] QEMU: add a mutex to protect IRQ chip data structures

2008-04-17 Thread Marcelo Tosatti
Subject says it all. With KVM in-kernel irqchip this is unused. Index: kvm-userspace.io/qemu/hw/apic.c === --- kvm-userspace.io.orig/qemu/hw/apic.c +++ kvm-userspace.io/qemu/hw/apic.c @@ -478,6 +478,8 @@ int

[kvm-devel] [patch 03/13] QEMU: make esp.c build conditional to SPARC target

2008-04-17 Thread Marcelo Tosatti
Only used by qemu/hw/sun4m.c. Index: kvm-userspace.io/qemu/Makefile.target === --- kvm-userspace.io.orig/qemu/Makefile.target +++ kvm-userspace.io/qemu/Makefile.target @@ -563,7 +563,7 @@ DEPLIBS += libfdt.a endif # SCSI layer

[kvm-devel] [patch 06/13] QEMU: plug QEMUDevice pt2 / iomem awareness

2008-04-17 Thread Marcelo Tosatti
Same as before, but make the iomem-device relationship visible. Index: kvm-userspace.io/qemu/cpu-all.h === --- kvm-userspace.io.orig/qemu/cpu-all.h +++ kvm-userspace.io/qemu/cpu-all.h @@ -840,7 +840,7 @@ void

[kvm-devel] [patch 07/13] QEMU: grab device lock for ioport/iomem processing

2008-04-17 Thread Marcelo Tosatti
Record which device owns ioports/memports, and use that to grab the appropriate lock when entering ioport/iomem processing. Make cpu_physical_memory_rw() unlocked (called from inside device code), and locking optional from __cpu_physical_memory_rw(), to be called when a vcpu enters mmio

[kvm-devel] [patch 08/13] QEMU: character device locking

2008-04-17 Thread Marcelo Tosatti
Grab device locks when moving data through char devices in the host-guest direction. Index: kvm-userspace.io/qemu/hw/serial.c === --- kvm-userspace.io.orig/qemu/hw/serial.c +++ kvm-userspace.io/qemu/hw/serial.c @@ -305,18 +305,21 @@

[kvm-devel] [patch 09/13] QEMU: network device locking

2008-04-17 Thread Marcelo Tosatti
Grab device locks when moving data through network devices in the host-guest direction. Index: kvm-userspace.io/qemu/hw/e1000.c === --- kvm-userspace.io.orig/qemu/hw/e1000.c +++ kvm-userspace.io/qemu/hw/e1000.c @@ -1008,6 +1008,7 @@

[kvm-devel] [patch 10/13] QEMU: get rid of aiocb cache

2008-04-17 Thread Marcelo Tosatti
the malloc() implementation should do a decent job at this, simplifies block device locking. Index: kvm-userspace.io/qemu/block.c === --- kvm-userspace.io.orig/qemu/block.c +++ kvm-userspace.io/qemu/block.c @@ -1447,14 +1447,10 @@

[kvm-devel] [patch 12/13] QEMU: scsi-disk reentrancy fix

2008-04-17 Thread Marcelo Tosatti
Unrelated to this series. Ignore it. Index: kvm-userspace.io/qemu/hw/scsi-disk.c === --- kvm-userspace.io.orig/qemu/hw/scsi-disk.c +++ kvm-userspace.io/qemu/hw/scsi-disk.c @@ -196,12 +196,12 @@ static void scsi_read_data(SCSIDevice

[kvm-devel] [patch 13/13] QEMU/KVM: get rid of global lock

2008-04-17 Thread Marcelo Tosatti
Now that QEMU does all necessary locking itself, get rid of the global mutex lock. Allows more than one thread inside QEMU simultaneously. Index: kvm-userspace.io/qemu/qemu-kvm.c === --- kvm-userspace.io.orig/qemu/qemu-kvm.c +++

[kvm-devel] [patch 11/13] QEMU: block device locking

2008-04-17 Thread Marcelo Tosatti
Grab device locks when moving data through block devices in the host-guest direction. Also protect the aio_list by a separate lock. Index: kvm-userspace.io/qemu/block-qcow.c === --- kvm-userspace.io.orig/qemu/block-qcow.c +++

Re: [kvm-devel] [PATCH 1/2] kvm-s390: provide get/set_mp_state stubs to fix compile error

2008-04-16 Thread Marcelo Tosatti
On Wed, Apr 16, 2008 at 11:21:05AM -0500, Hollis Blanchard wrote: By the way Marcelo, it would be polite to provide these stubs yourself to avoid breaking the build on other architectures. Indeed, should have been more careful. It looks like IA64 is still broken because of this. Now I'm not

[kvm-devel] KVM: MMU: kvm_pv_mmu_op should not take mmap_sem

2008-04-16 Thread Marcelo Tosatti
kvm_pv_mmu_op should not take mmap_sem. All gfn_to_page() callers down in the MMU processing will take it if necessary, so as it is it can deadlock. Apparently a leftover from the days before slots_lock. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/arch/x86/kvm/mmu.c b/arch

Re: [kvm-devel] disappointing speed with virtio_blk

2008-04-16 Thread Marcelo Tosatti
On Thu, Apr 17, 2008 at 01:05:50AM +0200, Gerd von Egidy wrote: Hi Marcelo, virtio-blk is doing synchronous IO which blocks the guest CPU. This is especially bad for write intensive loads where the guest will hang in the host write throttling logic. In the meantime please try the

Re: [kvm-devel] [patch 2/2] QEMU: decrease console refresh rate with -nographic

2008-04-15 Thread Marcelo Tosatti
On Tue, Apr 15, 2008 at 05:45:28PM +0300, Avi Kivity wrote: Anthony Liguori wrote: Why did we ever need sigtimedwait() anyway? Even if we were select()ing within the VCPU context, we should break out of the select() on signal delivery. select() is no good since if the signal is

Re: [kvm-devel] [patch 2/2] QEMU: decrease console refresh rate with -nographic

2008-04-15 Thread Marcelo Tosatti
On Tue, Apr 15, 2008 at 08:40:09AM -0500, Anthony Liguori wrote: Avi Kivity wrote: Anthony Liguori wrote: BTW, when we set O_ASYNC on the tap fd, we're eliminating O_NONBLOCK. This means that we have to poll loop select() when readv()'ing packets instead of just reading until hitting

Re: [kvm-devel] [patch 2/2] QEMU: decrease console refresh rate with -nographic

2008-04-14 Thread Marcelo Tosatti
On Sun, Apr 13, 2008 at 06:30:34PM +0200, Anders wrote: Marcelo Tosatti wrote: With SIGIO enabled on stdio, there's no need to wakeup the thread performing IO every 30ms. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.io/qemu/vl.c

Re: [kvm-devel] [patch 2/2] QEMU: decrease console refresh rate with -nographic

2008-04-14 Thread Marcelo Tosatti
On Mon, Apr 14, 2008 at 07:24:06PM +0300, Avi Kivity wrote: Issue is that the dumb console timer wakes up the vcpu to do IO processing in main_loop_wait(). So while you're right that vga_hw_update() is a no-op for the -nographic case, the indirect effect of the timer triggering

Re: [kvm-devel] disappointing speed with virtio_blk

2008-04-13 Thread Marcelo Tosatti
On Sun, Apr 13, 2008 at 11:04:44PM +0200, Gerd von Egidy wrote: Hi, I just tried the virtio block device with the intent to boost disk throughput for my vm. I ran bonnie++ -r 512 -s 2048 -u nobody -d /tmp: Version 1.03 --Sequential Output-- --Sequential Input- --Random-

[kvm-devel] [patch 1/5] QEMU/KVM: properly copy the in-kernel apicbase value

2008-04-11 Thread Marcelo Tosatti
The MSR_IA32_APICBASE_ENABLE/MSR_IA32_APICBASE_BSP bits in s-apicbase are not initialized if in-kernel APIC emulation is used, so save the actual value passed by cpu_set_apic_base() caller. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.io/qemu/hw/apic.c

[kvm-devel] [patch 2/5] QEMU/KVM: Add libkvm interface to get/set the mpstate.

2008-04-11 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.io/libkvm/libkvm.c === --- kvm-userspace.io.orig/libkvm/libkvm.c +++ kvm-userspace.io/libkvm/libkvm.c @@ -776,6 +776,28 @@ int kvm_set_sregs(kvm_context_t kvm, int

[kvm-devel] [patch 5/5] KVM: add ioctls to save/store mpstate

2008-04-11 Thread Marcelo Tosatti
So userspace can save/restore the mpstate during migration. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm/arch/x86/kvm/x86.c === --- kvm.orig/arch/x86/kvm/x86.c +++ kvm/arch/x86/kvm/x86.c @@ -814,6 +814,7 @@ int

[kvm-devel] [patch 4/5] QEMU/KVM: ignore SIG_IPI signals in userspace

2008-04-11 Thread Marcelo Tosatti
Otherwise a signal can be received in userspace and a vcpu goes back to the kernel while it should stay still. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.io/qemu/qemu-kvm.c === --- kvm-userspace.io.orig

[kvm-devel] [patch 3/5] QEMU/KVM: save and load mp state

2008-04-11 Thread Marcelo Tosatti
Use the new interface to save and restore MP_STATE for all vcpu's. Increase version_id for cpu_load/cpu_save. Fixes SMP migration. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.io/qemu/hw/pc.c === --- kvm

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-11 Thread Marcelo Tosatti
)) schedule() atomic_inc(pit_timer-pending) Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm/arch/ia64/kvm/kvm-ia64.c === --- kvm.orig/arch/ia64/kvm/kvm-ia64.c +++ kvm/arch/ia64/kvm

[kvm-devel] [patch 0/2] SIGIO handling changes

2008-04-11 Thread Marcelo Tosatti
First patch from Anders Melchiorsen cleans up SIGIO handling: - SIGALRM for alarm timers - enable SIGIO on qemu_set_fd_handler2() - avoid tap from abusing enable_sigio_timer() With that in place its possible to increase the dumb console (-nographic) refresh rate to 1s (from 30ms). --

[kvm-devel] [patch 1/2] QEMU: use SIGARLM for alarm timers, enable SIGIO on qemu_set_fd_handler2()

2008-04-11 Thread Marcelo Tosatti
From: Anders Melchiorsen [EMAIL PROTECTED] Without I/O signals, qemu is relying on periodic timer events to poll the I/O. That seems wrong, even though it works reasonably well because timers are so frequent. In KVM, timers are less frequent, and it does not work quite as well. Here is a quick

[kvm-devel] [patch 2/2] QEMU: decrease console refresh rate with -nographic

2008-04-11 Thread Marcelo Tosatti
With SIGIO enabled on stdio, there's no need to wakeup the thread performing IO every 30ms. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.io/qemu/vl.c === --- kvm-userspace.io.orig/qemu/vl.c +++ kvm

Re: [kvm-devel] [patch 1/2] QEMU: use SIGARLM for alarm timers, enable SIGIO on qemu_set_fd_handler2()

2008-04-11 Thread Marcelo Tosatti
On Fri, Apr 11, 2008 at 01:59:35PM -0500, Anthony Liguori wrote: With the IO thread, shouldn't we be striving to perform the select()s within the IO thread itself to completely avoid the need to use SIGIO at all? Fully agree. Problem with it are the fundamental changes in qemu that are

Re: [kvm-devel] [patch 1/2] QEMU: use SIGARLM for alarm timers, enable SIGIO on qemu_set_fd_handler2()

2008-04-11 Thread Marcelo Tosatti
On Fri, Apr 11, 2008 at 01:59:35PM -0500, Anthony Liguori wrote: -static void enable_sigio_timer(int fd) +static void enable_sigio(int fd) +{ +struct sigaction act; + +sigfillset(act.sa_mask); +act.sa_flags = 0; +act.sa_handler = host_io_handler; + +sigaction(SIGIO,

[kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-10 Thread Marcelo Tosatti
. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm/arch/x86/kvm/i8254.c === --- kvm.orig/arch/x86/kvm/i8254.c +++ kvm/arch/x86/kvm/i8254.c @@ -199,6 +199,7 @@ int __pit_timer_fn(struct kvm_kpit_state struct kvm_kpit_timer

[kvm-devel] [patch 0/2] fix in-kernel timer / IRQ injection races

2008-04-10 Thread Marcelo Tosatti
-- - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.

[kvm-devel] [patch 2/2] KVM: fix kvm_vcpu_kick vs __vcpu_run race

2008-04-10 Thread Marcelo Tosatti
-guest_mode = 1 So move guest_mode=1 assignment before -inject_pending_irq, and make sure that it won't reorder after it. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm/arch/x86/kvm/x86.c === --- kvm.orig/arch/x86/kvm/x86.c

[kvm-devel] QEMU/KVM: make sure all vcpus are paused before saving state

2008-04-09 Thread Marcelo Tosatti
Make sure that all threads are paused in userspace before saving machine state. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] --- kvm-userspace.io/qemu/qemu-kvm.c +++ kvm-userspace.io/qemu/qemu-kvm.c @@ -244,7 +244,7 @@ static int all_threads_paused(void) int i; for (i = 0; i

Re: [kvm-devel] Compilation problems with git tree

2008-04-08 Thread Marcelo Tosatti
. But then during code run I've got this coredump: 'ti' seems to be containing some garbage - am I using the latest code ?? (as this is the last commit I could see: commit 5208ce19dca268f84a2b9441c2fbb6129161e44c Author: Marcelo Tosatti [EMAIL PROTECTED] Date: Thu Apr 3 20:24:37 2008 -0300

Re: [kvm-devel] [patch 0/4] fix SMP migration and loadvm/savevm (V2)

2008-04-08 Thread Marcelo Tosatti
On Wed, Apr 09, 2008 at 12:59:50AM +0300, Avi Kivity wrote: Marcelo Tosatti wrote: Avi, I prefer not to fold mpstate into kvm_save_registers() as a hidden register because the MPSTATE is only used during migration, whereas save_registers() is not (seems safer) But that's the point... what

Re: [kvm-devel] performance tuning, problem with paravirtualized clock

2008-04-07 Thread Marcelo Tosatti
On Sun, Apr 06, 2008 at 09:56:39PM +0200, Nikola Ciprich wrote: Hi, I spent some time trying to tune performance of KVM guest using kernel compilation as a kind of benchmark (I'm using virtual machines for compiling a lot, so it's good benchmark for me in general) Host machine: 2x quad

Re: [kvm-devel] [patch 3/4] QEMU/KVM: ignore SIG_IPI signals in userspace

2008-04-07 Thread Marcelo Tosatti
On Sun, Apr 06, 2008 at 12:15:07PM +0300, Avi Kivity wrote: Marcelo Tosatti wrote: Otherwise a signal can be received in userspace and a vcpu goes back to the kernel while it should stay still. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: kvm-userspace.io/qemu/qemu-kvm.c

[kvm-devel] [PATCH] add ioctl's to save/restore mpstate

2008-04-07 Thread Marcelo Tosatti
So userspace can save/restore the mpstate during migration. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cb57b6a..2ce22d6 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -814,6 +814,7 @@ int

[kvm-devel] [patch 0/4] fix SMP migration and loadvm/savevm (V2)

2008-04-07 Thread Marcelo Tosatti
Now guarded by KVM_CAP and with increased version_id of cpu_save/load as requested. Avi, I prefer not to fold mpstate into kvm_save_registers() as a hidden register because the MPSTATE is only used during migration, whereas save_registers() is not (seems safer). --

[kvm-devel] [patch 1/4] QEMU/KVM: properly copy the in-kernel apicbase value

2008-04-07 Thread Marcelo Tosatti
The MSR_IA32_APICBASE_ENABLE/MSR_IA32_APICBASE_BSP bits in s-apicbase are not initialized if in-kernel APIC emulation is used, so save the actual value passed by cpu_set_apic_base() caller. Signed-off-by: Marcelo Tosatti [EMAIL PROTECTED] Index: marcelo/git/kvm-userspace.io/qemu/hw/apic.c

  1   2   3   4   >