From owner-freebsd-ia32@FreeBSD.ORG Wed Dec 13 12:25:05 2006 Return-Path: X-Original-To: freebsd-ia32@freebsd.org Delivered-To: freebsd-ia32@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6013A16A412 for ; Wed, 13 Dec 2006 12:25:05 +0000 (UTC) (envelope-from ranjith_kumar_b4u@yahoo.com) Received: from rrr4-v2.mail.re1.yahoo.com (rrr4-v2.mail.re1.yahoo.com [66.196.101.251]) by mx1.FreeBSD.org (Postfix) with SMTP id 0C8AD43CA2 for ; Wed, 13 Dec 2006 12:23:35 +0000 (GMT) (envelope-from ranjith_kumar_b4u@yahoo.com) Received: (qmail 23063 invoked from network); 13 Dec 2006 09:59:23 -0000 Received: from web58615.mail.re3.yahoo.com (68.142.236.213) by rrr4-v2.mail.re1.yahoo.com with SMTP; 13 Dec 2006 09:59:23 -0000 Received: (qmail 6760 invoked by uid 60001); 13 Dec 2006 09:59:23 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=4UJoT4MDaBsCXz+qtDkLDkk10z2frwEE0zapNQLLQh5ytdOeNKaKOnI66CzCZszUTMLNttc4FxiNny2ixSxxuW9d0Y5NkKQXUAmvJAoR1gGMBroD9xY4Sg7mrUXO5o3l4dXQmkS6gaK0LJv0Z1HfqkGV5hheQF9tlDJh/WQ2bFE=; X-YMail-OSG: OJdqXM4VM1n.tjz8tzj39rhxSqN2Gph6XbFbUagMuXduya8w23ZWN_Vvr.A9j3zdq.G8Ik5mFQq9om5c6P6PpI0j29sTENUo8fvo5Kz0ZVtwWRAjqrH4KA-- Received: from [59.163.25.48] by web58615.mail.re3.yahoo.com via HTTP; Wed, 13 Dec 2006 01:59:23 PST Date: Wed, 13 Dec 2006 01:59:23 -0800 (PST) From: ranjith kumar To: freebsd-ia32@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <75870.6526.qm@web58615.mail.re3.yahoo.com> X-Mailman-Approved-At: Wed, 13 Dec 2006 12:53:00 +0000 Subject: writing to performance event select registers X-BeenThere: freebsd-ia32@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD on the IA-32 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2006 12:25:05 -0000 Hi, I want to measure number of last level cache misses in Pentium 4 processor. In IA-32 programmers manuals it was given that there are (architectural= same across all IA-32 processors)perfomance monitoring counters starting at address 0c1H and performance_event_select registers starting at address 186H. 1) When I tried to run a kernel module to write some value in performance event select register (with address 186H) by wrmsr instruction, the system is hanging.Why? The program is : #include /* Needed by all modules */ #include /* Needed for KERN_INFO */ //#include int i,j,k=0; unsigned int xx,yy,xx1,yy1,xx2,yy2; unsigned int t1,t2,t3,t4,BIG=0xffffffff; int init_module(void) { asm volatile (" movl $0x186, %%ecx;" " movl $0x0, %%edx;" " movl $0x0009412E, %%eax;" " wrmsr;" : : :"%eax","%edx","%ecx"); printk(KERN_INFO " Initially %u=t1 %u=t2 %u=t3 %u=t4 \n",t1,t2,t3,t4); return 0; } void cleanup_module(void) { printk(KERN_INFO "Goodbye world \n"); } ------------------------------------------------------- Thanks in advane. ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com