From owner-freebsd-current@freebsd.org Fri Apr 1 17:05:05 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 782ABAEB346 for ; Fri, 1 Apr 2016 17:05:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 EB7CC196C for ; Fri, 1 Apr 2016 17:05:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u31H4xrL090652 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 1 Apr 2016 20:05:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u31H4xrL090652 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u31H4w1e090651; Fri, 1 Apr 2016 20:04:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 1 Apr 2016 20:04:58 +0300 From: Konstantin Belousov To: Ryan Stone Cc: FreeBSD Current Subject: Re: accessing a PCIe register from userspace through kmem or other ways ? Message-ID: <20160401170458.GV1741@kib.kiev.ua> References: <5045119.GKNSyI10vh@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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: Fri, 01 Apr 2016 17:05:05 -0000 On Fri, Apr 01, 2016 at 12:48:24PM -0400, Ryan Stone wrote: > That is actually a really good question. I know that with some recent > BIOSes if I enabled allocating 64-bit addresses to BARs, the BAR would > actually be mapped outside of the range of /dev/mem. From a quick glance > at libpciaccess, I don't think that it handles this case. A specific > mechanism for allowing mmaping of BARs would be useful, I think. I am not sure what do you mean by 'outside of the range of /dev/mem'. IMO /dev/mem (not kmem) handles every possible physical address both for mmap(2) and for read(2)/write(2). For io interface there were some bugs, but they are believed to be fixed. I mean amd64.