Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2015 22:55:43 -0700 (MST)
From:      sson <sson@FreeBSD.org>
To:        freebsd-mips@freebsd.org
Subject:   Re: [RFC] Cache control from user land (patch)
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1421214943629-5980520.post>