But different callers need different validation rules. A MOV DS, AX needs to reject call gates but accept data segments. A CALL FAR needs to accept call gates and code segments. How can one shared subroutine perform different validation?
Daniel Stenberg Founder, cURL
,推荐阅读搜狗输入法2026获取更多信息
更多精彩内容,关注钛媒体微信号(ID:taimeiti),或者下载钛媒体App
Nearly every protection-related instruction -- far CALL, far JMP, far RET, INT, IRET, MOV to segment register, task switch -- needs to load a segment descriptor from the GDT or LDT. The 386 microcode centralizes this into a shared subroutine called LD_DESCRIPTOR, which reads the 8-byte descriptor from memory and feeds the high DWORD (containing Type, DPL, S, and P bits) to the Test PLA for validation.