From: Chris Metcalf Date: Mon, 2 May 2011 19:35:06 +0000 (-0400) Subject: arch/tile: properly flush the I$ when unloading kernel modules X-Git-Tag: v3.0-rc1~152^2~20 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=229f4df1fb84e5d3306b4fc49b41f7847340092d;p=linux.git 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: Chris Metcalf --- diff --git a/arch/tile/kernel/module.c b/arch/tile/kernel/module.c index e2ab82b7c7e7..f68df69f1f67 100644 --- a/arch/tile/kernel/module.c +++ b/arch/tile/kernel/module.c @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef __tilegx__ # define Elf_Rela Elf64_Rela @@ -86,8 +87,13 @@ void *module_alloc(unsigned long size) void module_free(struct module *mod, void *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. */ }