From owner-cvs-src@FreeBSD.ORG Tue Sep 16 16:29:08 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F2B3106566C; Tue, 16 Sep 2008 16:29:08 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBE18FC2D; Tue, 16 Sep 2008 16:29:08 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m8GGT8JH006134; Tue, 16 Sep 2008 16:29:08 GMT (envelope-from marcel@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m8GGT6pc005905; Tue, 16 Sep 2008 16:29:06 GMT (envelope-from marcel@repoman.freebsd.org) Message-Id: <200809161629.m8GGT6pc005905@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to marcel@repoman.freebsd.org using -f From: Marcel Moolenaar Date: Tue, 16 Sep 2008 16:28:51 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/powerpc/include cpufunc.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2008 16:29:08 -0000 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