From ohki@gssm.otsuka.tsukuba.ac.jp  Tue Apr  9 22:55:53 2002
Return-Path: <ohki@gssm.otsuka.tsukuba.ac.jp>
Received: from gssm.otsuka.tsukuba.ac.jp (utogwgw.gssm.otsuka.tsukuba.ac.jp [130.158.176.189])
	by hub.freebsd.org (Postfix) with SMTP id D1B7D37B405
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Apr 2002 22:55:51 -0700 (PDT)
Received: (qmail 96544 invoked from network); 10 Apr 2002 05:55:50 -0000
Received: from OneOfLocalMachines (HELO smr01.gssm.otsuka.tsukuba.ac.jp) (10.2.1.2)
  by 10.1.1.1 with SMTP; 10 Apr 2002 05:55:50 -0000
Received: (from ohki@localhost)
	by smr01.gssm.otsuka.tsukuba.ac.jp (8.11.6/8.11.6) id g3A5tox02367;
	Wed, 10 Apr 2002 14:55:50 +0900 (JST)
	(envelope-from ohki)
Message-Id: <200204100555.g3A5tox02367@smr01.gssm.otsuka.tsukuba.ac.jp>
Date: Wed, 10 Apr 2002 14:55:50 +0900 (JST)
From: Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp>
Reply-To: Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: linux emulation does not work well on SMP
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36953
>Category:       kern
>Synopsis:       linux emulation does not work well on SMP
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 09 23:00:01 PDT 2002
>Closed-Date:    Tue Aug 19 03:35:13 PDT 2003
>Last-Modified:  Tue Aug 19 03:35:13 PDT 2003
>Originator:     Atsuo Ohki
>Release:        FreeBSD 4.5-RELEASE i386
>Organization:
gssm, Univesity of Tsukua, Tokyo
>Environment:
System: FreeBSD smr01 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Wed Feb 27 19:18:56 JST 2002 ohki@smr01:/usr/src/sys/compile/gssm i386


>Description:
	linux emulation does not work well on SMP
>How-To-Repeat:
	run Java demo programs of jdk1.4.0
>Fix:

--- sys/i386/linux-REL/linprocfs/linprocfs_misc.c	Tue Jun 26 04:46:47 2001
+++ sys/i386/linux/linprocfs/linprocfs_misc.c	Mon Feb 25 13:28:52 2002
@@ -41,6 +41,7 @@
  * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_misc.c,v 1.3.2.8 2001/06/25 19:46:47 pirzyk Exp $
  */
 
+#include "../../../../../../opt_global.h"	/* for SMP */
 #include <sys/param.h>
 #include <sys/blist.h>
 #include <sys/dkstat.h>
@@ -172,7 +173,13 @@
 {
 	char *ps;
 	int xlen;
+#ifdef SMP
+	extern int mp_ncpus;
+	char psbuf[512*4];		/* XXX - conservative */
+	int cpuidx;
+#else
 	char psbuf[512];		/* XXX - conservative */
+#endif /* SMP */
 	int class;
         int i;
 #if 0
@@ -218,13 +225,20 @@
 	}
 
 	ps = psbuf;
+#ifdef SMP
+    for (cpuidx = 0; cpuidx < mp_ncpus; cpuidx++) {
+#endif /* SMP */
 	ps += sprintf(ps,
 			"processor\t: %d\n"
 			"vendor_id\t: %.20s\n"
 			"cpu family\t: %d\n"
 			"model\t\t: %d\n"
 			"stepping\t: %d\n",
+#ifdef SMP
+			cpuidx, cpu_vendor, class, cpu, cpu_id & 0xf);
+#else
 			0, cpu_vendor, class, cpu, cpu_id & 0xf);
+#endif /* SMP */
 
         ps += sprintf(ps,
                         "flags\t\t:");
@@ -248,6 +262,9 @@
                         (tsc_freq + 4999) / 1000000,
                         ((tsc_freq + 4999) / 10000) % 100);
         }
+#ifdef SMP
+    }
+#endif /* SMP */
         
 	xlen = ps - psbuf;
 	xlen -= uio->uio_offset;



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Tue Jun 11 14:06:43 PDT 2002 
Responsible-Changed-Why:  
Linprocfs patch to show multiple CPUs should probably belond to DES. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36953 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Tue Aug 19 03:34:52 PDT 2003 
State-Changed-Why:  
Duplicate of 27543. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36953 
>Unformatted:
