Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
6e040755
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,发现更多精彩内容 >>
未验证
提交
6e040755
编写于
6月 07, 2016
作者:
A
Artyom Tarasenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
target-sparc: implement UA2005 hypervisor traps
Signed-off-by:
N
Artyom Tarasenko
<
atar4qemu@gmail.com
>
上级
9a10756d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
39 addition
and
5 deletion
+39
-5
target/sparc/cpu.h
target/sparc/cpu.h
+1
-0
target/sparc/int64_helper.c
target/sparc/int64_helper.c
+32
-5
target/sparc/win_helper.c
target/sparc/win_helper.c
+6
-0
未找到文件。
target/sparc/cpu.h
浏览文件 @
6e040755
...
...
@@ -79,6 +79,7 @@
#define TT_FILL 0xc0
#define TT_WOTHER (1 << 5)
#define TT_TRAP 0x100
#define TT_HTRAP 0x180
#endif
#define PSR_NEG_SHIFT 23
...
...
target/sparc/int64_helper.c
浏览文件 @
6e040755
...
...
@@ -78,8 +78,10 @@ void sparc_cpu_do_interrupt(CPUState *cs)
static
int
count
;
const
char
*
name
;
if
(
intno
<
0
||
intno
>=
0x1
80
)
{
if
(
intno
<
0
||
intno
>=
0x1
ff
)
{
name
=
"Unknown"
;
}
else
if
(
intno
>=
0x180
)
{
name
=
"Hyperprivileged Trap Instruction"
;
}
else
if
(
intno
>=
0x100
)
{
name
=
"Trap Instruction"
;
}
else
if
(
intno
>=
0xc0
)
{
...
...
@@ -135,16 +137,36 @@ void sparc_cpu_do_interrupt(CPUState *cs)
tsptr
->
tnpc
=
env
->
npc
;
tsptr
->
tt
=
intno
;
if
(
cpu_has_hypervisor
(
env
))
{
env
->
htstate
[
env
->
tl
]
=
env
->
hpstate
;
/* XXX OpenSPARC T1 - UltraSPARC T3 have MAXPTL=2
but this may change in the future */
if
(
env
->
tl
>
2
)
{
env
->
hpstate
|=
HS_PRIV
;
}
}
switch
(
intno
)
{
case
TT_IVEC
:
if
(
!
cpu_has_hypervisor
(
env
))
{
cpu_change_pstate
(
env
,
PS_PEF
|
PS_PRIV
|
PS_IG
);
}
break
;
case
TT_TFAULT
:
case
TT_DFAULT
:
case
TT_TMISS
...
TT_TMISS
+
3
:
case
TT_DMISS
...
TT_DMISS
+
3
:
case
TT_DPROT
...
TT_DPROT
+
3
:
if
(
cpu_has_hypervisor
(
env
))
{
env
->
hpstate
|=
HS_PRIV
;
env
->
pstate
=
PS_PEF
|
PS_PRIV
;
}
else
{
cpu_change_pstate
(
env
,
PS_PEF
|
PS_PRIV
|
PS_MG
);
}
break
;
case
TT_INSN_REAL_TRANSLATION_MISS
...
TT_DATA_REAL_TRANSLATION_MISS
:
case
TT_HTRAP
...
TT_HTRAP
+
127
:
env
->
hpstate
|=
HS_PRIV
;
break
;
default:
cpu_change_pstate
(
env
,
PS_PEF
|
PS_PRIV
|
PS_AG
);
...
...
@@ -158,8 +180,13 @@ void sparc_cpu_do_interrupt(CPUState *cs)
}
else
if
((
intno
&
0x1c0
)
==
TT_FILL
)
{
cpu_set_cwp
(
env
,
cpu_cwp_inc
(
env
,
env
->
cwp
+
1
));
}
if
(
cpu_hypervisor_mode
(
env
))
{
env
->
pc
=
(
env
->
htba
&
~
0x3fffULL
)
|
(
intno
<<
5
);
}
else
{
env
->
pc
=
env
->
tbr
&
~
0x7fffULL
;
env
->
pc
|=
((
env
->
tl
>
1
)
?
1
<<
14
:
0
)
|
(
intno
<<
5
);
}
env
->
npc
=
env
->
pc
+
4
;
cs
->
exception_index
=
-
1
;
}
...
...
target/sparc/win_helper.c
浏览文件 @
6e040755
...
...
@@ -366,6 +366,9 @@ void helper_done(CPUSPARCState *env)
env
->
asi
=
(
tsptr
->
tstate
>>
24
)
&
0xff
;
cpu_change_pstate
(
env
,
(
tsptr
->
tstate
>>
8
)
&
0xf3f
);
cpu_put_cwp64
(
env
,
tsptr
->
tstate
&
0xff
);
if
(
cpu_has_hypervisor
(
env
))
{
env
->
hpstate
=
env
->
htstate
[
env
->
tl
];
}
env
->
tl
--
;
trace_win_helper_done
(
env
->
tl
);
...
...
@@ -387,6 +390,9 @@ void helper_retry(CPUSPARCState *env)
env
->
asi
=
(
tsptr
->
tstate
>>
24
)
&
0xff
;
cpu_change_pstate
(
env
,
(
tsptr
->
tstate
>>
8
)
&
0xf3f
);
cpu_put_cwp64
(
env
,
tsptr
->
tstate
&
0xff
);
if
(
cpu_has_hypervisor
(
env
))
{
env
->
hpstate
=
env
->
htstate
[
env
->
tl
];
}
env
->
tl
--
;
trace_win_helper_retry
(
env
->
tl
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录