Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
36bb94ba
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
36bb94ba
编写于
11月 16, 2010
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: pgtable: provide RDONLY page table bit rather than WRITE bit
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
9522d7e4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
41 addition
and
42 deletion
+41
-42
arch/arm/include/asm/pgtable.h
arch/arm/include/asm/pgtable.h
+19
-19
arch/arm/mm/mmu.c
arch/arm/mm/mmu.c
+9
-10
arch/arm/mm/proc-macros.S
arch/arm/mm/proc-macros.S
+8
-8
arch/arm/mm/proc-v7.S
arch/arm/mm/proc-v7.S
+3
-3
arch/arm/mm/proc-xscale.S
arch/arm/mm/proc-xscale.S
+2
-2
未找到文件。
arch/arm/include/asm/pgtable.h
浏览文件 @
36bb94ba
...
...
@@ -169,7 +169,7 @@ extern void __pgd_error(const char *file, int line, pgd_t);
#define L_PTE_YOUNG (_AT(pteval_t, 1) << 1)
#define L_PTE_FILE (_AT(pteval_t, 1) << 2)
/* only when !PRESENT */
#define L_PTE_DIRTY (_AT(pteval_t, 1) << 6)
#define L_PTE_
WRITE
(_AT(pteval_t, 1) << 7)
#define L_PTE_
RDONLY
(_AT(pteval_t, 1) << 7)
#define L_PTE_USER (_AT(pteval_t, 1) << 8)
#define L_PTE_XN (_AT(pteval_t, 1) << 9)
#define L_PTE_SHARED (_AT(pteval_t, 1) << 10)
/* shared(v6), coherent(xsc3) */
...
...
@@ -205,23 +205,23 @@ extern pgprot_t pgprot_kernel;
#define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b))
#define PAGE_NONE _MOD_PROT(pgprot_user, L_PTE_XN)
#define PAGE_SHARED _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_
WRITE | L_PTE_
XN)
#define PAGE_SHARED_EXEC _MOD_PROT(pgprot_user, L_PTE_USER
| L_PTE_WRITE
)
#define PAGE_COPY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_XN)
#define PAGE_COPY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER)
#define PAGE_READONLY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_XN)
#define PAGE_READONLY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER)
#define PAGE_NONE _MOD_PROT(pgprot_user, L_PTE_XN
| L_PTE_RDONLY
)
#define PAGE_SHARED _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_XN)
#define PAGE_SHARED_EXEC _MOD_PROT(pgprot_user, L_PTE_USER)
#define PAGE_COPY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_
RDONLY | L_PTE_
XN)
#define PAGE_COPY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER
| L_PTE_RDONLY
)
#define PAGE_READONLY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_
RDONLY | L_PTE_
XN)
#define PAGE_READONLY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER
| L_PTE_RDONLY
)
#define PAGE_KERNEL _MOD_PROT(pgprot_kernel, L_PTE_XN)
#define PAGE_KERNEL_EXEC pgprot_kernel
#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_XN)
#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_
WRITE | L_PTE_
XN)
#define __PAGE_SHARED_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER
| L_PTE_WRITE
)
#define __PAGE_COPY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)
#define __PAGE_COPY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER)
#define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)
#define __PAGE_READONLY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER)
#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_
RDONLY | L_PTE_
XN)
#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)
#define __PAGE_SHARED_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER)
#define __PAGE_COPY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_
RDONLY | L_PTE_
XN)
#define __PAGE_COPY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER
| L_PTE_RDONLY
)
#define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_
RDONLY | L_PTE_
XN)
#define __PAGE_READONLY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER
| L_PTE_RDONLY
)
#define __pgprot_modify(prot,mask,bits) \
__pgprot((pgprot_val(prot) & ~(mask)) | (bits))
...
...
@@ -380,7 +380,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
#define pte_none(pte) (!pte_val(pte))
#define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT)
#define pte_write(pte) (
pte_val(pte) & L_PTE_WRITE
)
#define pte_write(pte) (
!(pte_val(pte) & L_PTE_RDONLY)
)
#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY)
#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
#define pte_exec(pte) (!(pte_val(pte) & L_PTE_XN))
...
...
@@ -393,8 +393,8 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
#define PTE_BIT_FUNC(fn,op) \
static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
PTE_BIT_FUNC
(
wrprotect
,
&=
~
L_PTE_WRITE
);
PTE_BIT_FUNC
(
mkwrite
,
|=
L_PTE_WRITE
);
PTE_BIT_FUNC
(
wrprotect
,
|=
L_PTE_RDONLY
);
PTE_BIT_FUNC
(
mkwrite
,
&=
~
L_PTE_RDONLY
);
PTE_BIT_FUNC
(
mkclean
,
&=
~
L_PTE_DIRTY
);
PTE_BIT_FUNC
(
mkdirty
,
|=
L_PTE_DIRTY
);
PTE_BIT_FUNC
(
mkold
,
&=
~
L_PTE_YOUNG
);
...
...
@@ -404,7 +404,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
static
inline
pte_t
pte_modify
(
pte_t
pte
,
pgprot_t
newprot
)
{
const
pteval_t
mask
=
L_PTE_XN
|
L_PTE_
WRITE
|
L_PTE_USER
;
const
pteval_t
mask
=
L_PTE_XN
|
L_PTE_
RDONLY
|
L_PTE_USER
;
pte_val
(
pte
)
=
(
pte_val
(
pte
)
&
~
mask
)
|
(
pgprot_val
(
newprot
)
&
mask
);
return
pte
;
}
...
...
arch/arm/mm/mmu.c
浏览文件 @
36bb94ba
...
...
@@ -190,7 +190,7 @@ void adjust_cr(unsigned long mask, unsigned long set)
}
#endif
#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_
WRITE|L_PTE_
XN
#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN
#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE
static
struct
mem_type
mem_types
[]
=
{
...
...
@@ -234,19 +234,19 @@ static struct mem_type mem_types[] = {
.
domain
=
DOMAIN_KERNEL
,
},
[
MT_LOW_VECTORS
]
=
{
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
,
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
|
L_PTE_RDONLY
,
.
prot_l1
=
PMD_TYPE_TABLE
,
.
domain
=
DOMAIN_USER
,
},
[
MT_HIGH_VECTORS
]
=
{
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
|
L_PTE_USER
,
L_PTE_USER
|
L_PTE_RDONLY
,
.
prot_l1
=
PMD_TYPE_TABLE
,
.
domain
=
DOMAIN_USER
,
},
[
MT_MEMORY
]
=
{
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
|
L_PTE_WRITE
,
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
,
.
prot_l1
=
PMD_TYPE_TABLE
,
.
prot_sect
=
PMD_TYPE_SECT
|
PMD_SECT_AP_WRITE
,
.
domain
=
DOMAIN_KERNEL
,
...
...
@@ -257,21 +257,20 @@ static struct mem_type mem_types[] = {
},
[
MT_MEMORY_NONCACHED
]
=
{
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
|
L_PTE_
WRITE
|
L_PTE_
MT_BUFFERABLE
,
L_PTE_MT_BUFFERABLE
,
.
prot_l1
=
PMD_TYPE_TABLE
,
.
prot_sect
=
PMD_TYPE_SECT
|
PMD_SECT_AP_WRITE
,
.
domain
=
DOMAIN_KERNEL
,
},
[
MT_MEMORY_DTCM
]
=
{
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
|
L_PTE_
WRITE
|
L_PTE_
XN
,
L_PTE_XN
,
.
prot_l1
=
PMD_TYPE_TABLE
,
.
prot_sect
=
PMD_TYPE_SECT
|
PMD_SECT_XN
,
.
domain
=
DOMAIN_KERNEL
,
},
[
MT_MEMORY_ITCM
]
=
{
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
|
L_PTE_WRITE
,
.
prot_pte
=
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
,
.
prot_l1
=
PMD_TYPE_TABLE
,
.
domain
=
DOMAIN_KERNEL
,
},
...
...
@@ -478,7 +477,7 @@ static void __init build_mem_type_table(void)
pgprot_user
=
__pgprot
(
L_PTE_PRESENT
|
L_PTE_YOUNG
|
user_pgprot
);
pgprot_kernel
=
__pgprot
(
L_PTE_PRESENT
|
L_PTE_YOUNG
|
L_PTE_DIRTY
|
L_PTE_WRITE
|
kern_pgprot
);
L_PTE_DIRTY
|
kern_pgprot
);
mem_types
[
MT_LOW_VECTORS
].
prot_l1
|=
ecc_mask
;
mem_types
[
MT_HIGH_VECTORS
].
prot_l1
|=
ecc_mask
;
...
...
arch/arm/mm/proc-macros.S
浏览文件 @
36bb94ba
...
...
@@ -81,7 +81,7 @@
#if L_PTE_SHARED != PTE_EXT_SHARED
#error PTE shared bit mismatch
#endif
#if (L_PTE_XN+L_PTE_USER+L_PTE_
WRITE
+L_PTE_DIRTY+L_PTE_YOUNG+\
#if (L_PTE_XN+L_PTE_USER+L_PTE_
RDONLY
+L_PTE_DIRTY+L_PTE_YOUNG+\
L_PTE_FILE
+
L_PTE_PRESENT
)
>
L_PTE_SHARED
#error Invalid Linux PTE bit settings
#endif
...
...
@@ -132,9 +132,9 @@
and
r2
,
r1
,
#
L_PTE_MT_MASK
ldr
r2
,
[
ip
,
r2
]
tst
r1
,
#
L_PTE_WRITE
tst
ne
r1
,
#
L_PTE_DIRT
Y
orr
eq
r3
,
r3
,
#
PTE_EXT_APX
eor
r1
,
r1
,
#
L_PTE_DIRTY
tst
r1
,
#
L_PTE_DIRTY
|
L_PTE_RDONL
Y
orr
ne
r3
,
r3
,
#
PTE_EXT_APX
tst
r1
,
#
L_PTE_USER
orrne
r3
,
r3
,
#
PTE_EXT_AP1
...
...
@@ -172,7 +172,7 @@
.
macro
armv3_set_pte_ext
wc_disable
=
1
str
r1
,
[
r0
],
#
2048
@
linux
version
eor
r3
,
r1
,
#
L_PTE_PRESENT
| L_PTE_YOUNG |
L_PTE_
WRITE
|
L_PTE_
DIRTY
eor
r3
,
r1
,
#
L_PTE_PRESENT
| L_PTE_YOUNG |
L_PTE_DIRTY
bic
r2
,
r1
,
#
PTE_SMALL_AP_MASK
@
keep
C
,
B
bits
bic
r2
,
r2
,
#
PTE_TYPE_MASK
...
...
@@ -181,7 +181,7 @@
tst
r3
,
#
L_PTE_USER
@
user
?
orrne
r2
,
r2
,
#
PTE_SMALL_AP_URO_SRW
tst
r3
,
#
L_PTE_
WRITE
|
L_PTE_DIRTY
@
write
and
dirty
?
tst
r3
,
#
L_PTE_
RDONLY
|
L_PTE_DIRTY
@
write
and
dirty
?
orreq
r2
,
r2
,
#
PTE_SMALL_AP_UNO_SRW
tst
r3
,
#
L_PTE_PRESENT
|
L_PTE_YOUNG
@
present
and
young
?
...
...
@@ -215,7 +215,7 @@
.
macro
xscale_set_pte_ext_prologue
str
r1
,
[
r0
]
@
linux
version
eor
r3
,
r1
,
#
L_PTE_PRESENT
| L_PTE_YOUNG |
L_PTE_
WRITE
|
L_PTE_
DIRTY
eor
r3
,
r1
,
#
L_PTE_PRESENT
| L_PTE_YOUNG |
L_PTE_DIRTY
bic
r2
,
r1
,
#
PTE_SMALL_AP_MASK
@
keep
C
,
B
bits
orr
r2
,
r2
,
#
PTE_TYPE_EXT
@
extended
page
...
...
@@ -223,7 +223,7 @@
tst
r3
,
#
L_PTE_USER
@
user
?
orrne
r2
,
r2
,
#
PTE_EXT_AP_URO_SRW
@
yes
->
user
r
/
o
,
system
r
/
w
tst
r3
,
#
L_PTE_
WRITE
|
L_PTE_DIRTY
@
write
and
dirty
?
tst
r3
,
#
L_PTE_
RDONLY
|
L_PTE_DIRTY
@
write
and
dirty
?
orreq
r2
,
r2
,
#
PTE_EXT_AP_UNO_SRW
@
yes
->
user
n
/
a
,
system
r
/
w
@
combined
with
user
->
user
r
/
w
.
endm
...
...
arch/arm/mm/proc-v7.S
浏览文件 @
36bb94ba
...
...
@@ -140,9 +140,9 @@ ENTRY(cpu_v7_set_pte_ext)
tst
r1
,
#
1
<<
4
orrne
r3
,
r3
,
#
PTE_EXT_TEX
(
1
)
tst
r1
,
#
L_PTE_WRITE
tst
ne
r1
,
#
L_PTE_DIRTY
orr
eq
r3
,
r3
,
#
PTE_EXT_APX
eor
r1
,
r1
,
#
L_PTE_DIRTY
tst
r1
,
#
L_PTE_RDONLY
|
L_PTE_DIRTY
orr
ne
r3
,
r3
,
#
PTE_EXT_APX
tst
r1
,
#
L_PTE_USER
orrne
r3
,
r3
,
#
PTE_EXT_AP1
...
...
arch/arm/mm/proc-xscale.S
浏览文件 @
36bb94ba
...
...
@@ -500,8 +500,8 @@ ENTRY(cpu_xscale_set_pte_ext)
@
@
Erratum
40
:
must
set
memory
to
write
-
through
for
user
read
-
only
pages
@
and
ip
,
r1
,
#(
L_PTE_MT_MASK
| L_PTE_USER |
L_PTE_
WRITE
)
&
~
(
4
<<
2
)
teq
ip
,
#
L_PTE_MT_WRITEBACK
|
L_PTE_USER
and
ip
,
r1
,
#(
L_PTE_MT_MASK
| L_PTE_USER |
L_PTE_
RDONLY
)
&
~
(
4
<<
2
)
teq
ip
,
#
L_PTE_MT_WRITEBACK
| L_PTE_USER
|
L_PTE_RDONLY
moveq
r1
,
#
L_PTE_MT_WRITETHROUGH
and
r1
,
r1
,
#
L_PTE_MT_MASK
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录