Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
efee7340
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
efee7340
编写于
8月 26, 2013
作者:
A
Andreas Färber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cpu: Move icount_extra field from CPU_COMMON to CPUState
Reset it. Signed-off-by:
N
Andreas Färber
<
afaerber@suse.de
>
上级
99df7dce
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
13 deletion
+15
-13
cpu-exec.c
cpu-exec.c
+5
-5
cpus.c
cpus.c
+7
-7
include/exec/cpu-defs.h
include/exec/cpu-defs.h
+0
-1
include/qom/cpu.h
include/qom/cpu.h
+2
-0
qom/cpu.c
qom/cpu.c
+1
-0
未找到文件。
cpu-exec.c
浏览文件 @
efee7340
...
@@ -650,15 +650,15 @@ int cpu_exec(CPUArchState *env)
...
@@ -650,15 +650,15 @@ int cpu_exec(CPUArchState *env)
int
insns_left
;
int
insns_left
;
tb
=
(
TranslationBlock
*
)(
next_tb
&
~
TB_EXIT_MASK
);
tb
=
(
TranslationBlock
*
)(
next_tb
&
~
TB_EXIT_MASK
);
insns_left
=
env
->
icount_decr
.
u32
;
insns_left
=
env
->
icount_decr
.
u32
;
if
(
env
->
icount_extra
&&
insns_left
>=
0
)
{
if
(
cpu
->
icount_extra
&&
insns_left
>=
0
)
{
/* Refill decrementer and continue execution. */
/* Refill decrementer and continue execution. */
env
->
icount_extra
+=
insns_left
;
cpu
->
icount_extra
+=
insns_left
;
if
(
env
->
icount_extra
>
0xffff
)
{
if
(
cpu
->
icount_extra
>
0xffff
)
{
insns_left
=
0xffff
;
insns_left
=
0xffff
;
}
else
{
}
else
{
insns_left
=
env
->
icount_extra
;
insns_left
=
cpu
->
icount_extra
;
}
}
env
->
icount_extra
-=
insns_left
;
cpu
->
icount_extra
-=
insns_left
;
env
->
icount_decr
.
u16
.
low
=
insns_left
;
env
->
icount_decr
.
u16
.
low
=
insns_left
;
}
else
{
}
else
{
if
(
insns_left
>
0
)
{
if
(
insns_left
>
0
)
{
...
...
cpus.c
浏览文件 @
efee7340
...
@@ -143,7 +143,7 @@ static int64_t cpu_get_icount_locked(void)
...
@@ -143,7 +143,7 @@ static int64_t cpu_get_icount_locked(void)
if
(
!
cpu_can_do_io
(
cpu
))
{
if
(
!
cpu_can_do_io
(
cpu
))
{
fprintf
(
stderr
,
"Bad clock read
\n
"
);
fprintf
(
stderr
,
"Bad clock read
\n
"
);
}
}
icount
-=
(
env
->
icount_decr
.
u16
.
low
+
env
->
icount_extra
);
icount
-=
(
env
->
icount_decr
.
u16
.
low
+
cpu
->
icount_extra
);
}
}
return
qemu_icount_bias
+
(
icount
<<
icount_time_shift
);
return
qemu_icount_bias
+
(
icount
<<
icount_time_shift
);
}
}
...
@@ -1236,6 +1236,7 @@ int vm_stop_force_state(RunState state)
...
@@ -1236,6 +1236,7 @@ int vm_stop_force_state(RunState state)
static
int
tcg_cpu_exec
(
CPUArchState
*
env
)
static
int
tcg_cpu_exec
(
CPUArchState
*
env
)
{
{
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
int
ret
;
int
ret
;
#ifdef CONFIG_PROFILER
#ifdef CONFIG_PROFILER
int64_t
ti
;
int64_t
ti
;
...
@@ -1248,9 +1249,9 @@ static int tcg_cpu_exec(CPUArchState *env)
...
@@ -1248,9 +1249,9 @@ static int tcg_cpu_exec(CPUArchState *env)
int64_t
count
;
int64_t
count
;
int64_t
deadline
;
int64_t
deadline
;
int
decr
;
int
decr
;
qemu_icount
-=
(
env
->
icount_decr
.
u16
.
low
+
env
->
icount_extra
);
qemu_icount
-=
(
env
->
icount_decr
.
u16
.
low
+
cpu
->
icount_extra
);
env
->
icount_decr
.
u16
.
low
=
0
;
env
->
icount_decr
.
u16
.
low
=
0
;
env
->
icount_extra
=
0
;
cpu
->
icount_extra
=
0
;
deadline
=
qemu_clock_deadline_ns_all
(
QEMU_CLOCK_VIRTUAL
);
deadline
=
qemu_clock_deadline_ns_all
(
QEMU_CLOCK_VIRTUAL
);
/* Maintain prior (possibly buggy) behaviour where if no deadline
/* Maintain prior (possibly buggy) behaviour where if no deadline
...
@@ -1267,7 +1268,7 @@ static int tcg_cpu_exec(CPUArchState *env)
...
@@ -1267,7 +1268,7 @@ static int tcg_cpu_exec(CPUArchState *env)
decr
=
(
count
>
0xffff
)
?
0xffff
:
count
;
decr
=
(
count
>
0xffff
)
?
0xffff
:
count
;
count
-=
decr
;
count
-=
decr
;
env
->
icount_decr
.
u16
.
low
=
decr
;
env
->
icount_decr
.
u16
.
low
=
decr
;
env
->
icount_extra
=
count
;
cpu
->
icount_extra
=
count
;
}
}
ret
=
cpu_exec
(
env
);
ret
=
cpu_exec
(
env
);
#ifdef CONFIG_PROFILER
#ifdef CONFIG_PROFILER
...
@@ -1276,10 +1277,9 @@ static int tcg_cpu_exec(CPUArchState *env)
...
@@ -1276,10 +1277,9 @@ static int tcg_cpu_exec(CPUArchState *env)
if
(
use_icount
)
{
if
(
use_icount
)
{
/* Fold pending instructions back into the
/* Fold pending instructions back into the
instruction counter, and clear the interrupt flag. */
instruction counter, and clear the interrupt flag. */
qemu_icount
-=
(
env
->
icount_decr
.
u16
.
low
qemu_icount
-=
(
env
->
icount_decr
.
u16
.
low
+
cpu
->
icount_extra
);
+
env
->
icount_extra
);
env
->
icount_decr
.
u32
=
0
;
env
->
icount_decr
.
u32
=
0
;
env
->
icount_extra
=
0
;
cpu
->
icount_extra
=
0
;
}
}
return
ret
;
return
ret
;
}
}
...
...
include/exec/cpu-defs.h
浏览文件 @
efee7340
...
@@ -149,7 +149,6 @@ typedef struct CPUWatchpoint {
...
@@ -149,7 +149,6 @@ typedef struct CPUWatchpoint {
CPU_COMMON_TLB \
CPU_COMMON_TLB \
struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE]; \
struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE]; \
\
\
int64_t icount_extra;
/* Instructions until next timer event. */
\
/* Number of cycles left, with interrupt flag in high bit. \
/* Number of cycles left, with interrupt flag in high bit. \
This allows a single read-compare-cbranch-write sequence to test \
This allows a single read-compare-cbranch-write sequence to test \
for both decrementer underflow and exceptions. */
\
for both decrementer underflow and exceptions. */
\
...
...
include/qom/cpu.h
浏览文件 @
efee7340
...
@@ -157,6 +157,7 @@ struct kvm_run;
...
@@ -157,6 +157,7 @@ struct kvm_run;
* @tcg_exit_req: Set to force TCG to stop executing linked TBs for this
* @tcg_exit_req: Set to force TCG to stop executing linked TBs for this
* CPU and return to its top level loop.
* CPU and return to its top level loop.
* @singlestep_enabled: Flags for single-stepping.
* @singlestep_enabled: Flags for single-stepping.
* @icount_extra: Instructions until next timer event.
* @can_do_io: Nonzero if memory-mapped IO is safe.
* @can_do_io: Nonzero if memory-mapped IO is safe.
* @env_ptr: Pointer to subclass-specific CPUArchState field.
* @env_ptr: Pointer to subclass-specific CPUArchState field.
* @current_tb: Currently executing TB.
* @current_tb: Currently executing TB.
...
@@ -196,6 +197,7 @@ struct CPUState {
...
@@ -196,6 +197,7 @@ struct CPUState {
volatile
sig_atomic_t
tcg_exit_req
;
volatile
sig_atomic_t
tcg_exit_req
;
uint32_t
interrupt_request
;
uint32_t
interrupt_request
;
int
singlestep_enabled
;
int
singlestep_enabled
;
int64_t
icount_extra
;
AddressSpace
*
as
;
AddressSpace
*
as
;
MemoryListener
*
tcg_as_listener
;
MemoryListener
*
tcg_as_listener
;
...
...
qom/cpu.c
浏览文件 @
efee7340
...
@@ -241,6 +241,7 @@ static void cpu_common_reset(CPUState *cpu)
...
@@ -241,6 +241,7 @@ static void cpu_common_reset(CPUState *cpu)
cpu
->
halted
=
0
;
cpu
->
halted
=
0
;
cpu
->
mem_io_pc
=
0
;
cpu
->
mem_io_pc
=
0
;
cpu
->
mem_io_vaddr
=
0
;
cpu
->
mem_io_vaddr
=
0
;
cpu
->
icount_extra
=
0
;
cpu
->
can_do_io
=
0
;
cpu
->
can_do_io
=
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录