Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
7d117ce8
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看板
提交
7d117ce8
编写于
7月 07, 2015
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
target-i386: Clear bndregs during legacy near jumps
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
bdd87b3b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
0 deletion
+29
-0
target-i386/helper.h
target-i386/helper.h
+1
-0
target-i386/mpx_helper.c
target-i386/mpx_helper.c
+8
-0
target-i386/translate.c
target-i386/translate.c
+20
-0
未找到文件。
target-i386/helper.h
浏览文件 @
7d117ce8
...
...
@@ -21,6 +21,7 @@ DEF_HELPER_FLAGS_3(bndldx32, TCG_CALL_NO_WG, i64, env, tl, tl)
DEF_HELPER_FLAGS_3
(
bndldx64
,
TCG_CALL_NO_WG
,
i64
,
env
,
tl
,
tl
)
DEF_HELPER_FLAGS_5
(
bndstx32
,
TCG_CALL_NO_WG
,
void
,
env
,
tl
,
tl
,
i64
,
i64
)
DEF_HELPER_FLAGS_5
(
bndstx64
,
TCG_CALL_NO_WG
,
void
,
env
,
tl
,
tl
,
i64
,
i64
)
DEF_HELPER_1
(
bnd_jmp
,
void
,
env
)
DEF_HELPER_2
(
aam
,
void
,
env
,
int
)
DEF_HELPER_2
(
aad
,
void
,
env
,
int
)
...
...
target-i386/mpx_helper.c
浏览文件 @
7d117ce8
...
...
@@ -156,3 +156,11 @@ void helper_bndstx32(CPUX86State *env, target_ulong base, target_ulong ptr,
cpu_stl_data_ra
(
env
,
bte
+
4
,
ub
,
ra
);
cpu_stl_data_ra
(
env
,
bte
+
8
,
ptr
,
ra
);
}
void
helper_bnd_jmp
(
CPUX86State
*
env
)
{
if
(
!
(
env
->
hflags2
&
HF2_MPX_PR_MASK
))
{
memset
(
env
->
bnd_regs
,
0
,
sizeof
(
env
->
bnd_regs
));
env
->
hflags
&=
~
HF_MPX_IU_MASK
;
}
}
target-i386/translate.c
浏览文件 @
7d117ce8
...
...
@@ -2406,6 +2406,19 @@ static void gen_reset_hflag(DisasContext *s, uint32_t mask)
}
}
/* Clear BND registers during legacy branches. */
static
void
gen_bnd_jmp
(
DisasContext
*
s
)
{
/* Do nothing if BND prefix present, MPX is disabled, or if the
BNDREGs are known to be in INIT state already. The helper
itself will check BNDPRESERVE at runtime. */
if
((
s
->
prefix
&
PREFIX_REPNZ
)
==
0
&&
(
s
->
flags
&
HF_MPX_EN_MASK
)
==
0
&&
(
s
->
flags
&
HF_MPX_IU_MASK
)
==
0
)
{
gen_helper_bnd_jmp
(
cpu_env
);
}
}
/* generate a generic end of block. Trace exception is also generated
if needed */
static
void
gen_eob
(
DisasContext
*
s
)
...
...
@@ -4795,6 +4808,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
tcg_gen_movi_tl
(
cpu_T1
,
next_eip
);
gen_push_v
(
s
,
cpu_T1
);
gen_op_jmp_v
(
cpu_T0
);
gen_bnd_jmp
(
s
);
gen_eob
(
s
);
break
;
case
3
:
/* lcall Ev */
...
...
@@ -4820,6 +4834,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
tcg_gen_ext16u_tl
(
cpu_T0
,
cpu_T0
);
}
gen_op_jmp_v
(
cpu_T0
);
gen_bnd_jmp
(
s
);
gen_eob
(
s
);
break
;
case
5
:
/* ljmp Ev */
...
...
@@ -6201,6 +6216,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
gen_stack_update
(
s
,
val
+
(
1
<<
ot
));
/* Note that gen_pop_T0 uses a zero-extending load. */
gen_op_jmp_v
(
cpu_T0
);
gen_bnd_jmp
(
s
);
gen_eob
(
s
);
break
;
case
0xc3
:
/* ret */
...
...
@@ -6208,6 +6224,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
gen_pop_update
(
s
,
ot
);
/* Note that gen_pop_T0 uses a zero-extending load. */
gen_op_jmp_v
(
cpu_T0
);
gen_bnd_jmp
(
s
);
gen_eob
(
s
);
break
;
case
0xca
:
/* lret im */
...
...
@@ -6274,6 +6291,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
}
tcg_gen_movi_tl
(
cpu_T0
,
next_eip
);
gen_push_v
(
s
,
cpu_T0
);
gen_bnd_jmp
(
s
);
gen_jmp
(
s
,
tval
);
}
break
;
...
...
@@ -6303,6 +6321,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
}
else
if
(
!
CODE64
(
s
))
{
tval
&=
0xffffffff
;
}
gen_bnd_jmp
(
s
);
gen_jmp
(
s
,
tval
);
break
;
case
0xea
:
/* ljmp im */
...
...
@@ -6342,6 +6361,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
if
(
dflag
==
MO_16
)
{
tval
&=
0xffff
;
}
gen_bnd_jmp
(
s
);
gen_jcc
(
s
,
b
,
tval
,
next_eip
);
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录