[PATCH v7 01/10] KVM: arm64: Allow userspace to get the writable masks for feature ID registers

Oliver Upton oliver.upton at linux.dev
Tue Aug 8 10:02:53 PDT 2023


On Thu, Aug 03, 2023 at 03:20:41PM +0200, Cornelia Huck wrote:
> On Wed, Aug 02 2023, Oliver Upton <oliver.upton at linux.dev> wrote:
> > Sorry, 'index' is a bit overloaded in this context. The point I was
> > trying to get across is that we might want to describe a completely
> > different range of registers than the feature ID registers in the
> > future. Nonetheless, we shouldn't even presume the shape of future
> > extensions to the ioctl.
> >
> > 	struct reg_mask_range {
> > 		__u64 addr;	/* pointer to mask array */
> > 		__u64 rsvd[7];
> > 	};
> >
> > Then in KVM we should require ::rsvd be zero and fail the ioctl
> > otherwise.
> 
> [I assume rsvd == reserved? I think I have tried to divine further
> meaning into this for far too long...]

Indeed.

> Is the idea here for userspace the request a mask array for FEATURE_ID
> and future ranges separately instead of getting all id-type regs in one
> go?

I rambled a bit, but the overall suggestion is that we leave room in the
UAPI for future extension. Asserting that the reserved portions of the
structure must be zero is the easiest way to accomplish that. The
complete feature ID register space is known, but maybe there are other
ranges of registers (possibly unrelated to ID) that we'd like to
similarly describe with masks.

-- 
Thanks,
Oliver



More information about the linux-arm-kernel mailing list