From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751856AbcGFGEP (ORCPT ); Wed, 6 Jul 2016 02:04:15 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34695 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404AbcGFGEN (ORCPT ); Wed, 6 Jul 2016 02:04:13 -0400 Subject: Re: [PATCH] KVM: VMX: switch to hrtimer for TSC deadline timer when L2 guest is running To: Wanpeng Li , Haozhong Zhang References: <20160706051051.7869-1-haozhong.zhang@intel.com> Cc: kvm , Radim Krcmar , Yunhong Jiang , Wanpeng Li , "linux-kernel@vger.kernel.org" , Jan Kiszka From: Paolo Bonzini Message-ID: <1a2c4809-ac93-d0cc-b79a-5ff891d7920c@redhat.com> Date: Wed, 6 Jul 2016 08:04:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/2016 07:37, Wanpeng Li wrote: > Cc Jan, > 2016-07-06 13:10 GMT+08:00 Haozhong Zhang : >> A different VMCS is loaded when L2 guest is running, so it's incorrect >> to use the VMX preemption timer for L1 TSC deadline timer. This patch >> switches to hrtimer for L1 TSC deadline timer when entering L2 guest, >> and switches back to VMX preemption timer when nested VMEXIT from L2 to >> L1. > > Nested preemption timer is emulated by hrtimer, so it doesn't > influence vmcs02, why this is needed? I agree (and nested APIC timer is emulated by L1). Because the L1 APIC timer is set in the preemption timer before vmentry, this should not be necessary. Paolo