[4459] converted more helpers to TCG - fixed some SVM issues
Revision: 4459
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4459 Author: bellard Date: 2008-05-15 16:46:30 +0000 (Thu, 15 May 2008)
Log Message:
-----------
converted more helpers to TCG - fixed some SVM issues
Modified Paths:
--------------
trunk/target-i386/TODO
trunk/target-i386/exec.h
trunk/target-i386/helper.c
trunk/target-i386/helper.h
trunk/target-i386/op.c
trunk/target-i386/ops_sse.h
trunk/target-i386/ops_sse_header.h
trunk/target-i386/ops_template.h
trunk/target-i386/svm.h
trunk/target-i386/translate.cModified: trunk/target-i386/TODO
===================================================================
target-i386/TODO +11 -2
@@ -3,12 +3,13 @@ - rework eflags optimization (will be a consequence of TCG port) - SVM: rework the implementation: simplify code, move most intercept tests as dynamic, correct segment access, verify exception safety, - remove most of the added CPU state. + 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 ? -- x86_64: cmovl bug intel/amd differences ? +- x86_64: cmovl intel/amd differences ? +- cmpxchg16b + cmpxchg8b cpuid test - x86: monitor invalid - better code fetch (different exception handling + CS.limit support) - user/kernel PUSHL/POPL in helper.c
@@ -19,10 +20,18 @@ - full support of segment limit/rights - full x87 exception support - improve x87 bit exactness (use bochs code ?) +- DRx register support +- CR0.AC emulation +- SSE alignment checks +- fix SSE min/max with nans Optimizations/Features: - finish TCG port +- add SVM nested paging support +- add VMX support +- add AVX support +- add SSE5 support - 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/exec.h
===================================================================
target-i386/exec.h +4 -22
@@ -105,16 +105,6 @@extern CCTable cc_table[]; -void helper_load_seg (int seg_reg,int selector); -void helper_ljmp_protected_T0_T1 (int next_eip); -void helper_lcall_real_T0_T1 (int shift,int next_eip); -void helper_lcall_protected_T0_T1 (int shift,int next_eip); -void helper_iret_real (int shift); -void helper_iret_protected (int shift,int next_eip); -void helper_lret_protected (int shift,int addend); -void helper_movl_crN_T0 (int reg); -void helper_movl_drN_T0 (int reg); -void helper_invlpg (target_ulong addr);void cpu_x86_update_cr0 (CPUX86State *env,uint32_t new_cr0);void cpu_x86_update_cr3 (CPUX86State *env,target_ulong new_cr3);void cpu_x86_update_cr4 (CPUX86State *env,uint32_t new_cr4);
@@ -141,18 +131,11 @@#include "helper.h" -void helper_mulq_EAX_T0 (void ); -void helper_imulq_EAX_T0 (void ); -void helper_imulq_T0_T1 (void ); -void helper_cmpxchg8b (void ); +static inline void svm_check_intercept (uint32_t type) +{ +helper_svm_check_intercept_param (type,0 ); +} -void check_iob_T0 (void ); -void check_iow_T0 (void ); -void check_iol_T0 (void ); -void check_iob_DX (void ); -void check_iow_DX (void ); -void check_iol_DX (void ); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h"
@@ -363,7 +346,6 @@void fpu_raise_exception (void );void restore_native_fp_state (CPUState *env);void save_native_fp_state (CPUState *env); -void vmexit (uint64_t exit_code,uint64_t exit_info_1);extern const uint8_t parity_table[256 ];extern const uint8_t rclw_table[32 ];
Modified: trunk/target-i386/helper.c
===================================================================
target-i386/helper.c +179 -130
627 lines not on this page · raw message
Modified: trunk/target-i386/helper.h
===================================================================
target-i386/helper.h +39 -11
91 lines not on this page · raw message
Modified: trunk/target-i386/op.c
===================================================================
target-i386/op.c +14 -127
195 lines not on this page · raw message
Modified: trunk/target-i386/ops_sse.h
===================================================================
target-i386/ops_sse.h +2 -2
@@ -471,12 +471,12 @@#endif } -void glue (helper_maskmov ,SUFFIX ) (Reg *d,Reg *s) +void glue (helper_maskmov ,SUFFIX ) (Reg *d,Reg *s,target_ulong a0) {int i;for (i =0 ; i < (8 <<SHIFT ); i++) {if (s->B (i) &0x80 ) -stb (A0 + i, d->B (i)); +stb (a0 + i, d->B (i)); }FORCE_RET (); }
Modified: trunk/target-i386/ops_sse_header.h
===================================================================
target-i386/ops_sse_header.h +1 -1
@@ -104,7 +104,7 @@void glue (helper_pmaddwd ,SUFFIX ) (Reg *d,Reg *s);void glue (helper_psadbw ,SUFFIX ) (Reg *d,Reg *s); -void glue (helper_maskmov ,SUFFIX ) (Reg *d,Reg *s); +void glue (helper_maskmov ,SUFFIX ) (Reg *d,Reg *s,target_ulong a0);void glue (helper_movl_mm_T0 ,SUFFIX ) (Reg *d,uint32_t val);#ifdef TARGET_X86_64 void glue (helper_movq_mm_T0 ,SUFFIX ) (Reg *d,uint64_t val);
Modified: trunk/target-i386/ops_template.h
===================================================================
target-i386/ops_template.h +0 -33
@@ -554,39 +554,6 @@T0 =DF <<SHIFT ; } -/* port I/O */ -#if DATA_BITS <=32 -void OPPROTO glue(glue(op_out, SUFFIX), _T0_T1)(void) -{ -glue (cpu_out,SUFFIX )(env,T0 ,T1 &DATA_MASK ); -} - -void OPPROTO glue(glue(op_in, SUFFIX), _T0_T1)(void) -{ -T1 =glue (cpu_in,SUFFIX )(env,T0 ); -} - -void OPPROTO glue(glue(op_in, SUFFIX), _DX_T0)(void) -{ -T0 =glue (cpu_in,SUFFIX )(env,EDX &0xffff ); -} - -void OPPROTO glue(glue(op_out, SUFFIX), _DX_T0)(void) -{ -glue (cpu_out,SUFFIX )(env,EDX &0xffff ,T0 ); -} - -void OPPROTO glue(glue(op_check_io, SUFFIX), _T0)(void) -{ -glue (glue (check_io,SUFFIX ), _T0)(); -} - -void OPPROTO glue(glue(op_check_io, SUFFIX), _DX)(void) -{ -glue (glue (check_io,SUFFIX ), _DX)(); -} -#endif -#undef DATA_BITS#undef SHIFT_MASK#undef SHIFT1_MASK
Modified: trunk/target-i386/svm.h
===================================================================
target-i386/svm.h +1 -10
@@ -71,8 +71,7 @@uint32_t int_vector;uint32_t int_state;uint8_t reserved_3[4 ]; -uint32_t exit_code; -uint32_t exit_code_hi; +uint64_t exit_code;uint64_t exit_info_1;uint64_t exit_info_2;uint32_t exit_int_info;
@@ -323,14 +322,6 @@/* function references */ -void helper_stgi (void ); -void vmexit (uint64_t exit_code,uint64_t exit_info_1); -int svm_check_intercept_param (uint32_t type,uint64_t param); -static inline int svm_check_intercept (unsigned int type) { -return svm_check_intercept_param (type,0 ); -} - -#define INTERCEPTED (mask) (env->intercept & mask)#define INTERCEPTEDw (var, mask) (env->intercept ## var & mask)#define INTERCEPTEDl (var, mask) (env->intercept ## var & mask)
Modified: trunk/target-i386/translate.c
===================================================================
target-i386/translate.c +153 -147
565 lines not on this page · raw message