]> git.proxmox.com Git - mirror_qemu.git/commitdiff
kvm: x86: Remove obsolete SS.RPL/DPL aligment
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 27 Dec 2010 14:57:35 +0000 (15:57 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Fri, 21 Jan 2011 16:05:22 +0000 (14:05 -0200)
This seems to date back to the days KVM didn't support real mode. The
check is no longer needed and, even worse, is corrupting the guest state
in case SS.RPL != DPL.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
target-i386/kvm.c

index ee7bdf801234b14834f563f9e25bc5573e800811..7e5982b132fdcc01d3d10b1cc22d62af3f38a246 100644 (file)
@@ -780,13 +780,6 @@ static int kvm_put_sregs(CPUState *env)
            set_seg(&sregs.fs, &env->segs[R_FS]);
            set_seg(&sregs.gs, &env->segs[R_GS]);
            set_seg(&sregs.ss, &env->segs[R_SS]);
-
-           if (env->cr[0] & CR0_PE_MASK) {
-               /* force ss cpl to cs cpl */
-               sregs.ss.selector = (sregs.ss.selector & ~3) |
-                       (sregs.cs.selector & 3);
-               sregs.ss.dpl = sregs.ss.selector & 3;
-           }
     }
 
     set_seg(&sregs.tr, &env->tr);