Re: [PATCH v20 03/14] KVM: arm64: Manage GCS access and registers for guests
From: Leonardo Bras
Date: Wed Sep 02 2026 - 13:33:45 EST
Hi Mark,
On Tue, Sep 01, 2026 at 10:47:01PM +0100, Mark Brown wrote:
> GCS introduces a number of system registers, on systems with GCS we need
> to context switch them and expose them to VMMs to allow guests to use
> GCS.
>
> In order to allow guests to use GCS we also need to configure
> HCRX_EL2.GCSEn, if this is not set GCS instructions will be noops and
> CHKFEAT will report GCS as disabled.
>
Everything you do seems the correct approach, and all the loads/saves
are symmetrical, except for VEL2, for which the reason was made known
in v19 discussion.
That being said, I may have missed something as I am still not very much
used to NV code. So, FWIW:
Reviewed-by: Leonardo Bras <leo.bras@xxxxxxx>
Nit:
Reading this patch, it feels like it should have been two different
patches: one for adding the registers to kvm infra, and the other for
loading/saving it in the code (with GCSEn). If you later decide to split
it, feel free to add my R-b in both of them.
Thanks!
Leo