VirtualBox

Ignore:
Timestamp:
Feb 23, 2009 10:26:39 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43248
Message:

VMM,REM: Brushed up the TR/TSS shadowing. We're now relying on the hidden TR registers in SELM and CPUM/REM will make sure these are always in sync. Joined CPUMGetGuestTRHid and CPUMGetGuestTR. Kicked out sync_tr (unused now) and SELMGCGetRing1Stack.

Location:
trunk/src/recompiler_new/target-i386
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler_new/target-i386/helper.h

    r15034 r17035  
    4343DEF_HELPER(void, helper_lcall_real, (int new_cs, target_ulong new_eip1,
    4444                       int shift, int next_eip))
    45 DEF_HELPER(void, helper_lcall_protected, (int new_cs, target_ulong new_eip, 
     45DEF_HELPER(void, helper_lcall_protected, (int new_cs, target_ulong new_eip,
    4646                            int shift, int next_eip_addend))
    4747DEF_HELPER(void, helper_iret_real, (int shift))
     
    114114DEF_HELPER(void, helper_svm_check_intercept_param, (uint32_t type, uint64_t param))
    115115DEF_HELPER(void, helper_vmexit, (uint32_t exit_code, uint64_t exit_info_1))
    116 DEF_HELPER(void, helper_svm_check_io, (uint32_t port, uint32_t param, 
     116DEF_HELPER(void, helper_svm_check_io, (uint32_t port, uint32_t param,
    117117                         uint32_t next_eip_addend))
    118118DEF_HELPER(void, helper_vmrun, (int aflag, int next_eip_addend))
     
    134134DEF_HELPER(void, helper_fildl_ST0, (int32_t val))
    135135DEF_HELPER(void, helper_fildll_ST0, (int64_t val))
    136 #ifndef VBOX 
     136#ifndef VBOX
    137137DEF_HELPER(uint32_t, helper_fsts_ST0, (void))
    138138DEF_HELPER(uint64_t, helper_fstl_ST0, (void))
     
    257257void sync_seg(CPUX86State *env1, int seg_reg, int selector);
    258258void sync_ldtr(CPUX86State *env1, int selector);
    259 int  sync_tr(CPUX86State *env1, int selector);
    260259
    261260#endif
  • trunk/src/recompiler_new/target-i386/op_helper.c

    r16505 r17035  
    58615861}
    58625862
    5863 /**
    5864  * Correctly loads a new tr selector.
    5865  *
    5866  * @param   env1        CPU environment.
    5867  * @param   selector    Selector to load.
    5868  */
    5869 int sync_tr(CPUX86State *env1, int selector)
    5870 {
    5871     /* ARG! this was going to call helper_ltr_T0 but that won't work because of busy flag. */
    5872     SegmentCache *dt;
    5873     uint32_t e1, e2;
    5874     int index, type, entry_limit;
    5875     target_ulong ptr;
    5876     CPUX86State *saved_env = env;
    5877     env = env1;
    5878 
    5879     selector &= 0xffff;
    5880     if ((selector & 0xfffc) == 0) {
    5881         /* NULL selector case: invalid TR */
    5882         env->tr.base = 0;
    5883         env->tr.limit = 0;
    5884         env->tr.flags = 0;
    5885     } else {
    5886         if (selector & 0x4)
    5887             goto l_failure;
    5888         dt = &env->gdt;
    5889         index = selector & ~7;
    5890 #ifdef TARGET_X86_64
    5891         if (env->hflags & HF_LMA_MASK)
    5892             entry_limit = 15;
    5893         else
    5894 #endif
    5895             entry_limit = 7;
    5896         if ((index + entry_limit) > dt->limit)
    5897             goto l_failure;
    5898         ptr = dt->base + index;
    5899         e1 = ldl_kernel(ptr);
    5900         e2 = ldl_kernel(ptr + 4);
    5901         type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
    5902         if ((e2 & DESC_S_MASK) /*||
    5903             (type != 1 && type != 9)*/)
    5904             goto l_failure;
    5905         if (!(e2 & DESC_P_MASK))
    5906             goto l_failure;
    5907 #ifdef TARGET_X86_64
    5908         if (env->hflags & HF_LMA_MASK) {
    5909             uint32_t e3;
    5910             e3 = ldl_kernel(ptr + 8);
    5911             load_seg_cache_raw_dt(&env->tr, e1, e2);
    5912             env->tr.base |= (target_ulong)e3 << 32;
    5913         } else
    5914 #endif
    5915         {
    5916             load_seg_cache_raw_dt(&env->tr, e1, e2);
    5917         }
    5918         e2 |= DESC_TSS_BUSY_MASK;
    5919         stl_kernel(ptr + 4, e2);
    5920     }
    5921     env->tr.selector = selector;
    5922 
    5923     env = saved_env;
    5924     return 0;
    5925 l_failure:
    5926     AssertMsgFailed(("selector=%d\n", selector));
    5927     return -1;
    5928 }
    5929 
    5930 
    59315863int get_ss_esp_from_tss_raw(CPUX86State *env1, uint32_t *ss_ptr,
    59325864                             uint32_t *esp_ptr, int dpl)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette