arm64: KVM: Write TRFCR value on guest switch with nVHE
The guest value for TRFCR requested by the Coresight driver is saved in
kvm_host_global_state. On guest switch this value needs to be written to
the register. Currently TRFCR is only modified when we want to disable
trace completely in guests due to an issue with TRBE. Expand the
__debug_save_trace() function to always write to the register if a
different value for guests is required, but also keep the existing TRBE
disable behavior if that's required.
The TRFCR restore function remains functionally the same, except a value
of 0 doesn't mean "don't restore" anymore. Now that we save both guest
and host values the register is restored any time the guest and host
values differ.
Signed-off-by:
James Clark <james.clark@arm.com>
Loading
Please register or sign in to comment