When making a call from real mode to protected mode, we save and restore the global and interrupt descriptor table registers. The restore currently takes place after returning to real mode, which generates two EXCEPTION_NMIs and corresponding VM exits when running under KVM on an Intel CPU. Avoid the VM exits by restoring the descriptor table registers inside prot_to_real, while still running in protected mode. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
253 |
|
253 |
|
254 |
|
254 |
|
255 |
|
255 |
|
256 |
|
|
|
257 |
|
|
|
258 |
|
|
|
259 |
|
|
|
260 |
|
|
|
261 |
|
|
|
262 |
|
256 |
|
263 |
|
257 |
|
264 |
|
258 |
|
|
|
||
275 |
|
269 |
|
276 |
|
270 |
|
277 |
|
271 |
|
|
272 |
|
|
278 |
|
273 |
|
279 |
|
274 |
|
280 |
|
275 |
|
281 |
|
276 |
|
282 |
|
277 |
|
283 |
|
278 |
|
|
279 |
|
|
|
280 |
|
|
|
281 |
|
|
|
282 |
|
|
|
283 |
|
|
|
284 |
|
|
|
285 |
|
|
|
286 |
|
|
|
287 |
|
|
284 |
|
288 |
|
285 |
|
289 |
|
286 |
|
290 |
|
|
|
||
300 |
|
304 |
|
301 |
|
305 |
|
302 |
|
306 |
|
303 |
|
|
|
304 |
|
|
|
305 |
|
|
|
306 |
|
307 |
|
307 |
|
308 |
|
308 |
|
309 |
|
|
|
||
314 |
|
315 |
|
315 |
|
316 |
|
316 |
|
317 |
|
|
318 |
|
|
|
319 |
|
|
317 |
|
320 |
|
318 |
|
321 |
|
319 |
|
322 |
|
|
|
||
349 |
|
352 |
|
350 |
|
353 |
|
351 |
|
354 |
|
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
|
358 |
|
|
|
359 |
|
|
|
360 |
|
|
352 |
|
361 |
|
353 |
|
362 |
|
354 |
|
363 |
|
|
|
||
384 |
|
393 |
|
385 |
|
394 |
|
386 |
|
395 |
|
387 |
|
|
|
388 |
|
|
|
|
396 |
|
|
|
397 |
|
|
389 |
|
398 |
|
390 |
|
399 |
|
391 |
|
400 |
|
|
|
||
403 |
|
412 |
|
404 |
|
413 |
|
405 |
|
414 |
|
406 |
|
|
|
|
415 |
|
|
407 |
|
416 |
|
408 |
|
|
|
409 |
|
|
|
|
417 |
|
|
|
418 |
|
|
410 |
|
419 |
|
411 |
|
420 |
|
412 |
|
421 |
|
|
|
||
426 |
|
435 |
|
427 |
|
436 |
|
428 |
|
437 |
|
|
438 |
|
|
429 |
|
439 |
|
430 |
|
440 |
|
431 |
|
441 |
|
432 |
|
442 |
|
433 |
|
443 |
|
434 |
|
|
|
435 |
|
|
|
436 |
|
|
|
437 |
|
|
|
438 |
|
|
|
|
444 |
|
|
|
445 |
|
|
439 |
|
446 |
|
440 |
|
447 |
|
441 |
|
448 |
|
|
|
||
489 |
|
496 |
|
490 |
|
497 |
|
491 |
|
498 |
|
|
499 |
|
|
492 |
|
500 |
|
493 |
|
501 |
|
494 |
|
502 |
|
|
|
||
520 |
|
528 |
|
521 |
|
529 |
|
522 |
|
530 |
|
|
531 |
|
|
|
532 |
|
|
|
533 |
|
|
|
534 |
|
|
|
535 |
|
|
|
536 |
|
|
|
537 |
|
|
|
538 |
|
|
523 |
|
539 |
|
524 |
|
540 |
|
525 |
|
541 |
|