Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2015 17:13:13 -0800
From:      Yuri <yuri@rawbw.com>
To:        freebsd-hackers@FreeBSD.org
Subject:   'cacheflush' in FreeBSD ?
Message-ID:  <54C594A9.2030802@rawbw.com>

next in thread | raw e-mail | index | archive | help
LLVM has the function llvm::sys::Memory::InvalidateInstructionCache, 
that invalidates instruction cache after they allocate memory for the 
binary code, and before they run it.
On Linux this function calls cachflush(2). And on FreeBSD this function 
is a noop (besides some related valgrind cache call).

FreeBSD doesn't have 'cacheflush' system call. So how is instruction 
cache flushed on FreeBSD? I suspect this is a bug in LLVM that this 
function is a noop.

libexec/rtld-elf also loads binary code in similar way, and it isn't 
clear from its source code how instruction cache flushing is handled there.

Can somebody clarify what is the equivalent of linux cachflush(2), and 
is this a bug that llvm::sys::Memory::InvalidateInstructionCache is a noop?


Yuri



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54C594A9.2030802>