PCI passthrough on Sony Vaio F11 laptop...

2010-11-12 Thread Erik Brakkee
Hi all, I have KVM running successfully on opensuse 11.3 (64bit) with a opensuse 11.1 guest. I am using hardware virtualization and want to experiment with PCI passthrough with the (wired) network card on my laptop because I want to repeat similar steps later on a server (with a TV card). The

Re: [V2 PATCH] virtio-net: init link state correctly

2010-11-12 Thread David Miller
From: Jason Wang Date: Fri, 05 Nov 2010 10:50:08 +0800 > For device that supports VIRTIO_NET_F_STATUS, there's no need to > assume the link is up and we need to call nerif_carrier_off() before > querying device status, otherwise we may get wrong operstate after > diver was loaded because the link

[PATCH v2 9/9] pci: Store capability offsets in PCIDevice

2010-11-12 Thread Alex Williamson
This not only makes pci_find_capability a directly lookup, but also allows us to better track added capabilities and avoids the proliferation of random additional capability offset markers. Signed-off-by: Alex Williamson --- hw/msix.c | 15 +++ hw/pci.c | 20 ++-

[PATCH v2 8/9] pci: Remove capability read/write config handlers

2010-11-12 Thread Alex Williamson
These are just as easy to handle out of the main config read/write handlers. Also expand cap_map to config_map so we can use it to track all of config space. Signed-off-by: Alex Williamson --- hw/device-assignment.c | 22 +++- hw/pci.c | 66 ---

[PATCH v2 6/9] device-assignment: Move PCI capabilities to match physical hardware

2010-11-12 Thread Alex Williamson
Now that common PCI code doesn't have a hangup on capabilities being contiguous, move assigned device capabilities to match their offset on physical hardware. This helps for drivers that assume a capability configuration and don't bother searching. We can also remove several calls to assigned_dev

[PATCH v2 7/9] pci: Pass ID for capability read/write handlers

2010-11-12 Thread Alex Williamson
Any handlers that actually want to interact with specific capabilities are going to want to know the capability ID being accessed. With the capability map, this is readily available, so we can save handlers the trouble of figuring it out. Signed-off-by: Alex Williamson --- hw/device-assignment

[PATCH v2 3/9] device-assignment: Use PCI capabilities support

2010-11-12 Thread Alex Williamson
Convert to use common pci_add_capabilities() rather than creating our own mess. Signed-off-by: Alex Williamson --- hw/device-assignment.c | 112 +++- 1 files changed, 63 insertions(+), 49 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-

[PATCH v2 4/9] pci: Replace used bitmap with capability byte map

2010-11-12 Thread Alex Williamson
Capabilities are allocated in bytes, so we can track both whether a byte is used and by what capability in the same structure. Remove pci_reserve_capability() as there are no users. Signed-off-by: Alex Williamson --- hw/pci.c | 16 +--- hw/pci.h |6 ++ 2 files changed, 7

[PATCH v2 5/9] pci: Remove cap.length, cap.start, cap.supported

2010-11-12 Thread Alex Williamson
Capabilities aren't required to be contiguous, so cap.length never really made much sense. Likewise, cap.start is mostly meaningless too. Both of these are better served by the capability map. We can also get rid of cap.supported, since it's really now unused and redundant with flag in the statu

[PATCH v2 2/9] pci: Remove pci_enable_capability_support()

2010-11-12 Thread Alex Williamson
This interface doesn't make much sense, adding a capability can take care of everything, just provide a means to register capability read/write handlers. Device assignment does it's own thing, so requires a couple ugly hacks that will be cleaned by subsequent patches. Signed-off-by: Alex Williams

[PATCH v2 1/9] pci: pci_default_cap_write_config ignores wmask

2010-11-12 Thread Alex Williamson
Make use of wmask, just like the rest of config space. Signed-off-by: Alex Williamson --- hw/pci.c | 22 ++ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 92aaa85..4bc5882 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1175,13 +1175,15

[PATCH v2 0/9] PCI capability and device assignment improvements

2010-11-12 Thread Alex Williamson
v2: - Fixed the function name in 1/8 per Michael's suggestion. - Removed capability specific config read/write registration - Added more checks to add_capability - Added capability lookup table to PCIDevice I've dropped the RFC patch to add more capabilities to device assignment while I do so

Re: 2.6.36 modprobe kvm-intel - general protection fault

2010-11-12 Thread Nikola Ciprich
Hi Avi, unfortunately I'm unable to reproduce this on any of my testing machine and I don't have access to problematic machine ATM. I'll report when I get chance to try again (and bisect if possible) n. On Tue, Nov 09, 2010 at 11:57:11AM +0200, Avi Kivity wrote: > On 11/08/2010 09:41 PM, Nikola Ci

Announce: Auto/Lazy-migration Patches RFC on linux-numa list

2010-11-12 Thread Lee Schermerhorn
At last weeks' LPC, there was some interest in my patches for Auto/Lazy Migration to improve locality and possibly performance of unpinned guest VMs on a NUMA platform. As a result of these conversations I have reposted the patches [4 series, ~40 patches] as RFCs to the linux-numa list. Links to

Re: [PATCH 1/8] pci: pci_default_cap_write_config ignores wmask

2010-11-12 Thread Alex Williamson
On Fri, 2010-11-12 at 10:48 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 11:03:19PM -0700, Alex Williamson wrote: > > On Fri, 2010-11-12 at 07:22 +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 11, 2010 at 07:55:01PM -0700, Alex Williamson wrote: > > > > Make use of wmask, just lik

Re: [RFC PATCH 8/8] device-assignment: pass through and stub more PCI caps

2010-11-12 Thread Alex Williamson
On Fri, 2010-11-12 at 11:11 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 11:30:07PM -0700, Alex Williamson wrote: > > On Fri, 2010-11-12 at 07:36 +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 11, 2010 at 07:56:46PM -0700, Alex Williamson wrote: > > > > Some drivers depend on find

Re: [PATCH 4/8] pci: Replace used bitmap with capability byte map

2010-11-12 Thread Alex Williamson
On Fri, 2010-11-12 at 11:02 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 11:07:15PM -0700, Alex Williamson wrote: > > On Fri, 2010-11-12 at 07:40 +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 11, 2010 at 07:55:43PM -0700, Alex Williamson wrote: > > > > Capabilities are allocated

Re: [PATCH v3 3/3] virtio-pci: Don't use ioeventfd on old kernels

2010-11-12 Thread Stefan Hajnoczi
On Fri, Nov 12, 2010 at 1:24 PM, Stefan Hajnoczi wrote: > @@ -1046,6 +1087,11 @@ int kvm_has_xcrs(void) >     return kvm_state->xcrs; >  } > > +int kvm_has_many_ioeventfds(void) > +{ > +    return kvm_state->many_ioeventfds; > +} > + Missing if (!kvm_enabled()) { return 0; }. Will fix in next ve

Re: [PATCH 6/8] device-assignment: Move PCI capabilities to match physical hardware

2010-11-12 Thread Alex Williamson
On Fri, 2010-11-12 at 11:20 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 07:56:13PM -0700, Alex Williamson wrote: > > Now that common PCI code doesn't have a hangup on capabilities > > being contiguous, > > Hmm, this comment confused me : there's no requirement of > contigious alloca

[PATCH v3 1/3] virtio-pci: Rename bugs field to flags

2010-11-12 Thread Stefan Hajnoczi
The VirtIOPCIProxy bugs field is currently used to enable workarounds for older guests. Rename it to flags so that other per-device behavior can be tracked. A later patch uses the flags field to remember whether ioeventfd should be used for virtqueue host notification. Signed-off-by: Stefan Hajn

[PATCH v3 2/3] virtio-pci: Use ioeventfd for virtqueue notify

2010-11-12 Thread Stefan Hajnoczi
Virtqueue notify is currently handled synchronously in userspace virtio. This prevents the vcpu from executing guest code while hardware emulation code handles the notify. On systems that support KVM, the ioeventfd mechanism can be used to make virtqueue notify a lightweight exit by deferring har

[PATCH v3 3/3] virtio-pci: Don't use ioeventfd on old kernels

2010-11-12 Thread Stefan Hajnoczi
There used to be a limit of 6 KVM io bus devices inside the kernel. On such a kernel, don't use ioeventfd for virtqueue host notification since the limit is reached too easily. This ensures that existing vhost-net setups (which always use ioeventfd) have ioeventfds available so they can continue

Re: [PATCH 2/3] virtio-pci: Use ioeventfd for virtqueue notify

2010-11-12 Thread Stefan Hajnoczi
On Fri, Nov 12, 2010 at 9:25 AM, Michael S. Tsirkin wrote: > On Fri, Nov 12, 2010 at 09:18:48AM +, Stefan Hajnoczi wrote: >> On Thu, Nov 11, 2010 at 3:53 PM, Michael S. Tsirkin wrote: >> > On Thu, Nov 11, 2010 at 01:47:21PM +, Stefan Hajnoczi wrote: >> >> Care must be taken not to interfe

Re: [Qemu-devel] [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT v2

2010-11-12 Thread Jes Sorensen
On 11/08/10 07:44, M. Mohan Kumar wrote: >> This patch introduce a fallback mechanism for old systems that do not >> support utimensat. This will fix build failure with following warnings: >> >> hw/virtio-9p-local.c: In function 'local_utimensat': >> hw/virtio-9p-local.c:479: warning: implicit dec

Re: [PATCH 6/7] KVM: assigned dev: MSI-X mask support

2010-11-12 Thread Michael S. Tsirkin
On Fri, Nov 12, 2010 at 06:54:01PM +0800, Sheng Yang wrote: > On Friday 12 November 2010 18:47:29 Michael S. Tsirkin wrote: > > On Fri, Nov 12, 2010 at 06:13:48PM +0800, Sheng Yang wrote: > > > On Friday 12 November 2010 17:53:13 Michael S. Tsirkin wrote: > > > > On Thu, Nov 11, 2010 at 03:46:59PM

Re: [PATCH 6/7] KVM: assigned dev: MSI-X mask support

2010-11-12 Thread Sheng Yang
On Friday 12 November 2010 18:47:29 Michael S. Tsirkin wrote: > On Fri, Nov 12, 2010 at 06:13:48PM +0800, Sheng Yang wrote: > > On Friday 12 November 2010 17:53:13 Michael S. Tsirkin wrote: > > > On Thu, Nov 11, 2010 at 03:46:59PM +0800, Sheng Yang wrote: > > > > This patch enable per-vector mask f

Re: [PATCH 6/7] KVM: assigned dev: MSI-X mask support

2010-11-12 Thread Michael S. Tsirkin
On Fri, Nov 12, 2010 at 06:13:48PM +0800, Sheng Yang wrote: > On Friday 12 November 2010 17:53:13 Michael S. Tsirkin wrote: > > On Thu, Nov 11, 2010 at 03:46:59PM +0800, Sheng Yang wrote: > > > This patch enable per-vector mask for assigned devices using MSI-X. > > > > > > This patch provided two

Re: [PATCH 2/4] KVM: MMU: rename 'reset_host_protection' to 'host_writeable'

2010-11-12 Thread Xiao Guangrong
On 11/12/2010 06:33 PM, Xiao Guangrong wrote: > From: Lai Jiangshan > > Rename it to fix the sense better > CCed to Lai Jiangshan -- 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.o

[PATCH 4/4] KVM: MMU: cleanup update_pte, pte_prefetch and sync_page functions

2010-11-12 Thread Xiao Guangrong
Some operation of these functions is very similar, so introduce a common function to cleanup them Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |3 - arch/x86/kvm/paging_tmpl.h | 191 --- 2 files changed, 107 insertions(+), 87 deletions

[PATCH 3/4] KVM: MMU: notrap it if gpte's reserved is set

2010-11-12 Thread Xiao Guangrong
We can past the page fault to guest directly if gpte's reserved is set Signed-off-by: Xiao Guangrong --- arch/x86/kvm/paging_tmpl.h | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 291342d..952357a 100

[PATCH 2/4] KVM: MMU: rename 'reset_host_protection' to 'host_writeable'

2010-11-12 Thread Xiao Guangrong
From: Lai Jiangshan Rename it to fix the sense better Signed-off-by: Lai Jiangshan Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |8 arch/x86/kvm/paging_tmpl.h | 10 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/a

[PATCH 1/4] KVM: MMU: don't drop spte if overwrite it from W to RO

2010-11-12 Thread Xiao Guangrong
We just need flush tlb if overwrite a writable spte with a read-only one Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 19 +-- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 4b6d54c..1a93ab4 100644 --- a/ar

Re: [PATCH 6/7] KVM: assigned dev: MSI-X mask support

2010-11-12 Thread Sheng Yang
On Friday 12 November 2010 17:53:13 Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 03:46:59PM +0800, Sheng Yang wrote: > > This patch enable per-vector mask for assigned devices using MSI-X. > > > > This patch provided two new APIs: one is for guest to specific device's > > MSI-X table addres

Re: [PATCH 6/7] KVM: assigned dev: MSI-X mask support

2010-11-12 Thread Michael S. Tsirkin
On Thu, Nov 11, 2010 at 03:46:59PM +0800, Sheng Yang wrote: > This patch enable per-vector mask for assigned devices using MSI-X. > > This patch provided two new APIs: one is for guest to specific device's MSI-X > table address in MMIO, the other is for userspace to get information about > mask >

Re: [PATCH 2/3] virtio-pci: Use ioeventfd for virtqueue notify

2010-11-12 Thread Michael S. Tsirkin
On Fri, Nov 12, 2010 at 09:18:48AM +, Stefan Hajnoczi wrote: > On Thu, Nov 11, 2010 at 3:53 PM, Michael S. Tsirkin wrote: > > On Thu, Nov 11, 2010 at 01:47:21PM +, Stefan Hajnoczi wrote: > >> Care must be taken not to interfere with vhost-net, which already uses > >> ioeventfd host notifie

Re: [PATCH 6/8] device-assignment: Move PCI capabilities to match physical hardware

2010-11-12 Thread Michael S. Tsirkin
On Thu, Nov 11, 2010 at 07:56:13PM -0700, Alex Williamson wrote: > Now that common PCI code doesn't have a hangup on capabilities > being contiguous, Hmm, this comment confused me : there's no requirement of contigious allocations in current code in pci.c, is there? -- MST -- To unsubscribe from

Re: [Qemu-devel] Re: [PATCH 2/3] virtio-pci: Use ioeventfd for virtqueue notify

2010-11-12 Thread Stefan Hajnoczi
On Thu, Nov 11, 2010 at 4:45 PM, Christoph Hellwig wrote: > On Thu, Nov 11, 2010 at 01:47:21PM +, Stefan Hajnoczi wrote: >> Some virtio devices are known to have guest drivers which expect a notify to >> be >> processed synchronously and spin waiting for completion.  Only enable >> ioeventfd

Re: [PATCH 2/3] virtio-pci: Use ioeventfd for virtqueue notify

2010-11-12 Thread Stefan Hajnoczi
On Thu, Nov 11, 2010 at 3:53 PM, Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 01:47:21PM +, Stefan Hajnoczi wrote: >> Care must be taken not to interfere with vhost-net, which already uses >> ioeventfd host notifiers.  The following list shows the behavior implemented >> in >> this pat

Re: [RFC PATCH 8/8] device-assignment: pass through and stub more PCI caps

2010-11-12 Thread Michael S. Tsirkin
On Thu, Nov 11, 2010 at 11:30:07PM -0700, Alex Williamson wrote: > On Fri, 2010-11-12 at 07:36 +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 11, 2010 at 07:56:46PM -0700, Alex Williamson wrote: > > > Some drivers depend on finding capabilities like power management, > > > PCI express/X, vital pr

Re: [PATCH 4/8] pci: Replace used bitmap with capability byte map

2010-11-12 Thread Michael S. Tsirkin
On Thu, Nov 11, 2010 at 11:07:15PM -0700, Alex Williamson wrote: > On Fri, 2010-11-12 at 07:40 +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 11, 2010 at 07:55:43PM -0700, Alex Williamson wrote: > > > Capabilities are allocated in bytes, so we can track both whether > > > a byte is used and by wh

Re: [PATCH 1/8] pci: pci_default_cap_write_config ignores wmask

2010-11-12 Thread Michael S. Tsirkin
On Thu, Nov 11, 2010 at 11:03:19PM -0700, Alex Williamson wrote: > On Fri, 2010-11-12 at 07:22 +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 11, 2010 at 07:55:01PM -0700, Alex Williamson wrote: > > > Make use of wmask, just like the rest of config space. > > > > > > Signed-off-by: Alex Williams