From owner-freebsd-arm@FreeBSD.ORG Sat May 16 09:48:31 2015 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B95D208 for ; Sat, 16 May 2015 09:48:31 +0000 (UTC) Received: from mout1.freenet.de (mout1.freenet.de [IPv6:2001:748:100:40::2:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.freenet.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AF0F10DC for ; Sat, 16 May 2015 09:48:30 +0000 (UTC) Received: from [195.4.92.142] (helo=mjail2.freenet.de) by mout1.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (port 25) (Exim 4.82 #2) id 1YtYhn-0005Rq-0R for freebsd-arm@FreeBSD.org; Sat, 16 May 2015 11:48:27 +0200 Received: from localhost ([::1]:35621 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.82 #2) id 1YtYhm-0003JA-Od for freebsd-arm@FreeBSD.org; Sat, 16 May 2015 11:48:26 +0200 Received: from mx7.freenet.de ([195.4.92.17]:55449) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.82 #2) id 1YtYfh-0007zu-I2 for freebsd-arm@FreeBSD.org; Sat, 16 May 2015 11:46:17 +0200 Received: from p5ddd7234.dip0.t-ipconnect.de ([93.221.114.52]:50464 helo=[127.0.0.1]) by mx7.freenet.de with esmtpsa (ID freebsdnewbie@freenet.de) (TLSv1.2:DHE-RSA-AES128-SHA:128) (port 587) (Exim 4.82 #2) id 1YtYfh-0000gL-Bh for freebsd-arm@FreeBSD.org; Sat, 16 May 2015 11:46:17 +0200 Message-ID: <555711E8.3020802@freenet.de> Date: Sat, 16 May 2015 11:46:16 +0200 From: =?UTF-8?B?TWFudWVsIFN0w7xobg==?= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: freebsd-arm@FreeBSD.org Subject: mmap()-caching Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 150516-0, 16.05.2015), Outbound message X-Antivirus-Status: Clean X-Originated-At: 93.221.114.52!50464 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2015 09:48:31 -0000 Hi list, I'm trying to extend the TI-pru drivers' features on a Beaglebone Black. Due the long compile time of a complete kernel i removed the driver entry (device ti_pruss) from kernel-config and load it as kernel-module instead. I'd copied the files sys/arm/ti/ti_pruss.[sh] to a sperate folder and added this makefile: % cat Makefile .PATH: ${.CURDIR} KMOD = ti_pruss SRCS = ti_pruss.c SRCS += bus_if.h device_if.h ofw_bus_if.h CFLAGS += -DDEBUG .include % It builds and loads fine, but its behavior is not exact the same as if it is compiled into the kernel statically. The ti-pruss driver reveals the pru internals by implementing the mmap() stub and marks this area uncacheable. This works perfectly if this driver is compiled directly into the kernel! But when i use these very same files and build a kernel module instead, there seems to be caching active. I recognize this by using a ported version of prudebug[1] and singlestepping through pru-code. If there is caching active, single step does not result in a step. I've put some debug-outputting to the mmap()-stub of the driver-module to print out the memory-attributes (vm_memattr_t *memattr); this output looks like: ti_pruss_mmap: *memattr: 0x00000001 so to me it seems, that the VM_MEMATTR_UNCACHEABLE is set in *memattr. How can i provide the same behavior for the module as for the built-in driver? Thanks, Manuel [1] http://sourceforge.net/projects/prudebug/