From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [v6] kvm/fpu: Enable fully eager restore kvm FPU Date: Fri, 24 Apr 2015 09:55:24 +0200 Message-ID: <5539F6EC.6080604@redhat.com> References: <1429823583-3226-1-git-send-email-liang.z.li@intel.com> <55390F9A.2070808@intel.com> <553955D9.3030600@zytor.com> <5539F45D.6020400@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: "gleb@kernel.org" , "mtosatti@redhat.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "x86@kernel.org" , "joro@8bytes.org" , "Hao, Xudong" To: "Zhang, Yang Z" , "H. Peter Anvin" , "Hansen, Dave" , "Li, Liang Z" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47602 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755431AbbDXHzm (ORCPT ); Fri, 24 Apr 2015 03:55:42 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 24/04/2015 09:46, Zhang, Yang Z wrote: > > On the other hand vmexit is lighter and lighter on newer processors; a > > Sandy Bridge has less than half the vmexit cost of a Core 2 (IIRC 1000 > > vs. 2500 clock cycles approximately). > > 1000 cycles? I remember it takes about 4000 cycle even in HSW server. I was going from memory, but I now measured it with the vmexit test of kvm-unit-tests. With both SNB Xeon E5 and IVB Core i7, returns about 1400 clock cycles for a vmcall exit. This includes the overhead of doing the cpuid itself. Thus the vmexit cost is around 1300 cycles. Of this the vmresume instruction is probably around 800 cycles, and the rest is introduced by KVM. There are at least 4-5 memory barriers and locked instructions. Paolo