Date: Sat, 4 Apr 2009 22:23:03 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/powerpc/aim swtch.S Message-ID: <200904042223.n34MNFK5035138@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
marcel 2009-04-04 22:23:03 UTC FreeBSD src repository Modified files: sys/powerpc/aim swtch.S Log: SVN rev 190704 on 2009-04-04 22:23:03Z by marcel Perform a dummy stwcx. when we switch contexts. The context being switched out may hold a reservation. The stwcx. will clear the reservation. This is architecturally recommended. The scenario this addresses is as follows: 1. Thread 1 performs a lwarx and as such holds a reservation. 2. Thread 1 gets switched out (before doing the matching stwcx.) and thread 2 is switched in. 3. Thread 2 performs a stwcx. to the same reservation granule. This will succeed because the processor has the reservation even though thread 2 didn't do the lwarx. Note that on some processors the address given the stwcx. is not checked. On these processors the mere condition of having a reservation would cause the stwcx. to succeed, irrespective of whether the addresses are the same. The dummy stwcx. is especially important for those processors. Revision Changes Path 1.28 +6 -0 src/sys/powerpc/aim/swtch.S
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904042223.n34MNFK5035138>