x86: setup code_bytes - use mask to restrict it's size
RFC 1/1 x86: setup code_bytes - use mask to restrict it's size
This patch strips off 8 bytes from text section. Not a really big advantage (especially for __init section). It seems 8192 bytes of disassembled code is rare used anyway.
before:
text data bss dec hex filename 9900 176 20 10096 2770 arch/x86/kernel/traps_64.o.old after: text data bss dec hex filename 9892 176 20 10088 2768 arch/x86/kernel/traps_64.o
---
If there is no benefit at all - just drop the patch. Any comments are welcome ;)
arch/x86/kernel/traps_32.c +3 -2
@@ -1229,8 +1229,9 @@ __setup("kstack=", kstack_setup);static int __init code_bytes_setup (char *s) { code_bytes =simple_strtoul (s,NULL ,0 ); -if (code_bytes >8192 ) - code_bytes =8192 ; + +/* we don't want too long code-dump */ + code_bytes &=8191 ;return 1 ; }
arch/x86/kernel/traps_64.c +3 -2
@@ -1196,8 +1196,9 @@ early_param("kstack", kstack_setup);static int __init code_bytes_setup (char *s) { code_bytes =simple_strtoul (s,NULL ,0 ); -if (code_bytes >8192 ) - code_bytes =8192 ; + +/* we don't want too long code-dump */ + code_bytes &=8191 ;return 1 ; }
H. Peter Anvin
reviewerQuoted 11 lines · Cyrill Gorcunov
This patch strips off 8 bytes from text section. Not a really big advantage (especially for
__initsection). It seems 8192 bytes of disassembled code is rare used anyway.before:
text data bss dec hex filename 9900 176 20 10096 2770 arch/x86/kernel/traps_64.o.old after: text data bss dec hex filename 9892 176 20 10088 2768 arch/x86/kernel/traps_64.o
Quoted 5 lines
Signed-off-by Cyrill Gorcunov <[email protected]>---
If there is no benefit at all - just drop the patch. Any comments are welcome ;)
I don't think this is the behaviour we want (wrapping around); worse, if people enter a larger power of two they will get zero.
So NAK on this patch, IMO.
-hpa
Thanks for review. Agreed with you absolutely. Silly patch, sorry :(
Quoted 25 lines · H. Peter Anvin
Quoted 11 lines · Cyrill Gorcunov
This patch strips off 8 bytes from text section. Not a really big advantage (especially for
__initsection). It seems 8192 bytes of disassembled code is rare used anyway.before:
text data bss dec hex filename 9900 176 20 10096 2770 arch/x86/kernel/traps_64.o.old after: text data bss dec hex filename 9892 176 20 10088 2768 arch/x86/kernel/traps_64.oQuoted 5 lines
Signed-off-by Cyrill Gorcunov <[email protected]>---
If there is no benefit at all - just drop the patch. Any comments are welcome ;)
I don't think this is the behaviour we want (wrapping around); worse, if people enter a larger power of two they will get zero.
So NAK on this patch, IMO.
-hpa
H. Peter Anvin
reviewerQuoted 1 line · Cyrill Gorcunov
Thanks for review. Agreed with you absolutely. Silly patch, sorry :(
S'okay :) Thanks for trying!
-hpa