coresight: Allow guests to be traced when FEAT_TRF and VHE are present
Currently the userspace and kernel filters for guests are never set, so
no trace will be generated for them. Add it by writing to the guest
filters when exclude_guest isn't set. By writing either E1TRE or E0TRE,
filtering on either guest kernel or guest userspace is also supported.
Since TRFCR_EL1 access is trapped, this can't be modified by the guest.
This change also brings exclude_host support which is difficult to add
as a separate commit without excess churn and resulting in no trace at
all.
Testing
=======
The addresses were counted with the following:
$ perf report -D | grep -Eo 'EL2|EL1|EL0' | sort | uniq -c
Guest kernel only:
$ perf record -e cs_etm//Gk -a -- true
535 EL1
1 EL2
Guest user only (0 addresses expected because the guest OS hasn't reached
userspace yet):
$ perf record -e cs_etm//Gu -a -- true
Host kernel only:
$ perf record -e cs_etm//Hk -a -- true
3501 EL2
Host userspace only:
$ perf record -e cs_etm//Hu -a -- true
408 EL0
1 EL2
Signed-off-by:
James Clark <james.clark@arm.com>
Loading
Please register or sign in to comment