From owner-freebsd-current@FreeBSD.ORG Mon Jan 2 19:03:53 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 794FC16A41F for ; Mon, 2 Jan 2006 19:03:53 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBECE43D45 for ; Mon, 2 Jan 2006 19:03:51 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5F5E3.dip.t-dialin.net [84.165.245.227]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.1/8.13.1) with ESMTP id k02J0Edi070876; Mon, 2 Jan 2006 20:00:14 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from localhost (localhost [127.0.0.1]) by Andro-Beta.Leidinger.net (8.13.3/8.13.3) with ESMTP id k02J3mRn085862; Mon, 2 Jan 2006 20:03:49 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (Andro-Beta.Leidinger.net [192.168.1.42]) by webmail.leidinger.net (Horde MIME library) with HTTP; Mon, 02 Jan 2006 20:03:47 +0100 Message-ID: <20060102200347.2bumr7okkkgossww@netchild.homeip.net> X-Priority: 3 (Normal) Date: Mon, 02 Jan 2006 20:03:47 +0100 From: Alexander Leidinger To: Divacky Roman References: <20060102101653.GA65178@stud.fit.vutbr.cz> In-Reply-To: <20060102101653.GA65178@stud.fit.vutbr.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) / FreeBSD-4.11 X-Virus-Scanned: by amavisd-new Cc: current@freebsd.org Subject: Re: AMD cache values for page colouring X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2006 19:03:53 -0000 Divacky Roman wrote: [no cachesize detection] > my CPU is: > CPU: AMD Athlon(tm) XP 2500+ (1834.88-MHz 686-class CPU) > Origin = "AuthenticAMD" Id = 0x6a0 Stepping = 0 > Features=0x383fbff > AMD Features=0xc0400800 So the AMD64 code works (on AMD processors) but the IA32 (on AMD) fails. Either I did something completely wrong, or it's a small typo I do overlook (tomatoes on the eyes...). Can someone with a little bit of AMD feature detection knowledge have a look at: ---snip--- static void setPQL2_AMD(int *const size, int *const ways) { if (cpu_exthigh >= 0x80000006) { u_int regs[4]; do_cpuid(0x80000006, regs); *size = regs[2] >> 16; *ways = (regs[2] >> 12) & 0x0f; if(*ways == 255) /* fully associative */ *ways = 1; } } void setPQL2(int *const size, int *const ways) { if (strcmp(cpu_vendor, "AuthenticAMD") == 0) setPQL2_AMD(size, ways); else if (strcmp(cpu_vendor, "GenuineIntel") == 0) setPQL2_INTEL(size, ways); } ---snip--- This is from sys/i386/i386/identcpu.c. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 When we are planning for posterity, we ought to remember that virtue is not hereditary. -- Thomas Paine