From: Dan Magenheimer Subject: RE: [RFC] Physical hot-add cpus and TSC Date: Wed, 26 May 2010 10:39:40 -0700 (PDT) Message-ID: <64b09ca3-fb6e-4c06-907d-94560aab2420@default> References: <5738eada-ede6-4a58-af6b-a7f965aa3ecf@default C8231914.15F11%keir.fraser@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , "Xen-Devel (xen-devel@lists.xensource.com)" , Ian Pratt List-Id: xen-devel@lists.xenproject.org > From: Keir Fraser [mailto:keir.fraser@eu.citrix.com] > Subject: Re: [Xen-devel] [RFC] Physical hot-add cpus and TSC >=20 > On 26/05/2010 17:44, "Dan Magenheimer" > wrote: >=20 > >> True at the moment, but can we not just whack the TSC of the newly > >> added CPU on the head when it is brought online, to match the > >> boot CPU? > > > > Possibly... but the code for whacking the TSC of a CPU after > > C3-state results in a TSC value that is poorly-aligned with other > > running TSCs. If there is a better way for "whacking" that > > results in a nearly-perfectly-aligned TSC (that would pass > > a "tsc warp test"), that is an option. >=20 > But what we do in 4.0 is whack all the TSCs at boot time... How is this > any different? I don't think we do that anymore, at least not when the underlying machine is deemed to have a stable TSC (Invariant TSC or constant/nonstop TSC with max_cstate<3). > From: Ian Pratt [mailto:Ian.Pratt@eu.citrix.com] > Subject: RE: [Xen-devel] [RFC] Physical hot-add cpus and TSC >=20 > > Possibly... but the code for whacking the TSC of a CPU after > > C3-state results in a TSC value that is poorly-aligned with other > > running TSCs. If there is a better way for "whacking" that > > results in a nearly-perfectly-aligned TSC (that would pass > > a "tsc warp test"), that is an option. >=20 > It ought to be possible to enhance the "whacking" code to set the TSC > based on the topologically nearest live CPU and then sanity-check > against all others, repeating a few times to protect against SMIs etc. Well obviously firmware can do it pre-boot, but I don't know what the impact of the mechanism is on running cpu's. I'd assume that at least all guest activity would have to be stopped for some not-so-short period (~10-100msec?)