• Nadav Amit's avatar
    KVM: x86: Remove redundant and incorrect cpl check on task-switch · 2c2ca2d1
    Nadav Amit authored
    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: default avatarNadav Amit <namit@cs.technion.ac.il>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    2c2ca2d1
emulate.c 130 KB