Skip to contentSkip to conversation

[4514] convert remaining segment handling to TCG

Qemu-devel Fabrice Bellard 2 participants 4 messages May 21, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 4514

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4514
Author:   bellard
Date:     2008-05-21 16:34:06 +0000 (Wed, 21 May 2008)

Log Message:
-----------
convert remaining segment handling to TCG

Modified Paths:
--------------

    trunk/target-i386/TODO
    trunk/target-i386/op.c
    trunk/target-i386/translate.c

Modified: trunk/target-i386/TODO
===================================================================

target-i386/TODO +2 -1
@@ -4,7 +4,6 @@
 - SVM: rework the implementation: simplify code, move most intercept
   tests as dynamic, correct segment access, verify exception safety,
   cpu save/restore, SMM save/restore. 
-- arpl eflags computation is invalid
 - x86_64: fxsave/fxrestore intel/amd differences
 - x86_64: lcall/ljmp intel/amd differences ?
 - x86_64: cmpxchgl intel/amd differences ?
@@ -32,6 +31,8 @@
 - add VMX support
 - add AVX support
 - add SSE5 support
+- faster EFLAGS update: consider SZAP, C, O can be updated separately
+  with a bit field in CC_OP and more state variables.
 - evaluate x87 stack pointer statically
 - find a way to avoid translating several time the same TB if CR0.TS
   is set or not.

Modified: trunk/target-i386/op.c
===================================================================

target-i386/op.c +0 -39
@@ -147,45 +147,6 @@
 
 #endif
 
-/* segment handling */
-
-/* faster VM86 version */
-void OPPROTO op_movl_seg_T0_vm(void)
-{
-    int selector;
-    SegmentCache *sc;
-
-    selector = T0 & 0xffff;
-    /* env->segs[] access */
-    sc = (SegmentCache *)((char *)env + PARAM1);
-    sc->selector = selector;
-    sc->base = (selector << 4);
-}
-
-void OPPROTO op_movl_T0_seg(void)
-{
-    T0 = env->segs[PARAM1].selector;
-}
-
-void OPPROTO op_arpl(void)
-{
-    if ((T0 & 3) < (T1 & 3)) {
-        /* XXX: emulate bug or 0xff3f0000 oring as in bochs ? */
-        T0 = (T0 & ~3) | (T1 & 3);
-        T1 = CC_Z;
-   } else {
-        T1 = 0;
-    }
-    FORCE_RET();
-}
-
-void OPPROTO op_arpl_update(void)
-{
-    int eflags;
-    eflags = cc_table[CC_OP].compute_all();
-    CC_SRC = (eflags & ~CC_Z) | T1;
-}
-
 void OPPROTO op_movl_T0_env(void)
 {
     T0 = *(uint32_t *)((char *)env + PARAM1);

Modified: trunk/target-i386/translate.c
===================================================================

target-i386/translate.c +36 -9

88 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Fabrice Bellard

convert remaining segment handling to TCG

Does qemu generate different code when the segment bases are zero? The segment base additions can be trivially avoided in this case.

Signature · 1 line
error compiling committee.c: too many arguments to function
#2 lore raw
Quoted 5 lines · Avi Kivity
Quoted 2 lines · Fabrice Bellard

convert remaining segment handling to TCG

Does qemu generate different code when the segment bases are zero? The segment base additions can be trivially avoided in this case.

Yes, but only when DS, ES and SS have zero bases.

Fabrice.

#3 lore raw
Quoted 5 lines · Fabrice Bellard
Quoted 2 lines

Does qemu generate different code when the segment bases are zero? The segment base additions can be trivially avoided in this case.

Yes, but only when DS, ES and SS have zero bases.

Sure, that's the common case.

On a slightly different subject, are you considering improving tcg optimization? It can even be made dynamic, with aggressive optimization only kicking in if a block has been executed a large number of times.

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.