Skip to contentSkip to conversation

kvm: x86: Remove obsolet SS.RPL/DPL aligment

PATCH Applied Jan Kiszka 2 participants 2 messages Dec 27, 2010 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 kvm: x86: Remove obsolet SS.RPL/DPL aligment

From: Jan Kiszka <[email protected]>

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.

---
 target-i386/kvm.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
target-i386/kvm.c +0 -7
index b3d7c54..85edacc 100644
@@ -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);
Signature · 1 line
1.7.1
Applied
#1 lore raw
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

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.

Applied to uq/master (nice how obsolete code propagates itself); thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function