From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751113AbdKTLYg (ORCPT ); Mon, 20 Nov 2017 06:24:36 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:57811 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751021AbdKTLYf (ORCPT ); Mon, 20 Nov 2017 06:24:35 -0500 Date: Mon, 20 Nov 2017 12:24:29 +0100 (CET) From: Thomas Gleixner To: Jan Kiszka cc: Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Linux Kernel Mailing List , jailhouse-dev@googlegroups.com Subject: Re: [PATCH 05/10] x86: jailhouse: Set up timekeeping In-Reply-To: <12f18935-51a5-08a1-bf72-42e3367a2f87@web.de> Message-ID: References: <62f3fde8db44e5aedf934b5a753d448979f50082.1510817211.git.jan.kiszka@siemens.com> <12f18935-51a5-08a1-bf72-42e3367a2f87@web.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 18 Nov 2017, Jan Kiszka wrote: > On 2017-11-17 23:49, Thomas Gleixner wrote: > > On Thu, 16 Nov 2017, Jan Kiszka wrote: > >> Calibrate the TSC and, where necessary, the APIC timer against the > >> TMTIMER. We need our own implementation as neither the PIC nor the HPET > >> are available, and the standard calibration routines try to make use of > >> them. > > > > Why is this needed at all? > > > > The host the frequency already. So this can be done w/o pmtimer and extra > > calibration routine. > > The hypervisor does not have the frequencies. It will never use the APIC > timer (it's owned by the guests), and it has no use case for the TSC so > far. Only the root cell (the Linux that booted the system) has that > data. Now we could > > - trust the root cell to provide the right values and export them during > startup to the hypervisor and from there to the non-root cells. > > - calculate the frequencies once and store them in the hyperivsor > config, just like other system-specific information, for re-export to > the cells. > > But I don't think option 1 will be ok for all use cases. Maybe a > combination of both, falling back to the root cell data if nothing is > defined in the config. Let me think about this. Another question is whether systems which can support jailhouse, have the frequencies available via cpuid/msr and can avoid that calibration thing completely. Thanks, tglx