[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] libxc: correct bounce direction in xc_get_device_group()



On 01/12/2021 09:42, Jan Beulich wrote:
> The array of IDs is an output.
>
> Fixes: 79647c5bc9c6 ("libxc: convert domctl interfaces over to hypercall 
> buffers")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> Clearly the function, including its Python wrapper, cannot have been
> used by anything for many years. I wonder whether that isn't good enough
> a reason to sanitize the layout of the array elements: Right now they
> have BDF in bits 8...23, when conventionally this would be bits 0...15.

There is a lot of WTF with this hypercall.  It's obviously an attempt to
do the thing that Linux calls IOMMU groups now, except that the correct
way to do this would be for the group ID to be the unit of
assignment/deassignment.  (We need to do this anyway for other reasons.)

The last user was deleted with Xend (2013), which suggests that it was
broken for 3 years due to the incorrect bounce direction (2010).

Furthermore, it will arbitrarily fail if targetting domains without an
IOMMU configured, but everything else seems to be invariant of the
passed domain.  This should clearly be sysctl, not a domctl.


I suggest ripping all of this infrastructure out.  It's clearly unused
(and broken in Xen too - see patch 1), and not something which should be
used in this form in the future.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.