Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753578AbbGUT3n (ORCPT ); Tue, 21 Jul 2015 15:29:43 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:33618 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752510AbbGUT3m (ORCPT ); Tue, 21 Jul 2015 15:29:42 -0400 MIME-Version: 1.0 In-Reply-To: <5808.1437505205@turing-police.cc.vt.edu> References: <20150708160750.GQ19282@twins.programming.kicks-ass.net> <559D8250.8000707@gmail.com> <20150710141359.GJ19282@twins.programming.kicks-ass.net> <20150721082107.GE18673@twins.programming.kicks-ass.net> <20150721154959.GS19282@twins.programming.kicks-ass.net> <20150721161215.GU19282@twins.programming.kicks-ass.net> <20150721181553.GA3378@nazgul.tnic> <55AE9471.1000601@gmail.com> <5808.1437505205@turing-police.cc.vt.edu> From: Andy Lutomirski Date: Tue, 21 Jul 2015 12:29:21 -0700 Message-ID: Subject: Re: Kernel broken on processors without performance counters To: Valdis Kletnieks Cc: Jason Baron , Borislav Petkov , Peter Zijlstra , Thomas Gleixner , Mikulas Patocka , Paul Mackerras , Arnaldo Carvalho de Melo , Kees Cook , Andrea Arcangeli , Vince Weaver , "hillf.zj" , "linux-kernel@vger.kernel.org" , Steven Rostedt Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1020 Lines: 24 On Tue, Jul 21, 2015 at 12:00 PM, wrote: > On Tue, 21 Jul 2015 11:54:30 -0700, Andy Lutomirski said: > >> Could this be done at link time, or perhaps when compressing the >> kernel image, instead of at boot time? > > That's only safe to do if the kernel is built for one specific CPU - if it's > a generic kernel that boots on multiple hardware designs, it will be wrong > for some systems. > > In other words - safe to do if you're building it for *your* hardware. Totally > unsafe for a distro. That's not what I meant. We do something in the C code that tells the build step which way the initial state goes. At link time, we make the initial state actually work like that. Then, at run time, we can still switch it again if needed. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/