From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932927AbcLMN0W (ORCPT ); Tue, 13 Dec 2016 08:26:22 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:41571 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932312AbcLMN0U (ORCPT ); Tue, 13 Dec 2016 08:26:20 -0500 Date: Tue, 13 Dec 2016 14:23:36 +0100 (CET) From: Thomas Gleixner To: Peter Zijlstra cc: LKML , x86@kernel.org, Borislav Petkov , Bruce Schlobohm , Roland Scheidegger , Kevin Stanton , Allen Hung Subject: Re: [patch 1/2] x86/tsc: Validate TSC_ADJUST after resume In-Reply-To: <20161213132250.GK3124@twins.programming.kicks-ass.net> Message-ID: References: <20161213131115.764824574@linutronix.de> <20161213131211.317654500@linutronix.de> <20161213132250.GK3124@twins.programming.kicks-ass.net> 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 Tue, 13 Dec 2016, Peter Zijlstra wrote: > On Tue, Dec 13, 2016 at 01:14:17PM -0000, Thomas Gleixner wrote: > > --- a/arch/x86/power/cpu.c > > +++ b/arch/x86/power/cpu.c > > @@ -256,6 +256,7 @@ static void notrace __restore_processor_ > > mtrr_bp_restore(); > > perf_restore_debug_store(); > > msr_restore_context(ctxt); > > + tsc_verify_tsc_adjust(true); > > } > > Should we do that sooner, as in before calling > restore_sched_clock_state() ? Otherwise we recompute the sched_clock > deltas vs the wrecked TSC and then fix it up through the ADJUST, > wrecking our sched clock again. Ah. Indeed. Will fix. That needs some thought on the secondary CPUs as well... Thanks, tglx