From owner-freebsd-current@freebsd.org Tue Apr 5 04:03:13 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 646C8ADE9CA for ; Tue, 5 Apr 2016 04:03:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44D721AA2 for ; Tue, 5 Apr 2016 04:03:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AB937B972; Tue, 5 Apr 2016 00:03:11 -0400 (EDT) From: John Baldwin To: Ryan Stone Cc: FreeBSD Current , Konstantin Belousov Subject: Re: accessing a PCIe register from userspace through kmem or other ways ? Date: Mon, 04 Apr 2016 21:02:49 -0700 Message-ID: <5009932.qXoZ6E4rhX@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <9376230.YZMFsgSvTf@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 Apr 2016 00:03:11 -0400 (EDT) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2016 04:03:13 -0000 On Monday, April 04, 2016 08:58:47 PM Ryan Stone wrote: > On Mon, Apr 4, 2016 at 6:45 PM, John Baldwin wrote: > > > I suspect Ryan might be referring to BARs outside of the DMAP which we > > only populate to Maxmem IIRC. /dev/mem should work for those. > > > > Unfortunately I no longer have access to the systems so I can't really > confirm. I had a debug tool that attempted to read PCI device registers > through /dev/mem, and on these systems (which were running a 8.2 > derivative) the reads from /dev/mem failed with some kind of error. > > The one detail that I do remember is that the errors started happening > after we enabled the use of 64-bit BARs in the BIOS and the addresses > assigned to the BARs were quite large -- I believe well beyond the bounds > of real memory. kib@ fixed /dev/mem to handle addresses beyond the direct map limit to use temporary mappings instead of failing with EFAULT in 277051 which was only committed to HEAD last January, so well after 8.2. -- John Baldwin