Skip to content

Commit 5ac37f8

Browse files
Michael KarcherIngo Molnar
authored andcommitted
x86: fix ldt limit for 64 bit
Fix size of LDT entries. On x86-64, ldt_desc is a double-sized descriptor. Signed-off-by: Michael Karcher <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent a361ee5 commit 5ac37f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/asm-x86/desc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ static inline void native_set_ldt(const void *addr, unsigned int entries)
192192
unsigned cpu = smp_processor_id();
193193
ldt_desc ldt;
194194

195-
set_tssldt_descriptor(&ldt, (unsigned long)addr,
196-
DESC_LDT, entries * sizeof(ldt) - 1);
195+
set_tssldt_descriptor(&ldt, (unsigned long)addr, DESC_LDT,
196+
entries * LDT_ENTRY_SIZE - 1);
197197
write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_LDT,
198198
&ldt, DESC_LDT);
199199
asm volatile("lldt %w0"::"q" (GDT_ENTRY_LDT*8));

0 commit comments

Comments
 (0)