Re: Issues with getting PCI pass-through to work

2010-05-31 Thread Adhyas Avasthi
Tried working on it a bit more. Now it complains that it cannot find IOMMU. This is an Intel Montevina chipset with DMA remapping support (VT-d). Any pointers as to why it is not finding the support? The message is coming from hw/device-assignment.c after the call to kvm_check_extension for IOMMU f

RE: host panic on kernel 2.6.34

2010-05-31 Thread Hao, Xudong
Maciej Rutecki wrote: > On poniedziaƂek, 24 maja 2010 o 10:23:11 Hao, Xudong wrote: >> Hi all >> I build latest kvm 37dec075a7854f0f550540bf3b9bbeef37c11e2a, based on >> kernel 2.6.34, after kvm and kvm_intel module loaded, then >> /etc/init.d/kvm start, a few minutes later, the system will panic

KVM call agenda for June 1

2010-05-31 Thread Chris Wright
Please send in any agenda items you are interested in covering. If we have a lack of agenda items I'll cancel the week's call. thanks, -chris -- 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

[PATCH 02/21] arch/powerpc: Remove unnecessary kmalloc casts

2010-05-31 Thread Joe Perches
Signed-off-by: Joe Perches --- arch/powerpc/kernel/nvram_64.c |3 +-- arch/powerpc/kvm/book3s.c |4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 9cf197f..99c6dab 100644 --- a/arch/powerpc/ker

Re: [PATCH 1/5] KVM: MMU: introduce some macros to cleanup hlist traverseing

2010-05-31 Thread Xiao Guangrong
Avi Kivity wrote: > On 05/31/2010 05:00 AM, Xiao Guangrong wrote: >> >>> + +#define for_each_gfn_indirect_sp(kvm, sp, gfn, pos, n)\ + hlist_for_each_entry_safe(sp, pos, n,\ +&kvm->arch.mmu_page_hash[kvm_page_table_hashfn(gfn)], hash_link)\

[PATCH 2/2] qemu: Enable XSAVE related CPUID

2010-05-31 Thread Sheng Yang
We can support it in KVM now. The 0xd leaf is queried from KVM. Signed-off-by: Sheng Yang --- target-i386/cpuid.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index eebf038..ec47950 100644 --- a/target-i38

[PATCH 1/2] qemu: kvm: Extend kvm_arch_get_supported_cpuid() to support index

2010-05-31 Thread Sheng Yang
Would use it later for XSAVE related CPUID. Signed-off-by: Sheng Yang --- kvm.h |2 +- qemu-kvm-x86.c|8 target-i386/kvm.c | 19 +++ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/kvm.h b/kvm.h index aab5118..16b06a4 100644 ---

Re: [PATCH 2/5] KVM: MMU: split the operations of kvm_mmu_zap_page()

2010-05-31 Thread Xiao Guangrong
Avi Kivity wrote: > > It would be better to rewrite kvm_mmu_zap_page() in terms of > prepare/commit in the patch so we don't have two copies of the same > thing (also easier to review). OK, i'll do it in the next version. > > > > >>> This is a good idea, but belongs in a separate patch?

Re: [PATCH] KVM: PPC: elide struct thread_struct instances from stack

2010-05-31 Thread Alexander Graf
On 01.06.2010, at 00:40, Paul Mackerras wrote: > On Mon, May 31, 2010 at 09:59:13PM +0200, Andreas Schwab wrote: > >> Instead of instantiating a whole thread_struct on the stack use only the >> required parts of it. > > ... > >> +_GLOBAL(kvm_cvt_fd) >> +lfd 0,0(r5) /* l

Re: [PATCH] KVM: PPC: elide struct thread_struct instances from stack

2010-05-31 Thread Paul Mackerras
On Mon, May 31, 2010 at 09:59:13PM +0200, Andreas Schwab wrote: > Instead of instantiating a whole thread_struct on the stack use only the > required parts of it. ... > +_GLOBAL(kvm_cvt_fd) > + lfd 0,0(r5) /* load up fpscr value */ > + MTFSF_L(0) > + lfs 0,0(r

Re: [PATCH qemu-kvm] device-assignment: add config fd qdev property

2010-05-31 Thread Marcelo Tosatti
On Mon, May 24, 2010 at 10:53:49AM -0600, Alex Williamson wrote: > On Wed, 2010-05-19 at 12:00 -0700, Chris Wright wrote: > > When libvirt launches a guest it first chowns the relevenat > > /sys/bus/pci/.../config file for an assigned device then drops privileges. > > > > This causes an issue for

Re: [PATCH] make-release: misc fixes

2010-05-31 Thread Marcelo Tosatti
On Mon, May 24, 2010 at 04:12:14PM +0300, Michael S. Tsirkin wrote: > This fixes /tmp usage in make-release script for security. > Also, create output directory if it does not exist. > This also adds a 'tarball' optin to specify output file name. > Finally, remote output file before gzip to avoid p

Re: [PATCH] KVM: PPC: elide struct thread_struct instances from stack

2010-05-31 Thread Alexander Graf
On 31.05.2010, at 21:59, Andreas Schwab wrote: > Instead of instantiating a whole thread_struct on the stack use only the > required parts of it. > > Signed-off-by: Andreas Schwab > Tested-by: Alexander Graf Avi or Marcelo, please pull this in through kvm.git. Signed-off-by: Alexander Graf

[PATCH] KVM: PPC: elide struct thread_struct instances from stack

2010-05-31 Thread Andreas Schwab
Instead of instantiating a whole thread_struct on the stack use only the required parts of it. Signed-off-by: Andreas Schwab Tested-by: Alexander Graf --- arch/powerpc/include/asm/kvm_fpu.h | 27 + arch/powerpc/kernel/ppc_ksyms.c |4 - arch/powerpc/kvm/book3s.c

[PATCH][RESEND] VMX: Properly return error to userspace on vmentry failure

2010-05-31 Thread Mohammed Gamal
The vmexit handler returns KVM_EXIT_UNKNOWN since there is no handler for vmentry failures. This intercepts vmentry failures and returns KVM_FAIL_ENTRY to userspace instead. Signed-off-by: Mohammed Gamal --- arch/x86/kvm/vmx.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) dif

[PATCH][RESEND] Print a user-friendly message on failed vmentry

2010-05-31 Thread Mohammed Gamal
This patch address bug report in https://bugs.launchpad.net/qemu/+bug/530077. Failed vmentries were handled with handle_unhandled() which prints a rather unfriendly message to the user. This patch separates handling vmentry failures from unknown exit reasons and prints a friendly message to the us

[PATCH] ceph/rbd block driver for qemu-kvm (v3)

2010-05-31 Thread Christian Brunner
Hi Kevin, here is an updated patch for the ceph/rbd driver. I hope that everything is fine now. Regards, Christian This is a block driver for the distributed file system Ceph (http://ceph.newdream.net/). This driver uses librados (which is part of the Ceph server) for direct access to the Ceph

Re: [QEMU-KVM]: Megasas + TCM_Loop + SG_IO into Windows XP guests

2010-05-31 Thread Alexander Graf
Am 31.05.2010 um 11:52 schrieb Gerd Hoffmann : Hi, Also it's worth mentioning that I am still running C: on QEMU IDE emulation, as I could not quite figure out how to boot for a megasas LD with option-rom. What QEMU CLI ops where requried to make this work again..? -option-rom $file o

Re: [PATCH] make-release: misc fixes

2010-05-31 Thread Michael S. Tsirkin
On Mon, May 24, 2010 at 04:12:14PM +0300, Michael S. Tsirkin wrote: > This fixes /tmp usage in make-release script for security. > Also, create output directory if it does not exist. > This also adds a 'tarball' optin to specify output file name. > Finally, remote output file before gzip to avoid p

Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers

2010-05-31 Thread Michael S. Tsirkin
On Mon, May 31, 2010 at 02:50:29PM +0300, Avi Kivity wrote: > On 05/30/2010 05:53 PM, Michael S. Tsirkin wrote: >> >> So what I suggested is failing any kind of access until iommu >> is assigned. >> > > So, the kernel driver must be aware of the iommu. In which case it may > as well program

Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers

2010-05-31 Thread Alan Cox
> +/* > + * Map usr buffer at specific IO virtual address > + */ > +static int vfio_dma_map_iova( > + mlp = kzalloc(sizeof *mlp, GFP_KERNEL); Not good at that point. I think you need to allocate it first, error if it can't be allocated and then do the work and free it on error ? > + ml

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-05-31 Thread Michael S. Tsirkin
On Mon, May 31, 2010 at 05:45:07PM +0200, Tejun Heo wrote: > Hello, > > On 05/31/2010 05:22 PM, Michael S. Tsirkin wrote: > > On Sun, May 30, 2010 at 10:24:01PM +0200, Tejun Heo wrote: > >> Replace vhost_workqueue with per-vhost kthread. Other than callback > >> argument change from struct work_s

Re: host panic on kernel 2.6.34

2010-05-31 Thread Maciej Rutecki
On poniedziaƂek, 24 maja 2010 o 10:23:11 Hao, Xudong wrote: > Hi all > I build latest kvm 37dec075a7854f0f550540bf3b9bbeef37c11e2a, based on > kernel 2.6.34, after kvm and kvm_intel module loaded, then /etc/init.d/kvm > start, a few minutes later, the system will panic. > I created a Bugzilla e

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-05-31 Thread Tejun Heo
Hello, On 05/31/2010 05:22 PM, Michael S. Tsirkin wrote: > On Sun, May 30, 2010 at 10:24:01PM +0200, Tejun Heo wrote: >> Replace vhost_workqueue with per-vhost kthread. Other than callback >> argument change from struct work_struct * to struct vhost_poll *, >> there's no visible change to vhost_p

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-05-31 Thread Tejun Heo
Hello, On 05/31/2010 05:31 PM, Oleg Nesterov wrote: >> I might have slightly over engineered this part not knowing the >> expected workload. ->queue_seq/->done_seq pair is to guarantee that >> flushers never get starved. > > Ah, indeed. > > Well, afaics we do not need 2 counters anyway, both vh

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-05-31 Thread Oleg Nesterov
On 05/31, Tejun Heo wrote: > > On 05/31/2010 04:39 PM, Oleg Nesterov wrote: > > > What I can't understand is why we do have ->queue_seq and ->done_seq. > > > > Isn't the single "bool poll->active" enough? vhost_poll_queue() sets > > ->active == T, vhost_poller() clears it before wake_up_all(poll->d

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-05-31 Thread Michael S. Tsirkin
On Sun, May 30, 2010 at 10:24:01PM +0200, Tejun Heo wrote: > Replace vhost_workqueue with per-vhost kthread. Other than callback > argument change from struct work_struct * to struct vhost_poll *, > there's no visible change to vhost_poll_*() interface. I would prefer a substructure vhost_work, e

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-05-31 Thread Tejun Heo
Hello, On 05/31/2010 04:39 PM, Oleg Nesterov wrote: > On 05/30, Tejun Heo wrote: >> >> This conversion is to make each vhost use a dedicated kthread so that >> resource control via cgroup can be applied. > > Personally, I agree. I think This is better than play with workqueue thread. Yeap, I thi

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-05-31 Thread Oleg Nesterov
On 05/30, Tejun Heo wrote: > > This conversion is to make each vhost use a dedicated kthread so that > resource control via cgroup can be applied. Personally, I agree. I think This is better than play with workqueue thread. A couple of simple questions after the quick glance at the unapplied patc

Re: [PATCH] Add Documentation/kvm/msr.txt

2010-05-31 Thread Avi Kivity
On 05/31/2010 04:49 PM, Glauber Costa wrote: How are we failing to meet it? All guests align to at least four bytes. static struct pvclock_wall_clock wall_clock; Unless there is something that the compiler does that I should take for granted, there is no alignment directive in there, a

Re: [PATCH] Add Documentation/kvm/msr.txt

2010-05-31 Thread Glauber Costa
On Sun, May 30, 2010 at 12:14:21PM +0300, Avi Kivity wrote: > On 05/27/2010 07:02 PM, Glauber Costa wrote: > >> > >>>+ > >>>+Custom MSR list > >>>+ > >>>+ > >>>+The current supported Custom MSR list is: > >>>+ > >>>+MSR_KVM_WALL_CLOCK: 0x11 > >>>+ > >>>+ data: physical address of a memory

Re: [PATCHv2-RFC 0/2] virtio: put last seen used index into ring itself

2010-05-31 Thread Michael S. Tsirkin
On Mon, May 31, 2010 at 09:36:00AM +0200, Jes Sorensen wrote: > On 05/30/10 13:22, Michael S. Tsirkin wrote: > > On Fri, May 28, 2010 at 11:56:54AM +0200, Jes Sorensen wrote: > >> It looks pretty good to me, however one thing I have been thinking of > >> while reading through it: > >> > >> Rather t

Re: [PATCHv2-RFC 0/2] virtio: put last seen used index into ring itself

2010-05-31 Thread Michael S. Tsirkin
On Mon, May 31, 2010 at 05:16:42PM +0930, Rusty Russell wrote: > On Thu, 27 May 2010 05:20:35 am Michael S. Tsirkin wrote: > > Here's a rewrite of the original patch with a new layout. > > I haven't tested it yet so no idea how this performs, but > > I think this addresses the cache bounce issue ra

[PATCH v7] KVM: VMX: Enable XSAVE/XRSTOR for guest

2010-05-31 Thread Sheng Yang
From: Dexuan Cui This patch enable guest to use XSAVE/XRSTOR instructions. We assume that host_xcr0 would use all possible bits that OS supported. And we loaded xcr0 in the same way we handled fpu - do it as late as we can. Signed-off-by: Dexuan Cui Signed-off-by: Sheng Yang --- Change from

Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers

2010-05-31 Thread Avi Kivity
On 05/30/2010 05:53 PM, Michael S. Tsirkin wrote: So what I suggested is failing any kind of access until iommu is assigned. So, the kernel driver must be aware of the iommu. In which case it may as well program it. -- I have a truly marvellous patch that fixes the bug which this signa

Re: KVM: MMU: always invalidate and flush on spte page size change

2010-05-31 Thread Avi Kivity
On 05/30/2010 06:19 PM, Marcelo Tosatti wrote: On Sun, May 30, 2010 at 01:28:19PM +0300, Avi Kivity wrote: On 05/28/2010 03:44 PM, Marcelo Tosatti wrote: Always invalidate spte and flush TLBs when changing page size, to make sure different sized translations for the same address are n

Re: [PATCH] KVM: x86: XSAVE/XRSTOR live migration support

2010-05-31 Thread Avi Kivity
On 05/31/2010 02:21 PM, Sheng Yang wrote: Need to reserve way more space here for future xsave growth. I think at least 4K. LRB wa 32x512bit = 1K (though it probably isn't a candidate for vmx). Would be good to get an opinion from your processor architects. I don't think we need to detail t

Re: [PATCH] KVM: x86: XSAVE/XRSTOR live migration support

2010-05-31 Thread Sheng Yang
On Thursday 27 May 2010 18:02:31 Avi Kivity wrote: > On 05/27/2010 12:48 PM, Sheng Yang wrote: > > This patch enable save/restore of xsave state. > > > > Signed-off-by: Sheng Yang > > --- > > > > arch/x86/include/asm/kvm.h | 29 > > arch/x86/kvm/x86.c | 79 > > ++

[PATCH] test: Add XSAVE unit test

2010-05-31 Thread Sheng Yang
Only test legal action so far, we can extend it later. Signed-off-by: Sheng Yang --- kvm/test/config-x86-common.mak |5 +- kvm/test/x86/xsave.c | 173 2 files changed, 177 insertions(+), 1 deletions(-) create mode 100644 kvm/test/x86/xsave

Re: [PATCH 1/5] KVM: MMU: introduce some macros to cleanup hlist traverseing

2010-05-31 Thread Avi Kivity
On 05/31/2010 05:00 AM, Xiao Guangrong wrote: + +#define for_each_gfn_indirect_sp(kvm, sp, gfn, pos, n)\ + hlist_for_each_entry_safe(sp, pos, n,\ +&kvm->arch.mmu_page_hash[kvm_page_table_hashfn(gfn)], hash_link)\ +if (sp->gfn == gfn&& !sp->role.d

Re: [PATCH 2/5] KVM: MMU: split the operations of kvm_mmu_zap_page()

2010-05-31 Thread Avi Kivity
On 05/31/2010 05:13 AM, Xiao Guangrong wrote: Avi Kivity wrote: On 05/30/2010 03:37 PM, Xiao Guangrong wrote: Using kvm_mmu_prepare_zap_page() and kvm_mmu_commit_zap_page() to split kvm_mmu_zap_page() function, then we can: - traverse hlist safely - easily to gather remote tlb flush

Re: [PATCH -v3] KVM, Fix QEMU-KVM is killed by guest SRAO MCE (resend)

2010-05-31 Thread Avi Kivity
On 05/31/2010 09:28 AM, Huang Ying wrote: In common cases, guest SRAO MCE will cause corresponding poisoned page be un-mapped and SIGBUS be sent to QEMU-KVM, then QEMU-KVM will relay the MCE to guest OS. But it is reported that if the poisoned page is accessed in guest after un-mapped and before

Re: [PATCH UPDATED2 3/3] vhost: apply cpumask and cgroup to vhost pollers

2010-05-31 Thread Tejun Heo
Apply the cpumask and cgroup of the initializing task to the created vhost poller. Based on Sridhar Samudrala's patch. Li Zefan spotted a bug in error path (twice), fixed (twice). Cc: Michael S. Tsirkin Cc: Sridhar Samudrala Cc: Li Zefan --- Heh... that's embarrassing. Let's see if I can get

Re: [PATCH 0/2] Setup scsi-bus xfer and xfer_mode for PR IN/OUT and Maintenance IN/OUT

2010-05-31 Thread Gerd Hoffmann
On 05/31/10 03:42, Nicholas A. Bellinger wrote: From: Nicholas Bellinger Greetings Gerd, Kevin and Co, Attached are two patches to add the necesary CDB parsing to determine SCSIRequest->cmd.xfer (length) and SCSIRequest->cmd.mode (direction) for Persistent Reservation IN/OUT CDBs and for Maint

Re: [QEMU-KVM]: Megasas + TCM_Loop + SG_IO into Windows XP guests

2010-05-31 Thread Gerd Hoffmann
Hi, Also it's worth mentioning that I am still running C: on QEMU IDE emulation, as I could not quite figure out how to boot for a megasas LD with option-rom. What QEMU CLI ops where requried to make this work again..? -option-rom $file or -device megasas,romfile=$file cheers, Gerd --

[PATCH] kvm mmu: Don't calculate quadrant if tdp_enabled.

2010-05-31 Thread Gui Jianfeng
There's no need to calculate quadrant if tdp is enabled. Signed-off-by: Gui Jianfeng --- arch/x86/kvm/mmu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 0bb9f17..431863b 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/

Re: [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held

2010-05-31 Thread Martin Schwidefsky
On Mon, 31 May 2010 10:38:07 +0200 Christian Borntraeger wrote: > > The containing function is called from several places. At one of them, in > > the function __sigp_stop, the spin lock &fi->lock is held. > [...] > > Signed-off-by: Julia Lawall > > Acked-by: Christian Borntraeger Ok, I'll ad

Re: [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held

2010-05-31 Thread Christian Borntraeger
> The containing function is called from several places. At one of them, in > the function __sigp_stop, the spin lock &fi->lock is held. [...] > Signed-off-by: Julia Lawall Acked-by: Christian Borntraeger [...] > --- a/arch/s390/kvm/sigp.c > +++ b/arch/s390/kvm/sigp.c > @@ -113,7 +113,7 @@ sta

Re: [PATCHv2-RFC 0/2] virtio: put last seen used index into ring itself

2010-05-31 Thread Rusty Russell
On Thu, 27 May 2010 05:20:35 am Michael S. Tsirkin wrote: > Here's a rewrite of the original patch with a new layout. > I haven't tested it yet so no idea how this performs, but > I think this addresses the cache bounce issue raised by Avi. > Posting for early flames/comments. Sorry, not without s

Re: [PATCH UPDATED 3/3] vhost: apply cpumask and cgroup to vhost pollers

2010-05-31 Thread Li Zefan
> poller = kthread_create(vhost_poller, dev, "vhost-%d", current->pid); > - if (IS_ERR(poller)) > - return PTR_ERR(poller); > + if (IS_ERR(poller)) { > + ret = PTR_ERR(poller); > + goto out; here... > + } > + > + ret = sched_getaffinity(cu

Re: [PATCHv2-RFC 0/2] virtio: put last seen used index into ring itself

2010-05-31 Thread Jes Sorensen
On 05/30/10 13:22, Michael S. Tsirkin wrote: > On Fri, May 28, 2010 at 11:56:54AM +0200, Jes Sorensen wrote: >> It looks pretty good to me, however one thing I have been thinking of >> while reading through it: >> >> Rather than storing a pointer within the ring struct, pointing into a >> position

Re: [PATCH 2/3] cgroups: Add an API to attach a task to current task's cgroup

2010-05-31 Thread Tejun Heo
On 05/31/2010 03:07 AM, Li Zefan wrote: > 04:24, Tejun Heo wrote: >> From: Sridhar Samudrala >> >> Add a new kernel API to attach a task to current task's cgroup >> in all the active hierarchies. >> >> Signed-off-by: Sridhar Samudrala > > Acked-by: Li Zefan > > btw: you lost the reviewed-by ta

[PATCH UPDATED 3/3] vhost: apply cpumask and cgroup to vhost pollers

2010-05-31 Thread Tejun Heo
Apply the cpumask and cgroup of the initializing task to the created vhost poller. Based on Sridhar Samudrala's patch. Li Zefan spotted a bug in error path, fixed. Cc: Michael S. Tsirkin Cc: Sridhar Samudrala Cc: Li Zefan --- Updated accordingly. Thanks. drivers/vhost/vhost.c | 36 ++