Commit 229f4df1 authored by Chris Metcalf's avatar Chris Metcalf

arch/tile: properly flush the I$ when unloading kernel modules

Otherwise, in principle, there could be stale I$ data present
next time the page that previously held the kernel module code was
used to run some new code.
Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
parent 7194988f
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/opcode-tile.h> #include <asm/opcode-tile.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/homecache.h>
#ifdef __tilegx__ #ifdef __tilegx__
# define Elf_Rela Elf64_Rela # define Elf_Rela Elf64_Rela
...@@ -86,8 +87,13 @@ void *module_alloc(unsigned long size) ...@@ -86,8 +87,13 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region) void module_free(struct module *mod, void *module_region)
{ {
vfree(module_region); vfree(module_region);
/* Globally flush the L1 icache. */
flush_remote(0, HV_FLUSH_EVICT_L1I, cpu_online_mask,
0, 0, 0, NULL, NULL, 0);
/* /*
* FIXME: If module_region == mod->init_region, trim exception * FIXME: If module_region == mod->module_init, trim exception
* table entries. * table entries.
*/ */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment