From 93f2dc950c544117d2e854bdb7b7830831669927 Mon Sep 17 00:00:00 2001 Message-Id: <93f2dc950c544117d2e854bdb7b7830831669927.1350309834.git.minovotn@redhat.com> In-Reply-To: <14b740b7e3fbafdbfe2e6a302f51d6aa4fa96bf7.1350309834.git.minovotn@redhat.com> References: <14b740b7e3fbafdbfe2e6a302f51d6aa4fa96bf7.1350309834.git.minovotn@redhat.com> From: Gleb Natapov Date: Mon, 15 Oct 2012 09:29:19 +0200 Subject: [PATCH 17/17] kvm: x86: Remove obsolete SS.RPL/DPL aligment RH-Author: Gleb Natapov Message-id: <1350293359-26619-3-git-send-email-gleb@redhat.com> Patchwork-id: 43129 O-Subject: [PATCH qemu-kvm RHEL6.4 2/2] kvm: x86: Remove obsolete SS.RPL/DPL aligment Bugzilla: 852612 RH-Acked-by: Orit Wasserman RH-Acked-by: Paolo Bonzini RH-Acked-by: Marcelo Tosatti 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 Signed-off-by: Avi Kivity Upstream: 3980e3024b2d1677a9910de5e35d22d5d8392522 Signed-off-by: Gleb Natapov --- qemu-kvm-x86.c | 7 ------- 1 file changed, 7 deletions(-) Signed-off-by: Michal Novotny --- qemu-kvm-x86.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index f8796cd..f6634a6 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1037,13 +1037,6 @@ void kvm_arch_load_regs(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); -- 1.7.11.7