From owner-svn-src-head@FreeBSD.ORG Fri May 6 21:25:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D58D11065670; Fri, 6 May 2011 21:25:37 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5175B8FC12; Fri, 6 May 2011 21:25:37 +0000 (UTC) Received: by ywf7 with SMTP id 7so1685340ywf.13 for ; Fri, 06 May 2011 14:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BmwGvuTQN/TW4Zgw6Y8f8BBU/DmpKZPJsFIekdC9M9o=; b=KLVXjW8Ei0A/f4b2fXUHFIEieEsHprn7pPnGsb+oPe9wvjt7Ev+8d5jdCDSqAXOmqT HXJiNPEI9KcBIlgkMukJ4A6ZBK3m0yv/MoViQkTDUQX45IOVC5Q/NPYEXjXXjuRO0jf3 fPF0QL5nhKtIktAjJsLSkrhwmtjud+AluiELk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=k/7TuRAUmZdz0VDpXvrB4bZjqjkjV7lV8BcX4uyuj6DdH9CoxWM+XGtCFncXpR98GC fSAkzQQKnZY4lmT8Bn85P/ZHKgzh7Xn500xAp+GwPXiK2KZNPgxpVW/VpSd6OLObj23k SVLwJEA0GEvfty22mcooWJONkFXggGdgiON2g= MIME-Version: 1.0 Received: by 10.236.77.228 with SMTP id d64mr439316yhe.305.1304717136716; Fri, 06 May 2011 14:25:36 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.111.33 with HTTP; Fri, 6 May 2011 14:25:36 -0700 (PDT) In-Reply-To: <201105062043.p46Kh2Vs065320@svn.freebsd.org> References: <201105062043.p46Kh2Vs065320@svn.freebsd.org> Date: Fri, 6 May 2011 17:25:36 -0400 X-Google-Sender-Auth: kw4U8mO7VcyRAgvf8eoh0-M7UpY Message-ID: From: Attilio Rao To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221550 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 21:25:37 -0000 2011/5/6 Nathan Whitehorn : > Author: nwhitehorn > Date: Fri May =C2=A06 20:43:02 2011 > New Revision: 221550 > URL: http://svn.freebsd.org/changeset/base/221550 > > Log: > =C2=A0SMP has worked perfectly for a very long time on 32-bit PowerPC on = both > =C2=A0UP and SMP hardware. Enable it in GENERIC. > While working on largeSMP, I think there is a breakage in atomic.h. More specifically, atomic_store_rel_long() (and related functions) are not going to properly work because powerpc defines them as: atomic_store_rel_long -> atomic_store_rel_32(volatile u_int *p, u_int v) while this should really follow the long arguments. This happens because powerpc doesn't follow the other architectures semantic on defining the "similar" atomic operations. Other arches define an hardcode version of _type version of the function and than make a macro the _32 (or whatever) version. In other words this is what they do: void atomic_store_rel_32() { ... } #define atomic_store_rel_int atomic_store_rel_32 which si clearly dangerous for cases as reported above. Maybe that could be fixed by passing sized types, rather than simply int or long in numbered version, but I'd really prefer to follow the semantic by other architectures and then have: void atomic_store_rel_int() { ... } #define atomic_store_rel_32 atomic_store_rel_int I fixed the ATOMIC_STORE_LOAD case in my code, because I needed it, but the final cleanup is much bigger. I can make a patch tomorrow if you can test it. Attilio --=20 Peace can only be achieved by understanding - A. Einstein