diff options
| author | 项小羽 <[email protected]> | 2022-06-06 09:43:02 +0000 |
|---|---|---|
| committer | 项小羽 <[email protected]> | 2022-06-06 09:43:02 +0000 |
| commit | 2ddff156b622f91d6d7a71bd5afbb40829cb8b90 (patch) | |
| tree | 1282e818d5f47282d70a20fa7f62e63833b4f43f | |
| parent | 5dbf06771719469829937cb393aa9ae515887a7c (diff) | |
modify uif to register
| -rw-r--r-- | target/i386/tcg/misc_helper.c | 5 | ||||
| -rw-r--r-- | target/i386/tcg/seg_helper.c | 34 |
2 files changed, 22 insertions, 17 deletions
diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c index 07789aabad..1913503676 100644 --- a/target/i386/tcg/misc_helper.c +++ b/target/i386/tcg/misc_helper.c @@ -83,8 +83,13 @@ void helper_rdtsc(CPUX86State *env) // ??? 读取时间相关的函数 // static bool former = false; static bool current = false; void helper_senduipi(CPUX86State *env ,int reg_index){ + qemu_log("reg_index:%d\n", reg_index); uint32_t uittsz = (uint32_t)env->uintr_misc; int uitte_index = env->regs[R_EAX]; + if(reg_index == 244){ + uitte_index = env->regs[R_R12]; + qemu_log("read from r12, index :%d\n", uitte_index); + } if (uitte_index > uittsz){ raise_exception_ra(env, EXCP0D_GPF, GETPC()); } diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 9d05fd78d7..1de5d98c25 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -861,29 +861,29 @@ static inline target_ulong get_rsp_from_tss(CPUX86State *env, int level) } static void switch_uif(CPUX86State *env, bool on){ - CPUState *cs = env_cpu(env); - int prot; - uint64_t upid_phyaddress = get_hphys2(cs, env->uintr_pd, MMU_DATA_LOAD, &prot); - uintr_upid upid; - cpu_physical_memory_rw(upid_phyaddress, &upid, 16, false); + // CPUState *cs = env_cpu(env); + // int prot; + // uint64_t upid_phyaddress = get_hphys2(cs, env->uintr_pd, MMU_DATA_LOAD, &prot); + // uintr_upid upid; + // cpu_physical_memory_rw(upid_phyaddress, &upid, 16, false); if(on){ - // env->uintr_uif = 1; - upid.nc.reserved1 = 1; + env->uintr_uif = 1; + // upid.nc.reserved1 = 1; }else{ - // env->uintr_uif = 0; - upid.nc.reserved1 = 0; + env->uintr_uif = 0; + // upid.nc.reserved1 = 0; } - cpu_physical_memory_rw(upid_phyaddress, &upid, 16, true); + // cpu_physical_memory_rw(upid_phyaddress, &upid, 16, true); } static bool uif_enable(CPUX86State *env){ - // return env->uintr_uif != 0; - CPUState *cs = env_cpu(env); - int prot; - uint64_t upid_phyaddress = get_hphys2(cs, env->uintr_pd, MMU_DATA_LOAD, &prot); - uintr_upid upid; - cpu_physical_memory_rw(upid_phyaddress, &upid, 16, false); - return upid.nc.reserved1 != 0; + return env->uintr_uif != 0; + // CPUState *cs = env_cpu(env); + // int prot; + // uint64_t upid_phyaddress = get_hphys2(cs, env->uintr_pd, MMU_DATA_LOAD, &prot); + // uintr_upid upid; + // cpu_physical_memory_rw(upid_phyaddress, &upid, 16, false); + // return upid.nc.reserved1 != 0; } void helper_stui(CPUX86State *env){ |
