From owner-freebsd-current@FreeBSD.ORG Mon Sep 20 20:53:32 2004 Return-Path: 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 4306916A4D0 for ; Mon, 20 Sep 2004 20:53:32 +0000 (GMT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D5C843D4C for ; Mon, 20 Sep 2004 20:53:32 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 14984 invoked from network); 20 Sep 2004 20:53:31 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 20 Sep 2004 20:53:31 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i8KKrNxF025760; Mon, 20 Sep 2004 16:53:27 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Roman Kurakin Date: Mon, 20 Sep 2004 16:52:24 -0400 User-Agent: KMail/1.6.2 References: <41421D6A.8070805@cronyx.ru> <414E7581.2070505@root.org> <414F256B.1030304@cronyx.ru> In-Reply-To: <414F256B.1030304@cronyx.ru> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409201652.24457.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Roman Kurakin cc: FreeBSD Current cc: Nate Lawson Subject: Re: mp_machdep.c (was Re: [Fwd: Re: Bug reports requested - acpi]) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 20 Sep 2004 20:53:32 -0000 On Monday 20 September 2004 02:46 pm, Roman Kurakin wrote: > Hi, > > I have problem with one of my SMP systems (see end of letter). > It looks that following patch: > > Index: mp_machdep.c > =================================================================== > RCS file: /home/ncvs/src/sys/i386/i386/mp_machdep.c,v > retrieving revision 1.238 > diff -u -r1.238 mp_machdep.c > --- mp_machdep.c 1 Sep 2004 06:42:01 -0000 1.238 > +++ mp_machdep.c 20 Sep 2004 18:20:49 -0000 > @@ -747,6 +747,11 @@ > POSTCODE(INSTALL_AP_TRAMP_POST); > > pmap_kenter(boot_address + KERNBASE, boot_address); > +#ifdef I386_CPU > + invltlb(); > +#else > + invlpg((u_int)dst); > +#endif > for (x = 0; x < size; ++x) > *dst++ = *src++; > > solves the problem. I'll check it on not very recent hacked current. > So this is initial request. I'll check it with current current without my > hacks to double check that this works always and inform if this helps. > > The intent of this letter to ask community if this workaround for my > problem or real bug fix. If this is only workaround please let me know > and I'll continue to dig with version I currently use. > (I don't like workarounds) > > Best regards, > Roman Kurakin It's probably cleaner to use pmap_invalidate_range(). Something like: Index: mp_machdep.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/mp_machdep.c,v retrieving revision 1.238 diff -u -r1.238 mp_machdep.c --- mp_machdep.c 1 Sep 2004 06:42:01 -0000 1.238 +++ mp_machdep.c 20 Sep 2004 20:50:35 -0000 @@ -738,15 +738,19 @@ int x; int size = *(int *) ((u_long) & bootMP_size); u_char *src = (u_char *) ((u_long) bootMP); - u_char *dst = (u_char *) boot_address + KERNBASE; + u_char *dst; u_int boot_base = (u_int) bootMP; u_int8_t *dst8; u_int16_t *dst16; u_int32_t *dst32; + vm_offset_t va; POSTCODE(INSTALL_AP_TRAMP_POST); - pmap_kenter(boot_address + KERNBASE, boot_address); + va = boot_address + KERNBASE; + pmap_kenter(va, boot_address); + pmap_invalidate_range(kernel_pmap, va, va + size); + dst = (u_char *)va; for (x = 0; x < size; ++x) *dst++ = *src++; It seems odd that this is needed though. Does it go away if you use DISABLE_PSE or DISABLE_PGE? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org