From owner-freebsd-current@FreeBSD.ORG Tue May 29 16:05:03 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0A3D16A41F for ; Tue, 29 May 2007 16:05:03 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 878CC13C44B for ; Tue, 29 May 2007 16:05:03 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.14.0/8.14.0) with ESMTP id l4TG52Ek020243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 29 May 2007 12:05:02 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id l4TG4Y8W034955; Tue, 29 May 2007 12:04:34 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18012.20265.657576.944142@grasshopper.cs.duke.edu> Date: Tue, 29 May 2007 12:04:34 -0400 (EDT) To: freebsd-current@freebsd.org X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Subject: PAT_WRITE_COMBINING: how to use? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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, 29 May 2007 16:05:03 -0000 I would very much like to obtain a write-combine mapping of PCIe device memory for mxge(4) without depending on the flakiness of MTRRs. I currently use bus_alloc_resource() to map my device's memory space, and then use mem_range_attr_set() to attempt to change the memory to be write-combine. I recently noticed that pmap_mapdev_attr() function on amd64 & i386, but it looks like nexus_activate_resource() just calls pmap_mapdev(), which defaults to PAT_UNCACHEABLE. Would it be possible to add a flag which could tell the bus_* functions to map the memory write-combine? Or should I avoid bus_alloc_resource(), and map my device myself with pmap_mapdev_attr()? Or should I replace my call to mem_range_attr_set() with a call to pmap_change_attr? Thanks, Drew