Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
6236af82
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看板
提交
6236af82
编写于
7月 08, 2008
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'x86/fixmap' into x86/devel
Conflicts: arch/x86/mm/init_64.c Signed-off-by:
N
Ingo Molnar
<
mingo@elte.hu
>
上级
e3ae0acf
8b7ef4ec
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
130 addition
and
112 deletion
+130
-112
arch/x86/kernel/paravirt.c
arch/x86/kernel/paravirt.c
+2
-0
arch/x86/mm/init_64.c
arch/x86/mm/init_64.c
+4
-17
arch/x86/mm/pgtable.c
arch/x86/mm/pgtable.c
+20
-0
arch/x86/mm/pgtable_32.c
arch/x86/mm/pgtable_32.c
+4
-16
arch/x86/xen/enlighten.c
arch/x86/xen/enlighten.c
+29
-0
include/asm-x86/fixmap.h
include/asm-x86/fixmap.h
+55
-0
include/asm-x86/fixmap_32.h
include/asm-x86/fixmap_32.h
+0
-42
include/asm-x86/fixmap_64.h
include/asm-x86/fixmap_64.h
+0
-37
include/asm-x86/paravirt.h
include/asm-x86/paravirt.h
+13
-0
include/asm-x86/pgtable.h
include/asm-x86/pgtable.h
+3
-0
未找到文件。
arch/x86/kernel/paravirt.c
浏览文件 @
6236af82
...
...
@@ -420,6 +420,8 @@ struct pv_mmu_ops pv_mmu_ops = {
.
enter
=
paravirt_nop
,
.
leave
=
paravirt_nop
,
},
.
set_fixmap
=
native_set_fixmap
,
};
EXPORT_SYMBOL_GPL
(
pv_time_ops
);
...
...
arch/x86/mm/init_64.c
浏览文件 @
6236af82
...
...
@@ -148,15 +148,15 @@ static __init void *spp_getpage(void)
return
ptr
;
}
static
__init
void
set_pte_
phys
(
unsigned
long
vaddr
,
unsigned
long
phys
,
pgprot_t
prot
)
void
set_pte_
vaddr
(
unsigned
long
vaddr
,
pte_t
new_pte
)
{
pgd_t
*
pgd
;
pud_t
*
pud
;
pmd_t
*
pmd
;
pte_t
*
pte
,
new_pte
;
pte_t
*
pte
;
pr_debug
(
"set_pte_
phys %lx to %lx
\n
"
,
vaddr
,
phys
);
pr_debug
(
"set_pte_
vaddr %lx to %lx
\n
"
,
vaddr
,
native_pte_val
(
new_pte
)
);
pgd
=
pgd_offset_k
(
vaddr
);
if
(
pgd_none
(
*
pgd
))
{
...
...
@@ -183,7 +183,6 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot)
return
;
}
}
new_pte
=
pfn_pte
(
phys
>>
PAGE_SHIFT
,
prot
);
pte
=
pte_offset_kernel
(
pmd
,
vaddr
);
if
(
!
pte_none
(
*
pte
)
&&
pte_val
(
new_pte
)
&&
...
...
@@ -226,18 +225,6 @@ void __init cleanup_highmap(void)
}
}
/* NOTE: this is meant to be run only at boot */
void
__init
__set_fixmap
(
enum
fixed_addresses
idx
,
unsigned
long
phys
,
pgprot_t
prot
)
{
unsigned
long
address
=
__fix_to_virt
(
idx
);
if
(
idx
>=
__end_of_fixed_addresses
)
{
printk
(
KERN_ERR
"Invalid __set_fixmap
\n
"
);
return
;
}
set_pte_phys
(
address
,
phys
,
prot
);
}
static
unsigned
long
__initdata
table_start
;
static
unsigned
long
__meminitdata
table_end
;
...
...
arch/x86/mm/pgtable.c
浏览文件 @
6236af82
...
...
@@ -2,6 +2,7 @@
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/tlb.h>
#include <asm/fixmap.h>
pte_t
*
pte_alloc_one_kernel
(
struct
mm_struct
*
mm
,
unsigned
long
address
)
{
...
...
@@ -274,3 +275,22 @@ int ptep_clear_flush_young(struct vm_area_struct *vma,
return
young
;
}
int
fixmaps_set
;
void
__native_set_fixmap
(
enum
fixed_addresses
idx
,
pte_t
pte
)
{
unsigned
long
address
=
__fix_to_virt
(
idx
);
if
(
idx
>=
__end_of_fixed_addresses
)
{
BUG
();
return
;
}
set_pte_vaddr
(
address
,
pte
);
fixmaps_set
++
;
}
void
native_set_fixmap
(
enum
fixed_addresses
idx
,
unsigned
long
phys
,
pgprot_t
flags
)
{
__native_set_fixmap
(
idx
,
pfn_pte
(
phys
>>
PAGE_SHIFT
,
flags
));
}
arch/x86/mm/pgtable_32.c
浏览文件 @
6236af82
...
...
@@ -71,7 +71,7 @@ void show_mem(void)
* Associate a virtual page frame with a given physical page frame
* and protection flags for that frame.
*/
static
void
set_pte_pfn
(
unsigned
long
vaddr
,
unsigned
long
pfn
,
pgprot_t
flags
)
void
set_pte_vaddr
(
unsigned
long
vaddr
,
pte_t
pteval
)
{
pgd_t
*
pgd
;
pud_t
*
pud
;
...
...
@@ -94,8 +94,8 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags)
return
;
}
pte
=
pte_offset_kernel
(
pmd
,
vaddr
);
if
(
p
gprot_val
(
flags
))
set_pte_present
(
&
init_mm
,
vaddr
,
pte
,
p
fn_pte
(
pfn
,
flags
)
);
if
(
p
te_val
(
pteval
))
set_pte_present
(
&
init_mm
,
vaddr
,
pte
,
p
teval
);
else
pte_clear
(
&
init_mm
,
vaddr
,
pte
);
...
...
@@ -145,18 +145,6 @@ static int fixmaps;
unsigned
long
__FIXADDR_TOP
=
0xfffff000
;
EXPORT_SYMBOL
(
__FIXADDR_TOP
);
void
__set_fixmap
(
enum
fixed_addresses
idx
,
unsigned
long
phys
,
pgprot_t
flags
)
{
unsigned
long
address
=
__fix_to_virt
(
idx
);
if
(
idx
>=
__end_of_fixed_addresses
)
{
BUG
();
return
;
}
set_pte_pfn
(
address
,
phys
>>
PAGE_SHIFT
,
flags
);
fixmaps
++
;
}
/**
* reserve_top_address - reserves a hole in the top of kernel address space
* @reserve - size of hole to reserve
...
...
@@ -166,7 +154,7 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
*/
void
reserve_top_address
(
unsigned
long
reserve
)
{
BUG_ON
(
fixmaps
>
0
);
BUG_ON
(
fixmaps
_set
>
0
);
printk
(
KERN_INFO
"Reserving virtual address space above 0x%08x
\n
"
,
(
int
)
-
reserve
);
__FIXADDR_TOP
=
-
reserve
-
PAGE_SIZE
;
...
...
arch/x86/xen/enlighten.c
浏览文件 @
6236af82
...
...
@@ -1013,6 +1013,33 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf,
return
ret
;
}
static
void
xen_set_fixmap
(
unsigned
idx
,
unsigned
long
phys
,
pgprot_t
prot
)
{
pte_t
pte
;
phys
>>=
PAGE_SHIFT
;
switch
(
idx
)
{
case
FIX_BTMAP_END
...
FIX_BTMAP_BEGIN
:
#ifdef CONFIG_X86_F00F_BUG
case
FIX_F00F_IDT
:
#endif
case
FIX_WP_TEST
:
case
FIX_VDSO
:
#ifdef CONFIG_X86_LOCAL_APIC
case
FIX_APIC_BASE
:
/* maps dummy local APIC */
#endif
pte
=
pfn_pte
(
phys
,
prot
);
break
;
default:
pte
=
mfn_pte
(
phys
,
prot
);
break
;
}
__native_set_fixmap
(
idx
,
pte
);
}
static
const
struct
pv_info
xen_info
__initdata
=
{
.
paravirt_enabled
=
1
,
.
shared_kernel_pmd
=
0
,
...
...
@@ -1167,6 +1194,8 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
.
enter
=
paravirt_enter_lazy_mmu
,
.
leave
=
xen_leave_lazy
,
},
.
set_fixmap
=
xen_set_fixmap
,
};
#ifdef CONFIG_SMP
...
...
include/asm-x86/fixmap.h
浏览文件 @
6236af82
...
...
@@ -7,7 +7,62 @@
# include "fixmap_64.h"
#endif
extern
int
fixmaps_set
;
void
__native_set_fixmap
(
enum
fixed_addresses
idx
,
pte_t
pte
);
void
native_set_fixmap
(
enum
fixed_addresses
idx
,
unsigned
long
phys
,
pgprot_t
flags
);
#ifndef CONFIG_PARAVIRT
static
inline
void
__set_fixmap
(
enum
fixed_addresses
idx
,
unsigned
long
phys
,
pgprot_t
flags
)
{
native_set_fixmap
(
idx
,
phys
,
flags
);
}
#endif
#define set_fixmap(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL)
/*
* Some hardware wants to get fixmapped without caching.
*/
#define set_fixmap_nocache(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
#define clear_fixmap(idx) \
__set_fixmap(idx, 0, __pgprot(0))
#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
extern
void
__this_fixmap_does_not_exist
(
void
);
/*
* 'index to address' translation. If anyone tries to use the idx
* directly without translation, we catch the bug with a NULL-deference
* kernel oops. Illegal ranges of incoming indices are caught too.
*/
static
__always_inline
unsigned
long
fix_to_virt
(
const
unsigned
int
idx
)
{
/*
* this branch gets completely eliminated after inlining,
* except when someone tries to use fixaddr indices in an
* illegal way. (such as mixing up address types or using
* out-of-range indices).
*
* If it doesn't get removed, the linker will complain
* loudly with a reasonably clear error message..
*/
if
(
idx
>=
__end_of_fixed_addresses
)
__this_fixmap_does_not_exist
();
return
__fix_to_virt
(
idx
);
}
static
inline
unsigned
long
virt_to_fix
(
const
unsigned
long
vaddr
)
{
BUG_ON
(
vaddr
>=
FIXADDR_TOP
||
vaddr
<
FIXADDR_START
);
return
__virt_to_fix
(
vaddr
);
}
#endif
include/asm-x86/fixmap_32.h
浏览文件 @
6236af82
...
...
@@ -109,17 +109,8 @@ enum fixed_addresses {
__end_of_fixed_addresses
};
extern
void
__set_fixmap
(
enum
fixed_addresses
idx
,
unsigned
long
phys
,
pgprot_t
flags
);
extern
void
reserve_top_address
(
unsigned
long
reserve
);
#define set_fixmap(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL)
/*
* Some hardware wants to get fixmapped without caching.
*/
#define set_fixmap_nocache(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
...
...
@@ -128,38 +119,5 @@ extern void reserve_top_address(unsigned long reserve);
#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
#define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE)
#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
extern
void
__this_fixmap_does_not_exist
(
void
);
/*
* 'index to address' translation. If anyone tries to use the idx
* directly without tranlation, we catch the bug with a NULL-deference
* kernel oops. Illegal ranges of incoming indices are caught too.
*/
static
__always_inline
unsigned
long
fix_to_virt
(
const
unsigned
int
idx
)
{
/*
* this branch gets completely eliminated after inlining,
* except when someone tries to use fixaddr indices in an
* illegal way. (such as mixing up address types or using
* out-of-range indices).
*
* If it doesn't get removed, the linker will complain
* loudly with a reasonably clear error message..
*/
if
(
idx
>=
__end_of_fixed_addresses
)
__this_fixmap_does_not_exist
();
return
__fix_to_virt
(
idx
);
}
static
inline
unsigned
long
virt_to_fix
(
const
unsigned
long
vaddr
)
{
BUG_ON
(
vaddr
>=
FIXADDR_TOP
||
vaddr
<
FIXADDR_START
);
return
__virt_to_fix
(
vaddr
);
}
#endif
/* !__ASSEMBLY__ */
#endif
include/asm-x86/fixmap_64.h
浏览文件 @
6236af82
...
...
@@ -52,17 +52,6 @@ enum fixed_addresses {
__end_of_fixed_addresses
};
extern
void
__set_fixmap
(
enum
fixed_addresses
idx
,
unsigned
long
phys
,
pgprot_t
flags
);
#define set_fixmap(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL)
/*
* Some hardware wants to get fixmapped without caching.
*/
#define set_fixmap_nocache(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
...
...
@@ -71,30 +60,4 @@ extern void __set_fixmap(enum fixed_addresses idx,
#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
extern
void
__this_fixmap_does_not_exist
(
void
);
/*
* 'index to address' translation. If anyone tries to use the idx
* directly without translation, we catch the bug with a NULL-deference
* kernel oops. Illegal ranges of incoming indices are caught too.
*/
static
__always_inline
unsigned
long
fix_to_virt
(
const
unsigned
int
idx
)
{
/*
* this branch gets completely eliminated after inlining,
* except when someone tries to use fixaddr indices in an
* illegal way. (such as mixing up address types or using
* out-of-range indices).
*
* If it doesn't get removed, the linker will complain
* loudly with a reasonably clear error message..
*/
if
(
idx
>=
__end_of_fixed_addresses
)
__this_fixmap_does_not_exist
();
return
__fix_to_virt
(
idx
);
}
#endif
include/asm-x86/paravirt.h
浏览文件 @
6236af82
...
...
@@ -279,6 +279,13 @@ struct pv_mmu_ops {
#endif
struct
pv_lazy_ops
lazy_mode
;
/* dom0 ops */
/* Sometimes the physical address is a pfn, and sometimes its
an mfn. We can tell which is which from the index. */
void
(
*
set_fixmap
)(
unsigned
/* enum fixed_addresses */
idx
,
unsigned
long
phys
,
pgprot_t
flags
);
};
/* This contains all the paravirt structures: we get a convenient
...
...
@@ -1295,6 +1302,12 @@ static inline void arch_flush_lazy_mmu_mode(void)
}
}
static
inline
void
__set_fixmap
(
unsigned
/* enum fixed_addresses */
idx
,
unsigned
long
phys
,
pgprot_t
flags
)
{
pv_mmu_ops
.
set_fixmap
(
idx
,
phys
,
flags
);
}
void
_paravirt_nop
(
void
);
#define paravirt_nop ((void *)_paravirt_nop)
...
...
include/asm-x86/pgtable.h
浏览文件 @
6236af82
...
...
@@ -313,6 +313,9 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
unsigned
long
size
,
pgprot_t
*
vma_prot
);
#endif
/* Install a pte for a particular vaddr in kernel space. */
void
set_pte_vaddr
(
unsigned
long
vaddr
,
pte_t
pte
);
#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
#else
/* !CONFIG_PARAVIRT */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录