This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] ppc32 dl-machine.c
- From: Segher Boessenkool <segher at koffie dot nl>
- To: Anton Blanchard <anton at samba dot org>
- Cc: Steve Munroe <sjmunroe at vnet dot ibm dot com>,libc-alpha at sources dot redhat dot com, geoffk at geoffk dot org, roland at frob dot com
- Date: Wed, 25 Sep 2002 14:29:24 +0200
- Subject: Re: [PATCH] ppc32 dl-machine.c
- References: <200209242249.g8OMnGE11062@brule.rchland.ibm.com> <20020925024902.GD17331@krispykreme>
Anton Blanchard wrote:
> Looks good, except we should have a sync between dcbst and icbi. This
> patch applies on top of the last.
>
You need a sync between icbi and isync, too. See for example the MPC7410
user manual, 2.3.4.3.4.
Even this won't work on all (multiprocessor) machines; dcbf or similar is
necessary there. Oh, and I don't want to think about the races when
the kernel decides to schedule in the middle of this sequence, and the
next time this process is run, it runs on a different cpu...
Cheers,
Segher
> --- glibc-2.2.94/sysdeps/powerpc/powerpc32/dl-machine.c.sm 2002-09-25 09:51:57.000000000 +1000
> +++ glibc-2.2.94/sysdeps/powerpc/powerpc32/dl-machine.c 2002-09-25 10:01:05.000000000 +1000
> @@ -324,13 +324,15 @@
>
> size_modified = lazy ? rel_offset_words : 6;
> for (i = 0; i < size_modified; i += words_per_line)
> - {
> - PPC_DCBST (plt + i);
> - PPC_ICBI (plt + i);
> - }
> + PPC_DCBST (plt + i);
> PPC_DCBST (plt + size_modified - 1);
> +
> PPC_SYNC;
> +
> + for (i = 0; i < size_modified; i += words_per_line)
> + PPC_ICBI (plt + i);
> PPC_ICBI (plt + size_modified - 1);
> +
The extra PPC_SYNC; goes here
> PPC_ISYNC;
> }
>