confused about linux 64 bit LDT
Posted: Mon Aug 04, 2008 2:19 pm
http://git.kernel.org/?p=linux/kernel/g ... 504c2d81fe
I saw this patch in the linux kernel and got confused.
the set_tssldt_descriptor function is here:
http://lxr.linux.no/linux+v2.6.25.1/inc ... esc.h#L147
LDT_ENTRY_SIZE is hardcoded to 8 not matter which arch is used
sizeof(ldt) returns 16 bytes on 64 bit and 8 bytes on 32 bit
the size of an ldt entry on 64 bit is 16 bytes while the size of ldt entry is 8 bytes on 32 bits... so doesn't it seem like the patch broke what was previously working ? its setting the size field of the LDT entry in the GDT based on ldt entries of 8 bytes no matter what the arch is. this patch has me pretty confused and I am hoping someone knows/can figure out why they would change this. It seems like this patch broke what was working and cut the 64 bit LDT table in half.
I saw this patch in the linux kernel and got confused.
Code: Select all
- set_tssldt_descriptor(&ldt, (unsigned long)addr,
- DESC_LDT, entries * sizeof(ldt) - 1);
+ set_tssldt_descriptor(&ldt, (unsigned long)addr, DESC_LDT,
+ entries * LDT_ENTRY_SIZE - 1);http://lxr.linux.no/linux+v2.6.25.1/inc ... esc.h#L147
LDT_ENTRY_SIZE is hardcoded to 8 not matter which arch is used
sizeof(ldt) returns 16 bytes on 64 bit and 8 bytes on 32 bit
the size of an ldt entry on 64 bit is 16 bytes while the size of ldt entry is 8 bytes on 32 bits... so doesn't it seem like the patch broke what was previously working ? its setting the size field of the LDT entry in the GDT based on ldt entries of 8 bytes no matter what the arch is. this patch has me pretty confused and I am hoping someone knows/can figure out why they would change this. It seems like this patch broke what was working and cut the 64 bit LDT table in half.