From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753176AbcKTNKG (ORCPT ); Sun, 20 Nov 2016 08:10:06 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:44116 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbcKTNKF (ORCPT ); Sun, 20 Nov 2016 08:10:05 -0500 Date: Sun, 20 Nov 2016 14:10:02 +0100 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , Ingo Molnar , x86@kernel.org, Borislav Petkov , Yinghai Lu Subject: Re: [patch 4/8] x86/tsc: Verify TSC_ADJUST from idle Message-ID: <20161120131002.GZ3117@twins.programming.kicks-ass.net> References: <20161119133816.633700010@linutronix.de> <20161119134017.732180441@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161119134017.732180441@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 Sat, Nov 19, 2016 at 01:47:37PM -0000, Thomas Gleixner wrote: > When entering idle, it's a good oportunity to verify that the TSC_ADJUST > MSR has not been tampered with (BIOS hiding SMM cycles). If tampering is > detected, emit a warning and restore it to the previous value. > +++ b/arch/x86/kernel/process.c > @@ -277,6 +277,7 @@ void exit_idle(void) > > void arch_cpu_idle_enter(void) > { > + tsc_verify_tsc_adjust(); > local_touch_nmi(); > enter_idle(); > } Doing a RDMSR on the idle path isn't going to be popular. That path is already way too slow.