Re: [patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration

2014-12-11 Thread Marcelo Tosatti
On Thu, Dec 11, 2014 at 01:16:52PM -0800, Andy Lutomirski wrote: On Thu, Dec 11, 2014 at 1:10 PM, Paolo Bonzini pbonz...@redhat.com wrote: On 11/12/2014 21:48, Andy Lutomirski wrote: On 12/10/2014 07:07 PM, Marcelo Tosatti wrote: On Thu, Dec 11, 2014 at 12:37:57AM +0100, Paolo Bonzini

Re: [patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration

2014-12-11 Thread Marcelo Tosatti
On Thu, Dec 11, 2014 at 07:27:17PM -0200, Marcelo Tosatti wrote: On Thu, Dec 11, 2014 at 01:16:52PM -0800, Andy Lutomirski wrote: On Thu, Dec 11, 2014 at 1:10 PM, Paolo Bonzini pbonz...@redhat.com wrote: On 11/12/2014 21:48, Andy Lutomirski wrote: On 12/10/2014 07:07 PM, Marcelo

[QEMU patch 1/2] kvm: sync kernel headers

2014-12-10 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- linux-headers/asm-x86/kvm.h |5 + linux-headers/linux/kvm.h | 14 +++--- 2 files changed, 8 insertions(+), 11 deletions(-) Index: qemu/linux-headers/asm-x86/kvm.h

[QEMU patch 2/2] kvm: allow configuration of tsc deadline timer advancement

2014-12-10 Thread Marcelo Tosatti
Add machine option and QMP commands to configure TSC deadline timer advancement. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- monitor.c | 15 ++ qapi-schema.json | 29 +++ qmp-commands.hx | 48 target-i386/kvm.c

[QEMU patch 0/2] QEMU lapic tsc deadline advancement

2014-12-10 Thread Marcelo Tosatti
Add command to set TSC deadline timer advancement. This value will be subtracted from the expiration time of the high resolution timer which emulates TSC deadline timer. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

[patch 1/2] KVM: x86: add method to test PIR bitmap vector

2014-12-10 Thread Marcelo . Tosatti
kvm_x86_ops-test_posted_interrupt() returns true/false depending whether 'vector' is set. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/include/asm/kvm_host.h === --- kvm.orig/arch/x86/include/asm/kvm_host.h

[patch 0/2] KVM: add option to advance tscdeadline hrtimer expiration

2014-12-10 Thread Marcelo . Tosatti
See patches for details. -- 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

[patch 0/2] KVM: add option to advance tscdeadline hrtimer expiration (v2)

2014-12-10 Thread Marcelo Tosatti
See patches for details. -- 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

[patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration

2014-12-10 Thread Marcelo Tosatti
the value in say 500ns increments until avg cyclictest numbers stop decreasing. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/kvm/lapic.c === --- kvm.orig/arch/x86/kvm/lapic.c +++ kvm/arch/x86/kvm/lapic.c @@ -33,6

Re: [patch 1/2] KVM: x86: add method to test PIR bitmap vector

2014-12-10 Thread Marcelo Tosatti
On Wed, Dec 10, 2014 at 12:10:04PM -0500, Rik van Riel wrote: On 12/10/2014 12:06 PM, Marcelo Tosatti wrote: kvm_x86_ops-test_posted_interrupt() returns true/false depending whether 'vector' is set. Is that good? Bad? How does this patch address the issue? What issue? -- To unsubscribe

Re: [QEMU patch 2/2] kvm: allow configuration of tsc deadline timer advancement

2014-12-10 Thread Marcelo Tosatti
On Wed, Dec 10, 2014 at 06:09:19PM +0100, Paolo Bonzini wrote: On 10/12/2014 18:04, Marcelo Tosatti wrote: Please add an object property to the x86 CPU object. It can then be configured with -global on the command line. Don't want to allow individual values for different CPUs

Re: [patch 0/2] KVM: add option to advance tscdeadline hrtimer expiration (v2)

2014-12-10 Thread Marcelo Tosatti
On Wed, Dec 10, 2014 at 06:10:19PM +0100, Paolo Bonzini wrote: On 10/12/2014 18:06, Marcelo Tosatti wrote: See patches for details. Difference between v1 and v2? Please fix your workflow. Paolo Wrong sender email address, that is all. -- To unsubscribe from this list: send the line

Re: [QEMU patch 2/2] kvm: allow configuration of tsc deadline timer advancement

2014-12-10 Thread Marcelo Tosatti
On Wed, Dec 10, 2014 at 06:01:21PM +0100, Paolo Bonzini wrote: On 10/12/2014 17:23, Marcelo Tosatti wrote: Add machine option and QMP commands to configure TSC deadline timer advancement. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- monitor.c | 15

Re: [patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration

2014-12-10 Thread Marcelo Tosatti
combination. One method is to measure the average delay between apic_timer_fn and VM-entry. Another method is to start with 1000ns, and increase the value in say 500ns increments until avg cyclictest numbers stop decreasing. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com What

[patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration

2014-12-10 Thread Marcelo . Tosatti
the value in say 500ns increments until avg cyclictest numbers stop decreasing. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/kvm/lapic.c === --- kvm.orig/arch/x86/kvm/lapic.c +++ kvm/arch/x86/kvm/lapic.c @@ -33,6

[patch 1/2] KVM: x86: add method to test PIR bitmap vector

2014-12-10 Thread Marcelo Tosatti
kvm_x86_ops-test_posted_interrupt() returns true/false depending whether 'vector' is set. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/include/asm/kvm_host.h === --- kvm.orig/arch/x86/include/asm/kvm_host.h

Re: [patch 1/2] KVM: x86: add method to test PIR bitmap vector

2014-12-10 Thread Marcelo Tosatti
On Wed, Dec 10, 2014 at 12:50:29PM -0500, Rik van Riel wrote: On 12/10/2014 12:27 PM, Marcelo Tosatti wrote: On Wed, Dec 10, 2014 at 12:10:04PM -0500, Rik van Riel wrote: On 12/10/2014 12:06 PM, Marcelo Tosatti wrote: kvm_x86_ops-test_posted_interrupt() returns true/false depending

Re: [QEMU patch 2/2] kvm: allow configuration of tsc deadline timer advancement

2014-12-10 Thread Marcelo Tosatti
On Wed, Dec 10, 2014 at 06:29:43PM +0100, Paolo Bonzini wrote: On 10/12/2014 18:27, Marcelo Tosatti wrote: On Wed, Dec 10, 2014 at 06:09:19PM +0100, Paolo Bonzini wrote: On 10/12/2014 18:04, Marcelo Tosatti wrote: Please add an object property to the x86 CPU object. It can

kvm-unit-tests: add tscdeadline-latency test

2014-12-10 Thread Marcelo Tosatti
To test latency between TSC deadline timer interrupt injection. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm-unit-tests/config/config-x86-common.mak === --- kvm-unit-tests.orig/config/config-x86-common.mak2014

[patch 0/2] KVM: add option to advance tscdeadline hrtimer expiration (v3)

2014-12-10 Thread Marcelo Tosatti
See patches for details. v2: - fix email address. v3: - use module parameter for configuration of value (Paolo/Radim) -- 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

[patch 1/2] KVM: x86: add method to test PIR bitmap vector

2014-12-10 Thread Marcelo Tosatti
kvm_x86_ops-test_posted_interrupt() returns true/false depending whether 'vector' is set. Next patch makes use of this interface. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/include/asm/kvm_host.h

[patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration

2014-12-10 Thread Marcelo Tosatti
the value in say 500ns increments until avg cyclictest numbers stop decreasing. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/kvm/lapic.c === --- kvm.orig/arch/x86/kvm/lapic.c +++ kvm/arch/x86/kvm/lapic.c @@ -33,6

Re: [patch 2/2] KVM: x86: add option to advance tscdeadline hrtimer expiration

2014-12-10 Thread Marcelo Tosatti
On Thu, Dec 11, 2014 at 12:37:57AM +0100, Paolo Bonzini wrote: On 10/12/2014 21:57, Marcelo Tosatti wrote: For the hrtimer which emulates the tscdeadline timer in the guest, add an option to advance expiration, and busy spin on VM-entry waiting for the actual expiration time to elapse

Re: kvm-unit-tests: add tscdeadline-latency test

2014-12-10 Thread Marcelo Tosatti
On Wed, Dec 10, 2014 at 10:49:52PM +0100, Paolo Bonzini wrote: On 10/12/2014 21:23, Marcelo Tosatti wrote: To test latency between TSC deadline timer interrupt injection. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm-unit-tests/config/config-x86-common.mak

Re: [patch -rt 2/2] KVM: lapic: mark LAPIC timer handler as irqsafe

2014-12-05 Thread Marcelo Tosatti
On Thu, Dec 04, 2014 at 02:53:26PM +0100, Paolo Bonzini wrote: On 25/11/2014 21:24, Thomas Gleixner wrote: On Tue, 25 Nov 2014, Rik van Riel wrote: On 11/25/2014 12:21 PM, Marcelo Tosatti wrote: Since lapic timer handler only wakes up a simple waitqueue, it can be executed from

Re: [patch -rt 2/2] KVM: lapic: mark LAPIC timer handler as irqsafe

2014-12-04 Thread Marcelo Tosatti
On Tue, Nov 25, 2014 at 06:38:04PM +0100, Paolo Bonzini wrote: On 25/11/2014 18:21, Marcelo Tosatti wrote: + + if (r == HRTIMER_RESTART) { + do { + ret = hrtimer_start_expires(data, HRTIMER_MODE_ABS); + if (ret == -ETIME

[patch -rt 0/2] use simple waitqueue for kvm vcpu waitqueue (v2)

2014-11-25 Thread Marcelo Tosatti
The problem: On -RT, an emulated LAPIC timer instances has the following path: 1) hard interrupt 2) ksoftirqd is scheduled 3) ksoftirqd wakes up vcpu thread 4) vcpu thread is scheduled This extra context switch introduces unnecessary latency in the LAPIC path for a KVM guest. The solution:

[patch -rt 2/2] KVM: lapic: mark LAPIC timer handler as irqsafe

2014-11-25 Thread Marcelo Tosatti
Since lapic timer handler only wakes up a simple waitqueue, it can be executed from hardirq context. Reduces average cyclictest latency by 3us. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- arch/x86/kvm/lapic.c | 42 +++--- 1 file changed, 39

[patch -rt 1/2] KVM: use simple waitqueue for vcpu-wq

2014-11-25 Thread Marcelo Tosatti
context. cyclictest command line: # cyclictest -m -n -q -p99 -l 100 -h60 -D 1m This patch reduces the average latency in my tests from 14us to 11us. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- arch/arm/kvm/arm.c |4 ++-- arch/arm/kvm/psci.c

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu-wq

2014-11-25 Thread Marcelo Tosatti
On Tue, Nov 25, 2014 at 01:57:37PM -0500, Rik van Riel wrote: On 11/25/2014 12:21 PM, Marcelo Tosatti wrote: The problem: On -RT, an emulated LAPIC timer instances has the following path: 1) hard interrupt 2) ksoftirqd is scheduled 3) ksoftirqd wakes up vcpu thread 4) vcpu

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-14 Thread Marcelo Tosatti
On Thu, Nov 13, 2014 at 09:40:41AM +0100, Andrew Jones wrote: On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: The periodic kvmclock sync can be an undesired source of latencies. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b

KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-12 Thread Marcelo Tosatti
The periodic kvmclock sync can be an undesired source of latencies. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0033df3..be56fd3 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -98,6 +98,9 @@ module_param(ignore_msrs

Re: [PATCH] kvm: x86: add trace event for pvclock updates

2014-11-10 Thread Marcelo Tosatti
On Wed, Nov 05, 2014 at 11:46:42AM -0800, David Matlack wrote: The new trace event records: * the id of vcpu being updated * the pvclock_vcpu_time_info struct being written to guest memory This is useful for debugging pvclock bugs, such as the bug fixed by [PATCH] kvm: x86: Fix kvm

Re: [PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-05 Thread Marcelo Tosatti
On Wed, Nov 05, 2014 at 10:36:05AM +0100, Paolo Bonzini wrote: On 05/11/2014 00:30, Marcelo Tosatti wrote: + /* +* If the vcpus have matched TSCs and host clocksource is TSC, +* perform request to enable masterclock. +* +* If the masterclock is enabled, perform request

Re: [PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-05 Thread Marcelo Tosatti
On Wed, Nov 05, 2014 at 08:49:38PM +0100, Paolo Bonzini wrote: On 05/11/2014 20:47, Paolo Bonzini wrote: On 05/11/2014 19:19, Marcelo Tosatti wrote: + * If the vcpus have matched TSCs and host clocksource is TSC, + * perform request to enable masterclock

Re: KVM: x86: update masterclock on TSC writes

2014-11-04 Thread Marcelo Tosatti
On Tue, Nov 04, 2014 at 06:10:34PM +0100, Paolo Bonzini wrote: Extending the context we have: if (vcpus_matched gtod-clock.vclock_mode == VCLOCK_TSC) if (!ka-use_master_clock) do_request = 1; - if (!vcpus_matched ka-use_master_clock) +

[PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-04 Thread Marcelo Tosatti
When the guest writes to the TSC, the masterclock TSC copy must be updated as well along with the TSC_OFFSET update, otherwise a negative tsc_timestamp is calculated at kvm_guest_time_update. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

Re: [PATCH] kvm: x86: Fix kvm clock versioning.

2014-11-04 Thread Marcelo Tosatti
-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

KVM: x86: update masterclock on TSC writes

2014-11-03 Thread Marcelo Tosatti
When the guest writes to the TSC, the masterclock TSC copy must be updated as well along with the TSC_OFFSET update, otherwise a negative tsc_timestamp is calculated at kvm_guest_time_update. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-13 Thread Marcelo Tosatti
On Fri, Oct 10, 2014 at 04:09:29PM +0300, Gleb Natapov wrote: On Wed, Oct 08, 2014 at 04:22:31PM -0300, Marcelo Tosatti wrote: Argh, lets try again: skip_pinned = true -- mark page dirty, keep spte intact called from get dirty log path

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-08 Thread Marcelo Tosatti
On Wed, Oct 08, 2014 at 09:56:36AM +0300, Gleb Natapov wrote: On Mon, Oct 06, 2014 at 02:19:32PM -0300, Marcelo Tosatti wrote: On Sat, Oct 04, 2014 at 10:23:32AM +0300, Gleb Natapov wrote: On Tue, Sep 09, 2014 at 12:28:11PM -0300, Marcelo Tosatti wrote: On Mon, Jul 21, 2014 at 04:14:24PM

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-08 Thread Marcelo Tosatti
Argh, lets try again: skip_pinned = true -- mark page dirty, keep spte intact called from get dirty log path. skip_pinned = false --- reload remote mmu destroy pinned spte. called from: dirty log enablement, rmap write protect

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-06 Thread Marcelo Tosatti
On Sat, Oct 04, 2014 at 10:23:32AM +0300, Gleb Natapov wrote: On Tue, Sep 09, 2014 at 12:28:11PM -0300, Marcelo Tosatti wrote: On Mon, Jul 21, 2014 at 04:14:24PM +0300, Gleb Natapov wrote: On Wed, Jul 09, 2014 at 04:12:53PM -0300, mtosa...@redhat.com wrote: Reload remote vcpus MMU from

Re: VMEXIT and Threads

2014-10-06 Thread Marcelo Tosatti
On Mon, Oct 06, 2014 at 01:45:24PM +0900, Oscar Garcia wrote: Hello, I have a question about parallel vmexit calls, I would appreciate any answer or suggestion. I have a host with debian 7 (intel i7 - RAM 8GB), the guest OS is also debian. I am running a program with some threads, every

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-09-30 Thread Marcelo Tosatti
Ping? On Mon, Sep 22, 2014 at 02:19:14PM -0300, Marcelo Tosatti wrote: On Tue, Sep 09, 2014 at 12:28:11PM -0300, Marcelo Tosatti wrote: On Mon, Jul 21, 2014 at 04:14:24PM +0300, Gleb Natapov wrote: On Wed, Jul 09, 2014 at 04:12:53PM -0300, mtosa...@redhat.com wrote: Reload remote vcpus

Re: [x86, kvm] WARNING: at arch/x86/kernel/pvclock.c:182 pvclock_init_vsyscall()

2014-09-30 Thread Marcelo Tosatti
On Tue, Sep 30, 2014 at 02:05:09PM +0200, Paolo Bonzini wrote: Il 30/09/2014 09:59, Fengguang Wu ha scritto: +--++++ | | 71056ae22d |

Re: FreeBSD Guest Freezes during boot up on Linux KVM, RHEL 6.4 or RHEL 6.5

2014-09-29 Thread Marcelo Tosatti
On Fri, Sep 26, 2014 at 07:31:17AM +, Venkateswara Rao Nandigam wrote: Hi Paolo, As suggested by You, the following is the issue info. Is this something to be fixed in host kernel? Description: FreeBSD 64bit(10.0) Guest freezes at booting on Linux KVM, host running RHEL6.4 or

Re: [patch 4/4] KVM: MMU: pinned sps are not candidates for deletion.

2014-09-22 Thread Marcelo Tosatti
On Tue, Sep 09, 2014 at 12:41:27PM -0300, Marcelo Tosatti wrote: On Tue, Jul 22, 2014 at 05:59:42AM +0800, Xiao Guangrong wrote: On Jul 10, 2014, at 3:12 AM, mtosa...@redhat.com wrote: Skip pinned shadow pages when selecting pages to zap. It seems there is no way to prevent

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-09-22 Thread Marcelo Tosatti
On Tue, Sep 09, 2014 at 12:28:11PM -0300, Marcelo Tosatti wrote: On Mon, Jul 21, 2014 at 04:14:24PM +0300, Gleb Natapov wrote: On Wed, Jul 09, 2014 at 04:12:53PM -0300, mtosa...@redhat.com wrote: Reload remote vcpus MMU from GET_DIRTY_LOG codepath, before deleting a pinned spte

Re: KVM: nested VMX: disable perf cpuid reporting

2014-09-22 Thread Marcelo Tosatti
On Thu, Sep 18, 2014 at 06:24:57PM -0300, Marcelo Tosatti wrote: Initilization of L2 guest with -cpu host, on L1 guest with -cpu host triggers: (qemu) KVM: entry failed, hardware error 0x7 ... nested_vmx_run: VMCS MSR_{LOAD,STORE} unsupported Nested VMX MSR load/store support

Re: [PATCH] kvm: don't take vcpu mutex for obviously invalid vcpu ioctls

2014-09-22 Thread Marcelo Tosatti
On Fri, Sep 19, 2014 at 04:03:25PM -0700, David Matlack wrote: vcpu ioctls can hang the calling thread if issued while a vcpu is running. There is a mutex per-vcpu, so thats expected, OK... If we know ioctl is going to be rejected as invalid anyway, we can fail before trying to take the

Re: [PATCH] kvm: don't take vcpu mutex for obviously invalid vcpu ioctls

2014-09-22 Thread Marcelo Tosatti
On Mon, Sep 22, 2014 at 11:29:16PM +0200, Paolo Bonzini wrote: Il 22/09/2014 22:08, Marcelo Tosatti ha scritto: This patch does not change functionality, it just makes invalid ioctls fail faster. Should not be executing vcpu ioctls without interrupt KVM_RUN in the first place

Re: [PATCH] kvm: don't take vcpu mutex for obviously invalid vcpu ioctls

2014-09-22 Thread Marcelo Tosatti
On Mon, Sep 22, 2014 at 03:58:16PM -0700, David Matlack wrote: Should not be executing vcpu ioctls without interrupt KVM_RUN in the first place. This patch is trying to be nice to code that isn't aware it's probing kvm file descriptors. We saw long hangs with some generic process

KVM: nested VMX: disable perf cpuid reporting

2014-09-18 Thread Marcelo Tosatti
and disable function 0xA. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index e28d798..976e3a5 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -774,6 +774,12 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-09-09 Thread Marcelo Tosatti
On Mon, Jul 21, 2014 at 04:14:24PM +0300, Gleb Natapov wrote: On Wed, Jul 09, 2014 at 04:12:53PM -0300, mtosa...@redhat.com wrote: Reload remote vcpus MMU from GET_DIRTY_LOG codepath, before deleting a pinned spte. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- arch/x86

Re: [patch 4/4] KVM: MMU: pinned sps are not candidates for deletion.

2014-09-09 Thread Marcelo Tosatti
On Tue, Jul 22, 2014 at 05:59:42AM +0800, Xiao Guangrong wrote: On Jul 10, 2014, at 3:12 AM, mtosa...@redhat.com wrote: Skip pinned shadow pages when selecting pages to zap. It seems there is no way to prevent changing pinned spte on zap-all path? Xiao, The way would be to reload

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-09-09 Thread Marcelo Tosatti
On Tue, Jul 22, 2014 at 05:55:20AM +0800, Xiao Guangrong wrote: On Jul 10, 2014, at 3:12 AM, mtosa...@redhat.com wrote: Reload remote vcpus MMU from GET_DIRTY_LOG codepath, before deleting a pinned spte. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- arch/x86/kvm/mmu.c

Re: [PATCH] KVM: x86: fix TSC matching

2014-09-03 Thread Marcelo Tosatti
On Tue, Aug 26, 2014 at 12:08:32PM +0300, Pekka Enberg wrote: On Sun, Aug 17, 2014 at 11:54 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 15/08/2014 18:54, Marcelo Tosatti ha scritto: Ping on integration. It's been in kvm/next for a while, and is now in Linus's tree: Does this make

Re: [RFC]Enlarge the dalta of TSC match window from one second to five second

2014-08-18 Thread Marcelo Tosatti
On Mon, Aug 11, 2014 at 03:41:00PM +0800, xiexiangyou wrote: hi, In kvm_write_tsc() func of kvm, The TSCs will be synchronized unless the time diff of creating vcpus small than one second. However, In my enviroment, stress is large, the vcpu creating time is delay, sometimes the diff time

Re: [PATCH] KVM: x86: fix TSC matching

2014-08-15 Thread Marcelo Tosatti
Ping on integration. On Tue, Jun 24, 2014 at 09:42:43AM +0200, Tomasz Grabiec wrote: I've observed kvmclock being marked as unstable on a modern single-socket system with a stable TSC and qemu-1.6.2 or qemu-2.0.0. The culprit was failure in TSC matching because of overflow of

Re: [patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-17 Thread Marcelo Tosatti
On Thu, Jul 17, 2014 at 08:18:03PM +0300, Nadav Amit wrote: Small question if I may regarding kvm_mmu_pin_pages: On 7/9/14, 10:12 PM, mtosa...@redhat.com wrote: + +static int kvm_mmu_pin_pages(struct kvm_vcpu *vcpu) +{ +struct kvm_pinned_page_range *p; +int r = 1; + +if

Re: [PATCH] ensure guest's kvmclock never goes backwards when TSC jumps backward

2014-07-16 Thread Marcelo Tosatti
On Wed, Jul 16, 2014 at 12:18:37PM +0200, Paolo Bonzini wrote: Il 16/07/2014 11:52, Igor Mammedov ha scritto: There are buggy hosts in the wild that advertise invariant TSC and as result host uses TSC as clocksource, but TSC on such host sometimes sporadically jumps backwards. This causes

Re: [PATCH][RESEND] KVM: nVMX: Fix vmptrld fail and vmwrite error when L1 goes down

2014-07-11 Thread Marcelo Tosatti
On Fri, Jul 11, 2014 at 12:22:17PM +0800, Wanpeng Li wrote: This bug can be trigger by L1 goes down directly w/ enable_shadow_vmcs. [ 6413.158950] kvm: vmptrld (null)/7800 failed [ 6413.158954] vmwrite error: reg 401e value 4 (err 1) [ 6413.158957] CPU: 0 PID: 4840 Comm:

Re: [patch 2/5] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-09 Thread Marcelo Tosatti
On Sun, Jun 22, 2014 at 04:35:24PM +0300, Avi Kivity wrote: + * Failure to instantiate pages will abort guest entry. + * + * Page frames should be pinned with get_page in advance. + * + * Pinning is not guaranteed while executing as L2 guest. Does this undermine security? PEBS writes should

Re: [patch 0/4] KVM: support for pinning sptes (v2)

2014-07-09 Thread Marcelo Tosatti
On Wed, Jul 09, 2014 at 04:12:50PM -0300, mtosa...@redhat.com wrote: Required by PEBS support as discussed at Subject: [patch 0/4] [patch 0/5] Implement PEBS virtualization for Silvermont Message-Id: 1401412327-14810-1-git-send-email-a...@firstfloor.org Thread. --

Re: [patch 4/5] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-07-01 Thread Marcelo Tosatti
On Tue, Jul 01, 2014 at 09:27:19AM +0300, Gleb Natapov wrote: The vcpu will never see a read-only spte because the VM-exit (due to IPI) guarantees vcpu is outside of guest mode _before_ it is write protected. Right. Now I see why you absolutely have to send IPI in

Re: [PATCH] KVM: x86: fix TSC matching

2014-06-30 Thread Marcelo Tosatti
On Mon, Jun 30, 2014 at 01:41:40PM +0200, Paolo Bonzini wrote: Il 30/06/2014 10:43, Tomasz Grabiec ha scritto: ping. I was waiting for Marcelo to comment on this patch, but it looks good. Thanks for the detailed commit message. Paolo Looks good. -- To unsubscribe from this list: send

Re: [patch 2/5] KVM: MMU: allow pinning spte translations (TDP-only)

2014-06-30 Thread Marcelo Tosatti
On Fri, Jun 20, 2014 at 01:09:12PM +0300, Gleb Natapov wrote: On Thu, Jun 19, 2014 at 04:22:57PM -0300, Marcelo Tosatti wrote: On Thu, Jun 19, 2014 at 10:21:16AM +0300, Gleb Natapov wrote: On Wed, Jun 18, 2014 at 08:12:05PM -0300, mtosa...@redhat.com wrote: Allow vcpus to pin spte

Re: [patch 4/5] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-06-30 Thread Marcelo Tosatti
On Fri, Jun 20, 2014 at 01:46:10PM +0300, Gleb Natapov wrote: On Thu, Jun 19, 2014 at 03:40:31PM -0300, Marcelo Tosatti wrote: On Thu, Jun 19, 2014 at 11:17:19AM +0300, Gleb Natapov wrote: On Wed, Jun 18, 2014 at 08:12:07PM -0300, mtosa...@redhat.com wrote: Reload remote vcpus MMU from

Re: [PATCH 4/4] kvm: Implement PEBS virtualization

2014-06-24 Thread Marcelo Tosatti
On Sun, Jun 22, 2014 at 09:02:25PM +0200, Andi Kleen wrote: First, it's not sufficient to pin the debug store area, you also have to pin the guest page tables that are used to map the debug store. But even if you do that, as soon as the guest fork()s, it will create a new pgd which the

Re: [RFC PATCH 1/1] Move two pinned pages to non-movable node in kvm.

2014-06-20 Thread Marcelo Tosatti
On Fri, Jun 20, 2014 at 02:15:10PM +0300, Gleb Natapov wrote: On Thu, Jun 19, 2014 at 04:00:24PM -0300, Marcelo Tosatti wrote: On Thu, Jun 19, 2014 at 12:20:32PM +0300, Gleb Natapov wrote: CCing Marcelo, On Wed, Jun 18, 2014 at 02:50:44PM +0800, Tang Chen wrote: Hi Gleb

Re: [RFC PATCH 1/1] Move two pinned pages to non-movable node in kvm.

2014-06-20 Thread Marcelo Tosatti
On Fri, Jun 20, 2014 at 05:26:22PM +0300, Gleb Natapov wrote: On Fri, Jun 20, 2014 at 09:53:26AM -0300, Marcelo Tosatti wrote: On Fri, Jun 20, 2014 at 02:15:10PM +0300, Gleb Natapov wrote: On Thu, Jun 19, 2014 at 04:00:24PM -0300, Marcelo Tosatti wrote: On Thu, Jun 19, 2014 at 12:20:32PM

Re: [RFC PATCH 1/1] Move two pinned pages to non-movable node in kvm.

2014-06-20 Thread Marcelo Tosatti
On Fri, Jun 20, 2014 at 05:31:46PM -0300, Marcelo Tosatti wrote: IIRC your shadow page pinning patch series support flushing of ptes by mmu notifier by forcing MMU reload and, as a result, faulting in of pinned pages during next entry. Your patch series does not pin pages by elevating

Re: [patch 4/5] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-06-19 Thread Marcelo Tosatti
On Thu, Jun 19, 2014 at 11:17:19AM +0300, Gleb Natapov wrote: On Wed, Jun 18, 2014 at 08:12:07PM -0300, mtosa...@redhat.com wrote: Reload remote vcpus MMU from GET_DIRTY_LOG codepath, before deleting a pinned spte. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- arch/x86

Re: [patch 2/5] KVM: MMU: allow pinning spte translations (TDP-only)

2014-06-19 Thread Marcelo Tosatti
On Thu, Jun 19, 2014 at 11:01:06AM +0300, Avi Kivity wrote: On 06/19/2014 02:12 AM, mtosa...@redhat.com wrote: Allow vcpus to pin spte translations by: 1) Creating a per-vcpu list of pinned ranges. 2) On mmu reload request: - Fault ranges. - Mark sptes with a pinned bit.

Re: [RFC PATCH 1/1] Move two pinned pages to non-movable node in kvm.

2014-06-19 Thread Marcelo Tosatti
On Thu, Jun 19, 2014 at 12:20:32PM +0300, Gleb Natapov wrote: CCing Marcelo, On Wed, Jun 18, 2014 at 02:50:44PM +0800, Tang Chen wrote: Hi Gleb, Thanks for the quick reply. Please see below. On 06/18/2014 02:12 PM, Gleb Natapov wrote: On Wed, Jun 18, 2014 at 01:50:00PM +0800,

Re: [patch 3/5] KVM: MMU: notifiers support for pinned sptes

2014-06-19 Thread Marcelo Tosatti
On Thu, Jun 19, 2014 at 09:48:50AM +0300, Gleb Natapov wrote: On Wed, Jun 18, 2014 at 08:12:06PM -0300, mtosa...@redhat.com wrote: Request KVM_REQ_MMU_RELOAD when deleting sptes from MMU notifiers. Keep pinned sptes intact if page aging. Signed-off-by: Marcelo Tosatti mtosa

Re: [patch 2/5] KVM: MMU: allow pinning spte translations (TDP-only)

2014-06-19 Thread Marcelo Tosatti
On Thu, Jun 19, 2014 at 10:21:16AM +0300, Gleb Natapov wrote: On Wed, Jun 18, 2014 at 08:12:05PM -0300, mtosa...@redhat.com wrote: Allow vcpus to pin spte translations by: 1) Creating a per-vcpu list of pinned ranges. What if memory slot containing pinned range is going away?

Re: Fwd: KVM_SYSTEM_TIME clock is marked unstable on a modern single-socket system

2014-06-18 Thread Marcelo Tosatti
On Wed, Jun 18, 2014 at 01:38:09PM +0200, Tomasz Grabiec wrote: Hi, I'm working on OSv (https://github.com/cloudius-systems/osv), a guest operating system. Right, please add a tsc_matched field to kvm_vcpu_arch (to keep track per-vcpu) and then increment the global counter only once per

Re: [PATCH 4/4] kvm: Implement PEBS virtualization

2014-06-10 Thread Marcelo Tosatti
On Thu, May 29, 2014 at 06:12:07PM -0700, Andi Kleen wrote: { struct kvm_pmu *pmu = vcpu-arch.pmu; @@ -407,6 +551,20 @@ int kvm_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) return 0; } break; + case

Re: [PATCH 4/4] kvm: Implement PEBS virtualization

2014-06-10 Thread Marcelo Tosatti
On Tue, Jun 10, 2014 at 12:22:07PM -0700, Andi Kleen wrote: On Tue, Jun 10, 2014 at 03:04:48PM -0300, Marcelo Tosatti wrote: On Thu, May 29, 2014 at 06:12:07PM -0700, Andi Kleen wrote: { struct kvm_pmu *pmu = vcpu-arch.pmu; @@ -407,6 +551,20 @@ int kvm_pmu_set_msr(struct kvm_vcpu

Re: [PATCH 4/4] kvm: Implement PEBS virtualization

2014-06-02 Thread Marcelo Tosatti
On Mon, Jun 02, 2014 at 07:45:35PM +0300, Gleb Natapov wrote: On Fri, May 30, 2014 at 09:24:24AM -0700, Andi Kleen wrote: To avoid any problems with guest pages being swapped by the host we pin the pages when the PEBS buffer is setup, by intercepting that MSR. It will avoid guest

Re: [PATCH v2 4/4] KVM: x86: get CPL from SS.DPL

2014-05-26 Thread Marcelo Tosatti
the CPL cache, which becomes a duplicate of the SS access rights cache. This fixes doing KVM_IOCTL_SET_SREGS exactly after setting CR0.PE=1 but before CS has been reloaded. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Marcelo Tosatti mtosa...@redhat.com -- To unsubscribe from

Re: [PATCH v2 1/4] KVM: x86: use new CS.RPL as CPL during task switch

2014-05-26 Thread Marcelo Tosatti
(until version 2.0) manually tracks the CPL. Signed-off-by: Paolo Bonzini pbonz...@redhat.com 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

Re: [PATCH v2 3/4] KVM: x86: check CS.DPL against RPL during task switch

2014-05-26 Thread Marcelo Tosatti
not introduced by this patchset. 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] kvm_stat: always display non tracepoint based stats

2014-05-21 Thread Marcelo Tosatti
On Wed, May 21, 2014 at 12:44:51PM +0200, Paolo Bonzini wrote: The old stats contain information not available in the tracepoints. Inspired by a patch from Marcelo Tosatti. I avoided that because there is overlapping information. Now you report kvm_exit count twice, for example. Signed

Re: [PATCH] kvm_stat: always display non tracepoint based stats

2014-05-21 Thread Marcelo Tosatti
On Wed, May 21, 2014 at 02:42:35PM +0200, Paolo Bonzini wrote: Il 21/05/2014 14:27, Marcelo Tosatti ha scritto: On Wed, May 21, 2014 at 12:44:51PM +0200, Paolo Bonzini wrote: The old stats contain information not available in the tracepoints. Inspired by a patch from Marcelo Tosatti. I

[PATCH uq/master] kvm_stat: add option to display non tracepoint based stats

2014-05-20 Thread Marcelo Tosatti
The old stats contain information not available in the tracepoints. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 762544b..6ac3b21 100755 --- a/scripts/kvm/kvm_stat +++ b/scripts/kvm/kvm_stat @@ -493,12 +493,21

Re: [PATCH v2] kvmclock: Ensure time in migration never goes backward

2014-05-18 Thread Marcelo Tosatti
migration on the same foundation in host as well as guest. Remove this last phrase from the changelog please, the underlying bug is not fixed on newer KVM versions. Otherwise Reviewed-by: Marcelo Tosatti mtosa...@redhat.com -- To unsubscribe from this list: send the line unsubscribe kvm

Re: [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-14 Thread Marcelo Tosatti
On Fri, May 09, 2014 at 01:53:32PM +0200, Paolo Bonzini wrote: Il 09/05/2014 04:28, Marcelo Tosatti ha scritto: Alex, Unability to upgrade systems is not an excuse to fix the bug in the wrong place. It may be an excuse to fix the bug in both places though. Paolo Actually, its messy

Re: [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-14 Thread Marcelo Tosatti
On Mon, May 12, 2014 at 10:26:37PM +0200, Alexander Graf wrote: On 09.05.14 13:53, Paolo Bonzini wrote: Il 09/05/2014 04:28, Marcelo Tosatti ha scritto: Alex, Unability to upgrade systems is not an excuse to fix the bug in the wrong place. It may be an excuse to fix the bug in both

KVM: x86: disable master clock if TSC is reset during suspend

2014-05-14 Thread Marcelo Tosatti
Updating system_time from the kernel clock once master clock has been enabled can result in time backwards event, in case kernel clock frequency is lower than TSC frequency. Disable master clock in case its necessary to update it from the resume path. Signed-off-by: Marcelo Tosatti mtosa

KVM: x86: disable master clock if TSC is reset during suspend (v2)

2014-05-14 Thread Marcelo Tosatti
Updating system_time from the kernel clock once master clock has been enabled can result in time backwards event, in case kernel clock frequency is lower than TSC frequency. Disable master clock in case its necessary to update it from the resume path. Signed-off-by: Marcelo Tosatti mtosa

Re: KVM: x86: disable master clock if TSC is reset during suspend

2014-05-14 Thread Marcelo Tosatti
On Wed, May 14, 2014 at 11:09:36AM +0200, Paolo Bonzini wrote: Il 14/05/2014 09:26, Marcelo Tosatti ha scritto: Updating system_time from the kernel clock once master clock has been enabled can result in time backwards event, in case kernel clock frequency is lower than TSC frequency

KVM: x86: disable master clock if TSC is reset during suspend (v3)

2014-05-14 Thread Marcelo Tosatti
Updating system_time from the kernel clock once master clock has been enabled can result in time backwards event, in case kernel clock frequency is lower than TSC frequency. Disable master clock in case its necessary to update it from the resume path. Signed-off-by: Marcelo Tosatti mtosa

Re: [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-08 Thread Marcelo Tosatti
On Thu, May 08, 2014 at 09:21:29AM +0200, Alexander Graf wrote: On 08.05.14 03:33, Marcelo Tosatti wrote: On Mon, May 05, 2014 at 03:51:22PM +0200, Alexander Graf wrote: When we migrate we ask the kernel about its current belief on what the guest time would be. However, I've seen cases where

Re: [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-07 Thread Marcelo Tosatti
On Tue, May 06, 2014 at 09:18:27AM +0200, Alexander Graf wrote: On 06.05.14 01:31, Marcelo Tosatti wrote: On Mon, May 05, 2014 at 08:23:43PM -0300, Marcelo Tosatti wrote: Hi Alexander, On Mon, May 05, 2014 at 03:51:22PM +0200, Alexander Graf wrote: When we migrate we ask the kernel about

Re: [Qemu-devel] [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-07 Thread Marcelo Tosatti
On Tue, May 06, 2014 at 09:54:35PM +0200, Marcin Gibuła wrote: Yes, and it isn't. Any ideas why it's not? This patch really just uses the guest visible kvmclock time rather than the host view of it on migration. There is definitely something very broken on the host's side since it does

Re: [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-05 Thread Marcelo Tosatti
Hi Alexander, On Mon, May 05, 2014 at 03:51:22PM +0200, Alexander Graf wrote: When we migrate we ask the kernel about its current belief on what the guest time would be. KVM_GET_CLOCK which returns the time in struct kvm_clock_data. However, I've seen cases where the kvmclock guest

Re: [Qemu-devel] [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-05 Thread Marcelo Tosatti
On Mon, May 05, 2014 at 08:26:04PM +0200, Marcin Gibuła wrote: is it possible to have kvmclock jumping forward? Because I've reproducible case when at about 1 per 20 vm restores, VM freezes for couple of hours and then resumes with date few hundreds years ahead. Happens only with kvmclock.

<    1   2   3   4   5   6   7   8   9   10   >