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

2012-11-19 Thread Marcelo Tosatti
TSC stable pvclock flag in that case, allowing the guest to read clock from userspace. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kvm/x86.c === --- vsyscall.orig/arch/x86/kvm/x86.c +++ vsyscall/arch

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

2012-11-19 Thread Marcelo Tosatti
move to memblock_alloc based allocation. Acked-by: Glauber Costa glom...@parallels.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/kvmclock.c === --- vsyscall.orig/arch/x86/kernel/kvmclock.c

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

2012-11-19 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 glom...@parallels.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/pvclock.c

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

2012-11-19 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 mtosa...@redhat.com Index: vsyscall/arch/x86/kvm/x86.c

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

2012-11-19 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. Acked-by: John Stultz johns...@us.ibm.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall

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

2012-11-19 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. v5: - reduce preempt disable window in

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

2012-11-19 Thread Marcelo Tosatti
On Fri, Nov 16, 2012 at 06:12:58PM +0800, zhangyanfei wrote: Hello Marcelo, Any thoughts? I thought a function call was OK, but its better to have all code in vmx.c. Please have an atomic notifier in kexec.c (registered by KVM module via atomic_notifier_chain_register etc). Other than that,

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

2012-11-17 Thread Marcelo Tosatti
On Sat, Nov 17, 2012 at 10:06:18PM +0800, Xiao Guangrong wrote: On 11/16/2012 05:57 PM, Marcelo Tosatti wrote: On Fri, Nov 16, 2012 at 12:46:16PM +0800, Xiao Guangrong wrote: On 11/16/2012 11:56 AM, Marcelo Tosatti wrote: On Fri, Nov 16, 2012 at 11:39:12AM +0800, Xiao Guangrong wrote

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

2012-11-16 Thread Marcelo Tosatti
On Fri, Nov 16, 2012 at 12:46:16PM +0800, Xiao Guangrong wrote: 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

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

2012-11-16 Thread Marcelo Tosatti
On Fri, Nov 16, 2012 at 05:09:40PM +0900, Yoshihiro YUNOMAE wrote: Hi Marcelo, Thank you for commenting on my patch set. (2012/11/16 12:19), Marcelo Tosatti wrote: On Wed, Nov 14, 2012 at 10:36:21AM +0900, Yoshihiro YUNOMAE wrote: [...] In this summary, I suggest the patch which TSC

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

2012-11-16 Thread Marcelo Tosatti
On Fri, Nov 16, 2012 at 10:05:54AM -0500, Steven Rostedt wrote: On Wed, 2012-11-14 at 17:26 +0900, Yoshihiro YUNOMAE wrote: 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

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

2012-11-16 Thread Marcelo Tosatti
On Wed, Nov 14, 2012 at 05:26:10PM +0900, Yoshihiro YUNOMAE wrote: 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 rost...@goodmis.org wrote: On Wed,

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

2012-11-16 Thread Marcelo Tosatti
On Thu, Nov 15, 2012 at 12:26:37PM -0800, Will Auld wrote: 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

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

2012-11-16 Thread Marcelo Tosatti
On Thu, Nov 15, 2012 at 12:25:45PM -0800, Will Auld wrote: 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)

Re: Resend [PATCH] Enabling IA32_TSC_ADJUST for Qemu KVM guest VMs

2012-11-16 Thread Marcelo Tosatti
On Thu, Nov 15, 2012 at 12:31:05PM -0800, Will Auld wrote: 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

[GIT PULL] more KVM fixes for 3.7-rc5

2012-11-16 Thread Marcelo Tosatti
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive a correction for oops on module init with older Intel hosts. Takashi Iwai (1): KVM: x86: Fix invalid secondary exec controls in vmx_cpuid_update() arch/x86/kvm/vmx.c | 11 +++ 1 file

[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 mtosa...@redhat.com Index: vsyscall/arch/x86/include/asm/pvclock.h === --- vsyscall.orig/arch/x86/include/asm/pvclock.h

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

2012-11-15 Thread Marcelo Tosatti
move to memblock_alloc based allocation. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/kvmclock.c === --- vsyscall.orig/arch/x86/kernel/kvmclock.c +++ vsyscall/arch/x86/kernel/kvmclock.c @@ -23,6

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 +0800, Xiao

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 I/O

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 wrote: Hi

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 happliy read

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 mtosa...@redhat.com wrote: On Mon, Nov 05, 2012 at 05:59:26PM +0800, Xiao Guangrong wrote: Do

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

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

2012-11-14 Thread Marcelo Tosatti
/master Jan Kiszka (1): kvm: Actually remove software breakpoints from list on cleanup Marcelo Tosatti (1): acpi_piix4: fix migration of gpe fields hw/acpi_piix4.c | 50 ++ kvm-all.c |2 ++ 2 files changed, 48 insertions(+), 4

[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 mtosa...@redhat.com 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 mtosa...@redhat.com Index: vsyscall/arch/x86/include/asm/pvclock.h === --- vsyscall.orig/arch/x86/include/asm/pvclock.h

[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 mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/pvclock.c === --- vsyscall.orig

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

2012-11-14 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com 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 jan.kis...@siemens.com Signed-off-by: Marcelo Tosatti

[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

[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 mtosa...@redhat.com Index: vsyscall/include/linux/sched.h === --- vsyscall.orig/include/linux/sched.h +++ vsyscall/include/linux/sched.h @@ -107,6 +107,14 @@ extern

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

2012-11-14 Thread Marcelo Tosatti
TSC stable pvclock flag in that case, allowing the guest to read clock from userspace. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kvm/x86.c === --- vsyscall.orig/arch/x86/kvm/x86.c +++ vsyscall/arch

[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 mtosa...@redhat.com 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 mtosa...@redhat.com 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

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

2012-11-14 Thread Marcelo Tosatti
move to memblock_alloc based allocation. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/kvmclock.c === --- vsyscall.orig/arch/x86/kernel/kvmclock.c +++ vsyscall/arch/x86/kernel/kvmclock.c @@ -23,6

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

2012-11-14 Thread Marcelo Tosatti
TSC must be matched for the above to guarantee monotonicity. Allow master clock usage only if guest TSCs are synchronized. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/include/asm/kvm_host.h

[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 mtosa...@redhat.com Index: vsyscall/arch/ia64/kvm/kvm-ia64.c === --- vsyscall.orig/arch/ia64/kvm/kvm-ia64.c +++ vsyscall/arch/ia64/kvm/kvm-ia64.c

[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 glom...@parallels.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com 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 mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/kvmclock.c === --- vsyscall.orig/arch

[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 mtosa...@redhat.com Index: vsyscall/arch/x86/kvm/x86.c

[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 g...@redhat.com Reviewed-by: Glauber Costa glom...@parallels.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall

[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 mtosa...@redhat.com Index: vsyscall/arch/x86/include/asm/kvm_host.h === --- vsyscall.orig/arch/x86/include/asm/kvm_host.h

[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 mtosa...@redhat.com Index: vsyscall/arch/x86/kvm/x86.c

[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 pbonz...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- hw/acpi_piix4.c | 50

[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 mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/pvclock.c

[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 mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/pvclock.c === --- vsyscall.orig/arch/x86/kernel/pvclock.c +++ vsyscall/arch/x86/kernel

Re: Fix lapic time counter read for periodic mode

2012-11-13 Thread Marcelo Tosatti
On Tue, Nov 13, 2012 at 08:52:54AM +0100, Christian Ehrhardt wrote: Hi, thanks for your reply. On Mon, Nov 12, 2012 at 07:32:37PM -0200, Marcelo Tosatti wrote: there is a bug in the emulation of the lapic time counter. In particular what we are seeing is that the time counter

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

2012-11-13 Thread Marcelo Tosatti
To: x...@kernel.org; ke...@lists.infradead.org; Avi Kivity; Marcelo Tosatti Cc: linux-ker...@vger.kernel.org; kvm@vger.kernel.org Subject: [PATCH v3 2/2] KVM: make crash_clear_loaded_vmcss valid when loading kvm_intel module Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com

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

2012-11-13 Thread Marcelo Tosatti
On Fri, Nov 09, 2012 at 05:02:52PM -0800, John Stultz wrote: On 10/24/2012 06:13 AM, 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

Re: [RFC PATCH v3 0/5] s390: Host support for channel I/O.

2012-11-13 Thread Marcelo Tosatti
(-) -- 1.7.12.4 Reviewed-by: Marcelo Tosatti mtosa...@redhat.com -- 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.org/majordomo-info.html

Re: [PATCH v2 0/5] s390: Guest support for virtio-ccw.

2012-11-13 Thread Marcelo Tosatti
/virtio_ccw.c -- 1.7.12.4 Reviewed-by: Marcelo Tosatti mtosa...@redhat.com -- 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.org/majordomo-info.html

Re: [PATCH 1/3] KVM: do not kfree error pointer

2012-11-13 Thread Marcelo Tosatti
On Fri, Nov 02, 2012 at 06:33:21PM +0800, Guo Chao wrote: We should avoid kfree()ing error pointer in kvm_vcpu_ioctl() and kvm_arch_vcpu_ioctl(). Signed-off-by: Guo Chao y...@linux.vnet.ibm.com Applied all, thanks. -- To unsubscribe from this list: send the line unsubscribe kvm in the body

Re: Fix lapic time counter read for periodic mode

2012-11-12 Thread Marcelo Tosatti
On Sun, Nov 11, 2012 at 01:25:28PM +0100, Christian Ehrhardt wrote: Hi, there is a bug in the emulation of the lapic time counter. In particular what we are seeing is that the time counter of a periodic lapic timer in the guest reads as zero 99% of the time. The patch below fixes that.

Re: KVM call agenda for 2012-11-12

2012-11-12 Thread Marcelo Tosatti
On Mon, Nov 12, 2012 at 01:58:38PM +0100, Juan Quintela wrote: Hi Please send in any agenda topics you are interested in. Later, Juan. It would be good to have a status report on qemu-kvm compatibility (the remaining TODO items are with Anthony). They are: - qemu-kvm 1.2 machine type. -

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

2012-11-12 Thread Marcelo Tosatti
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 happliy read memory through it The idea is from Avi: | As I mentioned before, write-protecting a large spte is a good idea, | since it moves

Re: [PATCH 2/5] KVM: MMU: simplify mmu_set_spte

2012-11-12 Thread Marcelo Tosatti
On Mon, Nov 05, 2012 at 08:10:08PM +0800, Xiao Guangrong wrote: In order to detecting spte remapping, we can simply check whether the spte has already been pointing to the pfn even if the spte is not the last spte for middle spte is pointing to the kernel pfn which can not be mapped to

Re: [PATCH 2/3] s390: Virtual channel subsystem support.

2012-11-12 Thread Marcelo Tosatti
Hi Cornelia, On Wed, Oct 31, 2012 at 05:24:47PM +0100, Cornelia Huck wrote: Provide a mechanism for qemu to provide fully virtual subchannels to the guest. In the KVM case, this relies on the kernel's css support for I/O and machine check interrupt handling. The !KVM case handles interrupts

[GIT PULL] KVM fixes for 3.7-rc5

2012-11-12 Thread Marcelo Tosatti
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive a correction for user triggerable oops Petr Matousek (1): KVM: x86: invalid opcode oops on SET_SREGS with OSXSAVE bit set (CVE-2012-4461) arch/x86/kvm/cpuid.h |3 +++ arch/x86/kvm/x86.c |

Re: [PATCH v11] kvm: notify host when the guest is panicked

2012-11-12 Thread Marcelo Tosatti
On Fri, Nov 09, 2012 at 03:17:39PM -0500, Sasha Levin wrote: On Mon, Nov 5, 2012 at 8:58 PM, Hu Tao hu...@cn.fujitsu.com wrote: But in the case of panic notification, more dependency means more chances of failure of panic notification. Say, if we use a virtio device to do panic

Re: [patch 09/16] x86: kvm guest: pvclock vsyscall support

2012-11-05 Thread Marcelo Tosatti
On Fri, Nov 02, 2012 at 01:42:41PM +0400, Glauber Costa wrote: On 11/01/2012 02:47 AM, Marcelo Tosatti wrote: + info = pvclock_get_vsyscall_time_info(cpu); + + low = (int)__pa(info) | 1; + high = ((u64)__pa(per_cpu(hv_clock, cpu)) 32); + ret = native_write_msr_safe

Re: [patch 08/16] KVM: x86: introduce facility to support vsyscall pvclock, via MSR

2012-11-02 Thread Marcelo Tosatti
On Fri, Nov 02, 2012 at 02:23:06PM +0400, Glauber Costa wrote: On 11/02/2012 01:39 AM, Marcelo Tosatti wrote: On Thu, Nov 01, 2012 at 06:28:31PM +0400, Glauber Costa wrote: On 11/01/2012 02:47 AM, Marcelo Tosatti wrote: Allow a guest to register a second location for the VCPU time info

Re: [patch 02/16] x86: pvclock: make sure rdtsc doesnt speculate out of region

2012-11-01 Thread Marcelo Tosatti
On Thu, Nov 01, 2012 at 05:49:51PM +0400, Glauber Costa wrote: On 11/01/2012 03:48 PM, Gleb Natapov wrote: On Wed, Oct 31, 2012 at 08:46:58PM -0200, Marcelo Tosatti wrote: Originally from Jeremy Fitzhardinge. pvclock_get_time_values, which contains the memory barriers will be removed

Re: [patch 04/16] x86: pvclock: create helper for pvclock data retrieval

2012-11-01 Thread Marcelo Tosatti
On Thu, Nov 01, 2012 at 06:04:02PM +0400, Glauber Costa wrote: On 11/01/2012 02:47 AM, Marcelo Tosatti wrote: +static __always_inline +unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src, + cycle_t *cycles, u8 *flags) +{ + unsigned version

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

2012-11-01 Thread Marcelo Tosatti
On Thu, Nov 01, 2012 at 12:39:30PM +0200, Gleb Natapov wrote: On Wed, Oct 31, 2012 at 08:46:57PM -0200, Marcelo Tosatti wrote: Otherwise its possible for an unrelated KVM_REQ_UPDATE_CLOCK (such as due to CPU migration) to clear the bit. Noticed by Paolo Bonzini. Signed-off

Re: [patch 02/16] x86: pvclock: make sure rdtsc doesnt speculate out of region

2012-11-01 Thread Marcelo Tosatti
On Fri, Nov 02, 2012 at 12:13:54AM +0200, Gleb Natapov wrote: On Thu, Nov 01, 2012 at 06:56:11PM -0200, Marcelo Tosatti wrote: On Thu, Nov 01, 2012 at 05:49:51PM +0400, Glauber Costa wrote: On 11/01/2012 03:48 PM, Gleb Natapov wrote: On Wed, Oct 31, 2012 at 08:46:58PM -0200, Marcelo

Re: [patch 05/16] x86: pvclock: introduce helper to read flags

2012-11-01 Thread Marcelo Tosatti
On Thu, Nov 01, 2012 at 06:07:45PM +0400, Glauber Costa wrote: On 11/01/2012 02:47 AM, Marcelo Tosatti wrote: Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/pvclock.c If you are resending this series, I don't see a reason for this one

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

2012-11-01 Thread Marcelo Tosatti
On Thu, Nov 01, 2012 at 06:41:46PM +0400, Glauber Costa wrote: On 11/01/2012 02:47 AM, Marcelo Tosatti wrote: +#ifdef CONFIG_PARAVIRT_CLOCK + +static notrace const struct pvclock_vsyscall_time_info *get_pvti(int cpu) +{ + const aligned_pvti_t *pvti_base; + int idx = cpu

Re: [patch 08/16] KVM: x86: introduce facility to support vsyscall pvclock, via MSR

2012-11-01 Thread Marcelo Tosatti
On Thu, Nov 01, 2012 at 06:28:31PM +0400, Glauber Costa wrote: On 11/01/2012 02:47 AM, Marcelo Tosatti wrote: Allow a guest to register a second location for the VCPU time info structure for each vcpu (as described by MSR_KVM_SYSTEM_TIME_NEW). This is intended to allow the guest kernel

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

2012-11-01 Thread Marcelo Tosatti
On Thu, Nov 01, 2012 at 07:42:43PM -0200, Marcelo Tosatti wrote: On Thu, Nov 01, 2012 at 06:41:46PM +0400, Glauber Costa wrote: On 11/01/2012 02:47 AM, Marcelo Tosatti wrote: +#ifdef CONFIG_PARAVIRT_CLOCK + +static notrace const struct pvclock_vsyscall_time_info *get_pvti(int cpu

[PATCH 26/28] target-i386: cpu: make -cpu host/check/enforce code KVM-specific

2012-10-31 Thread Marcelo Tosatti
() and cpu_x86_fill_host() KVM-specific, document them as such, and rename them to kvm_check_features_against_host() and kvm_cpu_fill_host(). Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/cpu.c | 25 ++--- 1 files changed, 18

[PATCH 12/28] i386: kvm: mask cpuid_ext4_features bits earlier

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com This way all the filtering by GET_SUPPORTED_CPUID is being done at the same place in the code. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c |5 +++-- 1 files changed, 3

[PATCH 21/28] Use global properties to emulate -no-kvm-pit-reinjection

2012-10-31 Thread Marcelo Tosatti
-reinjection. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- qemu-options.hx |4 vl.c| 15 +++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 42e642c..4403c9c 100644 --- a/qemu-options.hx +++ b/qemu

[PATCH 24/28] Emulate qemu-kvms -no-kvm option

2012-10-31 Thread Marcelo Tosatti
option. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- qemu-options.hx |3 +++ vl.c|4 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 628bd44..fe8f15c 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2888,6

[PATCH 01/28] i386: kvm: kvm_arch_get_supported_cpuid: move R_EDX hack outside of for loop

2012-10-31 Thread Marcelo Tosatti
, but there's no kernel version that does that. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c | 31 ++- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/target-i386/kvm.c b

[PATCH 19/28] Use machine options to emulate -no-kvm-irqchip

2012-10-31 Thread Marcelo Tosatti
-irqchip option. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- qemu-options.hx |3 +++ vl.c|5 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index a67a255..d813755 100644 --- a/qemu-options.hx +++ b/qemu-options.hx

[PATCH 09/28] i386: kvm: set CPUID_EXT_TSC_DEADLINE_TIMER on kvm_arch_get_supported_cpuid()

2012-10-31 Thread Marcelo Tosatti
Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index aabac72..aae8af2 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c

[PATCH 23/28] Issue warning when deprecated -tdf option is used

2012-10-31 Thread Marcelo Tosatti
. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- qemu-options.hx |3 +++ vl.c|4 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 4403c9c..628bd44 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2898,6

[PATCH 28/28] update-linux-headers.sh: Handle new kernel uapi/ directories

2012-10-31 Thread Marcelo Tosatti
the old and new locations. Signed-off-by: Peter Maydell peter.mayd...@linaro.org Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- scripts/update-linux-headers.sh |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux

[PATCH 08/28] i386: kvm: set CPUID_EXT_HYPERVISOR on kvm_arch_get_supported_cpuid()

2012-10-31 Thread Marcelo Tosatti
automatically know that the flag can be safely set by QEMU. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/target-i386/kvm.c b/target-i386

[PATCH 03/28] i386: kvm: kvm_arch_get_supported_cpuid: use 'entry' variable

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com The reg switch will be moved to a separate function, so store the entry pointer in a variable. No behavior change, just code movement. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386

[PATCH 18/28] cirrus_vga: allow configurable vram size

2012-10-31 Thread Marcelo Tosatti
Allow RAM size to be configurable for cirrus, to allow migration compatibility from qemu-kvm. Acked-by: Gerd Hoffmann kra...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- hw/cirrus_vga.c | 21 - 1 files changed, 16 insertions(+), 5 deletions(-) diff

[PATCH 02/28] i386: kvm: kvm_arch_get_supported_cpuid: clean up has_kvm_features check

2012-10-31 Thread Marcelo Tosatti
...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index b7490f9..56addf1 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -130,7 +130,7

[PATCH 13/28] i386: kvm: filter CPUID feature words earlier, on cpu.c

2012-10-31 Thread Marcelo Tosatti
feature bits instead of GET_SUPPORTED_CPUID, and we need to fix that. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- kvm.h |1 + target-i386/cpu.c | 30 ++ target-i386/kvm.c | 18

[PATCH 07/28] i386: kvm: kvm_arch_get_supported_cpuid: replace if+switch with single 'if'

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com Additional fixups will be added, and making them a single 'if/else if' chain makes it clearer than two nested switch statements. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c

[PATCH 22/28] Issue warning when deprecated drive parameter boot=on|off is used

2012-10-31 Thread Marcelo Tosatti
option. From the qemu-kvm original commit message: We do not want to maintain this option forever. It will be removed after a grace period of a few releases. So warn the user that this option has no effect and will become invalid soon. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com

[PATCH 10/28] i386: kvm: x2apic is not supported without in-kernel irqchip

2012-10-31 Thread Marcelo Tosatti
kvm_arch_get_supported_cpuid()), but it will be eventually fixed to properly report the missing x2apic flag. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions

[PATCH 25/28] target-i386: make cpu_x86_fill_host() void

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com The return value of that function is always 0, and is always ignored. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/cpu.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions

[PATCH 06/28] i386: kvm: extract try_get_cpuid() loop to get_supported_cpuid() function

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com No behavior change, just code movement. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c | 19 ++- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git

[PATCH 05/28] i386: kvm: extract CPUID entry lookup to cpuid_find_entry() function

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com No behavior change, just code movement. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c | 30 ++ 1 files changed, 22 insertions(+), 8 deletions

[PATCH 17/28] target-i386: Add missing kvm cpuid feature name

2012-10-31 Thread Marcelo Tosatti
From: Don Slutz d...@cloudswitch.com Currently -cpu host,-kvmclock,-kvm_nopiodelay,-kvm_mmu does not turn off all bits in CPUID 0x4001 EAX. The missing ones is KVM_FEATURE_STEAL_TIME. This adds the name kvm_steal_time. Signed-off-by: Don Slutz d...@cloudswitch.com Signed-off-by: Marcelo

[PATCH 11/28] i386: kvm: mask cpuid_kvm_features earlier

2012-10-31 Thread Marcelo Tosatti
-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 4e96b04..8eb61a0 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -428,6 +428,9 @@ int

[PATCH 14/28] i386: kvm: reformat filter_features_for_kvm() code

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com Cosmetic, but it will also help to make futher patches easier to review. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/cpu.c | 28 +--- 1 files changed, 13

[PATCH 20/28] Issue warning when deprecated -no-kvm-pit is used

2012-10-31 Thread Marcelo Tosatti
option. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- qemu-options.hx |3 +++ vl.c|5 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index d813755..42e642c 100644 --- a/qemu-options.hx +++ b/qemu-options.hx

[PATCH 15/28] i386: kvm: filter CPUID leaf 7 based on GET_SUPPORTED_CPUID, too

2012-10-31 Thread Marcelo Tosatti
-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/cpu.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index be16898..22d91ed 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1384,6 +1384,8 @@ static void

[PATCH 04/28] i386: kvm: extract register switch to cpuid_entry_get_reg() function

2012-10-31 Thread Marcelo Tosatti
From: Eduardo Habkost ehabk...@redhat.com No behavior change: just code movement. Signed-off-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c | 37 +++-- 1 files changed, 23 insertions(+), 14

[PATCH 00/28] [PULL] qemu-kvm.git uq/master queue

2012-10-31 Thread Marcelo Tosatti
properties to emulate -no-kvm-pit-reinjection Issue warning when deprecated drive parameter boot=on|off is used Issue warning when deprecated -tdf option is used Emulate qemu-kvms -no-kvm option Marcelo Tosatti (1): cirrus_vga: allow configurable vram size Peter Maydell (1

[PATCH 16/28] i386: cpu: add missing CPUID[EAX=7,ECX=0] flag names

2012-10-31 Thread Marcelo Tosatti
...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/cpu.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 22d91ed..7c726fc 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -106,8 +106,8

Re: [PULL 00/12] ppc patch queue 2012-10-30

2012-10-31 Thread Marcelo Tosatti
On Wed, Oct 31, 2012 at 12:26:04PM +0200, Avi Kivity wrote: On 10/31/2012 12:22 PM, Alexander Graf wrote: On 31.10.2012, at 02:32, Marcelo Tosatti mtosa...@redhat.com wrote: On Tue, Oct 30, 2012 at 11:02:13AM +0100, Alexander Graf wrote: Hi Avi / Marcelo, This is my current

Re: [PULL 00/12] ppc patch queue 2012-10-30

2012-10-31 Thread Marcelo Tosatti
On Wed, Oct 31, 2012 at 11:22:55AM +0100, Alexander Graf wrote: On 31.10.2012, at 02:32, Marcelo Tosatti mtosa...@redhat.com wrote: On Tue, Oct 30, 2012 at 11:02:13AM +0100, Alexander Graf wrote: Hi Avi / Marcelo, This is my current patch queue for ppc. Please pull. Headline

[patch 03/16] x86: pvclock: remove pvclock_shadow_time

2012-10-31 Thread Marcelo Tosatti
Originally from Jeremy Fitzhardinge. We can copy the information directly from struct pvclock_vcpu_time_info, remove pvclock_shadow_time. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: vsyscall/arch/x86/kernel/pvclock.c

<    6   7   8   9   10   11   12   13   14   15   >