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

Re: [PATCH] xen/include/public: add macro for invalid grant reference


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Feb 2022 15:31:55 +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=JPbR5anL9d5zoDh+33JiFb/Q5vt7Fou5lwbqeLbfqUQ=; b=GvUWL0y4l9JF0uRnl+pBEIdxAoeasNP9lnq7zXLeM3KiPcHOdx4dXaxHYOFMK4IE9fWnCmFxRkRZK9GkZOASownhWTArMOVoiURIV4YkhR3i2N6tR+46QTmNBiv4VWdBjxQBJeIhssMtlzceirQeWM58nnAmhDyKVi3hGjrVqMQ67x0FQgSLl5a8NcHOGpFmwDVZafh6ZkRZhnpLnWgrOwt5URYjCYo49yyrh55jWyz3aHPgus5uN48HSt1oxqKuUVfy6zzPbbpCAL+jgwDgw44fihtgRTD+xNvJz7wb+yl7a2hR/UovJgOiuQxqO6Li6cIkMxpE25x5Ppf82SRQkQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ERg1qAZWy3h8VSiEI/GFMGrDwHe1qpGZNNd4DJeZXZ7wqgbFRLhCLzi3y/BM4A95f8+E65xGfgO9ngkMjQCYC0JTTlLkpTlqQWi5JKepw13oNDS4hxjHtcPMApxJ80OBBivLCOBtnxgZA93hNwO6r3qrjKIV2+uqT3miYPGolP8fVdF7YL1APx6SdVwtcAZ0JqNpoR6nsUTSTKTphKcyVYAtPJ1FdBzuktK7YX7tG1/BTUtyaAloncilO64OLXCLGhVU9WeZqFteXxWrM/q/zFNraSJSKLGvbgpTgPNwhBNGPZ/BwLZbf0YRkkHSbF2Jt+cLdBb5PKAn+sPHqjJ3dQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 21 Feb 2022 14:32:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.02.2022 15:27, Juergen Gross wrote:
> On 21.02.22 15:18, Jan Beulich wrote:
>> On 21.02.2022 13:42, Juergen Gross wrote:
>>> Providing a macro for an invalid grant reference would be beneficial
>>> for users, especially as some are using the wrong value "0" for that
>>> purpose.
>>>
>>> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
>>
>> Over the years I've been considering to add such to the public
>> interface, perhaps even more than once. But I'm afraid it's not that
>> easy. In principle 0xffffffff (which btw isn't necessarily ~0u) could
> 
> I can change that to use 0xffffffff explicitly.
> 
>> be a valid ref. It is really internal agreement by users of the
>> interface to set for themselves that they're not ever going to make
>> a valid grant behind that reference.
> 
> As the grant reference is an index into the grant table this would
> limit the size of the grant table to "only" UINT_MAX - 1. I don't
> think this will be ever a concern (other than an academical one).

That wasn't my point. Limiting the table to one less entry is not a
big deal indeed. But we have no reason to mandate which gref(s) to
consider invalid. A guest could consider gref 0 the invalid one.
The hypervisor doesn't care. Imo this simply is an aspect which is
not in need of pinning down in the ABI. Yet if it was pinned down
like you do, then the hypervisor would need to make sure it refuses
to act on this mandated invalid gref.

Jan




 


Rackspace

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