What will happen if the GDT is changed as the program is executing? Is there any physical register or anything else that monitors whether the GDT is changed when executing program?
Asked
Active
Viewed 59 times
1 Answers
4
Nothing will change until something tries to fetch from the GDT. This could be a load to segment register, an interrupt, far call/return, etc..
Between these occasions the segment register's shadow part keeps the descriptor that was referenced by the selector last loaded into this register.

Ruslan
- 18,162
- 8
- 67
- 136
-
Segment base/limit, permissions, etc. are often described as a "cache". They're not; as you say they're loaded from the GDT only at well-defined times, when the segment register is written. (Or for FS and GS, the bases are accessible as an MSR, or with `wrfsbase` on CPUs with that extension.) – Peter Cordes Mar 01 '20 at 00:18
-
sorry and I just didn't realize how to accept your answer。Thanks again! – Jack Smith Mar 21 '20 at 04:26