From owner-freebsd-mips@FreeBSD.ORG Wed Jan 14 05:55:44 2015 Return-Path: Delivered-To: freebsd-mips@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 46CA6E3D for ; Wed, 14 Jan 2015 05:55:44 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1.freebsd.org (Postfix) with ESMTP id 315B9AAA for ; Wed, 14 Jan 2015 05:55:44 +0000 (UTC) Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id E02C410766A1 for ; Tue, 13 Jan 2015 21:55:43 -0800 (PST) Date: Tue, 13 Jan 2015 22:55:43 -0700 (MST) From: sson To: freebsd-mips@freebsd.org Message-ID: <1421214943629-5980520.post@n5.nabble.com> In-Reply-To: <54B57760.3090508@ignoranthack.me> References: <1421175994697-5980362.post@n5.nabble.com> <54B57760.3090508@ignoranthack.me> Subject: Re: [RFC] Cache control from user land (patch) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2015 05:55:44 -0000 Sean Bruno-6 wrote > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 01/13/15 11:06, sson wrote: >> Hi all: >> >> Below is a link to a patch that provides a sysarch() so that cache >> lines may be invalidated from userspace (via the sysarch() system >> call). For convenience mips_cacheflush() is provided in the >> machine/cachectl.h header file: >> >> int mips_cacheflush(void *addr, size_t nbytes, int whichcache); >> >> mips_cacheflush() flushes the content of the selected cache for the >> user addresses in the range from addr to (addr+nbytes-1). >> whichcache may be: >> >> MIPS_CF_ICACHE: Flush the instruction cache lines for a given >> user address range. MIPS_CF_DCACHE: Write back to memory and >> invalidate the cache lines for a given user address range. >> MIPS_CF_BCACHE: Write back and invalidate both types of caches for >> a given user address range. MIPS_CF_ICACHE_ALL, MIPS_CF_DCACHE, or >> MIPS_CF_BCACHE: Full the entire given cache(s). >> >> mips_cacheflush() may return the errno EFAULT or EINVAL (whichcache >> is not valid). In short, it is similar to the cacheflush() that >> netbsd provides for mips. >> >> The diff: >> https://people.freebsd.org/~sson/mips/cacheflush/mips_cacheflush.diff >> >> Comments, concerns, questions, suggestions, etc. are welcome. >> >> Regards, >> >> -stacey. >> >> >> >> > I've tried applying this to head. > > I get a reject from the last bits to sys/mips/mips/sys_machdep.c I should have mentioned the diff is against cheribsd which will get upstreamed to freebsd at some point. FreeBSD head is missing the UserLevel Register support change, for example: https://people.freebsd.org/~sson/mips/ulri/ulri_kernel.diff -stacey. -- View this message in context: http://freebsd.1045724.n5.nabble.com/RFC-Cache-control-from-user-land-patch-tp5980362p5980520.html Sent from the freebsd-mips mailing list archive at Nabble.com.