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

Re: [PATCH v5 2/4] xen: do not return -EEXIST if iommu_add_dt_device is called twice

  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 23 Jul 2021 08:31:50 +0200
  • 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-SenderADCheck; bh=aGhPHyAOH4xHo0Etys8GzaCa69y9fc8GbAxJTiPSapc=; b=CMt2T0Kc5GlyV4orQeu2hxk00RJ6ccs8wzH1wqVvb1AVnw+NuKetpip3FrNlLhwjJz1/8OAyt53fzUY4tMed13rq1aXjt1Oxt+FMcKpb5puQXbEv+7lJlqZY7Yg31hSd4u8lqZqe01c0j4STB5PejbbLF88GeUIDmM6xo7JXecJRnPFGV/d/I1n8RfuwPHkq3Iug9e+Rijqgez9O7CBVSvgV68xhHFGJDEQR+Pz+iCkt71SBYkWgtlYD6vnuiCjQk0PYGUocKadFRW8baLzCGCVhvrjQSDG3IodYc8EVlUwnPmCjdynOZtEgefhstM5N578SNc8JWhmCDAy1s6jOng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WcXLYPr9IzLG7HOtuCZq84aFOMdMGw6JWb+N5wT5UndDO/uWN+/mbgv0w7bY/+c/wciwdJ5wKDh+bRMDvWSNShNGZMniFa2N0OBZEig+As0egSXQ+bn3++Sy6YNzrcCcMdlq/wRcpelBzuCny6Q1Xi9TKvbnHSxoI5tdRdd3p1/CX/uDr5+cxV/gMtcItU92lTz4NtWIk07jw/Oh3TXdYD5xudWW+qsH0MphNJonR/n7WwauwUkeAsXMUrV4Dndeq+HeYAclLpiZyEy6FaaXapq2ITY/YD/MICwJlts0TBVH00cYbpk0zZA2esErf1hqZZMErnDi/6nw3AEWcjxGEg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: julien@xxxxxxx, Bertrand.Marquis@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, rahul.singh@xxxxxxx, brian.woods@xxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 23 Jul 2021 06:32:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.07.2021 01:36, Stefano Stabellini wrote:
> --- a/xen/drivers/passthrough/device_tree.c
> +++ b/xen/drivers/passthrough/device_tree.c
> @@ -140,8 +140,13 @@ int iommu_add_dt_device(struct dt_device_node *np)
>      if ( !ops )
>          return -EINVAL;
> +    /*
> +     * Some Device Trees may expose both legacy SMMU and generic
> +     * IOMMU bindings together. If both are present, the device
> +     * can be already added.
> +     */
>      if ( dev_iommu_fwspec_get(dev) )
> -        return -EEXIST;
> +        return 0;

Since the xen: prefix in the subject made me go look (I wouldn't have
if it had been e.g. dt: ), I may as well ask: Since previously there
was concern about bogus duplicate entries, does this concern go away
no altogether? It's one thing for there to be a legacy and a generic
binding, but another if you found two legacy or two generic ones, I
would think.

And what if legacy and generic representation differ in some way?
Shouldn't you limit processing to just one of the two categories,
such that no legitimate "already present" case could be encountered
here in the first place?




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