From: Avi Kivity <[EMAIL PROTECTED]>

The hack also corrupts the segment attributes on nonpaging save/restore, which
is bad.  The previous commit fixes the problem at the source, rendering the
hack unnecessary.

Fixes 1959950.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
index 9a771ff..0bb5e06 100644
--- a/qemu/qemu-kvm-x86.c
+++ b/qemu/qemu-kvm-x86.c
@@ -149,15 +149,6 @@ static void get_seg(SegmentCache *lhs, const struct 
kvm_segment *rhs)
        | (rhs->avl * DESC_AVL_MASK);
 }
 
-/* the reset values of qemu are not compatible to SVM
- * this function is used to fix the segment descriptor values */
-static void fix_realmode_dataseg(struct kvm_segment *seg)
-{
-       seg->type = 0x02;
-       seg->present = 1;
-       seg->s = 1;
-}
-
 void kvm_arch_load_regs(CPUState *env)
 {
     struct kvm_regs regs;
@@ -224,15 +215,6 @@ void kvm_arch_load_regs(CPUState *env)
                        (sregs.cs.selector & 3);
                sregs.ss.dpl = sregs.ss.selector & 3;
            }
-
-           if (!(env->cr[0] & CR0_PG_MASK)) {
-                   fix_realmode_dataseg(&sregs.cs);
-                   fix_realmode_dataseg(&sregs.ds);
-                   fix_realmode_dataseg(&sregs.es);
-                   fix_realmode_dataseg(&sregs.fs);
-                   fix_realmode_dataseg(&sregs.gs);
-                   fix_realmode_dataseg(&sregs.ss);
-           }
     }
 
     set_seg(&sregs.tr, &env->tr);

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to