On 30/10/2021 12:20, Roger Pau Monné wrote:
> On Fri, Oct 29, 2021 at 06:38:13PM +0100, Andrew Cooper wrote:
>> In order to let the toolstack be able to set the gnttab version on a
>> per-domain basis, it needs to know which ABIs Xen supports. Introduce
>> XEN_SYSCTL_PHYSCAP_gnttab_v{1,2} for the purpose, and plumb in down into
>> userspace.
> I did consider exposing the versions supported together with
> max_{grant,maptrack}_frames using a new grant-table dedicated sysctl,
> but maybe it's fine to expose the version as a physcap and fetch the
> other two separately?
The naming is already rather wonky. xl calls it virt_caps which is how
most humans interact with the content, while the comments call it
"platform capabilities".
> I certainly didn't look much into this, maybe it's pointless to expose
> max_{grant,maptrack}_frames. I think the toolstack will need to be
> able to fetch grant related limits on a per-domain basis like we plan
> to do with the grant version in order to assert the destination host
> supports the current limit applied to the domain.
All capabilities, settings and limits ought to be available to an admin
in dom0. `xl dmesg | grep $FOO` is inadequate.
In an ideal world, yes, we would have max_*_frames available too so `xl`
can give a more coherent error message than "domaincreate returned
-EINVAL", but for now at least those are checks suitably.
On x86, the correct way for this all to have worked would be to have a
gnttab leaf in Xen's CPUID leaves, but that is firmly in ABI-v2
territory now.
~Andrew