From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Seeking a KVM benchmark Date: Mon, 10 Nov 2014 11:03:35 +0100 Message-ID: <54608D77.2090907@redhat.com> References: <545C7222.4070605@redhat.com> <20141108120125.GB2654@minantech.com> <20141109085238.GA26187@minantech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm list To: Andy Lutomirski , Gleb Natapov Return-path: Received: from mail-wg0-f41.google.com ([74.125.82.41]:50410 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbaKJKDm (ORCPT ); Mon, 10 Nov 2014 05:03:42 -0500 Received: by mail-wg0-f41.google.com with SMTP id k14so8319121wgh.28 for ; Mon, 10 Nov 2014 02:03:40 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 09/11/2014 17:36, Andy Lutomirski wrote: >> The purpose of vmexit test is to show us various overheads, so why not >> measure EFER switch overhead by having two tests one with equal EFER >> another with different EFER, instead of hiding it. > > I'll try this. We might need three tests, though: NX different, NX > same but SCE different, and all flags the same. The test actually explicitly enables NX in order to put itself in the "common case": commit 82d4ccb9daf67885a0316b1d763ce5ace57cff36 Author: Marcelo Tosatti Date: Tue Jun 8 15:33:29 2010 -0300 test: vmexit: enable NX Enable NX to disable MSR autoload/save. This is the common case anyway. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity (this commit is in qemu-kvm.git), so I guess forgetting to set SCE is just a bug. The results on my Xeon Sandy Bridge are very interesting: NX different ~11.5k (load/save EFER path) NX same, SCE different ~19.5k (urn path) all flags the same ~10.2k The inl_from_kernel results have absolutely no change, usually at most 5 cycles difference. This could be because I've added the SCE=1 variant directly to vmexit.c, so I'm running the tests one next to the other. I tried making also the other shared MSRs the same between guest and host (STAR, LSTAR, CSTAR, SYSCALL_MASK), so that the user return notifier has nothing to do. That saves about 4-500 cycles on inl_from_qemu. I do want to dig out my old Core 2 and see how the new test fares, but it really looks like your patch will be in 3.19. Paolo