aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-10-26 11:40:10 +0100
committerKeir Fraser <keir@xensource.com>2007-10-26 11:40:10 +0100
commit70ad570b27997f008b0609b8867ecdec65244a13 (patch)
treeeb830c230349dc60e10307c182a94337e05b22c5 /tools
parent333e063a9eb74a0ca46b16132500fea5cc81ee6c (diff)
downloadxen-70ad570b27997f008b0609b8867ecdec65244a13.tar.gz
xen-70ad570b27997f008b0609b8867ecdec65244a13.tar.bz2
xen-70ad570b27997f008b0609b8867ecdec65244a13.zip
x86/64: paravirt 32-on-64 call gate support
As we realized while trying out NetWare's ring 3 support, call gates didn't work for 32-bit guests on 64-bit hypervisor. Since x86-64 doesn't know 16- or 32-bit call gates, the only option was to emulate them. The code here was developed against 3.0.4, so hasn't been checked for potential integration possibilities with the much improved emulator; nevertheless I want to supply this patch. As was realized in the course of creating this patch, 64-bit gates don't work either, and will also need to be emulated if any environment intends to use them. The patch changes behavior here in that rather silently permitting the use of 64-bit gates (with possibly difficult to understand exceptions happening on the first instruction of the call/jump target) the call/jump itself will now fault, with the error code indicating the gate that was attempted to be used. I intend to complete the emulation to also cover 64-bit gates, but there is one issue that first needs to be addressed: Whether a gate transitions from user to kernel mode doesn't depend on the gate, but rather on the descriptor referenced by the selector held in the gate. As the two can change independently, this decision can be made only at the point of use of the gate, and consequently descriptors for kernel code segments must become distinguishable from user ones, which they currently aren't as they both get their DPL forced to 3. An initial thought here is to possibly leverage the otherwise meaningless conforming bit (i.e. forcing it on for all user code segments, and off for kernel ones, where then the distinction can be made at the point the descriptor gets verified/fixed up based of the kernel supplied DPL [wouldn't work for old guests when setting the DPL to 3 was still required to be done by the guest]). The patch also changes behavior of check_descriptor() in that no modification is done to the descriptor anymore unless all verification steps passed, and in that the selector RPL of selectors in call gates no longer gets fixed up (a comment elsewhere in the code correctly states that the RPL field here isn't used for anything by the processor); really, this field is now used on 64-bits to store the original DPL of the gate, because the architectural one now gets forced to zero. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions