Skip to content

Commit 001470f

Browse files
ytcoodeIngo Molnar
authored andcommitted
x86/boot: Fix incorrect startup_gdt_descr.size
Since the size value is added to the base address to yield the last valid byte address of the GDT, the current size value of startup_gdt_descr is incorrect (too large by one), fix it. [ mingo: This probably never mattered, because startup_gdt[] is only used in a very controlled fashion - but make it consistent nevertheless. ] Fixes: 866b556 ("x86/head/64: Install startup GDT") Signed-off-by: Yuntao Wang <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b3bee1e commit 001470f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/head64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = {
8080
* while the kernel still uses a direct mapping.
8181
*/
8282
static struct desc_ptr startup_gdt_descr = {
83-
.size = sizeof(startup_gdt),
83+
.size = sizeof(startup_gdt)-1,
8484
.address = 0,
8585
};
8686

0 commit comments

Comments
 (0)