[COMMIT master] Only execute lapic load when cpu is already initialized

2009-05-31 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com In a later patch, we will reorder the execution of vcpu initialization. After that, the first call to KVM_SET_LAPIC ioctl will not find an existant vcpu. So we introduce a function that tell us that the vcpu is already initialized, and is it safe to call

[COMMIT master] remove duplicated kvm_qemu_init_env() call

2009-05-31 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com This is a leftover from old days. There is already a call from this function in kvm_main_loop_cpu(), which is called unconditionally on the end of ap_main_loop. No need to duplicate. Signed-off-by: Glauber Costa glom...@redhat.com Signed-off-by: Avi Kivity

[COMMIT master] Allocate memory below 4GB as one chunk

2009-05-31 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Instead of allocating a separate chunk for the first 640KB and another for 1MB+, allocate one large chunk. This plays well in terms of alignment and size with large pages. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/hw/pc.c b/hw/pc.c index

[COMMIT master] Fix large page support

2009-05-31 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Discontiguous memory allocation broke large page support. This fixes large page support by allowing moving the large page code into chunk allocation. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/exec.c b/exec.c index e241f05..c024b8b 100644 ---

[COMMIT master] Make sure kvm_vpu_init is the last thing called in cpu initialization

2009-05-31 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com KVM access some state that is only present late in cpu initialization. This happens in kvm_vcpu_init(). APIC is an example of that. So we have to make sure that kvm_vcpu_init is the last thing called in the initialization process. We also have to

[COMMIT master] Fix -mem-path option spelling

2009-05-31 Thread Avi Kivity
From: Avi Kivity a...@redhat.com '-mem-path' was accidentally renamed to '-mempath'. Rename it back. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/qemu-options.hx b/qemu-options.hx index 173f458..481dbdf 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1601,8 +1601,8 @@ DEF(tdf,

[COMMIT master] Make PC speaker emulation aware of in-kernel PIT

2009-05-31 Thread Avi Kivity
From: Jan Kiszka jan.kis...@web.de When using the in-kernel PIT the speaker emulation has to synchronize the PIT state with KVM. Enhance the existing speaker sound device and allow it to take over port 0x61 by using KVM_CREATE_PIT2 where available. This unbreaks -soundhw pcspk in KVM mode.

[COMMIT master] Move kvm_trim_features where it belongs

2009-05-31 Thread Avi Kivity
From: Glauber Costa glom...@redhat.com We also kill the unused name argument. It would introduce an non-necessary depedency on code present at helper.c Signed-off-by: Glauber Costa glom...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index

[COMMIT master] eventfd_fget() compatibility

2009-05-31 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 131210a..9801441 100644 --- a/external-module-compat-comm.h +++ b/external-module-compat-comm.h @@ -800,3 +800,15 @@ static inline int

[COMMIT master] Add missing line continuation

2009-05-31 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/Makefile b/Makefile index db44772..f51b491 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ all:: prerequisite $(if

[COMMIT master] KVM: No disable_irq for MSI/MSI-X interrupt on device assignment

2009-05-31 Thread Avi Kivity
From: Sheng Yang sh...@linux.intel.com Disable interrupt at interrupt handler and enable it when guest ack is for the level triggered interrupt, to prevent reinjected interrupt. MSI/MSI-X don't need it. One possible problem is multiply same vector interrupt injected between irq handler and

[COMMIT master] KVM: validate irqfd type

2009-05-31 Thread Avi Kivity
From: Gregory Haskins ghask...@novell.com We should be more vigilant in validating the fd type passed down for use in irqfd. A malicious userspace could do something nasty like pass the kvm fd which would cause problems such as a reference leak on the kvm object on shutdown. Therefore, we use

[COMMIT master] KVM: remove redundant declarations

2009-05-31 Thread Avi Kivity
From: Christian Ehrhardt ehrha...@linux.vnet.ibm.com Changing s390 code in kvm_arch_vcpu_load/put come across this header declarations. They are complete duplicates, not even useful forward declarations as nothing using it is in between (maybe it was that in the past). This patch removes the two

Re: configure script bug..

2009-05-31 Thread Avi Kivity
john cooper wrote: Hit this yesterday when configure hung attempting to pull the version from a kernel's .config. Looks right, but missing a signoff. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body

Re: [RFC][PATCH] qemu-kvm: vl.c remove unused functions gethugepagesize() and alloc_mem_area()

2009-05-31 Thread Avi Kivity
Jaswinder Singh Rajput wrote: No user is available for functions gethugepagesize() and alloc_mem_area() Fixes : CCx86_64-softmmu/vl.o /home/jaswinder/jaswinder-git/qemu-kvm/vl.c:4884: warning: ‘alloc_mem_area’ defined but not used I've already fixed this differently (by re-adding

Re: Userspace MSR handling

2009-05-31 Thread Avi Kivity
Gerd Hoffmann wrote: Or do the standard function pointer trick. Event channel notifications change to eventfd_signal, grant table ops change to copy_to_user(). grant table ops include mapping pages of the guest (aka domU) into the host (aka dom0) address space, fill the pointer into some

Re: [PATCH 4/4] kvm-s390: streamline memslot handling - v6

2009-05-31 Thread Avi Kivity
ehrha...@linux.vnet.ibm.com wrote: From: Christian Ehrhardt ehrha...@linux.vnet.ibm.com *updates in v6* - ensure the wait_on_bit waiter is notified - move the reset of requests to kvm_vcpu_release to drop them early *updates in v5* - ensure dropping vcpu all requests while freeing a vcpu

Re: [patch] VMX Unrestricted mode support

2009-05-31 Thread Avi Kivity
Nitin A Kamble wrote: Avi, A new VMX feature Unrestricted Guest feature is added in the VMX specification. You can look at the latest Intel processor manual for details of the feature here: http://www.intel.com/products/processor/manuals It allows kvm guests to run real mode and unpaged

Re: strange guest slowness after some time

2009-05-31 Thread Avi Kivity
Tomasz Chmielewski wrote: Accidentally, I made some interesting discovery. This ~2 MB video shows a kvm-86 guest being rebooted and GRUB started: http://syneticon.net/kvm/kvm-slowness.ogg GRUB has its timeout set to 50 seconds, and is supposed to show it on the screen by decreasing the

Re: [PATCH 1/2] use explicit 64bit storage for sysenter values

2009-05-31 Thread Avi Kivity
Andre Przywara wrote: Since AMD does not support sysenter in 64bit mode, the VMCB fields storing the MSRs are truncated to 32bit upon VMRUN/#VMEXIT. So store the values in a separate 64bit storage to avoid truncation. Applied, thanks. + struct kvm_segment user_cs; /* used in

Re: [PATCH 2/2] add sysenter/syscall emulation for 32bit compat mode

2009-05-31 Thread Avi Kivity
Andre Przywara wrote: sysenter/sysexit are not supported on AMD's 32bit compat mode, whereas syscall is not supported on Intel's 32bit compat mode. To allow cross vendor migration we emulate the missing instructions by setting up the processor state according to the other call. The sysenter code

Re: [PATCH] kvm-kmod: Add missing line continuation

2009-05-31 Thread Avi Kivity
Jan Kiszka wrote: Signed-off-by: Jan Kiszka jan.kis...@siemens.com Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [KVM PATCH v4 3/3] kvm: add iosignalfd support

2009-05-31 Thread Avi Kivity
Gregory Haskins wrote: This is closer to how the original series worked, but Avi asked for a data-match token and thus the cookie was born. I think the rationale is that we can't predict whether the same eventfd will be registered more than once, and thus we need a way to further qualify it.

Re: [PATCH] allow CPUID vendor override

2009-05-31 Thread Avi Kivity
Andre Przywara wrote: KVM will always report the vendor ID of the physical CPU it is running on. Allow to override this if explicitly requested on the command line. It will not suffice to name a CPU type (like -cpu phenom), but you have to explicitly set the vendor: -cpu

Re: [PATCH 0/2] kvm: validate irqfd type

2009-05-31 Thread Avi Kivity
Gregory Haskins wrote: Michael Tsirkin pointed out an issue in kvm.git w.r.t. malicious userspace configuring irqfd objects: http://lkml.org/lkml/2009/5/27/341 This series applies to kvm.git/master:1a6a35a1 to attempt to close the vulnerability. Applied, thanks. -- error compiling

Re: [PATCH 0/4] Fix cpu hotplug - currently broken

2009-05-31 Thread Avi Kivity
Glauber Costa wrote: Hello guys, This patchset has already been sent before, and now is sent again in a new version. It is refactored to account for the way the new code looks like, plus addressing a comment from Jan, that an apic function was called from common code. I've split it in four

Re: [PATCH] KVM: No disable_irq for MSI/MSI-X interrupt on device assignment

2009-05-31 Thread Avi Kivity
Sheng Yang wrote: Disable interrupt at interrupt handler and enable it when guest ack is for the level triggered interrupt, to prevent reinjected interrupt. MSI/MSI-X don't need it. One possible problem is multiply same vector interrupt injected between irq handler and scheduled work handler

Re: [PATCH] kvm: remove redundant declarations

2009-05-31 Thread Avi Kivity
ehrha...@linux.vnet.ibm.com wrote: From: Christian Ehrhardt ehrha...@linux.vnet.ibm.com Changing s390 code in kvm_arch_vcpu_load/put come across this header declarations. They are complete duplicates, not even useful forward declarations as nothing using it is in between (maybe it was that in

Re: [PATCH v4] qemu-kvm: Make PC speaker emulation aware of in-kernel PIT

2009-05-31 Thread Jan Kiszka
Marcelo Tosatti wrote: On Thu, May 14, 2009 at 10:43:05PM +0200, Jan Kiszka wrote: When using the in-kernel PIT the speaker emulation has to synchronize the PIT state with KVM. Enhance the existing speaker sound device and allow it to take over port 0x61 by using KVM_CREATE_PIT2 where

Re: unhandled vm exit: 0x80000021 vcpu_id 0

2009-05-31 Thread Avi Kivity
Gabe Black wrote: Hello again. I'm making more progress getting KVM going in M5, and right now I'm trying to figure out why I'm getting an unhandled vm exit with exit code 0x8021. According to Intel's manual, something about the guest state isn't being set up correctly. I dumped the

Re: [PATCH v4] qemu-kvm: Make PC speaker emulation aware of in-kernel PIT

2009-05-31 Thread Avi Kivity
Jan Kiszka wrote: Would be nice to avoid sprinkling KVM details inside hw/pcspk.c though but that is another problem. Does this remark prevent merging the patch ATM? It doesn't, so I applied the patch. Thanks. -- error compiling committee.c: too many arguments to function -- To

Re: [PATCH + RFC] Cascading option --with-kvm-trace to qemu configure script

2009-05-31 Thread Avi Kivity
Lucas Meneghel Rodrigues wrote: We've found a build issue on release tarballs: if we take a recent release tarball, build it using the usual sequence ./configure make make install The modules generated can't be loaded due to unresolved symbols related to kvm trace. While fixing the problem, we

Re: [PATCH][KVM_AUTOTEST] Added functionality to the preprocessor to run scripts

2009-05-31 Thread Avi Kivity
David Huff wrote: This patch will run pre and post scripts defined in config file with the parameter pre_command and post_command post_command. Also exports all the prameters in preprocess for passing arguments to the script. + #execute any pre_commands +pre_command =

Re: [Qemu-devel] [PATCH 2/2] Add serial number support for virtio_blk, V4

2009-05-31 Thread Christoph Hellwig
On Fri, May 29, 2009 at 12:15:27AM -0400, john cooper wrote: virtio_blk-serial-4.patch The patch looks good to me, but to get it applied to the kernel tree the patch needs a good description and we also need your Signed-off-by line (See Documentation/SubmittingPatches in the kernel source

Re: [PATCH] KVM: powerpc: beyond ARRAY_SIZE of vcpu-arch.guest_tlb

2009-05-31 Thread Avi Kivity
Roel Kluin wrote: Do not go beyond ARRAY_SIZE of vcpu-arch.guest_tlb Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c index 0fce4fb..c2cfd46 100644 --- a/arch/powerpc/kvm/emulate.c +++ b/arch/powerpc/kvm/emulate.c @@ -125,7

Re: [PATCH v7 1/2] qemu-kvm: add irqfd support

2009-05-31 Thread Avi Kivity
Gregory Haskins wrote: irqfd lets you create an eventfd based file-desriptor to inject interrupts to a kvm guest. We associate one gsi per fd for fine-grained routing. Sorry, getting to userspace a little late in the game. @@ -34,6 +34,7 @@ #include string.h #include errno.h #include

Re: [PATCH 0/4] Fix cpu hotplug - currently broken

2009-05-31 Thread Glauber Costa
On Sun, May 31, 2009 at 12:40:40PM +0300, Avi Kivity wrote: hope you like it. I did, so I applied it all. my man... -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH -tip v8 0/7] tracing: kprobe-based event tracer and x86 instruction decoder

2009-05-31 Thread Masami Hiramatsu
Christoph Hellwig wrote: Small question to start with: What's your (or Hitachi s/Red Hat's) use case for this? It's obviously really cool technology, but I fear without some good user space side to make it easy to use it will most likely bit-rot which would be sad. Good question, Frankly to

Re: [PATCH 0/2] Simplify cpu_register_io_memory() a bit

2009-05-31 Thread Avi Kivity
Missed the blurb: This small patchset removes the unused io_index parameter from cpu_register_io_memory(), making future simplification of this mechanism a tiny bit simpler. The diffstat looks frightening, but the changes are quite simple -- error compiling committee.c: too many arguments to

[PATCH] Rename pci_register_io_region() to pci_register_bar()

2009-05-31 Thread Avi Kivity
This function is used to manage a PCI BAR, so make the more generic pci_register_io_region() available to other uses. Signed-off-by: Avi Kivity a...@redhat.com --- hw/ac97.c |4 ++-- hw/cirrus_vga.c |4 ++-- hw/e1000.c|4 ++-- hw/eepro100.c |6 +++---

Re: qemu: kvm: avoid harmless unhandled wrmsr 0xc0010117 messages

2009-05-31 Thread Avi Kivity
Marcelo Tosatti wrote: Olders kernel which don't contain kvm.git commit 61a6bd672bda3b9468bf5895c1be085c4e481138 display the following message: kvm: 32301: cpu0 unhandled wrmsr: 0xc0010117 data 0 When kvm_arch_load_regs is called. This is confusing in bug reports. Avoid it by checking

Re: [patch] VMX Unrestricted mode support

2009-05-31 Thread Anthony Liguori
Nitin A Kamble wrote: Avi, A new VMX feature Unrestricted Guest feature is added in the VMX specification. You can look at the latest Intel processor manual for details of the feature here: http://www.intel.com/products/processor/manuals It allows kvm guests to run real mode and

Re: [patch] VMX Unrestricted mode support

2009-05-31 Thread Avi Kivity
Anthony Liguori wrote: Nitin A Kamble wrote: Avi, A new VMX feature Unrestricted Guest feature is added in the VMX specification. You can look at the latest Intel processor manual for details of the feature here: http://www.intel.com/products/processor/manuals It allows kvm guests to

Qemu (host) - host userspace signaling?

2009-05-31 Thread pav
Hello, I am looking for a simple way to get a bidirectional event notification interface between qemu/kvm and host userspace processes. Just a kick, messages/data not required. What I basically need is a way to have an interested host process informed by a custom qemu device that something

[PATCH 0/3] RFC: virtual device as irq injection interface

2009-05-31 Thread Michael S. Tsirkin
As promised, here's a (compile-tested only) patchset that proposes an alternative interrupt injection interface, not using eventfd. The idea here is that we give user the ability to create virtual device file descriptors from kvm context, and bind them to in-kernel drivers. One kind of such

[PATCH 1/3] virt-core: binding together drivers and hypervisors

2009-05-31 Thread Michael S. Tsirkin
This adds support for virt-core: generic glue making it possible to implement kernel-level accelerators (drivers) which are independent of a hypervisor, that is can in theory work on top of either kvm or lguest. Each driver and hypervisor registers with core, and then when user adds a virtual

[PATCH 2/3] kvm: virtual device support

2009-05-31 Thread Michael S. Tsirkin
Implement virt_hypervisor in kvm, and add support for creating virtual devices. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/linux/kvm.h | 13 include/linux/kvm_host.h |3 ++ virt/kvm/kvm_main.c | 47 ++

[PATCH 3/3] virt_irq: virtual device for injecting interrupts

2009-05-31 Thread Michael S. Tsirkin
virt_irq is an alternative to irqfd interface, based on the virt core infrastructure, which also serves as an example of virt core usage. The main advantage here compared to irqfd is the use of fd created by the virt core, which avoids any possibility of deadlock issues with eventfd and kvm file

Re: [PATCH 0/3] RFC: virtual device as irq injection interface

2009-05-31 Thread Avi Kivity
Michael S. Tsirkin wrote: As promised, here's a (compile-tested only) patchset that proposes an alternative interrupt injection interface, not using eventfd. The idea here is that we give user the ability to create virtual device file descriptors from kvm context, and bind them to in-kernel

Re: [PATCH 0/3] RFC: virtual device as irq injection interface

2009-05-31 Thread Michael S. Tsirkin
On Sun, May 31, 2009 at 10:40:59PM +0300, Avi Kivity wrote: Michael S. Tsirkin wrote: As promised, here's a (compile-tested only) patchset that proposes an alternative interrupt injection interface, not using eventfd. The idea here is that we give user the ability to create virtual device

Re: [PATCH 0/3] RFC: virtual device as irq injection interface

2009-05-31 Thread Michael S. Tsirkin
On Sun, May 31, 2009 at 11:30:48PM +0300, Avi Kivity wrote: Michael S. Tsirkin wrote: Version N of irqfd actually had the kernel create the fd, due to concerns about eventfd's flexibility (thread wakeup vs function call). As it turned out these concerns were misplaced (well, we still

RE: [PATCH] qemu-kvm: Flush icache after dma operations for ia64

2009-05-31 Thread Zhang, Xiantao
Avi Kivity wrote: Jes Sorensen wrote: Ok, Trying once more. After spending a couple of hours trying to follow the QEMU dma codeflow, I have convinced myself Avi is right and those two functions don't need to do the flushing as they all end up calling dma_bdrv_cb() which calls