From: Alex Bligh Subject: Re: [PATCH] x86/vtsc: update vcpu_time after hvm_set_guest_time Date: Tue, 04 Jun 2013 11:24:45 +0100 Message-ID: <2FCD40715DE006ED58FDA5F6@Ximines.local> References: <1370337050-2444-1-git-send-email-roger.pau@citrix.com> Reply-To: Alex Bligh Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1370337050-2444-1-git-send-email-roger.pau@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Keir Fraser , Jan Beulich , George Dunlap , Alex Bligh , Diana Crisan , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org Roger, --On 4 June 2013 11:10:50 +0200 Roger Pau Monne wrote: > When using a vtsc, hvm_set_guest_time changes hvm_vcpu.stime_offset, > which is used in the vcpu time structure to calculate the > tsc_timestamp, so after updating stime_offset we need to propagate the > change to vcpu_time in order for the guest to get the right time if > using the PV clock. > > This was not done correctly, since in context_switch > update_vcpu_system_time was called before vmx_do_resume, which caused > the vcpu_info time structure to be updated with the wrong values. This > patch fixes this by calling update_vcpu_system_time after the call to > hvm_set_guest_time has happened. I think this is the 'proper' fix to the bug Diana reported about stuck clock - can you confirm? If so, we're happy to test this on 4.3 and/or do try our hand at a backport to 4.2. -- Alex Bligh