Re: [PATCH v2 05/12] KVM: arm64: Handle HAFGRTR_EL2 trapping in nested virt

Mark Brown
2023-12-08T13:52:07Z

[-- Attachment #1.1: Type: text/plain, Size: 959 bytes --]

On Fri, Dec 08, 2023 at 08:19:43AM +0000, Fuad Tabba wrote:
> On Thu, Dec 7, 2023 at 5:28 PM Mark Brown <broonie@kernel.org> wrote:

> > > +Sysreg HAFGRTR_EL2 3 4 3 1 6
> > > +Res0 63:50

> > Oh, we actually have the register fully encoded since we needed the
> > fields. Given this why did we need the manual encoding in the previous
> > patch? In any case this looks good according to DDI0601 2023-09:

> We need both because we need to know the polarity. RES0 and the valid
> bits are generated. In later patches in this series I move completely
> to using the generated RES0, and to calculating nMASK based on the
> other fields. But we still need the definitions in kvm_arm.h for the
> polarity.

Ah, I see - that makes sense. We could consider extending the language
to capture this information in the sysreg definition rather than typing
it in separately, though it's not going to get that much usage.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]