From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 17/30] nVMX: Prepare vmcs02 from vmcs01 and vmcs12 Date: Mon, 09 May 2011 13:45:50 +0300 Message-ID: <4DC7C5DE.8070106@redhat.com> References: <1304842511-nyh@il.ibm.com> <201105080823.p488Nuj8018238@rice.haifa.ibm.com> <4DC7BE01.80709@redhat.com> <20110509102712.GA26926@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, gleb@redhat.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8483 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637Ab1EIKp6 (ORCPT ); Mon, 9 May 2011 06:45:58 -0400 In-Reply-To: <20110509102712.GA26926@fermat.math.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: On 05/09/2011 01:27 PM, Nadav Har'El wrote: > Hi, and thanks again for the reviews. > > On Mon, May 09, 2011, Avi Kivity wrote about "Re: [PATCH 17/30] nVMX: Prepare vmcs02 from vmcs01 and vmcs12": > > >+ vmcs_write64(TSC_OFFSET, > > >+ vmx->nested.vmcs01_tsc_offset + vmcs12->tsc_offset); > > > > This is probably wrong (everything with time is probably wrong), but we > > can deal with it (much) later. > > I thought this was right :-) Why do you believe it to be wrong? Just out of principle, everything to do with time is wrong. > L1 wants to add vmcs12->tsc_offset to its own TSC to generate L2's TSC. > But L1's TSC is itself with vmx->nested.vmcs01_tsc_offset from L0's TSC. > So their sum, vmx->nested.vmcs01_tsc_offset + vmcs12->tsc_offset, is the > offset of L2's TSC from L0's TSC. Am I missing something? Only Zach knows. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.