Set DBGCLAIM when self-host debug is enabled

From: tingwei
Date: Wed Jan 06 2021 - 05:31:00 EST


Hi Will and Mark,

In recent implementation of save/restore ARM debug registers in EL2/EL3, we found
it's necessary to know whether self-host debug is enabled so EL2/EL3 can avoid
saving/restoring debug registers but no one is using debug.

In ARM PSCI, it has one option to set DBGCLAIM[1] to 1 to indicate that debug is
in use by a self-host debugger. Do you think it's resonable to add this to Kernel?

For example, can we set DBGCLAIM[1] to 1 in enable_debug_monitors() and clear it
in disable_debug_monitors().

Thanks,
Tingwei

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project