From owner-svn-src-all@FreeBSD.ORG Sun Nov 23 00:51:59 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A920D1065675 for ; Sun, 23 Nov 2008 00:51:59 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id 3B58A8FC17 for ; Sun, 23 Nov 2008 00:51:59 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1486623rvf.43 for ; Sat, 22 Nov 2008 16:51:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=lKEAw7e8JqSm0WAUsuKXP9fzu/HHRKJn1a+Yi3sL0uE=; b=MgT8tWQpD3YpYumh50OhEzjBajLSQzVn81QZZ0QTXhymv66u6c5azMXth7Sc6j3Ty/ K0zT532g7ukm3rCSUecIaByYouG/ttuTyFBL/Tlo1nloSNQii9+FC4Tqhkb+26Q1zBLT p/kjocBv/N27LKZ49BH1+B0VkvQ7VKd3/DnDE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=c1hcx4yi+Cj0Chu7sVieD/6wfT9k5BguBM9a+6/XH7vKWMqjI6hHy4kSMthL9/Eekx psebW4LW4Ik19+oym7jUOrneVR1yw77m8fCPMT1U3LIcJ5htxy98RvZMqshbCUpCWSz9 1PK5sQLJbkbvOehAdjARKexeN1Gm8bbL6EbBc= Received: by 10.140.226.13 with SMTP id y13mr1080583rvg.93.1227401518818; Sat, 22 Nov 2008 16:51:58 -0800 (PST) Received: by 10.141.153.21 with HTTP; Sat, 22 Nov 2008 16:51:58 -0800 (PST) Message-ID: <3c1674c90811221651u338294frcdbd99b386733851@mail.gmail.com> Date: Sun, 23 Nov 2008 00:51:58 +0000 From: "Kip Macy" Sender: mat.macy@gmail.com To: "Scott Long" In-Reply-To: <4928910B.1020403@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811220555.mAM5tuIJ007781@svn.freebsd.org> <20081122112949.GA6408@deviant.kiev.zoral.com.ua> <3c1674c90811221326m41e229f7p6abbc0eb473e900e@mail.gmail.com> <49288222.5060205@samsco.org> <20081122221953.GO6408@deviant.kiev.zoral.com.ua> <4928910B.1020403@samsco.org> X-Google-Sender-Auth: 59032d0dbbefb2b4 Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185162 - in head: . sys/amd64/include sys/arm/include sys/conf sys/dev/bce sys/dev/cxgb sys/dev/cxgb/sys sys/dev/cxgb/ulp/iw_cxgb sys/dev/mxge sys/dev/nxge sys/i386/include sys/i386/in... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 00:51:59 -0000 On Sat, Nov 22, 2008 at 11:08 PM, Scott Long wrote: > Kostik Belousov wrote: >> >> On Sat, Nov 22, 2008 at 03:05:22PM -0700, Scott Long wrote: >>> >>> A neat hack would be for the kernel linker to scan the text and do a >>> drop-in replacement of the opcode that is appropriate for the platform. >>> I can't see how a CPU_XXX definition would work because it's just a >>> compile time construct, one that can be included with any kernel >>> compile. >> >> Yes, it is possible to do that. Less drastic change is to directly >> check features. I moved slow code to separate section to eliminate >> unconditional jump in fast path. >> Only compile-tested. >> > > As long as it works, I think it's a step in the right direction; I'm > assuming that cpu_feature is a symbol filled in at runtime and not a > macro for the cpuid instruction, right? > > Scott > i386/include/md_var.h: <..> extern u_int cpu_exthigh; extern u_int cpu_feature; extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; <...> I'm not thrilled with it, but we can revisit the issue if it makes a measurable difference on someone's workload. Thanks, Kip -- If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis