lkml.org 
[lkml]   [2016]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/6] iommu/amd: Add support for non-pci devices
On Fri, Jan 08, 2016 at 10:52:59PM +0800, Wan Zongshun wrote:
> Actually I am supposing the '.add_device' will be the first called
> in iommu initializing stage, so I think as long as having no error
> of check device here, any call-sites of get_device_id() will be
> fine, because adding device successfully should be the pre-condition
> of any iommu function can be performed, please correct me.
>
> static int amd_iommu_add_device(struct device *dev)
> {
> struct iommu_dev_data *dev_data;
> struct iommu_domain *domain;
> struct amd_iommu *iommu;
> u16 devid;
> int ret;
>
> if (!check_device(dev) || get_dev_data(dev))
> return 0;
>
> devid = get_device_id(dev);
> iommu = amd_iommu_rlookup_table[devid];

There are places in the interrupt remapping code that call get_device_id
without calling check_device first. See get_irq_domain and get_devid.


Joerg

\
 
 \ /
  Last update: 2016-01-08 18:41    [W:0.713 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site