[RFC] Cache control from user land (patch)

sson sson at FreeBSD.org
Wed Jan 14 05:55:44 UTC 2015


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.


More information about the freebsd-mips mailing list