Skip to contentSkip to conversation

arch/avr32/mm/cache.c: export symbol flush_icache_range() for module using

PATCH In review Chen Gang 2 participants 8 messages Mar 8, 2014 – Mar 25, 2014

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arch/avr32/mm/cache.c: export symbol flush_icache_range() for module using

Need export symbol flush_icache_range() to modules, just like another platforms have done, or can not pass compiling.

The related error (with allmodconfig under avr32):

ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

---
 arch/avr32/mm/cache.c | 1 +
 1 file changed, 1 insertion(+)
arch/avr32/mm/cache.c +1 -0
index 6a46ecd..85d635c 100644
@@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end)
 	__flush_icache_range(start & ~(linesz - 1),
 			     (end + linesz - 1) & ~(linesz - 1));
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /*
  * This one is called from __do_fault() and do_swap_page().
Signature · 1 line
1.7.11.7
author
#1 lore raw

After this patch, our linux kernel can pass "avr32-linux-" allmodconfig (it contents quite a few of warnings, but after check, I guess they are not kernel's issue).

:-)

Thanks.

Quoted 28 lines · Chen Gang

Need export symbol flush_icache_range() to modules, just like another platforms have done, or can not pass compiling.

The related error (with allmodconfig under avr32):

ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

---
 arch/avr32/mm/cache.c | 1 +
 1 file changed, 1 insertion(+)
arch/avr32/mm/cache.c +1 -0
index 6a46ecd..85d635c 100644
@@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end)
 	__flush_icache_range(start & ~(linesz - 1),
 			     (end + linesz - 1) & ~(linesz - 1));
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /*
  * This one is called from __do_fault() and do_swap_page().
Signature · 3 lines
Chen Gang

Open, share and attitude like air, water and life which God blessed
#2 lore raw
Quoted 4 lines · Chen Gang

After this patch, our linux kernel can pass "avr32-linux-" allmodconfig (it contents quite a few of warnings, but after check, I guess they are not kernel's issue).

That sounds great, I am a bit surprised however that the lkdtm module need flush_icache_range. Would have been interesting to look into what causes this dependency.

I will pull this into my for-linus branch, and push during the next merge window.

Quoted 12 lines · Chen Gang
Quoted 11 lines

Need export symbol flush_icache_range() to modules, just like another platforms have done, or can not pass compiling.

The related error (with allmodconfig under avr32):

ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Quoted 16 lines
Quoted 16 lines
---
 arch/avr32/mm/cache.c | 1 +
 1 file changed, 1 insertion(+)
arch/avr32/mm/cache.c +1 -0
index 6a46ecd..85d635c 100644
@@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end)
 	__flush_icache_range(start & ~(linesz - 1),
 			     (end + linesz - 1) & ~(linesz - 1));
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /*
  * This one is called from __do_fault() and do_swap_page().
Signature · 2 lines
mvh
Hans-Christian Egtvedt
author
#3 lore raw
Quoted 10 lines · Hans-Christian Egtvedt
Quoted 4 lines · Chen Gang

After this patch, our linux kernel can pass "avr32-linux-" allmodconfig (it contents quite a few of warnings, but after check, I guess they are not kernel's issue).

That sounds great, I am a bit surprised however that the lkdtm module need flush_icache_range. Would have been interesting to look into what causes this dependency.

"driver/misc/lkdtm.c" will use this flush_icache_range().

And some architectures export it to modules.

  [root@gchen arch]# grep -rn flush_icache_range * | grep EXPORT
  arm64/mm/flush.c:105:EXPORT_SYMBOL(flush_icache_range);
  avr32/mm/cache.c:114:EXPORT_SYMBOL(flush_icache_range);
  m68k/mm/cache.c:106:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-inv-icache.c:129:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-flush-icache.c:155:EXPORT_SYMBOL(flush_icache_range);
  sparc/mm/init_64.c:435:EXPORT_SYMBOL(flush_icache_range);

Welcome any more details information by any other members, thanks.

Quoted 3 lines

I will pull this into my for-linus branch, and push during the next merge window.

OK, thanks

Quoted 6 lines
Quoted 6 lines · Chen Gang
Quoted 5 lines

Need export symbol flush_icache_range() to modules, just like another platforms have done, or can not pass compiling.

The related error (with allmodconfig under avr32):

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines

ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

OK, thanks.

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
---
 arch/avr32/mm/cache.c | 1 +
 1 file changed, 1 insertion(+)
arch/avr32/mm/cache.c +1 -0
index 6a46ecd..85d635c 100644
@@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end)
 	__flush_icache_range(start & ~(linesz - 1),
 			     (end + linesz - 1) & ~(linesz - 1));
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /*
  * This one is called from __do_fault() and do_swap_page().
Signature · 3 lines
Chen Gang

Open, share and attitude like air, water and life which God blessed
author
#4 lore raw
Quoted 11 lines · Chen Gang
Quoted 10 lines · Hans-Christian Egtvedt
Quoted 4 lines · Chen Gang

After this patch, our linux kernel can pass "avr32-linux-" allmodconfig (it contents quite a few of warnings, but after check, I guess they are not kernel's issue).

That sounds great, I am a bit surprised however that the lkdtm module need flush_icache_range. Would have been interesting to look into what causes this dependency.

After read a little more details for lkdtm, I guess "after overwrite an executable area by do_nothing(), it needs flush_icache_range() to be sure the new instructions/data must have effect with all cpu".

Welcome any additional information for it.

Thanks.

Quoted 14 lines

"driver/misc/lkdtm.c" will use this flush_icache_range().

And some architectures export it to modules.

  [root@gchen arch]# grep -rn flush_icache_range * | grep EXPORT
  arm64/mm/flush.c:105:EXPORT_SYMBOL(flush_icache_range);
  avr32/mm/cache.c:114:EXPORT_SYMBOL(flush_icache_range);
  m68k/mm/cache.c:106:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-inv-icache.c:129:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-flush-icache.c:155:EXPORT_SYMBOL(flush_icache_range);
  sparc/mm/init_64.c:435:EXPORT_SYMBOL(flush_icache_range);
Quoted 3 lines

Welcome any more details information by any other members, thanks.

Thanks.

Signature · 3 lines
Chen Gang

Open, share and attitude like air, water and life which God blessed
author
#5 lore raw

Is this patch OK?

If it is necessary to continue analysing more details, please let me know, and I will/should continue.

Thanks.

Quoted 41 lines · Chen Gang
Quoted 11 lines · Chen Gang
Quoted 10 lines · Hans-Christian Egtvedt
Quoted 4 lines · Chen Gang

After this patch, our linux kernel can pass "avr32-linux-" allmodconfig (it contents quite a few of warnings, but after check, I guess they are not kernel's issue).

That sounds great, I am a bit surprised however that the lkdtm module need flush_icache_range. Would have been interesting to look into what causes this dependency.

After read a little more details for lkdtm, I guess "after overwrite an executable area by do_nothing(), it needs flush_icache_range() to be sure the new instructions/data must have effect with all cpu".

Welcome any additional information for it.

Thanks.

Quoted 14 lines

"driver/misc/lkdtm.c" will use this flush_icache_range().

And some architectures export it to modules.

  [root@gchen arch]# grep -rn flush_icache_range * | grep EXPORT
  arm64/mm/flush.c:105:EXPORT_SYMBOL(flush_icache_range);
  avr32/mm/cache.c:114:EXPORT_SYMBOL(flush_icache_range);
  m68k/mm/cache.c:106:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-inv-icache.c:129:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-flush-icache.c:155:EXPORT_SYMBOL(flush_icache_range);
  sparc/mm/init_64.c:435:EXPORT_SYMBOL(flush_icache_range);
Quoted 3 lines

Welcome any more details information by any other members, thanks.

Thanks.

Signature · 3 lines
Chen Gang

Open, share and attitude like air, water and life which God blessed
#6 lore raw
Quoted 2 lines · Chen Gang

Is this patch OK?

I reread everything you said, and it looks sane.

Quoted 2 lines

If it is necessary to continue analysing more details, please let me know, and I will/should continue.

No, I will append it to my for-linus branch, and submit it early in the next cycle. It should be just around the corner, Linus just released rc8 (-:

Quoted 38 lines · Chen Gang
Quoted 37 lines · Chen Gang
Quoted 11 lines · Hans-Christian Egtvedt
Quoted 10 lines
Quoted 4 lines · Chen Gang

After this patch, our linux kernel can pass "avr32-linux-" allmodconfig (it contents quite a few of warnings, but after check, I guess they are not kernel's issue).

That sounds great, I am a bit surprised however that the lkdtm module need flush_icache_range. Would have been interesting to look into what causes this dependency.

After read a little more details for lkdtm, I guess "after overwrite an executable area by do_nothing(), it needs flush_icache_range() to be sure the new instructions/data must have effect with all cpu".

Welcome any additional information for it.

Thanks.

Quoted 13 lines

"driver/misc/lkdtm.c" will use this flush_icache_range().

And some architectures export it to modules.

  [root@gchen arch]# grep -rn flush_icache_range * | grep EXPORT
  arm64/mm/flush.c:105:EXPORT_SYMBOL(flush_icache_range);
  avr32/mm/cache.c:114:EXPORT_SYMBOL(flush_icache_range);
  m68k/mm/cache.c:106:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-inv-icache.c:129:EXPORT_SYMBOL(flush_icache_range);
  mn10300/mm/cache-flush-icache.c:155:EXPORT_SYMBOL(flush_icache_range);
  sparc/mm/init_64.c:435:EXPORT_SYMBOL(flush_icache_range);
Quoted 1 line

Welcome any more details information by any other members, thanks.

Thanks.

Signature · 2 lines
mvh
Hans-Christian Egtvedt
author
#7 lore raw
Quoted 4 lines · Hans-Christian Egtvedt
Quoted 2 lines · Chen Gang

Is this patch OK?

Quoted 8 lines

I reread everything you said, and it looks sane.

Quoted 2 lines

If it is necessary to continue analysing more details, please let me know, and I will/should continue.

No, I will append it to my for-linus branch, and submit it early in the next cycle. It should be just around the corner, Linus just released rc8 (-:

Thank you very much.

Signature · 3 lines
Chen Gang

Open, share, and attitude like air, water, and life which God blessed