From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753636AbcLMNXQ (ORCPT ); Tue, 13 Dec 2016 08:23:16 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:54167 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753081AbcLMNXP (ORCPT ); Tue, 13 Dec 2016 08:23:15 -0500 Date: Tue, 13 Dec 2016 14:22:50 +0100 From: Peter Zijlstra To: Thomas Gleixner 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 Message-ID: <20161213132250.GK3124@twins.programming.kicks-ass.net> References: <20161213131115.764824574@linutronix.de> <20161213131211.317654500@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161213131211.317654500@linutronix.de> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.