From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 10 21:44:17 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0843B8F3; Wed, 10 Oct 2012 21:44:17 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by mx1.freebsd.org (Postfix) with ESMTP id C72F88FC14; Wed, 10 Oct 2012 21:44:16 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 10 Oct 2012 14:44:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,565,1344236400"; d="scan'208";a="154794507" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by AZSMGA002.ch.intel.com with ESMTP; 10 Oct 2012 14:44:09 -0700 Message-ID: <5075EC29.1010907@intel.com> Date: Wed, 10 Oct 2012 14:44:09 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120724 Thunderbird/13.0.1 MIME-Version: 1.0 To: John Baldwin Subject: Re: No bus_space_read_8 on x86 ? References: <506DC574.9010300@intel.com> <201210051208.45550.jhb@freebsd.org> <8BC4C95F-2D10-46A5-89C8-74801BB4E23A@bsdimp.com> <201210091154.15873.jhb@freebsd.org> In-Reply-To: <201210091154.15873.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 21:44:17 -0000 Sorry for the slow response. I was dealing with a bit of a family emergency. Responses inline below. On 10/09/12 08:54, John Baldwin wrote: > On Monday, October 08, 2012 4:59:24 pm Warner Losh wrote: >> On Oct 5, 2012, at 10:08 AM, John Baldwin wrote: >>> I think cxgb* already have an implementation. For amd64 we should certainly >>> have bus_space_*_8(), at least for SYS_RES_MEMORY. I think they should fail >>> for SYS_RES_IOPORT. I don't think we can force a compile-time error though, >>> would just have to return -1 on reads or some such? Yes. Exactly what I was thinking. >> I believe it was because bus reads weren't guaranteed to be atomic on i386. >> don't know if that's still the case or a concern, but it was an intentional omission. > True. If you are on a 32-bit system you can read the two 4 byte values and > then build a 64-bit value. For 64-bit platforms we should offer bus_read_8() > however. I believe there is still no way to perform a 64-bit read on a i386 (or at least without messing with SSE instructions), but if you have to read a 64-bit register, you are stuck with doing two 32-bit reads and concatenating them. I figure we may as well provide an implementation for those who have to do that as well as the implementation for 64-bit. Anyhow, it sounds like we are basically in agreement. I'll put together a patch and send it out for review. Thanks, Carl