Date: Tue, 16 Sep 2008 16:28:51 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/powerpc/include cpufunc.h Message-ID: <200809161629.m8GGT6pc005905@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
marcel 2008-09-16 16:28:51 UTC
FreeBSD src repository
Modified files:
sys/powerpc/include cpufunc.h
Log:
SVN rev 183081 on 2008-09-16 16:28:51Z by marcel
In powerpc_get_pcpup(), make the inline assembly statement
volatile so that the compiler won't perform CSE. For SMP,
this may result in us accessing the wrong PCPU and as such
results in a bogus curthread value.
Note that getting curthread is not quite MP-safe in the sense
that it requires two instructions that aren't performed
atomically. The first instruction gets the address of the PCPU
structure and the second instruction dereferences that pointer
to get curthread. If a thread is switched-out in between these
instructions and switched-in on a different CPU, we still get
the wrong curthread.
Revision Changes Path
1.27 +1 -1 src/sys/powerpc/include/cpufunc.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809161629.m8GGT6pc005905>
