summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorFuad Tabba <fuad.tabba@linux.dev>2026-09-01 15:03:26 +0100
committerMarc Zyngier <maz@kernel.org>2026-09-14 11:26:51 +0100
commit8bd0e6812a1be71d50620f00445940ded0df897c (patch)
tree45e18bae9870f4823070795ffbc106261a2a28d7 /tools/perf/scripts/python/stackcollapse.py
parentab31289483f54892dc6204a6ce2015420d0d5213 (diff)
KVM: arm64: Tag host-VA hypercall parameters __kern
The nVHE hypervisor takes host virtual addresses as hypercall arguments and translates each with kern_hyp_va() before use. Nothing marks them as host-owned, so dereferencing one untranslated at EL2 - a recurring bug class - is invisible to the compiler. Add a __kern sparse address space, active only for EL2 code, and tag the host-VA parameters in the hypercall declarations. kern_hyp_va_host() is the only sanctioned unwrap: it translates the address, preserves the pointee type (stripped of qualifiers, as with the percpu accessors) and drops the tag with a __force cast, so an untranslated host VA fails sparse. The tag flows from the shared declaration into the generated handler and on into the donated-memory and tracing-descriptor helpers, so a handler cannot extract a host VA without it. Host code sees plain pointers, and the tag is checker-only: no code is generated. container_of() casts through void * and drops the address space, so __get_host_hyp_vcpus() now takes an already translated vCPU and its callers unwrap. Translating a vgic_v3_cpu_if before taking its container is equivalent, since va_mask spans every bit in which two linear-map addresses differ. Reviewed-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Link: https://patch.msgid.link/20260901140326.3812068-12-fuad.tabba@linux.dev Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions