Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 2004 17:47:43 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Roman Kurakin <rik@cronyx.ru>
Cc:        Nate Lawson <nate@root.org>
Subject:   Re: mp_machdep.c (was Re: [Fwd: Re: Bug reports requested - acpi])
Message-ID:  <200409201747.43612.jhb@FreeBSD.org>
In-Reply-To: <414F4AAC.5000807@cronyx.ru>
References:  <41421D6A.8070805@cronyx.ru> <200409201652.24457.jhb@FreeBSD.org> <414F4AAC.5000807@cronyx.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 20 September 2004 05:25 pm, Roman Kurakin wrote:
> John Baldwin:
> >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:
>
> Hm, what about pmap_invalidate_page () or even pmap_map () ?
>
> 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,15 @@
>  	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_int   boot_base = (u_int) bootMP;
>  	u_int8_t *dst8;
>  	u_int16_t *dst16;
>  	u_int32_t *dst32;
>
>  	POSTCODE(INSTALL_AP_TRAMP_POST);
>
> -	pmap_kenter(boot_address + KERNBASE, boot_address);
> +	pmap_map((vm_offset_t)dst, boot_address, boot_address + size, 0);
>  	for (x = 0; x < size; ++x)
>  		*dst++ = *src++;

This changes the value of 'dst', which is bad. :)  I looked at using it but 
decided not to because of that.

> >It seems odd that this is needed though.  Does it go away if you use
> >DISABLE_PSE or DISABLE_PGE?
>
> I'll check this.
>
> rik

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409201747.43612.jhb>