Re: [PATCH v3 2/6] arm64: KVM: Move SPE and trace registers to the sysreg array

James Clark
2023-12-04T16:17:50Z

On 04/12/2023 09:29, Marc Zyngier wrote:
> On Thu, 19 Oct 2023 17:55:00 +0100,
> James Clark <james.clark@arm.com> wrote:
>>
>> pmscr_el1 and trfcr_el1 are currently special cased in the
>> host_debug_state struct, but they're just registers after all so give
>> them entries in the sysreg array and refer to them through the host
>> context.
>>
>> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> Signed-off-by: James Clark <james.clark@arm.com>
>> ---
>> arch/arm64/include/asm/kvm_host.h | 6 ++--
>> arch/arm64/include/asm/kvm_hyp.h | 4 +--
>> arch/arm64/kvm/hyp/nvhe/debug-sr.c | 44 +++++++++++++++---------------
>> arch/arm64/kvm/hyp/nvhe/switch.c | 4 +--
>> 4 files changed, 28 insertions(+), 30 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
>> index 4a966c0d7373..7c82927ddaf2 100644
>> --- a/arch/arm64/include/asm/kvm_host.h
>> +++ b/arch/arm64/include/asm/kvm_host.h
>> @@ -437,6 +437,8 @@ enum vcpu_sysreg {
>> CNTHP_CVAL_EL2,
>> CNTHV_CTL_EL2,
>> CNTHV_CVAL_EL2,
>> + PMSCR_EL1, /* Statistical profiling extension */
>> + TRFCR_EL1, /* Self-hosted trace filters */
>
> Why this move? Are you also adding guest support for SPE?
>
> Until you do, I don't see the need to pollute the guest's sysreg
> namespace.
>
> M.
>

Ah ok yes, I think I misunderstood your previous review comment. You're
right I don't touch SPE and it's only ever for the host so I can leave
it where it was in struct host_debug_state.

James