diff options
| author | Wei-Lin Chang <weilin.chang@arm.com> | 2026-09-15 16:43:01 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-09-20 08:20:21 +0100 |
| commit | c2778d14cd2ff757224715221a2ddff89fc6f127 (patch) | |
| tree | b41cbf3ba6c0206ee7a0ee48b6a8e7c52a46c245 /tools/perf/scripts/python/stackcollapse.py | |
| parent | a6ca6cba59598de94eda90e4b3a4e405621aca90 (diff) | |
KVM: arm64: nv: Track guest stage-2 mapping creation
During shadow stage-2 faults, in addition to creating mappings in the
shadow page tables, also allocate kvm_guest_s2_mapping objects, record
the mapping ranges, and insert them into the canonical and nested mmu's
guest_s2_mappings tree.
Note that because we allow parallel faulting, the interval trees could
store mappings that are not live in the shadow page tables. Storing a
superset of the live mappings is fine because we will only over-unmap
when we use this information later to do the targeted MMU notifier
unmap.
The mapping is also added to the interval trees if
kvm_pgtable_stage2_map() returns -EAGAIN. This is required for example,
when a 2M block map (A) races with a 4K page map (B):
1. (A) maps the 2M block in kvm_pgtable_visitor_cb()
2. (B) breaks that block into a table and maps 4K
3. (A) reloads and finds the table after kvm_pgtable_visitor_cb(),
then descends into it.
4. (A) maps some 4K, but before it finishes it reads the entry mapped by
(B).
5. (A) returns -EAGAIN although it had mapped a few pages.
In this case, we don't know what subrange is mapped, just track the
whole requested mapping range.
Signed-off-by: Wei-Lin Chang <weilin.chang@arm.com>
Reviewed-by: Oliver Upton <oupton@kernel.org>
Tested-by: Shuai Xue <xueshuai@linux.alibaba.com>
Tested-by: Itaru Kitayama <itaru.kitayama@fujitsu.com>
Link: https://patch.msgid.link/20260915154305.3852871-4-weilin.chang@arm.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
