The code to invalidate a word (defined to be 4 bytes) in the icache in icache.cpp can segv if 1. The word is the last word in it's line. 2. The line is the last one in its mapped memory segment (e.g., the code cache). The bad code is in void AbstractICache::invalidate_word(address addr) { // Because this is called for instruction patching on the fly, // long after bootstrapping, we execute the stub directly. // Account for a 4-byte word spanning two cache lines. intptr_t start_line = ((intptr_t)addr + 0) & ~(ICache::line_size - 1); intptr_t end_line = ((intptr_t)addr + 4) & ~(ICache::line_size - 1); (*_flush_icache_stub)((address)start_line, start_line == end_line ? 1 : 2, 0); } '4' should be '3'.
|