From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 31 12:30:45 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB82616A419 for ; Mon, 31 Dec 2007 12:30:45 +0000 (UTC) (envelope-from oceanare@pacific.net.sg) Received: from smtpgate1.pacific.net.sg (smtpgate1.pacific.net.sg [203.120.90.31]) by mx1.freebsd.org (Postfix) with SMTP id D995D13C4CC for ; Mon, 31 Dec 2007 12:30:44 +0000 (UTC) (envelope-from oceanare@pacific.net.sg) Received: (qmail 13851 invoked from network); 31 Dec 2007 12:30:42 -0000 Received: from adsl120.dyn229.pacific.net.sg (HELO P2120.somewherefaraway.com) (oceanare@210.24.229.120) by smtpgate1.pacific.net.sg with ESMTPA; 31 Dec 2007 12:30:41 -0000 Message-ID: <4778E0EB.8040709@pacific.net.sg> Date: Mon, 31 Dec 2007 20:30:35 +0800 From: Erich Dollansky User-Agent: Thunderbird 2.0.0.6 (X11/20070826) MIME-Version: 1.0 To: Kostik Belousov References: <47760132.5040306@pacific.net.sg> <20071229111204.GX57756@deviant.kiev.zoral.com.ua> <20071230131056.GG57756@deviant.kiev.zoral.com.ua> <4778B8A3.8040400@pacific.net.sg> <20071231113327.GN57756@deviant.kiev.zoral.com.ua> In-Reply-To: <20071231113327.GN57756@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Kip Macy , Ivan Voras , freebsd-hackers@freebsd.org Subject: Re: Architectures with strict alignment? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2007 12:30:45 -0000 Hi, Kostik Belousov wrote: > On Mon, Dec 31, 2007 at 05:38:43PM +0800, Erich Dollansky wrote: >> Kostik Belousov wrote: >>> On Sat, Dec 29, 2007 at 01:12:04PM +0200, Kostik Belousov wrote: >>>> On Sat, Dec 29, 2007 at 12:14:11AM -0800, Kip Macy wrote: >>> I.e., it seems that gcc does not feel too guilty generating unaligned >>> half-word writes on i386. :( >> this should not be a problem inside a cache line. >> >> If the access goes accross two cache lines and the other cache line is >> not in the cache, it becomes real difficult. >> >> I can't tell you what the hardware actually does in this case. >> >> It should read the second affected cache line into the cache. But what >> happens if the second affected cache line is blocked by another CPU >> while the current CPU blocks the first cache line? > > From the manual, 253668, 7.1.1: > > I think we might get any half of the operation as a result. so, both CPUs are blocked as none can access the other cache line. Is there really nothing in a normal PC to handle this? I do not know. The hardware I developed earlier was able to handle this by aborting both bus cycles. It was then task of the operating system to handle this. Erich