Linus Torvalds writes: (Summary) Looking a bit more at this, I think it should be solved by:
- load the original read-write GDT early, along with the IDT.
We have already saved it off in __save_processor_state(), and it may
have already gotten loaded very early in at least some of the paths,
but it definitely hasn't gotten reloaded in all the paths (think
"suspend/resume testing" etc).
"suspend/resume testing" etc).
- add the LDT descriptor to the save area too, exactly like we already have IDT/GDT.
already have IDT/GDT.
Then, we can do "load_ldt()" early (along with IDT and GDT).
"suspend/resume testing" etc).
- add the LDT descriptor to the save area too, exactly like we already have IDT/GDT.
already have IDT/GDT.
Then, we can do "load_ldt()" early (along with IDT and GDT).