[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>, Juergen Gross <jgross@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Thu, 21 Apr 2022 17:47:37 +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=H2Qy3iqHX58/KgxoTbYDY4twNI1kkfoN3krCB9RNYNc=; b=L2IlsobNDiJfbwWM4kDgEg2jGoD4R87vO4vHj07W/Fd3nUcmwudimY5LfXw6hJH2wLIwCc4Y8nNq88BSqtvuDcQiPIYJ2hV7haxdrUcEcsD5Jd5UhSW/0+CXFtBkagq5pRJahEQzeNtamSoF0cCb+eZnIPGFvJOgKk0uzmOLmJxhykYwTTwVoze8xefxyq4o+tJhJpV2O0gWOPyhRzrEd9uWaWZNcSPs0h2hTWiZKxBk+2dPpsjQfwzOZ4R29sWwIvoecSp+O8r5H+cPXfB5LxlFheb2QvFzF6YufOL9AaFDG+v20i0wfVSkY3GOuW/G7kcummAeaSbwgl+Ov4Hbew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M2iOjDXtmHJoVDOLMraNLgDBrwr3L7a0BjFetHk9ea2j57biSyiZaoX673Zb2Nlm1REdckGMFDK/okhWymUl9V9IEwkbCxlDIPpHoxD7FNz39Ud/NiuxnVgBqn6Zj0DTHjW0P37rrL/RHc07j3lHpGlggsd7DQrmxKTR7skrS4jZ95lQqMWAOa5L+1qA7kvSt26pRpZbII0BMTzk0cqyhWsIuIZ2V/HTckk2nlk3oBPeXQcOblv7RnmBGTf58SH3tXjoslfp+0Qrtamk3KPTwhrk4oJ7Y4gph/gpBlUz00cQFDKySbXGciNsEjniZPDNofZgp0IQUgbJyiQ6e9C8ng==
  • 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>
  • Delivery-date: Thu, 21 Apr 2022 17:47:49 +0000
  • Ironport-data: A9a23:KiMbSa5qKgfKS7tcU5gbQQxRtM/GchMFZxGqfqrLsTDasY5as4F+v mAYXW/Xb/uPYzbyfYh3atmzoxkAvcPUzYdlTgtqryo2Hi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw0XqPp8Zj2tQy2YTjWlvX0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurTpQw0LPO7tmd42eBIDNyFAE7Nlyo7IdC3XXcy7lyUqclPK6tA3VgQTAtdd/ex6R2ZT6 fYfNTYBKAiZgP67y666Te8qgdk/KM7sP8UUvXQIITPxVK56B8ycBfuUo4MEtNszrpkm8fL2T swVczdwKj/HZAVCIAw/A5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loOWxPJAYxpo7n5 rMFFteqG4pYkrrTdaD2ZVamyq9N1lVnQ6dvv22y6IJyoEUHoCbQBFrYGpe4PeIsrEYHtDRXe q1NdZfH+LjRFGebLp04w==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYVHuOvzYJLKPprEuLadRqUVZq9az4UhqAgAAC1gCAAAFpgIACUHUA
  • Thread-topic: [PATCH v4] xen/iommu: cleanup iommu related domctl handling

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.

~Andrew

 


Rackspace

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