On Mon, May 13, 2019 at 10:32:46AM +0100, Andrea Bolognani wrote: > On Sun, 2019-05-12 at 10:36 +0200, Andrew Jones wrote: > [...] > > CPU type | accel | sve-max-vq | sve-vls-map > > ------------------------------------------- > > 1) max | tcg | $MAX_VQ | $VLS_MAP > > 2) max | kvm | $MAX_VQ | $VLS_MAP > > 3) host | kvm | N/A | $VLS_MAP > > > > Where for (1) $MAX_VQ sets the maximum vq and smaller vqs are > > all supported when $VLS_MAP is zero, or when the vqs are selected > > in $VLS_MAP. > > I'm a bit confused by the nomenclature here. VL clearly stands for > Vector Length, but what does VQ stand for? You seem to be using the > two terms pretty much interchangeably throughout the cover letter.
>From the Linux end, "vector length" or VL refers to the size of a vector register, either in no particular unit or in bytes. "VQ" refers specifically to the vector length in 128-bit quadwords. In some situations, neither terminology is obviously better than the other, such as in the way KVM_REG_ARM64_SVE_VLS is encoded. > [...] > > There is never any need to provide both properties, but if both > > are provided then they are checked for consistency. > > I would personally just error out when both are provided. > > > The QMP query returns a list of valid vq lists. For example, if > > a guest can use vqs 1, 2, 3, and 4, then the following list will > > be returned > > > > [ [ 1 ], [ 1, 2 ], [ 1, 2, 3 ], [ 1, 2, 3, 4 ] ] > > > > Another example might be 1, 2, 4, as the architecture states 3 > > is optional. In that case the list would be > > > > [ [ 1 ], [ 1, 2 ], [ 1, 2, 4 ] ] > > I think the proposed QMP command is problematic, because it reports > the valid vector lengths for either KVM or TCG based on which > accelerator is currently enabled: it should report all information > at all times instead, similarly to how query-gic-capabilities does > it. I wonder if this is premature flexibility? The size of these lists is going to get cumbersome if the architecture is ever extended. Even today, we might need over 100 items in this (nested) list. If this is to be presented to the user this will be far from friendly, it could get much worse if the architecutre changes in future to allow larger vectors or more flexible virtualisation. Could we just have a list of supported vector lengths and a possibly empty list of additional capabilities that describe what kinds of flexibility are allowed? So, for example, we might support vector lengths of 1, 2, 4 and 8 quadwords, with the the ability to clamp the max vector length the guest sees: the kernel ABI guarantees that you can do this, even if you can't disable/enable each individual vector length independently. So, [ 1, 2, 4, 8 ] seems sufficient to describe this in a forwards compatible way. Some day, we might report { "independent", [ 1, 2, 4, 8, 16, 32, ... ] } I'm guessing about the data representation here. [...] Cheers ---Dave