From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nadav Har'El" Subject: Re: TSC in nested SVM and VMX Date: Sun, 3 Oct 2010 10:35:09 +0200 Message-ID: <20101003083509.GA21130@fermat.math.technion.ac.il> References: <20100930225058.GA10452@fermat.math.technion.ac.il> <4CA565D0.9010202@redhat.com> <20101001112142.GA15107@fermat.math.technion.ac.il> <9324F9C3-A54A-4A2B-BF00-BFB1998FAFB0@suse.de> <4CA634EC.3090903@redhat.com> <4CA7B659.6070808@redhat.com> <139B2203-E0AE-4518-BE38-F0CC851777FB@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Zachary Amsden , "kvm@vger.kernel.org" , "joro@8bytes.org" , Avi Kivity To: Alexander Graf Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:33714 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752512Ab0JCIfN (ORCPT ); Sun, 3 Oct 2010 04:35:13 -0400 Content-Disposition: inline In-Reply-To: <139B2203-E0AE-4518-BE38-F0CC851777FB@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Oct 03, 2010, Alexander Graf wrote about "Re: TSC in nested SVM and VMX": > Looking through the spec, the only indicator I've found is this passage: > > TSC_OFFSET - an offset to add when the guest reads the TSC (time stamp > counter). Guest writes to the TSC can be intercepted and emulated by > changing the offset (without writing the physical TSC). This offset is > cleared when the guest exits back to the host. > > So apparently writes to TSC don't affect tsc_offset, but instead affect > the host's tsc skew. So with nesting a non-intercepted tsc write affects > L1's tsc_offset. This means the code is correct. Sorry for the fuss :). I don't understand, how does this passage imply that writes to the TSC don't affect the tsc_offset? It says that "writes to the TSC" can (I don't know why this word was used...) "changing the offset". I don't understand why a guest should be allowed to ruin its host's TSC (or in the nested case, why an L2 should be allowed to ruin L1's TSC without L1's knowledge) - isn't this exactly why the TSC offset exists? -- Nadav Har'El | Sunday, Oct 3 2010, 25 Tishri 5771 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |"Computers are useless. They can only http://nadav.harel.org.il |give you answers." -- Pablo Picasso