TSS segment should use (SIZE - 1) as limit, and do not set G bit (highest bit of LimitHigh) because limit means byte count.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Fan, Jeff" <jeff.fan@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18935
6f19259b-4bc3-4df7-8a09-
765794883524
.equ GDT_SIZE, .- NullSeg\r
\r
TssSeg:\r
.equ GDT_SIZE, .- NullSeg\r
\r
TssSeg:\r
- .word TSS_DESC_SIZE # LimitLow\r
+ .word TSS_DESC_SIZE -1 # LimitLow\r
.word 0 # BaseLow\r
.byte 0 # BaseMid\r
.byte 0x89\r
.word 0 # BaseLow\r
.byte 0 # BaseMid\r
.byte 0x89\r
- .byte 0x80 # LimitHigh\r
+ .byte 0x00 # LimitHigh\r
.byte 0 # BaseHigh\r
ExceptionTssSeg:\r
.byte 0 # BaseHigh\r
ExceptionTssSeg:\r
- .word TSS_DESC_SIZE # LimitLow\r
+ .word TSS_DESC_SIZE - 1 # LimitLow\r
.word 0 # BaseLow\r
.byte 0 # BaseMid\r
.byte 0x89\r
.word 0 # BaseLow\r
.byte 0 # BaseMid\r
.byte 0x89\r
- .byte 0x80 # LimitHigh\r
+ .byte 0x00 # LimitHigh\r
.byte 0 # BaseHigh\r
\r
.equ CODE_SEL, CodeSeg32 - NullSeg\r
.byte 0 # BaseHigh\r
\r
.equ CODE_SEL, CodeSeg32 - NullSeg\r
GDT_SIZE = $ - offset NullSeg\r
\r
TssSeg LABEL QWORD\r
GDT_SIZE = $ - offset NullSeg\r
\r
TssSeg LABEL QWORD\r
- DW TSS_DESC_SIZE ; LimitLow\r
+ DW TSS_DESC_SIZE - 1 ; LimitLow\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
DB 0 ; BaseHigh\r
ExceptionTssSeg LABEL QWORD\r
DB 0 ; BaseHigh\r
ExceptionTssSeg LABEL QWORD\r
- DW TSS_DESC_SIZE ; LimitLow\r
+ DW TSS_DESC_SIZE - 1 ; LimitLow\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
DB 0 ; BaseHigh\r
\r
CODE_SEL = offset CodeSeg32 - offset NullSeg\r
DB 0 ; BaseHigh\r
\r
CODE_SEL = offset CodeSeg32 - offset NullSeg\r
.byte 0 # BaseHigh\r
# TSS Segment for X64 specially\r
TssSeg:\r
.byte 0 # BaseHigh\r
# TSS Segment for X64 specially\r
TssSeg:\r
- .word TSS_DESC_SIZE # LimitLow\r
+ .word TSS_DESC_SIZE - 1 # LimitLow\r
.word 0 # BaseLow\r
.byte 0 # BaseMid\r
.byte 0x89\r
.word 0 # BaseLow\r
.byte 0 # BaseMid\r
.byte 0x89\r
- .byte 0xDB # LimitHigh\r
+ .byte 0x00 # LimitHigh\r
.byte 0 # BaseHigh\r
.long 0 # BaseUpper\r
.long 0 # Reserved\r
.byte 0 # BaseHigh\r
.long 0 # BaseUpper\r
.long 0 # Reserved\r
DB 0 ; BaseHigh\r
; TSS Segment for X64 specially\r
TssSeg LABEL QWORD\r
DB 0 ; BaseHigh\r
; TSS Segment for X64 specially\r
TssSeg LABEL QWORD\r
- DW TSS_DESC_SIZE ; LimitLow\r
+ DW TSS_DESC_SIZE - 1 ; LimitLow\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
DB 0 ; BaseHigh\r
DD 0 ; BaseUpper\r
DD 0 ; Reserved\r
DB 0 ; BaseHigh\r
DD 0 ; BaseUpper\r
DD 0 ; Reserved\r