Re: [Qemu-devel] [PATCH] kvm: Add helpers for checking and requiring kvm extensions

2009-05-03 Thread Avi Kivity
Juan Quintela wrote: Avi Kivity wrote: Hi diff --git a/kvm-all.c b/kvm-all.c index 36659a9..1642a2a 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -64,6 +64,30 @@ struct KVMState static KVMState *kvm_state; +int kvm_check_extension(int extension) +{ +int ret; + +ret = kvm_ioctl(kv

Re: [Qemu-devel] [RFC] Bring in all the Linux headers we depend on in QEMU

2009-05-03 Thread Stefan Weil
Anthony Liguori schrieb: > Sorry this explanation is long winded, but this is a messy situation. > > In Linux, there isn't a very consistent policy about userspace kernel > header inclusion. On a typical Linux system, you're likely to find > kernel headers in three places. > > glibc headers (/usr/

[RFC -v3 2/2] QEMU-KVM: MCE: Add MCE simulation support to qemu/kvm

2009-05-03 Thread Huang Ying
KVM ioctls are used to initialize MCE simulation and inject MCE. The real MCE simulation is implemented in Linux kernel. ChangeLog: v3: - Re-based on qemu/tcg MCE support patch v2: - Use new kernel MCE capability exportion interface. Signed-off-by: Huang Ying --- kvm/kernel/arch/x86/incl

[RFC -v3 1/2] QEMU-KVM: MCE: Add MCE simulation to qemu/tcg

2009-05-03 Thread Huang Ying
- MCE features are initialized when VCPU is intialized according to CPUID. - A monitor command "mce" is added to inject a MCE. - A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE. Signed-off-by: Huang Ying --- cpu-all.h |4 ++ cpu-exec.c |4 ++

[PATCH -v3] KVM: MCE: Add MCE support to KVM

2009-05-03 Thread Huang Ying
The related MSRs are emulated. MCE capability is exported via extension KVM_CAP_MCE and ioctl KVM_X86_GET_MCE_CAP_SUPPORTED. A new vcpu ioctl command KVM_X86_SETUP_MCE is used to setup MCE emulation such as the mcg_cap. MCE is injected via vcpu ioctl command KVM_X86_SET_MCE. Extended machine-check

Re: kvm-userspace broken?

2009-05-03 Thread Avi Kivity
Hans de Bruin wrote: Avi Kivity wrote: Oliver Rath wrote: Hi List, maybe i missed some announcements, but git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-userspace.git givs no response: kvm-userspace # git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-userspace.git Initialized empty

Re: KVM x86_64 with SR-IOV..?

2009-05-03 Thread Nicholas A. Bellinger
On Sun, 2009-05-03 at 22:28 -0700, Nicholas A. Bellinger wrote: > On Sun, 2009-05-03 at 21:36 -0700, Nicholas A. Bellinger wrote: > > On Mon, 2009-05-04 at 10:09 +0800, Sheng Yang wrote: > > > On Monday 04 May 2009 08:53:07 Nicholas A. Bellinger wrote: > > > > On Sat, 2009-05-02 at 18:22 +0800, She

Re: KVM x86_64 with SR-IOV..?

2009-05-03 Thread Nicholas A. Bellinger
On Sun, 2009-05-03 at 21:36 -0700, Nicholas A. Bellinger wrote: > On Mon, 2009-05-04 at 10:09 +0800, Sheng Yang wrote: > > On Monday 04 May 2009 08:53:07 Nicholas A. Bellinger wrote: > > > On Sat, 2009-05-02 at 18:22 +0800, Sheng Yang wrote: > > > > On Thu, Apr 30, 2009 at 01:22:54PM -0700, Nichola

RE: [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base for ipf.c

2009-05-03 Thread Zhang, Xiantao
Jes Sorensen wrote: > Zhang, Xiantao wrote: >> Avi Kivity wrote: >> Looks good to me. Xiantao? >> >> Hi, Jes >> Have you tested nvram support with this patch? I >> Xiantao > > No, > > But it is behaving exactly like the old code, so it is no more broken > than the old code was. > > Lets ap

Re: [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base for ipf.c

2009-05-03 Thread Jes Sorensen
Zhang, Xiantao wrote: Avi Kivity wrote: Looks good to me. Xiantao? Hi, Jes Have you tested nvram support with this patch? I Xiantao No, But it is behaving exactly like the old code, so it is no more broken than the old code was. Lets apply this and then look at the nvram issues afterwar

Re: KVM x86_64 with SR-IOV..?

2009-05-03 Thread Nicholas A. Bellinger
On Mon, 2009-05-04 at 10:09 +0800, Sheng Yang wrote: > On Monday 04 May 2009 08:53:07 Nicholas A. Bellinger wrote: > > On Sat, 2009-05-02 at 18:22 +0800, Sheng Yang wrote: > > > On Thu, Apr 30, 2009 at 01:22:54PM -0700, Nicholas A. Bellinger wrote: > > > > Greetings KVM folks, > > > > > > > > I won

Re: [RFC 1/2] Add MCE simulation support to qemu/tcg

2009-05-03 Thread Huang Ying
I found there is a qemu-kvm.git on git.kernel.org. I will re-base my patches for that. And I found that the kvm support in qemu (target-i386/kvm.c) is quite different from that in qemu-kvm (kvm/). Where should MCE support goes? To target-i386/kvm.c or kvm/ or both? Best Regards, Huang Ying On Th

Re: [PATCH] Assign the correct pci id range to virtio_pci

2009-05-03 Thread Pantelis Koukousoulas
>> I 'd be happy with a simple comment explaining the 0x103f (e.g., >> /* Not yet using the full 0x1000 - 0x10ef to hedge our bets in case we >> broke the ABI.*/ >> as explained above) > > Thanks, I like your patch. > > Where did this idea of "experimental" range come from, BTW? In the qemu source

Re: KVM x86_64 with SR-IOV..?

2009-05-03 Thread Sheng Yang
On Monday 04 May 2009 08:53:07 Nicholas A. Bellinger wrote: > On Sat, 2009-05-02 at 18:22 +0800, Sheng Yang wrote: > > On Thu, Apr 30, 2009 at 01:22:54PM -0700, Nicholas A. Bellinger wrote: > > > Greetings KVM folks, > > > > > > I wondering if any information exists for doing SR-IOV on the new VT-d

Re: KVM + virt-manager: which is the perfect host Linux distro?

2009-05-03 Thread Charles Duffy
Evert wrote: Can I conclude from that that Debian is the best host distro to go for? Better than Red Hat & Gentoo? I'm not really convinced there's a big enough difference that it matters -- particularly on a production system where you intend to stick to stable, well-tested software. That sa

Re: [PATCH] Assign the correct pci id range to virtio_pci

2009-05-03 Thread Rusty Russell
On Mon, 27 Apr 2009 12:53:25 pm Pantelis Koukousoulas wrote: > On Mon, Apr 27, 2009 at 3:44 AM, Anthony Liguori > wrote: > > Would be good to at least include the "experiment range" in case people are > > making third-party virtio modules and want to play around without replacing > > virtio-{pci,

RE: [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base for ipf.c

2009-05-03 Thread Zhang, Xiantao
Avi Kivity wrote: > Jes Sorensen wrote: >> Zhang, Xiantao wrote: >>> Jes Sorensen wrote: >>> I still can't see the difference with the patch in Avi's tree except >>> nvram stuff. And I believe the global variable you mentioned should >>> be only used for nvram. So I propose an incremental patch fo

RE: [PATCH] Revert "Sync idcache after emualted DMA operations for ia64"

2009-05-03 Thread Zhang, Xiantao
Avi Kivity wrote: > Hollis Blanchard wrote: >> This reverts commit 9dc99a28236161a5a1b4c58f1e9c4ec6179cb976. >> Aside from the other issues discussed on kvm-devel, this commit >> breaks the PowerPC build. >> >> > > Applied, thanks. Hollis, Could you explain why this patch breaks the powerp

RE: [PATCH] kvm-kmod: fix build on kernels with kvm trace set

2009-05-03 Thread Zhang, Xiantao
Avi Kivity wrote: > Michael S. Tsirkin wrote: >> CONFIG_KVM_TRACE in kernel conflicts with the definition >> in external module. external-module-compat-comm.h tried >> to work around this, but this didn't work as some >> code still does #include >> directly. >> >> Solve this differently by s/CONF

Re: KVM x86_64 with SR-IOV..?

2009-05-03 Thread Nicholas A. Bellinger
On Sat, 2009-05-02 at 18:22 +0800, Sheng Yang wrote: > On Thu, Apr 30, 2009 at 01:22:54PM -0700, Nicholas A. Bellinger wrote: > > Greetings KVM folks, > > > > I wondering if any information exists for doing SR-IOV on the new VT-d > > capable chipsets with KVM..? From what I understand the patches

Re: kvm-userspace broken?

2009-05-03 Thread Hans de Bruin
Avi Kivity wrote: Oliver Rath wrote: Hi List, maybe i missed some announcements, but git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-userspace.git givs no response: kvm-userspace # git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-userspace.git Initialized empty Git repository in /h

[RFC] Bring in all the Linux headers we depend on in QEMU

2009-05-03 Thread Anthony Liguori
Sorry this explanation is long winded, but this is a messy situation. In Linux, there isn't a very consistent policy about userspace kernel header inclusion. On a typical Linux system, you're likely to find kernel headers in three places. glibc headers (/usr/include/{linux,asm}) These heade

Custom BIOS supported size

2009-05-03 Thread Cristi Magherusan
Hello, Which is the maximum size supported for a custom BIOS image(eg. coreboot-based)? I tried some 256K coreboot BIOS images and seemed to work fine, but it blowed up with a 3MB image (which by the way works on qemu just fine). Qemu also seems to fail with images greater than 4MB, and I'd appr

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Al Viro
On Sun, May 03, 2009 at 01:11:39PM -0700, Davide Libenzi wrote: > On Sun, 3 May 2009, Al Viro wrote: > > > IOW, the sane solution would be to export something that returns your > > struct file *. And stop playing with fd completely. > > This builds but it's not tested at all. > > - Make all the

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Davide Libenzi
On Sun, 3 May 2009, Al Viro wrote: > IOW, the sane solution would be to export something that returns your > struct file *. And stop playing with fd completely. This builds but it's not tested at all. - Make all the work of the old anon_inode_getfd(), done by a new anon_inode_getfile(), with

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Michael S. Tsirkin
On Sun, May 03, 2009 at 10:17:16PM +0300, Avi Kivity wrote: >> Actually there's a third option: add KVM_MASK_IRQ, KVM_UNMASK_IRQ ioctls >> which will block/unblock guest from getting interrupt on this irq, >> whatever the source. Interrupts are queued in kernel while masked. A >> third ioctl KVM_P

file descriptor abuses

2009-05-03 Thread Al Viro
On Sun, May 03, 2009 at 08:01:36PM +0100, Al Viro wrote: > General rules: > * descriptor you've generated is fit only for return to userland; > * descriptor you've got from userland is fit only for *single* > fget() or equivalent, unless you are one of the core syscalls manipulating >

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Avi Kivity
Michael S. Tsirkin wrote: On Sun, May 03, 2009 at 07:59:40PM +0300, Avi Kivity wrote: Michael S. Tsirkin wrote: On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: This allows an eventfd to be registered as an irq source with a guest. Any signaling operation on

Re: qemu-kvm: unapplied patches in my queue

2009-05-03 Thread Michael S. Tsirkin
On Sun, May 03, 2009 at 08:22:15PM +0300, Avi Kivity wrote: > Michael S. Tsirkin wrote: >> Hi, >> The following patches have been posted a week ago: >> [PATCH] qemu-kvm: make clean should propagate into libkvm dire >> [PATCH] qemu-kvm: fix compiler warning >> [PATCH] qemu-kvm: make kvm_create_pit s

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Michael S. Tsirkin
On Sun, May 03, 2009 at 07:59:40PM +0300, Avi Kivity wrote: > Michael S. Tsirkin wrote: >> On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: >> >>> This allows an eventfd to be registered as an irq source with a guest. Any >>> signaling operation on the eventfd (via userspace or

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Al Viro
On Sun, May 03, 2009 at 11:07:26AM -0700, Davide Libenzi wrote: > On Sun, 3 May 2009, Al Viro wrote: > > On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: > > > + /* We re-use eventfd for irqfd */ > > > + fd = sys_eventfd2(0, 0); > > > + if (fd < 0) { > > > + ret = fd; > > >

Linux x86 guest panics in skb_copy_bits

2009-05-03 Thread Justin Dossey
Hi all, I have a pretty straightforward setup. Hypervisor: dual xeon e5205 running Gentoo Linux kernel 2.6.27 with virtio devices enabled kvm 84 libvirt 0.5.1 Guest: 32-bit, virtio for nic and disk, qcow2. Linux 2.6.28. Network is bridged using tap and brctl. I'm running Apache on the guest. 

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Davide Libenzi
On Sun, 3 May 2009, Al Viro wrote: > On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: > > + /* We re-use eventfd for irqfd */ > > + fd = sys_eventfd2(0, 0); > > + if (fd < 0) { > > + ret = fd; > > + goto fail; > > + } > > + > > + /* We maintain a refer

Re: qemu-kvm: unapplied patches in my queue

2009-05-03 Thread Avi Kivity
Michael S. Tsirkin wrote: Hi, The following patches have been posted a week ago: [PATCH] qemu-kvm: make clean should propagate into libkvm dire [PATCH] qemu-kvm: fix compiler warning [PATCH] qemu-kvm: make kvm_create_pit static No comments have been made since then - does this mean they can be a

qemu-kvm: unapplied patches in my queue

2009-05-03 Thread Michael S. Tsirkin
Hi, The following patches have been posted a week ago: [PATCH] qemu-kvm: make clean should propagate into libkvm dire [PATCH] qemu-kvm: fix compiler warning [PATCH] qemu-kvm: make kvm_create_pit static No comments have been made since then - does this mean they can be applied? Thanks, -- MST --

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Avi Kivity
Michael S. Tsirkin wrote: On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: This allows an eventfd to be registered as an irq source with a guest. Any signaling operation on the eventfd (via userspace or kernel) will inject the registered GSI at the next available window. Sig

Re: [PATCH 03/21] Remove use of signalfd in block-raw-posix.c

2009-05-03 Thread Avi Kivity
Avi Kivity wrote: Anthony Liguori wrote: Oh okay. But signal delivery is slow; for example the FPU needs to be reset. Is it really justified to add all of this extra code (including signalfd emulation) for something that probably isn't even measurable? We don't have to add signalfd emula

Re: KVM performance vs. Xen

2009-05-03 Thread Avi Kivity
Andrew Theurer wrote: If the overhead is dominated by copying, then you won't see the difference. Once the copying is eliminated, the comparison may yield different results. We should certainly see a difference in context switches. I would like to test this the proper way. What do I need t

Re: [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base for ipf.c

2009-05-03 Thread Avi Kivity
Jes Sorensen wrote: Zhang, Xiantao wrote: Jes Sorensen wrote: I still can't see the difference with the patch in Avi's tree except nvram stuff. And I believe the global variable you mentioned should be only used for nvram. So I propose an incremental patch for that. :) Hi, Here is an incre

Re: [PATCH] Revert "Sync idcache after emualted DMA operations for ia64"

2009-05-03 Thread Avi Kivity
Hollis Blanchard wrote: This reverts commit 9dc99a28236161a5a1b4c58f1e9c4ec6179cb976. Aside from the other issues discussed on kvm-devel, this commit breaks the PowerPC build. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list:

[PATCH 4/4] kvm: Trim cpu features not supported by kvm

2009-05-03 Thread Avi Kivity
Remove cpu features that are not supported by kvm from the cpuid features reported to the guest. Signed-off-by: Avi Kivity --- target-i386/helper.c | 30 ++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c i

[PATCH 1/4] kvm: Add support for querying supported cpu features

2009-05-03 Thread Avi Kivity
kvm does not support all cpu features; add support for dunamically querying the supported feature set. Signed-off-by: Avi Kivity --- kvm.h |3 ++ target-i386/kvm.c | 80 + 2 files changed, 83 insertions(+), 0 deletions(-) dif

[PATCH 3/4] Fix x86 feature modifications for features that set multiple bits

2009-05-03 Thread Avi Kivity
QEMU allows adding or removing cpu features by using the syntax '-cpu +feature' or '-cpu -feature'. Some cpuid features cause more than one bit to be set or cleared; but QEMU stops after just one bit has been modified, causing the feature bits to be inconsistent. Fix by allowing all feature bits

[PATCH 0/4] Fix kvm cpuid reporting

2009-05-03 Thread Avi Kivity
kvm supports an interface for reporting which cpuid features are supported. Use it for trimming the cpu feature set reported to the guest. This prevents, for example, reporting NX to a guest when in fact we do not support it. Avi Kivity (4): kvm: Add support for querying supported cpu features

[PATCH 2/4] Make x86 cpuid feature names available in file scope

2009-05-03 Thread Avi Kivity
To be used later. Signed-off-by: Avi Kivity --- target-i386/helper.c | 55 + 1 files changed, 28 insertions(+), 27 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index a070e08..88585b8 100644 --- a/target-i386/helper.c +++

Re: Unable to boot guest on kernel 2.6.29.1 with kvm-84 or kvm-85

2009-05-03 Thread Avi Kivity
Kenni Lund wrote: It won't help - I reproduced the issue. Instead, try passing the parameter '-cpu qemu32' (or '-cpu qemu64,-nx'). Adding the parameter '-cpu qemu32' (32bit host + 32 bit guest) makes the WinXP guest boot. ...but is this parameter equal to '-no-kvm'? Eg. with emulated CPU

Re: Unable to boot guest on kernel 2.6.29.1 with kvm-84 or kvm-85

2009-05-03 Thread Kenni Lund
>Avi Kivity wrote: >> Kenni Lund wrote: >>> Avi Kivity a...@redhat.com wrote: >>> Kenni Lund wrote: > Ok, but as I write in my message, I'm using the >

[PATCH] kvm: Add helpers for checking and requiring kvm extensions

2009-05-03 Thread Avi Kivity
Instead of open-coding the check extension sequence, provide helpers for checking whether an extension exists, and for aborting if an extension is missing. Signed-off-by: Avi Kivity --- kvm-all.c | 63 +++-- kvm.h |6 +

Re: Implement generic double fault generation mechanism

2009-05-03 Thread Gleb Natapov
On Thu, Apr 30, 2009 at 03:24:07PM +0800, Dong, Eddie wrote: > > > Move Double-Fault generation logic out of page fault > exception generating function to cover more generic case. > > Signed-off-by: Eddie Dong > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index ab1

Re: Unable to boot guest on kernel 2.6.29.1 with kvm-84 or kvm-85

2009-05-03 Thread Avi Kivity
Avi Kivity wrote: Kenni Lund wrote: Avi Kivity a...@redhat.com wrote: Kenni Lund wrote: Ok, but as I write in my message, I'm using the KVM modules from the latest> upstream kernel, not the kvm-85 modules.> According to the KVM download page, http://www.linux-kvm.org/page/Do

Re: [PATCH] kvm: trivial format fix in setup_routing_entry()

2009-05-03 Thread Avi Kivity
Chris Wright wrote: Remove extra tab. 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 http://vger.kernel.org/majo

Re: [PATCH] qemu-kvm: build system Add link to qemu

2009-05-03 Thread Avi Kivity
Jan Kiszka wrote: I'm getting closer to a working qemu-kvm, but there are still a few messy parts. The magic dance goes like this: cd qemu-kvm/kvm ln -s .. qemu (or apply patch below) ./configure -whatever make Still, this is unintuitive. As both top-level configure and Makefile alrea

Re: PPC support for qemu-kvm

2009-05-03 Thread Avi Kivity
Hollis Blanchard wrote: These patches fix a number of issues with PowerPC builds of qemu-kvm.git. However, even after applying these patches it still doesn't build, due to confusion with KVM_UPSTREAM and CONFIG_KVM. Applied all, thanks. -- error compiling committee.c: too many arguments to