[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

reading Symbol table issue



Dear listmembers,
I found the root cause for the problem reading the symbol table, I have a patch for the kernel and I would appreciate your comments.
Sparc 64 uses a wrapper for get_symbol_table that in fact uses a 64 Bit kernel call to perform the action. In the 32Bit world the structure kernel_sym consists of an unsigned long (4Byte) and a char - array (60Byte) summing up to 64 Byte total size.
When wrapping this call to the 64Bit kernel the size of the struct grows twice: first of all our unsigned long turns into 8 Byte, then things have to be word aligned. So the struct grows up to 72Byte in total.
This is where trouble begins. The kmalloc() call in use here is capable to allocate not more than 131048Byte, this boundary is hit here.
Erraneously I had thought this was related to SMP - it isnt. Accidentally the map-size was a little smaller for the non - SMP kernel thereby fitting into the available memory.
What I suggest now (as a first step) is to modify in linux/include/linux/module.h:

struct kernel_sym
{
#ifdef __ARCH_SPARC64_ATOMIC__   
          unsigned int value;
#else
          unsigned long value;
#endif
        char name[60];          /* should have been 64-sizeof(long); oh well */
};

Thereby the size of kernel_sym remains 64Byte and we do not need 4 additional alignment Byte to make things work again. So the limitation is pushed upwards from 1820 symbols (now) up to 2047 symbols (see above).
I honestly see no real reason for using a unsigned long here since it is almost always 4 Byte long - except on 64 Bit architectures.
I am 100% sure that the kernel junkees know a better switch than __ARCH_SPARC64_ATOMIC__ what I took from atomic.h knowing the latter being included into module.h.

So, who would be the right person to address this to? As I initially assumed, this is not a klogd issue - apart from the fact that klogd relies on get_kernel_symbols.
Take care




Dieter Jurzitza

-- 
________________________________________________

HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
   System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax:   +49 (0)7248 71-1216
eMail: DJurzitza@harmanbecker.com
Internet: http://www.becker.de
 


*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************



Reply to: