[COMMIT master] Fix live migration out-of-memory

2009-06-21 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Upsteam commit 9fa06385f6 (kvm: Mark full address range dirty on live migration start) requests dirty logging on the entire 64-bit address space. This triggered an allocation in qemu-kvm.c for this range, which oomed. Fix by allocating the buffer when we know

[COMMIT master] libkvm: remove ppc functions from callbacks

2009-06-21 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com handle_powerpc_dcr_read() and handle_powerpc_dcr_write() are two powerpc specific functions that are called via libkvm callbacks. However, grepping the source code finds simply no use of them. This is probably due to the fact that powerpc now relies on a

[COMMIT master] kvm: bios: Move _PR to SSDT

2009-06-21 Thread Avi Kivity
From: Jes Sorensen j...@sgi.com Move _PR block from the DSDT to a new SSDT in the KVM BIOS. As AML, or at least Windows doesn't allow forward declarations of Methods, it is necessary to declare the _GPE._L02 Method in the SSDT as well. This will make it possible to plug in different SSDTs with

[COMMIT master] Fold target-i386/libkvm.c into qemu-kvm-x86.c

2009-06-21 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com Same spirit of what has already been done for the generic code. Fold libkvm.c into qemu-kvm-x86.c. handle_tpr_access becomes kvm_handle_tpr_access, to avoid name clash. Signed-off-by: Glauber Costa glom...@redhat.com Signed-off-by: Avi Kivity

[COMMIT master] Update .gitignore for ftrace

2009-06-21 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/.gitignore b/.gitignore index bdebd0a..4fdbc62 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,10 @@ x86/irq_comm.c x86/timer.c x86/kvm_timer.h x86/iommu.c +x86/svm-trace.h +x86/trace-arch.h

[COMMIT master] Update source link

2009-06-21 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/linux-2.6 b/linux-2.6 index f0f1a43..acb57be 16 --- a/linux-2.6 +++ b/linux-2.6 @@ -1 +1 @@ -Subproject commit f0f1a433c63883874bcf93c338deecaccf654e12 +Subproject commit

[COMMIT master] Hack around 2.6.29 tracepoint API change

2009-06-21 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h index 1e511dc..53d03ea 100644 --- a/external-module-compat-comm.h +++ b/external-module-compat-comm.h @@ -840,3 +840,30 @@ static inline struct

[COMMIT master] KVM: protect concurrent make_all_cpus_request

2009-06-21 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com make_all_cpus_request contains a race condition which can trigger false request completed status, as follows: CPU0 CPU1 if (test_and_set_bit(req,vcpu-requests))

[COMMIT master] KVM: use MSR_K7_HWCR for MSRC001_0015 Hardware Configuration Register (HWCR)

2009-06-21 Thread Avi Kivity
From: Jaswinder Singh Rajput jaswin...@kernel.org MSR_K8_MSR is removed as it is duplicating MSRC001_0015 Hardware Configuration Register (HWCR), which is already defined as MSR_K7_HWCR Fix x86_64 allmodconfig : arch/x86/kvm/svm.c: In function 'svm_set_msr': arch/x86/kvm/svm.c:2152: error:

[COMMIT master] KVM: Make KVM_HPAGES_PER_HPAGE unsigned long to avoid build error on powerpc

2009-06-21 Thread Avi Kivity
From: Stephen Rothwell s...@canb.auug.org.au Eliminates this compiler warning: arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1178: error: integer overflow in expression Signed-off-by: Stephen Rothwell s...@canb.auug.org.au Signed-off-by: Avi Kivity a...@redhat.com diff --git

[COMMIT master] KVM: ia64: fix ia64 build due to missing kallsyms_lookup() and double export

2009-06-21 Thread Avi Kivity
From: Jes Sorensen j...@sgi.com Fix problem with double export of certain symbols from vsprintf.c which we do not wish to export from the kvm-intel.ko module. In addition, we do not have access to kallsyms_lookup() from the module, so make sure to #undef CONFIG_KALLSYMS Signed-off-by: Jes

[COMMIT master] KVM: convert custom marker based tracing to event traces

2009-06-21 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com This allows use of the powerful ftrace infrastructure. See Documentation/trace/ for usage information. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/Makefile

[COMMIT master] KVM: update inaccurate irqfd comment

2009-06-21 Thread Avi Kivity
From: Gregory Haskins ghask...@novell.com We no longer hold the fget() for the irqfd lifetime, so clean up the comments related to that. Signed-off-by: Gregory Haskins ghask...@novell.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index

[COMMIT master] KVM: kvm/x86_emulate.c toggle_interruptibility() should be static

2009-06-21 Thread Avi Kivity
From: Jaswinder Singh Rajput jaswin...@kernel.org toggle_interruptibility() is used only by same file, it should be static. Fixed following sparse warning : arch/x86/kvm/x86_emulate.c:1364:6: warning: symbol 'toggle_interruptibility' was not declared. Should it be static? Signed-off-by:

Re: [PATCH 0/5 v2] Further cleanups to qemu-kvm.c

2009-06-21 Thread Avi Kivity
On 06/18/2009 10:37 PM, Glauber Costa wrote: Avi, This is the patch set that should be applied. It is comprised of 4 patches. It however, depends on [PATCH 1/5] get rid of target-i386/libkvm.c, so I'm sending it again, since it does not seem to be already applied by you. Applied all,

Re: enable sysenter on 32bit guests

2009-06-21 Thread Avi Kivity
On 06/18/2009 08:38 PM, Andrea Arcangeli wrote: From: Andrea Arcangeliaarca...@redhat.com model=2 is not existent when vendor is intel and an errata of P6 says that any model= 2 when family is 6 lack sap feature, so windows and linux 32bit guests disable sap in software and slowdown for no good

Re: [PATCH 0/5 v2] Further cleanups to qemu-kvm.c

2009-06-21 Thread Avi Kivity
On 06/21/2009 01:01 PM, Avi Kivity wrote: On 06/18/2009 10:37 PM, Glauber Costa wrote: Avi, This is the patch set that should be applied. It is comprised of 4 patches. It however, depends on [PATCH 1/5] get rid of target-i386/libkvm.c, so I'm sending it again, since it does not seem to be

Re: [PATCH v2] qemu-kvm: x86: Fix CPU initialization

2009-06-21 Thread Avi Kivity
On 06/19/2009 08:17 PM, Jan Kiszka wrote: Jan Kiszka wrote: Fix regression in CPU initialization caused by merge a5b526135d and try to avoid this in the future by dropping qemu-kvm specific pc_new_cpu. If such refactoring is desired, it should go through upstream first. F...ine.

Re: [PATCH -tip][KVM] x86: kvm/x86_emulate.c toggle_interruptibility() should be static

2009-06-21 Thread Avi Kivity
On 06/18/2009 02:23 PM, Jaswinder Singh Rajput wrote: toggle_interruptibility() is used only by same file, it should be static. Fixed following sparse warning : arch/x86/kvm/x86_emulate.c:1364:6: warning: symbol 'toggle_interruptibility' was not declared. Should it be static?

Re: [patch] qemu-kvm introduce -maxcpus argument

2009-06-21 Thread Avi Kivity
On 06/19/2009 05:23 PM, Jes Sorensen wrote: libvirt currently does fd = open(/dev/kvm) r = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_NR_VCPUS); to figure out what the maximum allowed vCPUs will be for KVM, and currently it is returning 16 IIRC. Interesting, this will need to be

Re: [patch] qemu-kvm introduce -maxcpus argument

2009-06-21 Thread Avi Kivity
On 06/19/2009 04:59 PM, Jes Sorensen wrote: Hi, This one introduces a -maxcpus setting, allowing the user to specify the maximum number of vCPUs the system can have, as discussed with Gleb earlier in the week. Patch looks good. There is nothing kvm-specific about it, so please send it to

Re: [KVM PATCH 0/4] irqfd fixes/enhancements

2009-06-21 Thread Avi Kivity
On 06/18/2009 08:44 PM, Gregory Haskins wrote: (Applies to kvm.git/master:c27b64a0) The following series represents my queue of fixes for issues in irqfd, which include enhancements to eventfd. This is a respin of the patches originally proposed yesterday, called [KVM-RFC PATCH 0/2] eventfd

Re: [patch] move _PR to SSDT v2

2009-06-21 Thread Avi Kivity
On 06/18/2009 03:39 PM, Jes Sorensen wrote: On 06/16/2009 11:50 AM, Gleb Natapov wrote: Works for me with windows XP/7, but can you add a comment in DSDT where _GRE.L02 should be why it is missing and where to find it. Avi, Are you happy with the last version of the SSDT patch? I have more

Re: [KVM PATCH v7 2/2] KVM: add iosignalfd support

2009-06-21 Thread Avi Kivity
On 06/18/2009 05:09 PM, Gregory Haskins wrote: Avi Kivity wrote: On 06/18/2009 03:09 PM, Gregory Haskins wrote: +config KVM_MAX_IOSIGNALFD_ITEMS +int Maximum IOSIGNALFD items per address +depends on KVM +default 32 +---help--- + This option influences the maximum

Re: Checking guest memory pages changes from host userspace

2009-06-21 Thread Avi Kivity
On 06/19/2009 09:09 PM, Passera, Pablo R wrote: Hi list, I need to monitor some guest memory pages. I need to know if the information in these pages was changed. For this, I was thinking to mark the guest memory pages in some way (like write protecting them) so a page fault is

How to debug a triple fault at startup?

2009-06-21 Thread Michael Crawford
Greetings, I just subscribed. I get as far as the Press F12 for a boot menu, and then the guest reboots. I have gotten as far as figuring out that there is a triple fault in my guest's code, but I don't know why. Can anyone give me a clue as to how to debug it? I am able to attach gdb to the

[PATCHv6 00/12] qemu: MSI-X support

2009-06-21 Thread Michael S. Tsirkin
Here is the port of MSI-X support patches to upstream qemu. Please comment or commit. This patchset adds generic support for MSI-X, adds implementation in APIC, and uses MSI-X in virtio-net. Changelog: - since v5 make sure that load does not modify registers that guest can not change replace

[PATCHv6 01/12] qemu/pci: make default_write_config use mask table

2009-06-21 Thread Michael S. Tsirkin
Change much of hw/pci to use symbolic constants and a table-driven design: add a mask table with writable bits set and readonly bits unset. Detect change by comparing original and new registers. This makes it easy to support capabilities where read-only/writeable bit layout differs between

[PATCHv6 02/12] qemu/pci: helper routines for pci access

2009-06-21 Thread Michael S. Tsirkin
Add inline routines for convenient access to pci devices with correct (little) endianness. Will be used by MSI-X support. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/pci.h | 30 +++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/hw/pci.h

[PATCHv6 03/12] qemu/pci: add routines to manage PCI capabilities

2009-06-21 Thread Michael S. Tsirkin
Add routines to manage PCI capability list. First user will be MSI-X. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/pci.c | 74 +- hw/pci.h | 18 ++- 2 files changed, 90 insertions(+), 2 deletions(-) diff

[PATCHv6 04/12] qemu/pci: check constant registers on load

2009-06-21 Thread Michael S. Tsirkin
Add cmask table of constant register masks: if a bit is not writeable and is set in cmask table, this bit is checked on load. An attempt to load an image that would change such a register causes load to fail. Use this table to make sure that load does not modify registers that guest can not

[PATCHv6 05/12] qemu/pci: MSI-X support functions

2009-06-21 Thread Michael S. Tsirkin
Add functions implementing MSI-X support. First user will be virtio-pci. Note that platform must set a flag to declare MSI supported: this is a safety measure to avoid breaking platforms which should support MSI-X but currently lack this in the interrupt controller emulation. For PC this will be

[PATCHv6 06/12] qemu/apic: minimal MSI/MSI-X implementation for PC

2009-06-21 Thread Michael S. Tsirkin
Implement MSI support in APIC. Note that MSI and MMIO APIC registers are at the same memory location, but actually not on the global bus: MSI is on PCI bus, APIC is connected directly to the CPU. We map them on the global bus at the same address which happens to work because MSI registers are

[PATCHv6 08/12] qemu/virtio: MSI-X support in virtio PCI

2009-06-21 Thread Michael S. Tsirkin
This enables actual support for MSI-X in virtio PCI. First user will be virtio-net. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/virtio-pci.c | 152 -- rules.mak |2 +- 2 files changed, 113 insertions(+), 41 deletions(-)

[PATCHv6 07/12] qemu/virtio: virtio support for many interrupt vectors

2009-06-21 Thread Michael S. Tsirkin
Extend virtio to support many interrupt vectors, and rearrange code in preparation for multi-vector support (mostly move reset out to bindings, because we will have to reset the vectors in transport-specific code). Actual bindings in pci, and use in net, to follow. Load and save are not connected

[PATCHv6 09/12] qemu/virtio: virtio save/load bindings

2009-06-21 Thread Michael S. Tsirkin
Implement bindings for virtio save/load. Use them in virtio pci. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/virtio-pci.c | 46 +- hw/virtio.c | 33 - hw/virtio.h |4 3 files changed, 65

[PATCHv6 10/12] qemu/pci: add pci_get/set_byte

2009-06-21 Thread Michael S. Tsirkin
Add pci_get/set_byte to keep *_word and *_long access functions company. They are unused for now. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/pci.h | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/pci.h b/hw/pci.h index 03b0a70..52b66b3 100644

[PATCHv6 11/12] qemu/net: request 3 vectors in virtio-net

2009-06-21 Thread Michael S. Tsirkin
Request up to 3 vectors in virtio-net. Actual bindings might supply less. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/virtio-net.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index d584287..c8dabbe 100644 ---

[PATCHv6 12/12] qemu/net: flag to control the number of vectors a nic has

2009-06-21 Thread Michael S. Tsirkin
Add an option to specify the number of MSI-X vectors for PCI NIC cards. This can also be used to disable MSI-X, for compatibility with old qemu. This option currently only affects virtio cards. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/virtio-net.c |5 - net.c |

Re: [PATCH 3/3] eventfd: add internal reference counting to fix notifier race conditions

2009-06-21 Thread Davide Libenzi
On Sat, 20 Jun 2009, Gregory Haskins wrote: Davide Libenzi wrote: On Sat, 20 Jun 2009, Davide Libenzi wrote: On Sat, 20 Jun 2009, Davide Libenzi wrote: How about the one below? Maybe with an interface that can be undone w/out a file* :) This is another

[PATCHv2 RFC] qemu/msix: remove msix_supported safety flag

2009-06-21 Thread Michael S. Tsirkin
Don't add an option for platforms to disable MSI-X in all devices. Paul Brook will find and fix all platforms that have broken MSI-X emulation. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- This patch on top of my msix series v6 is a bit tongue in cheek: it shows what can be done and

Re: [PATCH 3/3] eventfd: add internal reference counting to fix notifier race conditions

2009-06-21 Thread Gregory Haskins
Davide Libenzi wrote: On Sat, 20 Jun 2009, Gregory Haskins wrote: Davide Libenzi wrote: On Sat, 20 Jun 2009, Davide Libenzi wrote: On Sat, 20 Jun 2009, Davide Libenzi wrote: How about the one below? Maybe with an interface that can

Re: Checking guest memory pages changes from host userspace

2009-06-21 Thread Alexander Graf
On 21.06.2009, at 17:51, Avi Kivity a...@redhat.com wrote: On 06/19/2009 09:09 PM, Passera, Pablo R wrote: Hi list, I need to monitor some guest memory pages. I need to know if the information in these pages was changed. For this, I was thinking to mark the guest memory pages

KVM-84 unknown migration protocol

2009-06-21 Thread jd
Hi I am on Ubuntu 9.04 with kvm-84. When I try to do migrate with file option it gives unknown migration protocol. Is this broken. I did find some conversation about it not being in upstream..etc. But could not find a resolution. Can someone please confirm that this is not expected

Re: Checking guest memory pages changes from host userspace

2009-06-21 Thread Avi Kivity
On 06/21/2009 09:46 PM, Alexander Graf wrote: You can use the dirty memory logging API. vga uses this to track which regions of the screen have changed, and live migration uses it to allow the guest to proceed while copying its memory to the other node. It works exactly by write protecting

Re: How to debug a triple fault at startup?

2009-06-21 Thread Michael Crawford
On Sun, Jun 21, 2009 at 9:02 AM, Michael Crawfordmdcrawf...@gmail.com wrote: I get as far as the Press F12 for a boot menu, and then the guest reboots.  I have gotten as far as figuring out that there is a triple fault in my guest's code, but I don't know why. Can anyone give me a clue as to

KVM-84 restoring from saved snapshot looses keyboard/mouse

2009-06-21 Thread jd
Hi I am saving a snapshot using migrate exec: gzip -c /tmp/cent_105.snapshot.xm and restoring it using the following option on the command line -incoming exec: gzip -c -d /tmp/cent_105.snapshot.xm Now the snapshot seems to be restored.. as I can get to the display of the VM.

Re: [PATCH 3/3] eventfd: add internal reference counting to fix notifier race conditions

2009-06-21 Thread Davide Libenzi
On Sun, 21 Jun 2009, Gregory Haskins wrote: This looks great, Davide. I am fairly certain I can now solve the races and even implement Michael's DEASSIGN feature with this patch in place. I will actually fire it up tomorrow when I am back in the office and give it a spin, but I do not spy

Re: How to debug a triple fault at startup?

2009-06-21 Thread Michael Crawford
I'm not completely certain, but I think I get a GPF whenever trying to output text to the screen once interrupts have been enabled. That is, before calling int 0x19, I can use printf from within rombios.c, and my messages appear. But from anywhere within the int19 code, they don't. I definitely

Re: [Qemu-devel] [PATCHv6 00/12] qemu: MSI-X support

2009-06-21 Thread Isaku Yamahata
On Sun, Jun 21, 2009 at 07:44:57PM +0300, Michael S. Tsirkin wrote: This uses the mask table patch that I posted previously, and which is included in the series. That patch has been slightly updated due to mask - wmask rename. Isaku Yamahata, maybe you want to update your patch series with

Re: [KVM_AUTOTEST] unattended installs take 2

2009-06-21 Thread Lucas Meneghel Rodrigues
On Thu, 2009-06-18 at 17:50 -0400, David Huff wrote: Second pass at the unattended install test. Both Linux and Windows guests are working however currently it just uses the existing boot test and extends timeouts. We still need a good way of determining if an unattended install completed

Re: kvm: emulation failure

2009-06-21 Thread Sheng Yang
On Saturday 20 June 2009 03:23:40 Ram Pai wrote: I see this problem with a x86 sles10 guest running on x86_64 intel host. If the guest is reset abruptly and rebooted, some where before grub sequence it hangs and the following message is seen in the logs emulation failed (pagetable) rip 7ed5

Re: [PATCH] kvm: device-assignment: Add PCI option ROM support

2009-06-21 Thread Yang, Sheng
On Friday 19 June 2009 21:44:40 Alex Williamson wrote: On Fri, 2009-06-19 at 15:27 +0800, Yang, Sheng wrote: On Friday 19 June 2009 00:28:41 Alex Williamson wrote: The one oddity I noticed is that even when the enable bit is clear, the guest can read the ROM. I don't know that this is