[PATCH v2] KVM: x86: Check INVPCID feature bit in EBX of leaf 7

2012-09-07 Thread Ren, Yongjie
Checks and operations on the INVPCID feature bit should use EBX of CPUID leaf 7 instead of ECX. Changes from v1: - fixed patch format issue. Signed-off-by: Junjie Mao Signed-off-by: Yongjie Ren --- arch/x86/kvm/vmx.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 2/3] update kvm related the head file from kernel

2012-09-07 Thread Liu Sheng
updated the head file from kernel for readonly memory feature. Signed-off-by: Liu Sheng --- linux-headers/asm-x86/kvm.h |1 + linux-headers/linux/kvm.h | 16 +--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x

[PATCH 0/3] support kvm readonly memory slot in qemu

2012-09-07 Thread Liu Sheng
This patch set make the readonly memory in qemu really readonly, using readonly memory slots feature in kvm, to make qemu-kvm safer. Memory regions with readonly property would be plug into kvm as readonly memory slots. This patch set depends on the last patch "Introduce write_readonly_mem in mm

[PATCH 1/3] set the readonly property of rom memory region in pc

2012-09-07 Thread Liu Sheng
make sure the memory regions of rom in pc have readonly property, prepare for plug these memory to kvm as readonly memory slots. Signed-off-by: Liu Sheng --- hw/pc.c |1 + hw/pci.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index c32ee8e..b7fb

[PATCH 3/3] support readonly memory feature in qemu

2012-09-07 Thread Liu Sheng
as readonly memory is support in kvm, this patch supports this feature in qemu, mainly pluging the memory region with KVM_MEM_READONLY flag to kvm. this can be tested by a kernel module from the author of kvm readonly memory slot: static int rom_tester_probe(struct pci_dev *dev, const struct pci_

Re: [RFC v2 PATCH 00/21] KVM: x86: CPU isolation and direct interrupts delivery to guests

2012-09-07 Thread Jan Kiszka
On 2012-09-06 13:27, Tomoki Sekiyama wrote: > This RFC patch series provides facility to dedicate CPUs to KVM guests > and enable the guests to handle interrupts from passed-through PCI devices > directly (without VM exit and relay by the host). > > With this feature, we can improve throughput and

Re: [PATCH 2/3] update kvm related the head file from kernel

2012-09-07 Thread Jan Kiszka
On 2012-09-07 10:26, Liu Sheng wrote: > updated the head file from kernel for readonly memory > feature. > > Signed-off-by: Liu Sheng > --- > linux-headers/asm-x86/kvm.h |1 + > linux-headers/linux/kvm.h | 16 +--- > 2 files changed, 14 insertions(+), 3 deletions(-) > > diff

Re: [PATCH 3/3] support readonly memory feature in qemu

2012-09-07 Thread Jan Kiszka
On 2012-09-07 10:26, Liu Sheng wrote: > as readonly memory is support in kvm, this patch supports this feature > in qemu, mainly pluging the memory region with KVM_MEM_READONLY flag > to kvm. > > this can be tested by a kernel module from the author of kvm readonly > memory slot: > > static int r

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 08:39, Rusty Russell ha scritto: >> > So it looks like a bug: we should teach driver to tell host first on leak? >> > Yan, Vadim, can you comment please? >> > >> > Also if true, looks like this bit will be useful to detect a fixed driver >> > on >> > the hypervisor side - to avoid un

Re: [PATCH 2/3] update kvm related the head file from kernel

2012-09-07 Thread Xiao Guangrong
Hi Jan, Thanks for your review. On 09/07/2012 04:49 PM, Jan Kiszka wrote: >> +#ifdef __KVM_HAVE_READONLY_MEM >> +__u8 write_readonly_mem; >> +#endif >> } mmio; >> /* KVM_EXIT_HYPERCALL */ >> struct { >> @@ -618,6 +625,9 @@ struct kvm_ppc

Re: [PATCH v6 12/12] KVM: indicate readonly access fault

2012-09-07 Thread Xiao Guangrong
On 09/06/2012 10:09 PM, Avi Kivity wrote: > On 08/22/2012 03:47 PM, Xiao Guangrong wrote: >> On 08/22/2012 08:06 PM, Avi Kivity wrote: >>> On 08/21/2012 06:03 AM, Xiao Guangrong wrote: Introduce write_readonly_mem in mmio-exit-info to indicate this exit is caused by write access on readon

Re: [PATCH 2/3] update kvm related the head file from kernel

2012-09-07 Thread Jan Kiszka
On 2012-09-07 11:39, Xiao Guangrong wrote: > Hi Jan, > > Thanks for your review. > > On 09/07/2012 04:49 PM, Jan Kiszka wrote: > >>> +#ifdef __KVM_HAVE_READONLY_MEM >>> + __u8 write_readonly_mem; >>> +#endif >>> } mmio; >>> /* KVM_EXIT_HYPERCALL */ >>>

Re: [PATCH v6 11/12] KVM: introduce readonly memslot

2012-09-07 Thread Jan Kiszka
On 2012-08-21 05:02, Xiao Guangrong wrote: > In current code, if we map a readonly memory space from host to guest > and the page is not currently mapped in the host, we will get a fault > pfn and async is not allowed, then the vm will crash > > We introduce readonly memory region to map ROM/ROMD

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Michael S. Tsirkin
On Fri, Sep 07, 2012 at 04:09:50PM +0930, Rusty Russell wrote: > > So it looks like a bug: we should teach driver to tell host first on leak? > > Yan, Vadim, can you comment please? > > > > Also if true, looks like this bit will be useful to detect a fixed driver on > > the hypervisor side - to avo

Re: [PATCH v6 11/12] KVM: introduce readonly memslot

2012-09-07 Thread Xiao Guangrong
On 09/07/2012 06:23 PM, Jan Kiszka wrote: > On 2012-08-21 05:02, Xiao Guangrong wrote: >> In current code, if we map a readonly memory space from host to guest >> and the page is not currently mapped in the host, we will get a fault >> pfn and async is not allowed, then the vm will crash >> >> We i

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Michael S. Tsirkin
On Fri, Sep 07, 2012 at 11:27:42AM +0200, Paolo Bonzini wrote: > Il 07/09/2012 08:39, Rusty Russell ha scritto: > >> > So it looks like a bug: we should teach driver to tell host first on > >> > leak? > >> > Yan, Vadim, can you comment please? > >> > > >> > Also if true, looks like this bit will b

Re: [PATCH v6 11/12] KVM: introduce readonly memslot

2012-09-07 Thread Jan Kiszka
On 2012-09-07 12:47, Xiao Guangrong wrote: > On 09/07/2012 06:23 PM, Jan Kiszka wrote: >> On 2012-08-21 05:02, Xiao Guangrong wrote: >>> In current code, if we map a readonly memory space from host to guest >>> and the page is not currently mapped in the host, we will get a fault >>> pfn and async

[PATCH] KVM: Improve wording of KVM_SET_USER_MEMORY_REGION documentation

2012-09-07 Thread Jan Kiszka
Signed-off-by: Jan Kiszka --- Documentation/virtual/kvm/api.txt | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index b91bfd4..36befa7 100644 --- a/Documentation/virtual/kvm/api.

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 12:53, Michael S. Tsirkin ha scritto: > Let us start with what is broken currently. Looking at > it very closely, I think the answer is nothing. > Even migration in qemu is not broken as you claimed initially. Correct, migration would be broken as soon as QEMU starts using MUST_TELL_

RE: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured

2012-09-07 Thread Liu, Jinsong
Avi Kivity wrote: >> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >> index 148ed66..0e64997 100644 >> --- a/arch/x86/kvm/x86.c >> +++ b/arch/x86/kvm/x86.c >> @@ -2210,7 +2210,11 @@ int kvm_dev_ioctl_check_extension(long ext) >> r = kvm_has_tsc_control; break; >> case KVM_

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Michael S. Tsirkin
On Fri, Sep 07, 2012 at 01:20:57PM +0200, Paolo Bonzini wrote: > Il 07/09/2012 12:53, Michael S. Tsirkin ha scritto: > > Let us start with what is broken currently. Looking at > > it very closely, I think the answer is nothing. > > Even migration in qemu is not broken as you claimed initially. > >

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 14:17, Michael S. Tsirkin ha scritto: >>> Next, consider the interface proposed here. You defacto declare >>> all existing drivers buggy. >> >> No, only Windows (and it is buggy, it calls tell_host last). > > It is not buggy. It does not ack MUST_TELL_HOST. So it is free to tell > ho

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Michael S. Tsirkin
On Fri, Sep 07, 2012 at 02:22:47PM +0200, Paolo Bonzini wrote: > Il 07/09/2012 14:17, Michael S. Tsirkin ha scritto: > >>> Next, consider the interface proposed here. You defacto declare > >>> all existing drivers buggy. > >> > >> No, only Windows (and it is buggy, it calls tell_host last). > > >

[RFC][PATCH] Improving directed yield scalability for PLE handler

2012-09-07 Thread Andrew Theurer
I have noticed recently that PLE/yield_to() is still not that scalable for really large guests, sometimes even with no CPU over-commit. I have a small change that make a very big difference. First, let me explain what I saw: Time to boot a 3.6-rc kernel in an 80-way VM on a 4 socket, 40 core, 80

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 14:44, Michael S. Tsirkin ha scritto: >> Well, according to your reading of the spec. >> >> In the spec I'm reading "Host must be told before pages from the balloon >> are used". Doesn't say anything about the guest. > > No? How is host told then? By divine force? For a simple madv

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Michael S. Tsirkin
On Fri, Sep 07, 2012 at 04:04:13PM +0200, Paolo Bonzini wrote: > Il 07/09/2012 14:44, Michael S. Tsirkin ha scritto: > >> Well, according to your reading of the spec. > >> > >> In the spec I'm reading "Host must be told before pages from the balloon > >> are used". Doesn't say anything about the g

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 16:25, Michael S. Tsirkin ha scritto: >> > Silent deflate is deflating just by using the page, without using the >> > deflateq at all. So it can be done even from GFP_ATOMIC context. > BTW I don't see a need to avoid deflateq. > Without MUST_TELL_HOST you can just deflate and then >

Re: [PATCH 4/5] virtio-scsi: Add start/stop functionality for vhost-scsi

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 08:48, Nicholas A. Bellinger ha scritto: > Cc: Stefan Hajnoczi > Cc: Zhi Yong Wu > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Signed-off-by: Nicholas Bellinger > --- > hw/virtio-pci.c |2 ++ > hw/virtio-scsi.c | 49 + > hw

Re: [RFC][PATCH] Improving directed yield scalability for PLE handler

2012-09-07 Thread Raghavendra K T
CCing PeterZ also. On 09/07/2012 06:41 PM, Andrew Theurer wrote: I have noticed recently that PLE/yield_to() is still not that scalable for really large guests, sometimes even with no CPU over-commit. I have a small change that make a very big difference. First, let me explain what I saw: Tim

Re: [PATCH 4/5] virtio-scsi: Add start/stop functionality for vhost-scsi

2012-09-07 Thread Nicholas A. Bellinger
On Fri, 2012-09-07 at 18:00 +0200, Paolo Bonzini wrote: > Il 07/09/2012 08:48, Nicholas A. Bellinger ha scritto: > > Cc: Stefan Hajnoczi > > Cc: Zhi Yong Wu > > Cc: Michael S. Tsirkin > > Cc: Paolo Bonzini > > Signed-off-by: Nicholas Bellinger > > --- > > hw/virtio-pci.c |2 ++ > > hw/vi

Re: [RFC][PATCH] Improving directed yield scalability for PLE handler

2012-09-07 Thread Andrew Theurer
On Fri, 2012-09-07 at 23:36 +0530, Raghavendra K T wrote: > CCing PeterZ also. > > On 09/07/2012 06:41 PM, Andrew Theurer wrote: > > I have noticed recently that PLE/yield_to() is still not that scalable > > for really large guests, sometimes even with no CPU over-commit. I have > > a small chang

Re: [PATCH 4/5] virtio-scsi: Add start/stop functionality for vhost-scsi

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 21:23, Nicholas A. Bellinger ha scritto: >> > Please create a completely separate device vhost-scsi-pci instead (or >> > virtio-scsi-tcm-pci, or something like that). It is used completely >> > differently from virtio-scsi-pci, it does not make sense to conflate the >> > two. >> > >

Re: [PATCH 1/2] PCI: Use local parameter pci_device_id for pci_get_subsys/class()

2012-09-07 Thread Yinghai Lu
On Thu, Aug 23, 2012 at 12:45 AM, Feng Tang wrote: > From 57a28ee5e7662ca28ba4c793aa037d64bd082dee Mon Sep 17 00:00:00 2001 > From: Feng Tang > Date: Wed, 22 Aug 2012 15:41:51 +0800 > Subject: [PATCH 1/2] PCI: Use local parameter pci_device_id for > pci_get_subsys/class() > > This fixes a kernel

Re: [PATCH 1/2] PCI: Use local parameter pci_device_id for pci_get_subsys/class()

2012-09-07 Thread Yinghai Lu
On Fri, Sep 7, 2012 at 6:00 PM, Yinghai Lu wrote: > On Thu, Aug 23, 2012 at 12:45 AM, Feng Tang wrote: >> From 57a28ee5e7662ca28ba4c793aa037d64bd082dee Mon Sep 17 00:00:00 2001 >> From: Feng Tang >> Date: Wed, 22 Aug 2012 15:41:51 +0800 >> Subject: [PATCH 1/2] PCI: Use local parameter pci_device

Re: [PATCH 1/2] PCI: Use local parameter pci_device_id for pci_get_subsys/class()

2012-09-07 Thread Greg Kroah-Hartman
On Fri, Sep 07, 2012 at 06:32:48PM -0700, Yinghai Lu wrote: > Greg, > > Any reason for using kmalloc instead of local variable during your > rewriting pci search code? > > commit 95247b57ed844511a212265b45cf9a919753aea1 > Author: Greg Kroah-Hartman > Date: Wed Feb 13 11:03:58 2008 -0800 Serio

Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works

2012-09-07 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Sep 07, 2012 at 04:09:50PM +0930, Rusty Russell wrote: >> > So it looks like a bug: we should teach driver to tell host first on leak? >> > Yan, Vadim, can you comment please? >> > >> > Also if true, looks like this bit will be useful to detect a fixed driver