Commit a4d5ca5c authored by Yanan Wang's avatar Yanan Wang Committed by Marc Zyngier

KVM: arm64: Introduce mm_ops member for structure stage2_attr_data

Also add a mm_ops member for structure stage2_attr_data, since we
will move I-cache maintenance for guest stage-2 to the permission
path and as a result will need mm_ops for some callbacks.
Reviewed-by: default avatarFuad Tabba <tabba@google.com>
Signed-off-by: default avatarYanan Wang <wangyanan55@huawei.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210617105824.31752-3-wangyanan55@huawei.com
parent 6204004d
...@@ -861,10 +861,11 @@ int kvm_pgtable_stage2_unmap(struct kvm_pgtable *pgt, u64 addr, u64 size) ...@@ -861,10 +861,11 @@ int kvm_pgtable_stage2_unmap(struct kvm_pgtable *pgt, u64 addr, u64 size)
} }
struct stage2_attr_data { struct stage2_attr_data {
kvm_pte_t attr_set; kvm_pte_t attr_set;
kvm_pte_t attr_clr; kvm_pte_t attr_clr;
kvm_pte_t pte; kvm_pte_t pte;
u32 level; u32 level;
struct kvm_pgtable_mm_ops *mm_ops;
}; };
static int stage2_attr_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep, static int stage2_attr_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep,
...@@ -903,6 +904,7 @@ static int stage2_update_leaf_attrs(struct kvm_pgtable *pgt, u64 addr, ...@@ -903,6 +904,7 @@ static int stage2_update_leaf_attrs(struct kvm_pgtable *pgt, u64 addr,
struct stage2_attr_data data = { struct stage2_attr_data data = {
.attr_set = attr_set & attr_mask, .attr_set = attr_set & attr_mask,
.attr_clr = attr_clr & attr_mask, .attr_clr = attr_clr & attr_mask,
.mm_ops = pgt->mm_ops,
}; };
struct kvm_pgtable_walker walker = { struct kvm_pgtable_walker walker = {
.cb = stage2_attr_walker, .cb = stage2_attr_walker,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment