]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: x86: Remove redundant and incorrect cpl check on task-switch
authorNadav Amit <namit@cs.technion.ac.il>
Sun, 2 Nov 2014 09:54:57 +0000 (11:54 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 Nov 2014 14:44:10 +0000 (15:44 +0100)
commit2c2ca2d12f5c7b7a961555029dcddd1154cc98e5
treec3f93d577fe10dfad4d3e1787069595b6d6782d9
parent9a9abf6b612709f67b9e3852554191541631d075
KVM: x86: Remove redundant and incorrect cpl check on task-switch

Task-switch emulation checks the privilege level prior to performing the
task-switch.  This check is incorrect in the case of task-gates, in which the
tss.dpl is ignored, and can cause superfluous exceptions.  Moreover this check
is unnecassary, since the CPU checks the privilege levels prior to exiting.
Intel SDM 25.4.2 says "If CALL or JMP accesses a TSS descriptor directly
outside IA-32e mode, privilege levels are checked on the TSS descriptor" prior
to exiting.  AMD 15.14.1 says "The intercept is checked before the task switch
takes place but after the incoming TSS and task gate (if one was involved) have
been checked for correctness."

This patch removes the CPL checks for CALL and JMP.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c