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

Re: [PATCH v4] xen/iommu: cleanup iommu related domctl handling


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Fri, 22 Apr 2022 19:01:33 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=IlQGvV+muFMVKgvw9h8yPUKC3o/hjcUSdtxGSXtmxnU=; b=WfIvIdBySTE3rr9uE0lyE2HfzKuwT0YDhZau2rxSGz9dy/B4p50I7hjeLnP1pRYq7owqImmiYQM+jo1tTbqQbEYcj/HzRZXs9j39Y3gkiGIDvvmf7tiOh2oVNIDeS82um46jl1m6WG5Hpl1HkpCPZXU3U8d147vn4djVu/PVDfOt+HG/4T2eQodxMG/EfQm7TPMVq8Aiht0aHbmeXKdv+MmQG1IdjMYTYFnBU3garHjkA3hxff+ozv+hrV1bOl+yZnGMfzUSGh1MfxiTPB2tP9H2/TCr+lPLGUWCuvos5RHZncJRhx6aGkk9QSuYyeDoaz4+VYitCI79JpRZ8GccfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KuSESmM8Lgu2cpqeF+iQZ/5S8ptM65FcHmHsc9EC9Wf84FUjiTgUpgi53n0lo0QVUeKulQ7TyF73udJa41ythmI9M7g3bQPewacyvehGlC8YTaL20Vgsu9nQWxGhgmRiJHQekjPX8GliTARe314D00sFfgo522DGRpD5kNcTwiKMgB0Vke49OkVQ+TInW2c/8CJbtPe228SkZY7zmr2sntX1VUecLLbCOhWEvANWxhlOpY82mBjFNP6UqxWSLB2OpWU+wlZXtmv8CtFh0Qemb80YLZ3hqjD0n0H/+LlptvakQjaepeLroG66ex9NJvcspdIt74YaS7AMcy7e3iLvsg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 22 Apr 2022 19:01:48 +0000
  • Ironport-data: A9a23:0RVv3qi/uy/q1nWu3k5DnG4NX161lxEKZh0ujC45NGQN5FlHY01je htvD2iDO/eLNmSnedB1O4Sz8h8D6J7RmNYyQFA4/is2ESMb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M78wIFqtQw24LhX1nX4 YmaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YS0qAar3vqMQaThJCi1kZpVh3OTlMHfq5KR/z2WeG5ft69NHKRlqeKE9pKNwC2wI8 uEEIjcQaBzFn/ix3L+wVuhrgIIkMdXvO4Qc/HpnyFk1D95/GcyFH/qMuoQegGpYasNmRJ4yY +IwbzZ1YQuGSBpIIloNU7o1nfuyh2m5eDpd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Owpd3kJ PdUElAvWp3YE7qAd3m5uw9zvkMehTIYd3A8LAv23EigMyMeFPCC1zxdHk+1829vv4YHsrXH/ 6uJZM+OY6XEVfT
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYVHuOvzYJLKPprEuLadRqUVZq9az4UhqAgAAC1gCAAAFpgIACUHUAgADgBQCAAMb5gA==
  • Thread-topic: [PATCH v4] xen/iommu: cleanup iommu related domctl handling

On 22/04/2022 08:09, Jan Beulich wrote:
> On 21.04.2022 19:47, Andrew Cooper wrote:
>> On 20/04/2022 07:27, Jan Beulich wrote:
>>> On 20.04.2022 08:22, Juergen Gross wrote:
>>>> On 20.04.22 08:11, Jan Beulich wrote:
>>>>> On 20.04.2022 07:57, Juergen Gross wrote:
>>>>>> --- a/xen/include/xen/iommu.h
>>>>>> +++ b/xen/include/xen/iommu.h
>>>>>> @@ -341,8 +341,17 @@ struct domain_iommu {
>>>>>>   /* Does the IOMMU pagetable need to be kept synchronized with the P2M 
>>>>>> */
>>>>>>   #ifdef CONFIG_HAS_PASSTHROUGH
>>>>>>   #define need_iommu_pt_sync(d)     (dom_iommu(d)->need_sync)
>>>>>> +
>>>>>> +int iommu_do_domctl(struct xen_domctl *domctl, struct domain *d,
>>>>>> +                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
>>>>>>   #else
>>>>>>   #define need_iommu_pt_sync(d)     ({ (void)(d); false; })
>>>>>> +
>>>>>> +static inline int iommu_do_domctl(struct xen_domctl *domctl, struct 
>>>>>> domain *d,
>>>>>> +                                  XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>>>>>> u_domctl)
>>>>>> +{
>>>>>> +    return -ENOSYS;
>>>>>> +}
>>>>> As said in reply to Andrew as well as in a number or earlier occasions,
>>>>> I firmly think that this wants to be -EOPNOTSUPP, not -ENOSYS. Views
>>>> In libxl there is an explicit check for ENOSYS being returned for
>>>> assigning/deassigning a device, same in the xc python bindings.
>>> Urgh.
>> Honestly, I wasn't particularly happy with your push to swap ENOSYS out
>> for EOPNOTSUPP.  This shows plainly why it's a bad move.
>>
>> An end user doesn't give two hoots about the distinction between
>> hypercall not supported and subops not supported; they care about
>> whether Xen can perform the requested action or not.  ENOSYS is the more
>> common way of signalling this, and having only one errno value to check
>> is better for everyone involved.
> End users are of little interest here. Code looking for ENOSYS is what
> is of interest, when the meaning of ENOSYS is quite well defined as
> "system call not implemented"

POSIX specifies it as "Functionality not supported" which is why other
compliment systems use it for smaller granularity than a system call.

~Andrew

 


Rackspace

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