From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [RFC PATCH V2 4/4] Utilize the vmx preemption timer for tsc deadline timer Date: Thu, 26 May 2016 17:32:54 +0200 Message-ID: <780d65f1-5908-a1f5-c7a1-8124be630366@redhat.com> References: <1464128852-14138-1-git-send-email-yunhong.jiang@linux.intel.com> <1464128852-14138-5-git-send-email-yunhong.jiang@linux.intel.com> <4d3a7b46-f663-92f0-8d3d-d95cf9aa10f2@redhat.com> <20160525154420.2c7fdcd3@jnakajim-build> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com, rkrcmar@redhat.com, kernellwp@gmail.com To: Alan Jenkins , yunhong jiang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56895 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753823AbcEZPdA (ORCPT ); Thu, 26 May 2016 11:33:00 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 26/05/2016 16:05, Alan Jenkins wrote: > 1. Against my interests: have you actually confirmed the VMX preemption > timer is affected by guest TSC scaling? No, it's not, hence my formula: host_tsc = ((unsigned __int128)(guest_tsc - tsc_offset) << kvm_tsc_scaling_ratio_frac_bits) / vcpu->arch.tsc_scaling_ratio; The idea is that once you have a host TSC deadline, you can use it to set the preemption timer on vmentry. > It's not explicit in the SDM. The way it's described for allocating > timeslices to the guest, IMO it makes more sense if it is not scaled. > > 2. Paolo, any chance I could also get away with requiring 64-bit? I.e. > > #ifdef CONFIG_X86_64 > #define HAVE_LAPIC_TIMER_ADVANCE 1 > #endif I wouldn't object. Paolo