Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
2a90358f
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看板
提交
2a90358f
编写于
12月 05, 2009
作者:
B
Blue Swirl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sparc64: handle MMU global bit and nucleus context
Signed-off-by:
N
Blue Swirl
<
blauwirbel@gmail.com
>
上级
dd5121bd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
11 deletion
+21
-11
target-sparc/cpu.h
target-sparc/cpu.h
+2
-0
target-sparc/helper.c
target-sparc/helper.c
+19
-11
未找到文件。
target-sparc/cpu.h
浏览文件 @
2a90358f
...
...
@@ -277,10 +277,12 @@ enum {
#define TTE_VALID_BIT (1ULL << 63)
#define TTE_USED_BIT (1ULL << 41)
#define TTE_LOCKED_BIT (1ULL << 6)
#define TTE_GLOBAL_BIT (1ULL << 0)
#define TTE_IS_VALID(tte) ((tte) & TTE_VALID_BIT)
#define TTE_IS_USED(tte) ((tte) & TTE_USED_BIT)
#define TTE_IS_LOCKED(tte) ((tte) & TTE_LOCKED_BIT)
#define TTE_IS_GLOBAL(tte) ((tte) & TTE_GLOBAL_BIT)
#define TTE_SET_USED(tte) ((tte) |= TTE_USED_BIT)
#define TTE_SET_UNUSED(tte) ((tte) &= ~TTE_USED_BIT)
...
...
target-sparc/helper.c
浏览文件 @
2a90358f
...
...
@@ -388,7 +388,8 @@ static inline int compare_masked(uint64_t x, uint64_t y, uint64_t mask)
// requires virtual address mask value calculated from TTE entry size
static
inline
int
ultrasparc_tag_match
(
SparcTLBEntry
*
tlb
,
uint64_t
address
,
uint64_t
context
,
target_phys_addr_t
*
physical
)
target_phys_addr_t
*
physical
,
int
is_nucleus
)
{
uint64_t
mask
;
...
...
@@ -410,8 +411,9 @@ static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,
// valid, context match, virtual address match?
if
(
TTE_IS_VALID
(
tlb
->
tte
)
&&
compare_masked
(
context
,
tlb
->
tag
,
0x1fff
)
&&
compare_masked
(
address
,
tlb
->
tag
,
mask
))
((
is_nucleus
&&
compare_masked
(
0
,
tlb
->
tag
,
0x1fff
))
||
TTE_IS_GLOBAL
(
tlb
->
tte
)
||
compare_masked
(
context
,
tlb
->
tag
,
0x1fff
))
&&
compare_masked
(
address
,
tlb
->
tag
,
mask
))
{
// decode physical address
*
physical
=
((
tlb
->
tte
&
mask
)
|
(
address
&
~
mask
))
&
0x1ffffffe000ULL
;
...
...
@@ -427,6 +429,7 @@ static int get_physical_address_data(CPUState *env,
{
unsigned
int
i
;
uint64_t
context
;
int
is_nucleus
;
if
((
env
->
lsu
&
DMMU_E
)
==
0
)
{
/* DMMU disabled */
*
physical
=
ultrasparc_truncate_physical
(
address
);
...
...
@@ -435,12 +438,13 @@ static int get_physical_address_data(CPUState *env,
}
context
=
env
->
dmmu
.
mmu_primary_context
&
0x1fff
;
is_nucleus
=
env
->
tl
>
0
;
for
(
i
=
0
;
i
<
64
;
i
++
)
{
// ctx match, vaddr match, valid?
if
(
ultrasparc_tag_match
(
&
env
->
dtlb
[
i
],
address
,
context
,
physical
)
)
{
address
,
context
,
physical
,
is_nucleus
)
)
{
// access ok?
if
(((
env
->
dtlb
[
i
].
tte
&
0x4
)
&&
is_user
)
||
(
!
(
env
->
dtlb
[
i
].
tte
&
0x2
)
&&
(
rw
==
1
)))
{
...
...
@@ -486,6 +490,7 @@ static int get_physical_address_code(CPUState *env,
{
unsigned
int
i
;
uint64_t
context
;
int
is_nucleus
;
if
((
env
->
lsu
&
IMMU_E
)
==
0
||
(
env
->
pstate
&
PS_RED
)
!=
0
)
{
/* IMMU disabled */
...
...
@@ -495,12 +500,13 @@ static int get_physical_address_code(CPUState *env,
}
context
=
env
->
dmmu
.
mmu_primary_context
&
0x1fff
;
is_nucleus
=
env
->
tl
>
0
;
for
(
i
=
0
;
i
<
64
;
i
++
)
{
// ctx match, vaddr match, valid?
if
(
ultrasparc_tag_match
(
&
env
->
itlb
[
i
],
address
,
context
,
physical
)
)
{
address
,
context
,
physical
,
is_nucleus
)
)
{
// access ok?
if
((
env
->
itlb
[
i
].
tte
&
0x4
)
&&
is_user
)
{
if
(
env
->
immu
.
sfsr
)
/* Fault status register */
...
...
@@ -596,7 +602,7 @@ void dump_mmu(CPUState *env)
}
if
((
env
->
dtlb
[
i
].
tte
&
0x8000000000000000ULL
)
!=
0
)
{
printf
(
"[%02u] VA: %"
PRIx64
", PA: %"
PRIx64
", %s, %s, %s, %s, ctx %"
PRId64
"
\n
"
,
", %s, %s, %s, %s, ctx %"
PRId64
"
%s
\n
"
,
i
,
env
->
dtlb
[
i
].
tag
&
(
uint64_t
)
~
0x1fffULL
,
env
->
dtlb
[
i
].
tte
&
(
uint64_t
)
0x1ffffffe000ULL
,
...
...
@@ -604,7 +610,8 @@ void dump_mmu(CPUState *env)
env
->
dtlb
[
i
].
tte
&
0x4
?
"priv"
:
"user"
,
env
->
dtlb
[
i
].
tte
&
0x2
?
"RW"
:
"RO"
,
env
->
dtlb
[
i
].
tte
&
0x40
?
"locked"
:
"unlocked"
,
env
->
dtlb
[
i
].
tag
&
(
uint64_t
)
0x1fffULL
);
env
->
dtlb
[
i
].
tag
&
(
uint64_t
)
0x1fffULL
,
TTE_IS_GLOBAL
(
env
->
dtlb
[
i
].
tag
)
?
"global"
:
"local"
);
}
}
}
...
...
@@ -630,14 +637,15 @@ void dump_mmu(CPUState *env)
}
if
((
env
->
itlb
[
i
].
tte
&
0x8000000000000000ULL
)
!=
0
)
{
printf
(
"[%02u] VA: %"
PRIx64
", PA: %"
PRIx64
", %s, %s, %s, ctx %"
PRId64
"
\n
"
,
", %s, %s, %s, ctx %"
PRId64
"
%s
\n
"
,
i
,
env
->
itlb
[
i
].
tag
&
(
uint64_t
)
~
0x1fffULL
,
env
->
itlb
[
i
].
tte
&
(
uint64_t
)
0x1ffffffe000ULL
,
mask
,
env
->
itlb
[
i
].
tte
&
0x4
?
"priv"
:
"user"
,
env
->
itlb
[
i
].
tte
&
0x40
?
"locked"
:
"unlocked"
,
env
->
itlb
[
i
].
tag
&
(
uint64_t
)
0x1fffULL
);
env
->
itlb
[
i
].
tag
&
(
uint64_t
)
0x1fffULL
,
TTE_IS_GLOBAL
(
env
->
itlb
[
i
].
tag
)
?
"global"
:
"local"
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录