From: Tim Deegan Subject: Re: [PATCH V2] x86/hvm: fix saved pmtimer value Date: Thu, 10 Sep 2015 12:03:00 +0100 Message-ID: <20150910110300.GA10477@deinos.phlegethon.org> References: <87io7ikduw.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <87io7ikduw.fsf@pingu.sky.yk.fujitsu.co.jp> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Kouya Shimura Cc: Wei Liu , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi, At 15:06 +0900 on 10 Sep (1441897575), Kouya Shimura wrote: > The ACPI PM timer is sometimes broken on live migration. > Since vcpu->arch.hvm_vcpu.guest_time is always zero in other than > "delay for missed ticks mode". Even in "delay for missed ticks mode", > vcpu's guest_time field is not valid (i.e. zero) when > the state of vcpu is "blocked". (see pt_save_timer function) Nice catch, thanks! > The original author (Tim Deegan) of pmtimer_save() must have > intended that it saves the last scheduled time of the > vcpu. Unfortunately it was already implied this bug. FYI, there is > no other timer mode than "delay for missed ticks mode" then. For > consistency with HPET, pmtimer_save() should refer > hvm_get_guest_time() to update the counter as well as hpet_save() > does. Using hvm_get_guest_time() here means the guest will see a time jump for the delay between being paused and the HVM state being saved. OTOH, fixing it so that this always uses the pause time (e.g. by making pt_freeze_time() always save the time as it used to) means the guest will see a time difference between PMTIMER and other HVM state (e.g. HPET). So I think this change is fine. But please update the comment right above it that talks about using the saved time! Cheers, Tim.