提交 b75e2b07 编写于 作者: A Arvind Sankar 提交者: Ard Biesheuvel

x86/boot: GDT limit value should be size - 1

The limit value for the GDTR should be such that adding it to the base
address gives the address of the last byte of the GDT, i.e. it should be
one less than the size, not the size.
Signed-off-by: NArvind Sankar <nivedita@alum.mit.edu>
Link: https://lore.kernel.org/r/20200202171353.3736319-7-nivedita@alum.mit.eduSigned-off-by: NArd Biesheuvel <ardb@kernel.org>
上级 ef5a7b5e
...@@ -624,12 +624,12 @@ SYM_FUNC_END(.Lno_longmode) ...@@ -624,12 +624,12 @@ SYM_FUNC_END(.Lno_longmode)
.data .data
SYM_DATA_START_LOCAL(gdt64) SYM_DATA_START_LOCAL(gdt64)
.word gdt_end - gdt .word gdt_end - gdt - 1
.quad 0 .quad 0
SYM_DATA_END(gdt64) SYM_DATA_END(gdt64)
.balign 8 .balign 8
SYM_DATA_START_LOCAL(gdt) SYM_DATA_START_LOCAL(gdt)
.word gdt_end - gdt .word gdt_end - gdt - 1
.long gdt .long gdt
.word 0 .word 0
.quad 0x00cf9a000000ffff /* __KERNEL32_CS */ .quad 0x00cf9a000000ffff /* __KERNEL32_CS */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册