Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751089AbVKKT6m (ORCPT ); Fri, 11 Nov 2005 14:58:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751100AbVKKT6m (ORCPT ); Fri, 11 Nov 2005 14:58:42 -0500 Received: from smtp.osdl.org ([65.172.181.4]:1684 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751089AbVKKT6l (ORCPT ); Fri, 11 Nov 2005 14:58:41 -0500 Date: Fri, 11 Nov 2005 11:58:20 -0800 (PST) From: Linus Torvalds To: Zachary Amsden cc: Pavel Machek , Andrew Morton , Linux Kernel Mailing List , "H. Peter Anvin" , Zwane Mwaikambo , Pratap Subrahmanyam , Christopher Li , "Eric W. Biederman" , Ingo Molnar Subject: Re: [PATCH 1/10] Cr4 is valid on some 486s In-Reply-To: <4374F2D5.7010106@vmware.com> Message-ID: References: <200511100032.jAA0WgUq027712@zach-dev.vmware.com> <20051111103605.GC27805@elf.ucw.cz> <4374F2D5.7010106@vmware.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 908 Lines: 35 On Fri, 11 Nov 2005, Zachary Amsden wrote: > > Agree nested exceptions are evil. But where is this called from execption > context? We have really nice ways of handling these things, so we should just use them. For example, you can do static inline void read_cr4(void) { unsigned long cr4; alternative_input("xorl %0,%0", "movl %%cr4,%0", X86_FEATURE_CR4, "r" (cr4)); return cr4; } and then just add that feature-flag discovery early on in boot (it needs to be pretty early, since the alternative instruction rewriting happens early). We have several "calculated" features already. Things like X86_FEATURE_P4 etc. Linus - 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/