Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ae4bffb5
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ae4bffb5
编写于
7月 07, 2020
作者:
M
Marc Zyngier
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'kvm-arm64/ttl-for-arm64' into HEAD
Signed-off-by:
N
Marc Zyngier
<
maz@kernel.org
>
上级
f9a026e3
c10bc62a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
70 addition
and
1 deletion
+70
-1
arch/arm64/include/asm/cpucaps.h
arch/arm64/include/asm/cpucaps.h
+2
-1
arch/arm64/include/asm/pgtable-hwdef.h
arch/arm64/include/asm/pgtable-hwdef.h
+2
-0
arch/arm64/include/asm/stage2_pgtable.h
arch/arm64/include/asm/stage2_pgtable.h
+9
-0
arch/arm64/include/asm/sysreg.h
arch/arm64/include/asm/sysreg.h
+1
-0
arch/arm64/include/asm/tlbflush.h
arch/arm64/include/asm/tlbflush.h
+45
-0
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpufeature.c
+11
-0
未找到文件。
arch/arm64/include/asm/cpucaps.h
浏览文件 @
ae4bffb5
...
...
@@ -62,7 +62,8 @@
#define ARM64_HAS_GENERIC_AUTH 52
#define ARM64_HAS_32BIT_EL1 53
#define ARM64_BTI 54
#define ARM64_HAS_ARMv8_4_TTL 55
#define ARM64_NCAPS 5
5
#define ARM64_NCAPS 5
6
#endif
/* __ASM_CPUCAPS_H */
arch/arm64/include/asm/pgtable-hwdef.h
浏览文件 @
ae4bffb5
...
...
@@ -178,10 +178,12 @@
#define PTE_S2_RDONLY (_AT(pteval_t, 1) << 6)
/* HAP[2:1] */
#define PTE_S2_RDWR (_AT(pteval_t, 3) << 6)
/* HAP[2:1] */
#define PTE_S2_XN (_AT(pteval_t, 2) << 53)
/* XN[1:0] */
#define PTE_S2_SW_RESVD (_AT(pteval_t, 15) << 55)
/* Reserved for SW */
#define PMD_S2_RDONLY (_AT(pmdval_t, 1) << 6)
/* HAP[2:1] */
#define PMD_S2_RDWR (_AT(pmdval_t, 3) << 6)
/* HAP[2:1] */
#define PMD_S2_XN (_AT(pmdval_t, 2) << 53)
/* XN[1:0] */
#define PMD_S2_SW_RESVD (_AT(pmdval_t, 15) << 55)
/* Reserved for SW */
#define PUD_S2_RDONLY (_AT(pudval_t, 1) << 6)
/* HAP[2:1] */
#define PUD_S2_RDWR (_AT(pudval_t, 3) << 6)
/* HAP[2:1] */
...
...
arch/arm64/include/asm/stage2_pgtable.h
浏览文件 @
ae4bffb5
...
...
@@ -256,4 +256,13 @@ stage2_pgd_addr_end(struct kvm *kvm, phys_addr_t addr, phys_addr_t end)
return
(
boundary
-
1
<
end
-
1
)
?
boundary
:
end
;
}
/*
* Level values for the ARMv8.4-TTL extension, mapping PUD/PMD/PTE and
* the architectural page-table level.
*/
#define S2_NO_LEVEL_HINT 0
#define S2_PUD_LEVEL 1
#define S2_PMD_LEVEL 2
#define S2_PTE_LEVEL 3
#endif
/* __ARM64_S2_PGTABLE_H_ */
arch/arm64/include/asm/sysreg.h
浏览文件 @
ae4bffb5
...
...
@@ -746,6 +746,7 @@
/* id_aa64mmfr2 */
#define ID_AA64MMFR2_E0PD_SHIFT 60
#define ID_AA64MMFR2_TTL_SHIFT 48
#define ID_AA64MMFR2_FWB_SHIFT 40
#define ID_AA64MMFR2_AT_SHIFT 32
#define ID_AA64MMFR2_LVA_SHIFT 16
...
...
arch/arm64/include/asm/tlbflush.h
浏览文件 @
ae4bffb5
...
...
@@ -10,6 +10,7 @@
#ifndef __ASSEMBLY__
#include <linux/bitfield.h>
#include <linux/mm_types.h>
#include <linux/sched.h>
#include <asm/cputype.h>
...
...
@@ -59,6 +60,50 @@
__ta; \
})
/*
* Level-based TLBI operations.
*
* When ARMv8.4-TTL exists, TLBI operations take an additional hint for
* the level at which the invalidation must take place. If the level is
* wrong, no invalidation may take place. In the case where the level
* cannot be easily determined, a 0 value for the level parameter will
* perform a non-hinted invalidation.
*
* For Stage-2 invalidation, use the level values provided to that effect
* in asm/stage2_pgtable.h.
*/
#define TLBI_TTL_MASK GENMASK_ULL(47, 44)
#define TLBI_TTL_TG_4K 1
#define TLBI_TTL_TG_16K 2
#define TLBI_TTL_TG_64K 3
#define __tlbi_level(op, addr, level) \
do { \
u64 arg = addr; \
\
if (cpus_have_const_cap(ARM64_HAS_ARMv8_4_TTL) && \
level) { \
u64 ttl = level & 3; \
\
switch (PAGE_SIZE) { \
case SZ_4K: \
ttl |= TLBI_TTL_TG_4K << 2; \
break; \
case SZ_16K: \
ttl |= TLBI_TTL_TG_16K << 2; \
break; \
case SZ_64K: \
ttl |= TLBI_TTL_TG_64K << 2; \
break; \
} \
\
arg &= ~TLBI_TTL_MASK; \
arg |= FIELD_PREP(TLBI_TTL_MASK, ttl); \
} \
\
__tlbi(op, arg); \
} while(0)
/*
* TLB Invalidation
* ================
...
...
arch/arm64/kernel/cpufeature.c
浏览文件 @
ae4bffb5
...
...
@@ -323,6 +323,7 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr1[] = {
static
const
struct
arm64_ftr_bits
ftr_id_aa64mmfr2
[]
=
{
ARM64_FTR_BITS
(
FTR_HIDDEN
,
FTR_NONSTRICT
,
FTR_LOWER_SAFE
,
ID_AA64MMFR2_E0PD_SHIFT
,
4
,
0
),
ARM64_FTR_BITS
(
FTR_HIDDEN
,
FTR_STRICT
,
FTR_LOWER_SAFE
,
ID_AA64MMFR2_TTL_SHIFT
,
4
,
0
),
ARM64_FTR_BITS
(
FTR_HIDDEN
,
FTR_STRICT
,
FTR_LOWER_SAFE
,
ID_AA64MMFR2_FWB_SHIFT
,
4
,
0
),
ARM64_FTR_BITS
(
FTR_VISIBLE
,
FTR_STRICT
,
FTR_LOWER_SAFE
,
ID_AA64MMFR2_AT_SHIFT
,
4
,
0
),
ARM64_FTR_BITS
(
FTR_HIDDEN
,
FTR_STRICT
,
FTR_LOWER_SAFE
,
ID_AA64MMFR2_LVA_SHIFT
,
4
,
0
),
...
...
@@ -1882,6 +1883,16 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
.
matches
=
has_cpuid_feature
,
.
cpu_enable
=
cpu_has_fwb
,
},
{
.
desc
=
"ARMv8.4 Translation Table Level"
,
.
type
=
ARM64_CPUCAP_SYSTEM_FEATURE
,
.
capability
=
ARM64_HAS_ARMv8_4_TTL
,
.
sys_reg
=
SYS_ID_AA64MMFR2_EL1
,
.
sign
=
FTR_UNSIGNED
,
.
field_pos
=
ID_AA64MMFR2_TTL_SHIFT
,
.
min_field_value
=
1
,
.
matches
=
has_cpuid_feature
,
},
#ifdef CONFIG_ARM64_HW_AFDBM
{
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录