Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
4e5dc64c
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看板
提交
4e5dc64c
编写于
10月 02, 2020
作者:
M
Marc Zyngier
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'kvm-arm64/pt-new' and 'kvm-arm64/pmu-5.9' into kvmarm-master/next
Signed-off-by:
N
Marc Zyngier
<
maz@kernel.org
>
上级
14ef9d04
ffd1b63a
030bdf36
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
21 deletion
+30
-21
Documentation/virt/kvm/devices/vcpu.rst
Documentation/virt/kvm/devices/vcpu.rst
+13
-13
arch/arm64/kvm/hyp/pgtable.c
arch/arm64/kvm/hyp/pgtable.c
+16
-7
arch/arm64/kvm/mmu.c
arch/arm64/kvm/mmu.c
+1
-1
未找到文件。
Documentation/virt/kvm/devices/vcpu.rst
浏览文件 @
4e5dc64c
...
...
@@ -67,25 +67,25 @@ irqchip.
:Returns:
======= ======================================================
-ENODEV
:
PMUv3 not supported or GIC not initialized
-ENXIO
:
PMUv3 not properly configured or in-kernel irqchip not
-ENODEV
PMUv3 not supported or GIC not initialized
-ENXIO
PMUv3 not properly configured or in-kernel irqchip not
configured as required prior to calling this attribute
-EBUSY
:
PMUv3 already initialized
-EINVAL
:
Invalid filter range
-EBUSY
PMUv3 already initialized
-EINVAL
Invalid filter range
======= ======================================================
Request the installation of a PMU event filter described as follows:
Request the installation of a PMU event filter described as follows:
:
struct kvm_pmu_event_filter {
__u16 base_event;
__u16 nevents;
struct kvm_pmu_event_filter {
__u16 base_event;
__u16 nevents;
#define KVM_PMU_EVENT_ALLOW 0
#define KVM_PMU_EVENT_DENY 1
#define KVM_PMU_EVENT_ALLOW 0
#define KVM_PMU_EVENT_DENY 1
__u8 action;
__u8 pad[3];
};
__u8 action;
__u8 pad[3];
};
A filter range is defined as the range [@base_event, @base_event + @nevents),
together with an @action (KVM_PMU_EVENT_ALLOW or KVM_PMU_EVENT_DENY). The
...
...
arch/arm64/kvm/hyp/pgtable.c
浏览文件 @
4e5dc64c
...
...
@@ -694,6 +694,7 @@ struct stage2_attr_data {
kvm_pte_t
attr_set
;
kvm_pte_t
attr_clr
;
kvm_pte_t
pte
;
u32
level
;
};
static
int
stage2_attr_walker
(
u64
addr
,
u64
end
,
u32
level
,
kvm_pte_t
*
ptep
,
...
...
@@ -706,6 +707,7 @@ static int stage2_attr_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep,
if
(
!
kvm_pte_valid
(
pte
))
return
0
;
data
->
level
=
level
;
data
->
pte
=
pte
;
pte
&=
~
data
->
attr_clr
;
pte
|=
data
->
attr_set
;
...
...
@@ -723,7 +725,8 @@ static int stage2_attr_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep,
static
int
stage2_update_leaf_attrs
(
struct
kvm_pgtable
*
pgt
,
u64
addr
,
u64
size
,
kvm_pte_t
attr_set
,
kvm_pte_t
attr_clr
,
kvm_pte_t
*
orig_pte
)
kvm_pte_t
attr_clr
,
kvm_pte_t
*
orig_pte
,
u32
*
level
)
{
int
ret
;
kvm_pte_t
attr_mask
=
KVM_PTE_LEAF_ATTR_LO
|
KVM_PTE_LEAF_ATTR_HI
;
...
...
@@ -743,20 +746,24 @@ static int stage2_update_leaf_attrs(struct kvm_pgtable *pgt, u64 addr,
if
(
orig_pte
)
*
orig_pte
=
data
.
pte
;
if
(
level
)
*
level
=
data
.
level
;
return
0
;
}
int
kvm_pgtable_stage2_wrprotect
(
struct
kvm_pgtable
*
pgt
,
u64
addr
,
u64
size
)
{
return
stage2_update_leaf_attrs
(
pgt
,
addr
,
size
,
0
,
KVM_PTE_LEAF_ATTR_LO_S2_S2AP_W
,
NULL
);
KVM_PTE_LEAF_ATTR_LO_S2_S2AP_W
,
NULL
,
NULL
);
}
kvm_pte_t
kvm_pgtable_stage2_mkyoung
(
struct
kvm_pgtable
*
pgt
,
u64
addr
)
{
kvm_pte_t
pte
=
0
;
stage2_update_leaf_attrs
(
pgt
,
addr
,
1
,
KVM_PTE_LEAF_ATTR_LO_S2_AF
,
0
,
&
pte
);
&
pte
,
NULL
);
dsb
(
ishst
);
return
pte
;
}
...
...
@@ -765,7 +772,7 @@ kvm_pte_t kvm_pgtable_stage2_mkold(struct kvm_pgtable *pgt, u64 addr)
{
kvm_pte_t
pte
=
0
;
stage2_update_leaf_attrs
(
pgt
,
addr
,
1
,
0
,
KVM_PTE_LEAF_ATTR_LO_S2_AF
,
&
pte
);
&
pte
,
NULL
);
/*
* "But where's the TLBI?!", you scream.
* "Over in the core code", I sigh.
...
...
@@ -778,7 +785,7 @@ kvm_pte_t kvm_pgtable_stage2_mkold(struct kvm_pgtable *pgt, u64 addr)
bool
kvm_pgtable_stage2_is_young
(
struct
kvm_pgtable
*
pgt
,
u64
addr
)
{
kvm_pte_t
pte
=
0
;
stage2_update_leaf_attrs
(
pgt
,
addr
,
1
,
0
,
0
,
&
pte
);
stage2_update_leaf_attrs
(
pgt
,
addr
,
1
,
0
,
0
,
&
pte
,
NULL
);
return
pte
&
KVM_PTE_LEAF_ATTR_LO_S2_AF
;
}
...
...
@@ -786,6 +793,7 @@ int kvm_pgtable_stage2_relax_perms(struct kvm_pgtable *pgt, u64 addr,
enum
kvm_pgtable_prot
prot
)
{
int
ret
;
u32
level
;
kvm_pte_t
set
=
0
,
clr
=
0
;
if
(
prot
&
KVM_PGTABLE_PROT_R
)
...
...
@@ -797,8 +805,9 @@ int kvm_pgtable_stage2_relax_perms(struct kvm_pgtable *pgt, u64 addr,
if
(
prot
&
KVM_PGTABLE_PROT_X
)
clr
|=
KVM_PTE_LEAF_ATTR_HI_S2_XN
;
ret
=
stage2_update_leaf_attrs
(
pgt
,
addr
,
1
,
set
,
clr
,
NULL
);
kvm_call_hyp
(
__kvm_tlb_flush_vmid_ipa
,
pgt
->
mmu
,
addr
,
0
);
ret
=
stage2_update_leaf_attrs
(
pgt
,
addr
,
1
,
set
,
clr
,
NULL
,
&
level
);
if
(
!
ret
)
kvm_call_hyp
(
__kvm_tlb_flush_vmid_ipa
,
pgt
->
mmu
,
addr
,
level
);
return
ret
;
}
...
...
arch/arm64/kvm/mmu.c
浏览文件 @
4e5dc64c
...
...
@@ -742,7 +742,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
struct
kvm_memory_slot
*
memslot
,
unsigned
long
hva
,
unsigned
long
fault_status
)
{
int
ret
;
int
ret
=
0
;
bool
write_fault
,
writable
,
force_pte
=
false
;
bool
exec_fault
;
bool
device
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录