[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()


  • To: Andrew Cooper <amc96@xxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Dec 2021 08:30:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oAqlqgzhEnJGOcrJ57AoOl+1KamxRZmtYbGPvq45KW4=; b=C+dEzY7FoD/0fBi1tG/3up41WK/2aX31MAoHZJ79xsdoGNgA3xi54CE5n89ZuyVc70EJbE1MJv5PbJKAU7SHRV8Zc1u2hHozGDYh243FeQkm1AaDqtNkoyYnOeA0z/GNMH7rXCYcaxAfRLQuORjLgvoABJLpULW7BOSugr0t8wlC7W3X3G3Oyey/LUmnu9TD65/i/Spy40TLDxLH6ajruMDjDMSEGw8w89Fw71+GLySzj8SDMEJxJxn4448PmoTw/WLT9j2TWxWCPs4QxKb/KtHpaJFP53X/o5wsgvM4UXuNLQRJYV4svnyK2QULIXhfV6WlufG76XKq/g1VOmPyeg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ii60zwkFTm71zxzguSwahRvjo8lKuMRPv9gkrVaGX88AridwDv2QGPPrR18vayZKClru5svRNURwMC7afaXZ3lcx0i26YbdCyJ8ZRAASZeOcen2Z0B4+x8PjbQX10F9pBApzR7CjWsy3w+G22j6AXDNZVc7yMrsoNWyU1NPxRQgqWoBzMTogPkTSsBc2b8GWeoAYrMf3LvebAJILetZ+oHQeplqRJaOZ+KHoDoCgPz5jErLH7lJx74oc8ApXRmGMYj92DZccc1D+xMzQo2OIhqXhXfZiaf20R96Jg7zPI25mC6NmngmBR5J2d+gSr5zjWEJHybeHwqSY+KiXmAvjwg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Thu, 02 Dec 2021 07:30:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.12.2021 16:11, Andrew Cooper wrote:
> 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),

I've not seen you point out any breakage in reply to patch 1, unless you
mean VT-d's returning of -1 (which you didn't point out as broken, but
which I can see would lead to misbehavior).

> and not something which should be used in this form in the future.

I didn't think the concept here was wrong. What's missing is the tool
stack actually making use of this plus a way to do assignment in groups.
Iirc the latter was something Paul had started work on before leaving
Citrix? (That's leaving aside the bug you mention plus potential further
ones.)

Paul, Ian, Wei - what are your thoughts towards Andrew's proposal?

Jan




 


Rackspace

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