From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v5] KVM: nVMX: Fully support of nested VMX preemption timer Date: Sun, 29 Sep 2013 14:30:51 +0300 Message-ID: <20130929113051.GT17294@redhat.com> References: <1379319104-10266-1-git-send-email-yzt356@gmail.com> <52444CF6.1020102@redhat.com> <52446C8D.8030000@web.de> <52447335.9090601@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kiszka , Arthur Chunqi Li , kvm@vger.kernel.org, "Zhang, Yang Z" To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223Ab3I2Lay (ORCPT ); Sun, 29 Sep 2013 07:30:54 -0400 Content-Disposition: inline In-Reply-To: <52447335.9090601@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Sep 26, 2013 at 07:47:33PM +0200, Paolo Bonzini wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Il 26/09/2013 19:19, Jan Kiszka ha scritto: > > On 2013-09-26 17:04, Paolo Bonzini wrote: > >> Il 16/09/2013 10:11, Arthur Chunqi Li ha scritto: > >>> This patch contains the following two changes: > >>> 1. Fix the bug in nested preemption timer support. If vmexit L2->L0 > >>> with some reasons not emulated by L1, preemption timer value should > >>> be save in such exits. > >>> 2. Add support of "Save VMX-preemption timer value" VM-Exit controls > >>> to nVMX. > >>> > >>> With this patch, nested VMX preemption timer features are fully > >>> supported. > >>> > >>> Signed-off-by: Arthur Chunqi Li > >>> --- > >>> ChangeLog to v4: > >>> Format changes and remove a flag in nested_vmx. > >>> arch/x86/include/uapi/asm/msr-index.h | 1 + > >>> arch/x86/kvm/vmx.c | 44 +++++++++++++++++++++++++++++++-- > >>> 2 files changed, 43 insertions(+), 2 deletions(-) > >> > >> Hi all, > >> > >> the test fails for me if the preemption timer value is set to a value > >> that is above ~2000 (which means ~65000 TSC cycles on this machine). > >> The preemption timer seems to count faster than what is expected, for > >> example only up to 4 million cycles if you set it to one million. > >> So, I am leaving the patch out of kvm/queue for now, until I can > >> test it on more processors. > > > > So this behaviour is a regression of this patch (and your own version as > > well)? > > Without this patch Arthur's preemption timer test doesn't work at all. > Have you ruled out test bugs? I see things like: + int i, j; ... + // Consume enough time to let L2->L0->L2 occurs + for(i = 0; i < 100000; i++) + for (j = 0; j < 10000; j++); which can be optimized out. Or use of rdtsc() which can be problematic if host tsc is not synchronised. -- Gleb.