Fix for x86_64 boot failures due to bad segment setup for protected mode.
A message that is not in the archive (sent off-list or not yet received): C178E6D1.438A%[email protected]
Quoted 7 lines · Keir Fraser
Quoted 4 lines · Steven Rostedt
The old approach would just update all the selectors if they fit inside the GDT table, whether or not they were changed or loaded. So when Linux had a bad (extremely large) GDT limit, we loaded all the selectors into the shadow selector, even though they were bogus.
Quoted 6 lines
A smaller patch might have been to implement those VMENTER sanity checks inside
load_seg(). I'm sure they're quite simple. However, this new approach is arguably saner than the old, and it's worked on a few images I've tested it with, so I checked it in and we'll see how it holds up under wider testing.
I believed Stephen looked at the sanity check approach, and determined that the code to simulate the sanity checks would be quite complex and error prone. But Stephen can correct me if I'm wrong.
-- Steve
Hi,
Quoted 2 lines · Keir Fraser
A smaller patch might have been to implement those VMENTER sanity checks inside
load_seg(). I'm sure they're quite simple.
I checked, as that was going to be my first approach. Turns out that they are not actually all that simple, with all sorts of different rules for base, size, access rights, type, flags and so on, dependent on which segment it is, whether it's 16 or 32-bit, etc.
They aren't _too_ tricky, but after looking at it some, there are enough rules there that I was actually more worried about introducing a regression going down that route than in the patch I ended up with.
Cheers,
Stephen