]> xenbits.xensource.com Git - xen.git/commit
x86: defer not-present segment checks
authorJan Beulich <jbeulich@suse.com>
Tue, 25 Oct 2016 15:16:30 +0000 (17:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 25 Oct 2016 15:16:30 +0000 (17:16 +0200)
commitce904f64784cc3afdb23b09de9af229b3a76a55c
treeefc512c4701244971bfbd652a93972cf0286b498
parent92848cf9903c10a9585be6ac1fb1316c25b8dad6
x86: defer not-present segment checks

Following on from commits 5602e74c60 ("x86emul: correct loading of
%ss") and bdb860d01c ("x86/HVM: correct segment register loading during
task switch") the point of the non-.present checks needs to be refined:
#NP (and its #SS companion), other than suggested by the various
instruction pages in Intel's SDM, gets checked for only after all type
and permission checks. The only checks getting done even later are the
long mode specific ones for system descriptors (which we don't support
yet) and 64-bit code segments (i.e. anything touching other than the
attribute byte).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
x86/hvm: Correct the position of the %cs L/D checks

Contrary to the description in the software manuals, in Long Mode, attempts to
load %cs check that D is not set in combination with L before the present flag
is checked.

This can be observed because the L/D check fails with #GP before the presence
check failes with #NP.

This change partially reverts c/s 78ff18c90 "x86: defer not-present segment
checks", taking it back to how it was in the v1 submission.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 78ff18c905318a9b1e5dd32662986f03b10a4e56
master date: 2016-10-10 12:16:49 +0200
master commit: 13b9f31751a55a96e86bd7e64b433a62a4a5b71e
master date: 2016-10-14 12:43:17 +0100
xen/arch/x86/hvm/hvm.c
xen/arch/x86/x86_emulate/x86_emulate.c