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

2012-11-14 Thread Yoshihiro YUNOMAE
Thank you for commenting on my patch set. (2012/11/14 11:31), Steven Rostedt wrote: On Tue, 2012-11-13 at 18:03 -0800, David Sharp wrote: On Tue, Nov 13, 2012 at 6:00 PM, Steven Rostedt wrote: On Wed, 2012-11-14 at 10:36 +0900, Yoshihiro YUNOMAE wrote: To merge the data like previous patter

Re: [PATCH v3 2/2] KVM: make crash_clear_loaded_vmcss valid when loading kvm_intel module

2012-11-14 Thread zhangyanfei
于 2012年11月14日 05:22, Marcelo Tosatti 写道: > On Thu, Nov 01, 2012 at 01:55:04PM +0800, zhangyanfei wrote: >> 于 2012年10月31日 17:01, Hatayama, Daisuke 写道: >>> >>> -Original Message- From: kexec-boun...@lists.infradead.org [mailto:kexec-boun...@lists.infradead.org] On Behalf Of zha

[PATCH v4 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-11-14 Thread zhangyanfei
Currently, kdump just makes all the logical processors leave VMX operation by executing VMXOFF instruction, so any VMCSs active on the logical processors may be corrupted. But, sometimes, we need the VMCSs to debug guest images contained in the host vmcore. To prevent the corruption, we should VMCL

[PATCH v4 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-11-14 Thread zhangyanfei
crash_clear_loaded_vmcss is added to VMCLEAR vmcss loaded on all cpus. And when loading kvm_intel module, the function pointer will be made valid. The percpu variable vmclear_skipped is added to flag the case that if loaded_vmcss_on_cpu list is being modified while the machine crashes and doing kdu

[PATCH v4 2/2] KVM: set/unset crash_clear_loaded_vmcss and vmclear_skipped in kvm_intel module

2012-11-14 Thread zhangyanfei
Signed-off-by: Zhang Yanfei --- arch/x86/kvm/vmx.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4ff0ab9..029ec7b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -41,6 +41,7 @@ #i

Re: [patch 10/16] x86: vdso: pvclock gettime support

2012-11-14 Thread Gleb Natapov
On Wed, Oct 31, 2012 at 08:47:06PM -0200, Marcelo Tosatti wrote: > Improve performance of time system calls when using Linux pvclock, > by reading time info from fixmap visible copy of pvclock data. > > Originally from Jeremy Fitzhardinge. > > Signed-off-by: Marcelo Tosatti > > Index: vsyscall

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

2012-11-14 Thread Marcelo Tosatti
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 +0800, Xiao Guangrong wrote: > >> Do not drop large spte until it can be insteaded by small pages so that > >> the guest can happl

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

2012-11-14 Thread Marcelo Tosatti
On Wed, Nov 14, 2012 at 12:33:50AM +0900, Takuya Yoshikawa wrote: > Ccing live migration developers who should be interested in this work, > > On Mon, 12 Nov 2012 21:10:32 -0200 > Marcelo Tosatti wrote: > > > On Mon, Nov 05, 2012 at 05:59:26PM +0800, Xiao Guangrong wrote: > > > Do not drop large

Re: [PULL 0/3] vfio-pci for 1.3-rc0

2012-11-14 Thread Anthony Liguori
Alex Williamson writes: > Hi Anthony, > > Please pull the tag below. I posted the linux-headers update > separately on Oct-15; since it hasn't been applied and should be > non-controversial, I include it again here. Thanks, > > Alex > Pulled. Thanks. Regards, Anthony Liguori > The following

Re: interrupt remapping support

2012-11-14 Thread Gleb Natapov
On Wed, Nov 14, 2012 at 05:46:45PM +0100, emdel wrote: > On Tue, Nov 13, 2012 at 10:29 AM, Gleb Natapov wrote: > > > KVM does not implement VT-d spec if this is your question. Any help with > > this will be appreciated. > > > > Hello everybody, > following this link [1] it looks like that we can

Re: interrupt remapping support

2012-11-14 Thread Gleb Natapov
On Wed, Nov 14, 2012 at 06:31:30PM +0100, emdel wrote: > On Wed, Nov 14, 2012 at 6:06 PM, Gleb Natapov wrote: > > > KVM uses VT-d on a host for device assignment. Guest running inside KVM > > will not see VT-d though since KVM does not emulate it. > > > > So another question comes up in my mind:

Re: [PATCH 04/20] KVM/MIPS32: MIPS arch specific APIs for KVM

2012-11-14 Thread Sanjay Lal
On Nov 1, 2012, at 11:18 AM, Avi Kivity wrote: >> + >> +/* Set the appropriate status bits based on host CPU features, before >> we hit the scheduler */ >> +kvm_mips_set_c0_status(); >> + >> +local_irq_enable(); > > Ah, so you handle exits with interrupts enabled. But that's not ho

Re: [patch 10/16] x86: vdso: pvclock gettime support

2012-11-14 Thread Marcelo Tosatti
On Wed, Nov 14, 2012 at 12:42:48PM +0200, Gleb Natapov wrote: > On Wed, Oct 31, 2012 at 08:47:06PM -0200, Marcelo Tosatti wrote: > > Improve performance of time system calls when using Linux pvclock, > > by reading time info from fixmap visible copy of pvclock data. > > > > Originally from Jeremy

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

2012-11-14 Thread Xiao Guangrong
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 +0800, Xiao Guangrong wrote: Do not drop large spte until it can be instea

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

2012-11-14 Thread Xiao Guangrong
On 11/14/2012 10:44 PM, Marcelo Tosatti wrote: > On Wed, Nov 14, 2012 at 12:33:50AM +0900, Takuya Yoshikawa wrote: >> Ccing live migration developers who should be interested in this work, >> >> On Mon, 12 Nov 2012 21:10:32 -0200 >> Marcelo Tosatti wrote: >> >>> On Mon, Nov 05, 2012 at 05:59:26PM

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

2012-11-14 Thread H. Peter Anvin
On 11/14/2012 11:45 AM, Blower, Melanie wrote: [1.] gcc -O0 assembly arch/x86/kvm/emulate.c gets compilation failure -- incorrect register restrictions [2.] Full description of the problem/report: I'm trying to compile this file at -O0, but gcc chokes in register allocation at the inline assemb

[PATCH 0/2] [PULL] qemu-kvm.git uq/master queue

2012-11-14 Thread Marcelo Tosatti
The following changes since commit ce34cf72fe508b27a78f83c184142e8d1e6a048a: Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-1.3.0-rc0' into staging (2012-11-14 08:53:40 -0600) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master

[patch 11/18] x86: vdso: pvclock gettime support

2012-11-14 Thread Marcelo Tosatti
Improve performance of time system calls when using Linux pvclock, by reading time info from fixmap visible copy of pvclock data. Originally from Jeremy Fitzhardinge. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/vdso/vclock_gettime.c =

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

2012-11-14 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/inclu

[patch 09/18] x86: pvclock: generic pvclock vsyscall initialization

2012-11-14 Thread Marcelo Tosatti
Originally from Jeremy Fitzhardinge. Introduce generic, non hypervisor specific, pvclock initialization routines. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kernel/pvclock.c === --- vsyscall.orig/arch/x86/kernel/pvclo

[PATCH 2/2] kvm: Actually remove software breakpoints from list on cleanup

2012-11-14 Thread Marcelo Tosatti
From: Jan Kiszka So far we only removed them from the guest, leaving its states in the list. This made it impossible for gdb to re-enable breakpoints on the same address after re-attaching. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c |2 ++ 1 files changed, 2 in

[patch 00/18] pvclock vsyscall support + KVM hypervisor support (v4)

2012-11-14 Thread Marcelo Tosatti
This patchset, based on earlier work by Jeremy Fitzhardinge, implements paravirtual clock vsyscall support. It should be possible to implement Xen support relatively easily. It reduces clock_gettime from 500 cycles to 200 cycles on my testbox. Please review. v4: - remove aligned_pvti structure

[patch 08/18] sched: add notifier for cross-cpu migrations

2012-11-14 Thread Marcelo Tosatti
Originally from Jeremy Fitzhardinge. Signed-off-by: Marcelo Tosatti Index: vsyscall/include/linux/sched.h === --- vsyscall.orig/include/linux/sched.h +++ vsyscall/include/linux/sched.h @@ -107,6 +107,14 @@ extern unsigned long this_

[patch 15/18] KVM: x86: implement PVCLOCK_TSC_STABLE_BIT pvclock flag

2012-11-14 Thread Marcelo Tosatti
KVM added a global variable to guarantee monotonicity in the guest. One of the reasons for that is that the time between 1. ktime_get_ts(×pec); 2. rdtscll(tsc); Is variable. That is, given a host with stable TSC, suppose that two VCPUs read the same time via ktime_get_ts() above.

[patch 13/18] time: export time information for KVM pvclock

2012-11-14 Thread Marcelo Tosatti
As suggested by John, export time data similarly to how its done by vsyscall support. This allows KVM to retrieve necessary information to implement vsyscall support in KVM guests. Signed-off-by: Marcelo Tosatti Index: vsyscall/include/linux/pvclock_gtod.h ===

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

2012-11-14 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kernel/pvclock.c === --- vsyscall.orig/arch/x86/kernel/pvclock.c +++ vsyscall/arch/x86/kernel/pvclock.c @@ -45,6 +45,19 @@ void pvclock_resume(void) atomic64_set(&last_

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

2012-11-14 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 move

[patch 17/18] KVM: x86: require matched TSC offsets for master clock

2012-11-14 Thread Marcelo Tosatti
With master clock, a pvclock clock read calculates: ret = system_timestamp + [ (rdtsc + tsc_offset) - tsc_timestamp ] Where 'rdtsc' is the host TSC. system_timestamp and tsc_timestamp are unique, one tuple per VM: the "master clock". Given a host with synchronized TSCs, its obvious that guest

[patch 16/18] KVM: x86: add kvm_arch_vcpu_postcreate callback, move TSC initialization

2012-11-14 Thread Marcelo Tosatti
TSC initialization will soon make use of online_vcpus. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/ia64/kvm/kvm-ia64.c === --- vsyscall.orig/arch/ia64/kvm/kvm-ia64.c +++ vsyscall/arch/ia64/kvm/kvm-ia64.c @@ -1330,6 +1330,11

[patch 04/18] x86: pvclock: remove pvclock_shadow_time

2012-11-14 Thread Marcelo Tosatti
Originally from Jeremy Fitzhardinge. We can copy the information directly from "struct pvclock_vcpu_time_info", remove pvclock_shadow_time. Reviewed-by: Glauber Costa Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kernel/pvclock.c =

[patch 10/18] x86: kvm guest: pvclock vsyscall support

2012-11-14 Thread Marcelo Tosatti
Hook into generic pvclock vsyscall code, with the aim to allow userspace to have visibility into pvclock data. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kernel/kvmclock.c === --- vsyscall.orig/arch/x86/kernel/kvmclock

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

2012-11-14 Thread Marcelo Tosatti
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 Index: vsyscall/arch/x86/kvm/x86.c === --- vsysca

[patch 01/18] KVM: x86: retain pvclock guest stopped bit in guest memory

2012-11-14 Thread Marcelo Tosatti
Otherwise its possible for an unrelated KVM_REQ_UPDATE_CLOCK (such as due to CPU migration) to clear the bit. Noticed by Paolo Bonzini. Reviewed-by: Gleb Natapov Reviewed-by: Glauber Costa Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kvm/x86.c ==

[patch 12/18] KVM: x86: pass host_tsc to read_l1_tsc

2012-11-14 Thread Marcelo Tosatti
Allow the caller to pass host tsc value to kvm_x86_ops->read_l1_tsc(). Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/include/asm/kvm_host.h === --- vsyscall.orig/arch/x86/include/asm/kvm_host.h +++ vsyscall/arch/x86/includ

[patch 14/18] KVM: x86: notifier for clocksource changes

2012-11-14 Thread Marcelo Tosatti
Register a notifier for clocksource change event. In case the host switches to clock other than TSC, disable master clock usage. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kvm/x86.c === --- vsyscall.orig/arch/x86/kvm/x8

Re: [patch 13/18] time: export time information for KVM pvclock

2012-11-14 Thread John Stultz
On 11/14/2012 04:08 PM, Marcelo Tosatti wrote: As suggested by John, export time data similarly to how its done by vsyscall support. This allows KVM to retrieve necessary information to implement vsyscall support in KVM guests. Signed-off-by: Marcelo Tosatti Thanks for the updates here. The no

[PATCH 1/2] acpi_piix4: fix migration of gpe fields

2012-11-14 Thread Marcelo Tosatti
Migrate 16 bytes for en/sts fields (which is the correct size), increase version to 3, and document how to support incoming migration from qemu-kvm 1.2. Acked-by: Paolo Bonzini Signed-off-by: Marcelo Tosatti --- hw/acpi_piix4.c | 50 ++ 1 files

[patch 03/18] x86: pvclock: make sure rdtsc doesnt speculate out of region

2012-11-14 Thread Marcelo Tosatti
Originally from Jeremy Fitzhardinge. pvclock_get_time_values, which contains the memory barriers will be removed by next patch. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kernel/pvclock.c === --- vsyscall.orig/arch/x86

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

2012-11-14 Thread Marcelo Tosatti
Originally from Jeremy Fitzhardinge. So code can be reused. Signed-off-by: Marcelo Tosatti Index: vsyscall/arch/x86/kernel/pvclock.c === --- vsyscall.orig/arch/x86/kernel/pvclock.c +++ vsyscall/arch/x86/kernel/pvclock.c @@ -26,13 +

Re: [patch 08/18] sched: add notifier for cross-cpu migrations

2012-11-14 Thread Gleb Natapov
CCing Peter and Ingo. On Wed, Nov 14, 2012 at 10:08:31PM -0200, Marcelo Tosatti wrote: > Originally from Jeremy Fitzhardinge. > > Signed-off-by: Marcelo Tosatti > > Index: vsyscall/include/linux/sched.h > === > --- vsyscall.orig/in