Re: [patch 02/18] x86: kvmclock: allocate pvclock shared memory area (v2)

2012-11-15 Thread Glauber Costa
On 11/16/2012 06:07 AM, Marcelo Tosatti wrote: > > We want to expose the pvclock shared memory areas, which > the hypervisor periodically updates, to userspace. > > For a linear mapping from userspace, it is necessary that > entire page sized regions are used for array of pvclock > structures.

Re: [PATCH] KVM: MMU: lazily drop large spte

2012-11-15 Thread Xiao Guangrong
On 11/16/2012 11:56 AM, Marcelo Tosatti wrote: > On Fri, Nov 16, 2012 at 11:39:12AM +0800, Xiao Guangrong wrote: >> On 11/16/2012 11:02 AM, Marcelo Tosatti wrote: >>> On Thu, Nov 15, 2012 at 07:17:15AM +0800, Xiao Guangrong wrote: On 11/14/2012 10:37 PM, Marcelo Tosatti wrote: > On Tue, No

Re: [PATCH] KVM: MMU: lazily drop large spte

2012-11-15 Thread Marcelo Tosatti
On Fri, Nov 16, 2012 at 11:39:12AM +0800, Xiao Guangrong wrote: > On 11/16/2012 11:02 AM, Marcelo Tosatti wrote: > > On Thu, Nov 15, 2012 at 07:17:15AM +0800, Xiao Guangrong wrote: > >> On 11/14/2012 10:37 PM, Marcelo Tosatti wrote: > >>> On Tue, Nov 13, 2012 at 04:26:16PM +0800, Xiao Guangrong wro

Re: [PATCH] KVM: MMU: lazily drop large spte

2012-11-15 Thread Xiao Guangrong
On 11/16/2012 11:02 AM, Marcelo Tosatti wrote: > On Thu, Nov 15, 2012 at 07:17:15AM +0800, Xiao Guangrong wrote: >> On 11/14/2012 10:37 PM, Marcelo Tosatti wrote: >>> On Tue, Nov 13, 2012 at 04:26:16PM +0800, Xiao Guangrong wrote: Hi Marcelo, On 11/13/2012 07:10 AM, Marcelo Tosatti w

Re: [RFC PATCH 0/2] kvm/vmx: Output TSC offset

2012-11-15 Thread Marcelo Tosatti
On Wed, Nov 14, 2012 at 10:36:21AM +0900, Yoshihiro YUNOMAE wrote: > Hi All, > > The following patch set can make disordered trace data of a guest and a host > sorted in chronological order. > > In a virtualization environment, it is difficult to analyze performance > problems, such as a delay of

Re: [PATCH] KVM: MMU: lazily drop large spte

2012-11-15 Thread Marcelo Tosatti
On Thu, Nov 15, 2012 at 07:17:15AM +0800, Xiao Guangrong wrote: > On 11/14/2012 10:37 PM, Marcelo Tosatti wrote: > > On Tue, Nov 13, 2012 at 04:26:16PM +0800, Xiao Guangrong wrote: > >> Hi Marcelo, > >> > >> On 11/13/2012 07:10 AM, Marcelo Tosatti wrote: > >>> On Mon, Nov 05, 2012 at 05:59:26PM +08

[patch 02/18] x86: kvmclock: allocate pvclock shared memory area (v2)

2012-11-15 Thread Marcelo Tosatti
We want to expose the pvclock shared memory areas, which the hypervisor periodically updates, to userspace. For a linear mapping from userspace, it is necessary that entire page sized regions are used for array of pvclock structures. There is no such guarantee with per cpu areas, therefore mov

[patch 07/18] x86: pvclock: add note about rdtsc barriers (v2)

2012-11-15 Thread Marcelo Tosatti
As noted by Gleb, not advertising SSE2 support implies no RDTSC barriers. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/include/asm/pvclock.h === --- vsyscall.orig/arch/x86/include/asm/pvclock.h +++ vsyscall/arch/x86/incl

Resend [PATCH] Enabling IA32_TSC_ADJUST for Qemu KVM guest VMs

2012-11-15 Thread Will Auld
CPUID.7.0.EBX[1]=1 indicates IA32_TSC_ADJUST MSR 0x3b is supported Basic design is to emulate the MSR by allowing reads and writes to the hypervisor vcpu specific locations to store the value of the emulated MSRs. In this way the IA32_TSC_ADJUST value will be included in all reads to the TSC MSR w

[PATCH 2/2] Enabling IA32_TSC_ADJUST for KVM guest VM support

2012-11-15 Thread Will Auld
CPUID.7.0.EBX[1]=1 indicates IA32_TSC_ADJUST MSR 0x3b is supported Basic design is to emulate the MSR by allowing reads and writes to a guest vcpu specific location to store the value of the emulated MSR while adding the value to the vmcs tsc_offset. In this way the IA32_TSC_ADJUST value will be i

[PATCH 1/2] Add code to track call origin for msr assignment.

2012-11-15 Thread Will Auld
In order to track who initiated the call (host or guest) to modify an msr value I have changed function call parameters along the call path. The specific change is to add a struct pointer parameter that points to (index, data, caller) information rather than having this information passed as indivi

[PATCH 0/2] Resend V2 of patch set to enable guest use of TSC_ADJUST functionality

2012-11-15 Thread Will Auld
Adding Gleb. This is a resend of the patches for TSC_ADJUST functionality. The two KVM patches and an additional QEMU-KVM patch together provide this support. Will Auld (2): Add code to track call origin for msr assignment. Enabling IA32_TSC_ADJUST for KVM guest VM support arch/x86/inclu

Re: [PATCH v2 1/3] VFIO: unregister IOMMU notifier on error recovery path

2012-11-15 Thread Alex Williamson
On Fri, 2012-11-16 at 00:43 +0800, Jiang Liu wrote: > On error recovery path in function vfio_create_group(), it should > unregister the IOMMU notifier for the new VFIO group. Otherwise it may > cause invalid memory access later when handling bus notifications. > > Signed-off-by: Jiang Liu > ---

[PATCH v2 1/3] VFIO: unregister IOMMU notifier on error recovery path

2012-11-15 Thread Jiang Liu
On error recovery path in function vfio_create_group(), it should unregister the IOMMU notifier for the new VFIO group. Otherwise it may cause invalid memory access later when handling bus notifications. Signed-off-by: Jiang Liu --- drivers/vfio/vfio.c | 31 +++ 1 f

[PATCH v2 2/3] VFIO: use ACCESS_ONCE() to guard access to dev->driver

2012-11-15 Thread Jiang Liu
Comments from dev_driver_string(), /* dev->driver can change to NULL underneath us because of unbinding, * so be careful about accessing it. */ So use ACCESS_ONCE() to guard access to dev->driver field. Signed-off-by: Jiang Liu --- drivers/vfio/vfio.c |3 ++- 1 file changed, 2 insertions(

[PATCH v2 3/3] VFIO: fix out of order labels for error recovery in vfio_pci_init()

2012-11-15 Thread Jiang Liu
The two labels for error recovery in function vfio_pci_init() is out of order, so fix it. Signed-off-by: Jiang Liu --- drivers/vfio/pci/vfio_pci.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 6968b72..d

[PATCH] vfio-pci: Re-order device reset

2012-11-15 Thread Alex Williamson
Move the device reset to the end of our disable path, the device should already be stopped from pci_disable_device(). This also allows us to manipulate the save/restore to avoid the save/reset/restore + save/restore that we had before. Signed-off-by: Alex Williamson --- Hannes, I think this doe

RE: virtio + vhost-net performance issue - preadv ?

2012-11-15 Thread Ben Clay
David- Thanks for the followup. That is disappointing, and I wish I knew why the performance is so poor. With the kernel and qemu replaced, I don't know where the limitation is - raising the MTU makes no difference, and I also tried a few different kernels inside the guest. The network stack ca

RE: PROBLEM: compilation issue, inline assembly arch/x86/kvm/emulate.c fails at -O0

2012-11-15 Thread Blower, Melanie
Thanks for your reply. As you agree there is an actual bug in this code, would you kindly be able to tell me when a fix would be available in the Linux trunk? Thanks and best regards, Melanie Blower -Original Message- From: H. Peter Anvin [mailto:h...@zytor.com] Sent: Wednesday, November

Re: [patch 18/18] KVM: x86: update pvclock area conditionally, on cpu migration

2012-11-15 Thread Glauber Costa
On 11/15/2012 04:08 AM, Marcelo Tosatti wrote: > As requested by Glauber, do not update kvmclock area on vcpu->pcpu > migration, in case the host has stable TSC. > > This is to reduce cacheline bouncing. > > Signed-off-by: Marcelo Tosatti This looks fine, but it can always get tricky... Assumi

Re: [patch 07/18] x86: pvclock: add note about rdtsc barriers

2012-11-15 Thread Glauber Costa
On 11/15/2012 04:08 AM, Marcelo Tosatti wrote: > As noted by Gleb, not advertising SSE2 support implies > no RDTSC barriers. > > Signed-off-by: Marcelo Tosatti And this gets a separate patch because? > Index: vsyscall/arch/x86/include/asm/pvclock.h >

Re: [patch 06/18] x86: pvclock: introduce helper to read flags

2012-11-15 Thread Glauber Costa
On 11/15/2012 04:08 AM, Marcelo Tosatti wrote: > Signed-off-by: Marcelo Tosatti > > > Index: vsyscall/arch/x86/kernel/pvclock.c > === > --- vsyscall.orig/arch/x86/kernel/pvclock.c Acked-by: Glauber Costa -- To unsubscribe from thi

Re: [patch 05/18] x86: pvclock: create helper for pvclock data retrieval

2012-11-15 Thread Glauber Costa
On 11/15/2012 04:08 AM, Marcelo Tosatti wrote: > Originally from Jeremy Fitzhardinge. > > So code can be reused. > > Signed-off-by: Marcelo Tosatti > I thought I had acked this one already? But maybe I didn't... Acked-by: Glauber Costa -- To unsubscribe from this list: send the line "unsubsc

[Question] Intercept read access in KVM

2012-11-15 Thread R
Hi, everyone I am studying KVM code. And I try to intercept a guest's read access to a page using VMX and EPT support. According to Intel Manual, the lowest bit of the EPT page table entry is used to control read access to a page. I modified the rmap_write_protect function to remove the VMX_EPT

Re: [patch 02/18] x86: kvmclock: allocate pvclock shared memory area

2012-11-15 Thread Glauber Costa
On 11/15/2012 04:08 AM, Marcelo Tosatti wrote: > We want to expose the pvclock shared memory areas, which > the hypervisor periodically updates, to userspace. > > For a linear mapping from userspace, it is necessary that > entire page sized regions are used for array of pvclock > structures. >