]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commit
x86/vmx: don't clobber exception_bitmap when entering/leaving emulated real mode
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 2 Feb 2016 13:00:52 +0000 (14:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 2 Feb 2016 13:00:52 +0000 (14:00 +0100)
commit78c93adf0a7f6a7abe249a63e7398ca1221a6d25
treef2143ff90421fab67fe6c9c1885d9933eb751679
parent428607a410e8abfb4bb71195d74cd1157e3d06ae
x86/vmx: don't clobber exception_bitmap when entering/leaving emulated real mode

Most updates to the exception bitmaps set or clear an individual bits.

However, entering or exiting emulated real mode unilaterally clobbers it,
leaving the exit code to recalculate what it should have been.  This is error
prone, and indeed currently fails to recalculate the TRAP_no_device intercept
appropriately.

Instead of overwriting exception_bitmap when entering emulated real mode, move
the override into vmx_update_exception_bitmap() and leave exception_bitmap
unmodified.

This means that recalculation is unnecessary, and that the use of
vmx_fpu_leave() and vmx_update_debug_state() while in emulated real mode
doesn't result in TRAP_no_device and TRAP_int3 being un-intercepted.

This is only a functional change on hardware lacking unrestricted guest
support.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmx.c