[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52762103614C7B8F1322F7CE8C74A@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Thu, 12 Jun 2025 08:27:12 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Nicolin Chen <nicolinc@...dia.com>, "jgg@...dia.com" <jgg@...dia.com>
CC: "will@...nel.org" <will@...nel.org>, "robin.murphy@....com"
<robin.murphy@....com>, "joro@...tes.org" <joro@...tes.org>,
"ddutile@...hat.com" <ddutile@...hat.com>, "Liu, Yi L" <yi.l.liu@...el.com>,
"peterz@...radead.org" <peterz@...radead.org>, "jsnitsel@...hat.com"
<jsnitsel@...hat.com>, "praan@...gle.com" <praan@...gle.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "iommu@...ts.linux.dev"
<iommu@...ts.linux.dev>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "patches@...ts.linux.dev"
<patches@...ts.linux.dev>, "baolu.lu@...ux.intel.com"
<baolu.lu@...ux.intel.com>
Subject: RE: [PATCH v1 08/12] iommufd/viommu: Replace ops->viommu_alloc with
ops->viommu_init
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Tuesday, June 10, 2025 1:14 AM
>
> + rc = ops->get_viommu_size(cmd->type, idev->dev, &viommu_size);
> + if (rc)
> + goto out_put_idev;
> +
> + /*
> + * It is a driver bug for providing a viommu_size smaller than the core
> + * vIOMMU structure size
> + */
> + if (WARN_ON_ONCE(viommu_size < sizeof(*viommu))) {
> + rc = -EINVAL;
> + goto out_put_idev;
> + }
> +
It's not about user providing an invalid argument. Sounds cleaner
to return NOSUPPORT in such case.
Powered by blists - more mailing lists