Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752924AbcDCJ5O (ORCPT ); Sun, 3 Apr 2016 05:57:14 -0400 Received: from www.linutronix.de ([62.245.132.108]:58622 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbcDCJ5M (ORCPT ); Sun, 3 Apr 2016 05:57:12 -0400 Date: Sun, 3 Apr 2016 11:55:34 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: Andy Lutomirski , X86 ML , Borislav Petkov , "linux-kernel@vger.kernel.org" , Linux API Subject: Re: [PATCH] x86: Add a turbo mode sysctl In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1016 Lines: 26 On Sat, 2 Apr 2016, Andy Lutomirski wrote: > On Fri, Apr 1, 2016 at 9:10 AM, Thomas Gleixner wrote: > >> + if (turbo_mode) > >> + write_cr0(cr0 & ~X86_CR0_CD); > >> + else > >> + write_cr0(cr0 | X86_CR0_CD); > > > > I think proper turbo mode disable requires ~(X86_CR0_CD | X86_CR0_NW) > > I thought that made no difference on family 6 and P4 and was actively > dangerous (disabled coherency) before. At least, that's what the > table of caching modes and the footnote seems to say. CD=0 and NW=1 result in #GP, which might be your intent as that is definitely the slowest mode you can achieve. But you should add a comment at least. > I think we should merge this patch and add a special-case so that > calling unlink on turbo_mode sets it to zero. Then people who rm -rf > / will brick their systems more slowly :) While at it can you please make a turbo = 0 call when we hit a WARN/BUG/Panic so the messages spill slower over the screen? Thanks, tglx