[Intel-gfx] [PATCH 4/6] drm/i915: Force compilation with intel-iommu for CI validation

kbuild test robot lkp at intel.com
Mon Sep 9 16:32:23 UTC 2019


Hi Chris,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[cannot apply to v5.3-rc8 next-20190904]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Chris-Wilson/drm-i915-selftests-Take-runtime-wakeref-for-igt_ggtt_lowlevel/20190909-201355
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-s2-201936 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/iommu/intel-iommu.c: In function 'domain_update_iommu_coherency':
>> drivers/iommu/intel-iommu.c:622:2: error: implicit declaration of function 'for_each_active_iommu'; did you mean 'for_each_active_irq'? [-Werror=implicit-function-declaration]
     for_each_active_iommu(iommu, drhd) {
     ^~~~~~~~~~~~~~~~~~~~~
     for_each_active_irq
>> drivers/iommu/intel-iommu.c:622:37: error: expected ';' before '{' token
     for_each_active_iommu(iommu, drhd) {
                                        ^
   drivers/iommu/intel-iommu.c: In function 'domain_update_iommu_snooping':
   drivers/iommu/intel-iommu.c:638:37: error: expected ';' before '{' token
     for_each_active_iommu(iommu, drhd) {
                                        ^
   drivers/iommu/intel-iommu.c: In function 'domain_update_iommu_superpage':
   drivers/iommu/intel-iommu.c:663:37: error: expected ';' before '{' token
     for_each_active_iommu(iommu, drhd) {
                                        ^
   drivers/iommu/intel-iommu.c: In function 'device_to_iommu':
   drivers/iommu/intel-iommu.c:781:37: error: expected ';' before '{' token
     for_each_active_iommu(iommu, drhd) {
                                        ^
   drivers/iommu/intel-iommu.c:812:2: warning: label 'out' defined but not used [-Wunused-label]
     out:
     ^~~
   drivers/iommu/intel-iommu.c:756:6: warning: unused variable 'i' [-Wunused-variable]
     int i;
         ^
   drivers/iommu/intel-iommu.c:753:17: warning: unused variable 'tmp' [-Wunused-variable]
     struct device *tmp;
                    ^~~
   drivers/iommu/intel-iommu.c: In function 'si_domain_init':
>> drivers/iommu/intel-iommu.c:2731:3: error: implicit declaration of function 'for_each_active_dev_scope'; did you mean 'for_each_active_irq'? [-Werror=implicit-function-declaration]
      for_each_active_dev_scope(rmrr->devices, rmrr->devices_cnt,
      ^~~~~~~~~~~~~~~~~~~~~~~~~
      for_each_active_irq
   drivers/iommu/intel-iommu.c:2732:16: error: expected ';' before '{' token
           i, dev) {
                   ^
   drivers/iommu/intel-iommu.c: In function 'device_has_rmrr':
>> drivers/iommu/intel-iommu.c:2794:4: error: expected ';' before 'if'
       if (tmp == dev ||
       ^~
   drivers/iommu/intel-iommu.c: In function 'init_dmars':
>> drivers/iommu/intel-iommu.c:3157:2: error: implicit declaration of function 'for_each_drhd_unit'; did you mean 'for_each_rmrr_units'? [-Werror=implicit-function-declaration]
     for_each_drhd_unit(drhd) {
     ^~~~~~~~~~~~~~~~~~
     for_each_rmrr_units
   drivers/iommu/intel-iommu.c:3157:27: error: expected ';' before '{' token
     for_each_drhd_unit(drhd) {
                              ^
   drivers/iommu/intel-iommu.c:3182:2: error: implicit declaration of function 'for_each_iommu'; did you mean 'for_each_cpu'? [-Werror=implicit-function-declaration]
     for_each_iommu(iommu, drhd) {
     ^~~~~~~~~~~~~~
     for_each_cpu
   drivers/iommu/intel-iommu.c:3182:30: error: expected ';' before '{' token
     for_each_iommu(iommu, drhd) {
                                 ^
   drivers/iommu/intel-iommu.c:3293:30: error: expected ';' before '{' token
     for_each_iommu(iommu, drhd) {
                                 ^
   drivers/iommu/intel-iommu.c:3327:37: error: expected ';' before '{' token
     for_each_active_iommu(iommu, drhd) {
                                        ^
   drivers/iommu/intel-iommu.c: In function 'get_private_domain_for_dev':
   drivers/iommu/intel-iommu.c:3391:18: error: expected ';' before '{' token
           i, i_dev) {
                     ^
   drivers/iommu/intel-iommu.c:3376:9: warning: unused variable 'ret' [-Wunused-variable]
     int i, ret;
            ^~~
   In file included from arch/x86/include/asm/bug.h:83:0,
                    from include/linux/bug.h:5,
                    from include/linux/jump_label.h:250,
                    from arch/x86/include/asm/string_64.h:6,
                    from arch/x86/include/asm/string.h:5,
                    from include/linux/string.h:20,
                    from include/linux/bitmap.h:9,
                    from drivers/iommu/intel-iommu.c:17:
   drivers/iommu/intel-iommu.c: In function 'quirk_ioat_snb_local_iommu':
>> drivers/iommu/intel-iommu.c:3827:35: error: dereferencing pointer to incomplete type 'struct dmar_drhd_unit'
     if (WARN_TAINT_ONCE(!drhd || drhd->reg_base_addr - vtbar != 0xa000,
                                      ^
   include/asm-generic/bug.h:173:27: note: in definition of macro 'WARN_TAINT_ONCE'
     int __ret_warn_once = !!(condition);   \
                              ^~~~~~~~~
   drivers/iommu/intel-iommu.c: In function 'init_no_remapping_devices':
   drivers/iommu/intel-iommu.c:3840:27: error: expected ';' before '{' token
     for_each_drhd_unit(drhd) {
                              ^
   drivers/iommu/intel-iommu.c:3838:6: warning: unused variable 'i' [-Wunused-variable]
     int i;
         ^
   drivers/iommu/intel-iommu.c:3837:17: warning: unused variable 'dev' [-Wunused-variable]
     struct device *dev;
                    ^~~
   drivers/iommu/intel-iommu.c: In function 'dmar_parse_one_rmrr':
>> drivers/iommu/intel-iommu.c:4023:19: error: implicit declaration of function 'dmar_alloc_dev_scope'; did you mean 'dmar_alloc_hwirq'? [-Werror=implicit-function-declaration]
     rmrru->devices = dmar_alloc_dev_scope((void *)(rmrr + 1),
                      ^~~~~~~~~~~~~~~~~~~~
                      dmar_alloc_hwirq
>> drivers/iommu/intel-iommu.c:4023:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     rmrru->devices = dmar_alloc_dev_scope((void *)(rmrr + 1),
                    ^
   drivers/iommu/intel-iommu.c: In function 'dmar_parse_one_atsr':
   drivers/iommu/intel-iommu.c:4082:18: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      atsru->devices = dmar_alloc_dev_scope((void *)(atsr + 1),
                     ^
   drivers/iommu/intel-iommu.c: In function 'intel_iommu_free_atsr':
>> drivers/iommu/intel-iommu.c:4098:2: error: implicit declaration of function 'dmar_free_dev_scope'; did you mean 'dmi_memdev_size'? [-Werror=implicit-function-declaration]
     dmar_free_dev_scope(&atsru->devices, &atsru->devices_cnt);
     ^~~~~~~~~~~~~~~~~~~
     dmi_memdev_size
   drivers/iommu/intel-iommu.c: In function 'dmar_check_one_atsr':
>> drivers/iommu/intel-iommu.c:4133:4: error: expected ';' before 'return'
       return -EBUSY;
       ^~~~~~
   drivers/iommu/intel-iommu.c: In function 'dmar_find_matched_atsr_unit':
>> drivers/iommu/intel-iommu.c:4288:3: error: implicit declaration of function 'for_each_dev_scope'; did you mean 'for_each_node_state'? [-Werror=implicit-function-declaration]
      for_each_dev_scope(atsru->devices, atsru->devices_cnt, i, tmp)
      ^~~~~~~~~~~~~~~~~~
      for_each_node_state
   drivers/iommu/intel-iommu.c:4289:4: error: expected ';' before 'if'
       if (tmp == &bridge->dev)
       ^~
   drivers/iommu/intel-iommu.c: At top level:
>> drivers/iommu/intel-iommu.c:4302:40: warning: 'struct dmar_pci_notify_info' declared inside parameter list will not be visible outside of this definition or declaration
    int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info)
                                           ^~~~~~~~~~~~~~~~~~~~
   drivers/iommu/intel-iommu.c: In function 'dmar_iommu_notify_scope_dev':
>> drivers/iommu/intel-iommu.c:4316:11: error: dereferencing pointer to incomplete type 'struct dmar_pci_notify_info'
      if (info->event == BUS_NOTIFY_ADD_DEVICE) {
              ^~
>> drivers/iommu/intel-iommu.c:4317:10: error: implicit declaration of function 'dmar_insert_dev_scope'; did you mean 'dmar_insert_one_dev_info'? [-Werror=implicit-function-declaration]
       ret = dmar_insert_dev_scope(info, (void *)(rmrr + 1),
             ^~~~~~~~~~~~~~~~~~~~~
             dmar_insert_one_dev_info
>> drivers/iommu/intel-iommu.c:4324:4: error: implicit declaration of function 'dmar_remove_dev_scope'; did you mean 'domain_remove_dev_info'? [-Werror=implicit-function-declaration]
       dmar_remove_dev_scope(info, rmrr->segment,
       ^~~~~~~~~~~~~~~~~~~~~
       domain_remove_dev_info
   drivers/iommu/intel-iommu.c: In function 'intel_iommu_memory_notifier':
>> drivers/iommu/intel-iommu.c:4401:5: error: expected ';' before 'iommu_flush_iotlb_psi'
        iommu_flush_iotlb_psi(iommu, si_domain,
        ^~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/intel-iommu.c: In function 'intel_disable_iommus':
>> drivers/iommu/intel-iommu.c:4455:3: error: expected ';' before 'iommu_disable_translation'
      iommu_disable_translation(iommu);
      ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/intel-iommu.c: In function 'probe_acpi_namespace_devices':
   drivers/iommu/intel-iommu.c:4587:37: error: expected ';' before '{' token
     for_each_active_iommu(iommu, drhd) {
                                        ^
   drivers/iommu/intel-iommu.c:4585:9: warning: unused variable 'ret' [-Wunused-variable]
     int i, ret = 0;
            ^~~
   drivers/iommu/intel-iommu.c:4585:6: warning: unused variable 'i' [-Wunused-variable]
     int i, ret = 0;
         ^
   drivers/iommu/intel-iommu.c:4584:17: warning: unused variable 'dev' [-Wunused-variable]
     struct device *dev;
                    ^~~
>> drivers/iommu/intel-iommu.c:4620:1: warning: no return statement in function returning non-void [-Wreturn-type]
    }
    ^
   drivers/iommu/intel-iommu.c: In function 'intel_iommu_init':
>> drivers/iommu/intel-iommu.c:4640:14: error: 'dmar_global_lock' undeclared (first use in this function); did you mean 'qi_global_iec'?
     down_write(&dmar_global_lock);
                 ^~~~~~~~~~~~~~~~
                 qi_global_iec
   drivers/iommu/intel-iommu.c:4640:14: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/iommu/intel-iommu.c:4641:6: error: implicit declaration of function 'dmar_table_init'; did you mean 'acpi_table_init'? [-Werror=implicit-function-declaration]
     if (dmar_table_init()) {
         ^~~~~~~~~~~~~~~
         acpi_table_init

vim +622 drivers/iommu/intel-iommu.c

8c11e798eee2ce drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  600  
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  601  static void domain_update_iommu_coherency(struct dmar_domain *domain)
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  602  {
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  603  	struct dmar_drhd_unit *drhd;
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  604  	struct intel_iommu *iommu;
2f119c7895af56 drivers/iommu/intel-iommu.c Quentin Lambert 2015-02-06  605  	bool found = false;
2f119c7895af56 drivers/iommu/intel-iommu.c Quentin Lambert 2015-02-06  606  	int i;
2e12bc29fc5a12 drivers/iommu/intel-iommu.c Alex Williamson 2011-11-11  607  
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  608  	domain->iommu_coherency = 1;
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  609  
29a27719abaa4d drivers/iommu/intel-iommu.c Joerg Roedel    2015-07-21  610  	for_each_domain_iommu(i, domain) {
2f119c7895af56 drivers/iommu/intel-iommu.c Quentin Lambert 2015-02-06  611  		found = true;
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  612  		if (!ecap_coherent(g_iommus[i]->ecap)) {
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  613  			domain->iommu_coherency = 0;
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  614  			break;
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  615  		}
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  616  	}
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  617  	if (found)
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  618  		return;
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  619  
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  620  	/* No hardware attached; use lowest common denominator */
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  621  	rcu_read_lock();
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11 @622  	for_each_active_iommu(iommu, drhd) {
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  623  		if (!ecap_coherent(iommu->ecap)) {
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  624  			domain->iommu_coherency = 0;
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  625  			break;
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  626  		}
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  627  	}
d0501960874624 drivers/iommu/intel-iommu.c David Woodhouse 2014-03-11  628  	rcu_read_unlock();
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  629  }
8e604097ddc483 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  630  
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  631  static int domain_update_iommu_snooping(struct intel_iommu *skip)
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  632  {
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  633  	struct dmar_drhd_unit *drhd;
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  634  	struct intel_iommu *iommu;
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  635  	int ret = 1;
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  636  
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  637  	rcu_read_lock();
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  638  	for_each_active_iommu(iommu, drhd) {
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  639  		if (iommu != skip) {
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  640  			if (!ecap_sc_support(iommu->ecap)) {
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  641  				ret = 0;
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  642  				break;
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  643  			}
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  644  		}
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  645  	}
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  646  	rcu_read_unlock();
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  647  
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  648  	return ret;
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  649  }
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  650  
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  651  static int domain_update_iommu_superpage(struct intel_iommu *skip)
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  652  {
8140a95d228efb drivers/iommu/intel-iommu.c Allen Kay       2011-10-14  653  	struct dmar_drhd_unit *drhd;
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  654  	struct intel_iommu *iommu;
8140a95d228efb drivers/iommu/intel-iommu.c Allen Kay       2011-10-14  655  	int mask = 0xf;
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  656  
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  657  	if (!intel_iommu_superpage) {
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  658  		return 0;
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  659  	}
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  660  
8140a95d228efb drivers/iommu/intel-iommu.c Allen Kay       2011-10-14  661  	/* set iommu_superpage to the smallest common denominator */
0e242612d9cdb4 drivers/iommu/intel-iommu.c Jiang Liu       2014-02-19  662  	rcu_read_lock();
8140a95d228efb drivers/iommu/intel-iommu.c Allen Kay       2011-10-14  663  	for_each_active_iommu(iommu, drhd) {
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  664  		if (iommu != skip) {
8140a95d228efb drivers/iommu/intel-iommu.c Allen Kay       2011-10-14  665  			mask &= cap_super_page_val(iommu->cap);
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  666  			if (!mask)
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  667  				break;
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  668  		}
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  669  	}
0e242612d9cdb4 drivers/iommu/intel-iommu.c Jiang Liu       2014-02-19  670  	rcu_read_unlock();
0e242612d9cdb4 drivers/iommu/intel-iommu.c Jiang Liu       2014-02-19  671  
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  672  	return fls(mask);
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  673  }
6dd9a7c73761a8 drivers/pci/intel-iommu.c   Youquan Song    2011-05-25  674  
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  675  /* Some capabilities may be different across iommus */
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  676  static void domain_update_iommu_cap(struct dmar_domain *domain)
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  677  {
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  678  	domain_update_iommu_coherency(domain);
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  679  	domain->iommu_snooping = domain_update_iommu_snooping(NULL);
161f693460772e drivers/iommu/intel-iommu.c Jiang Liu       2014-07-11  680  	domain->iommu_superpage = domain_update_iommu_superpage(NULL);
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  681  }
58c610bd1a3f50 drivers/pci/intel-iommu.c   Sheng Yang      2009-03-18  682  
26b86092c46503 drivers/iommu/intel-iommu.c Sohil Mehta     2018-09-11  683  struct context_entry *iommu_context_addr(struct intel_iommu *iommu, u8 bus,
26b86092c46503 drivers/iommu/intel-iommu.c Sohil Mehta     2018-09-11  684  					 u8 devfn, int alloc)
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  685  {
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  686  	struct root_entry *root = &iommu->root_entry[bus];
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  687  	struct context_entry *context;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  688  	u64 *entry;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  689  
4df4eab168c1c4 drivers/iommu/intel-iommu.c Joerg Roedel    2015-08-25  690  	entry = &root->lo;
765b6a98c1de3d drivers/iommu/intel-iommu.c Lu Baolu        2018-12-10  691  	if (sm_supported(iommu)) {
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  692  		if (devfn >= 0x80) {
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  693  			devfn -= 0x80;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  694  			entry = &root->hi;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  695  		}
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  696  		devfn *= 2;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  697  	}
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  698  	if (*entry & 1)
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  699  		context = phys_to_virt(*entry & VTD_PAGE_MASK);
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  700  	else {
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  701  		unsigned long phy_addr;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  702  		if (!alloc)
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  703  			return NULL;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  704  
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  705  		context = alloc_pgtable_page(iommu->node);
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  706  		if (!context)
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  707  			return NULL;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  708  
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  709  		__iommu_flush_cache(iommu, (void *)context, CONTEXT_SIZE);
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  710  		phy_addr = virt_to_phys((void *)context);
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  711  		*entry = phy_addr | 1;
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  712  		__iommu_flush_cache(iommu, entry, sizeof(*entry));
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  713  	}
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  714  	return &context[devfn];
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  715  }
03ecc32c527496 drivers/iommu/intel-iommu.c David Woodhouse 2015-02-13  716  
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  717  static int iommu_dummy(struct device *dev)
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  718  {
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  719  	return dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO;
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  720  }
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  721  
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  722  /**
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  723   * is_downstream_to_pci_bridge - test if a device belongs to the PCI
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  724   *				 sub-hierarchy of a candidate PCI-PCI bridge
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  725   * @dev: candidate PCI device belonging to @bridge PCI sub-hierarchy
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  726   * @bridge: the candidate PCI-PCI bridge
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  727   *
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  728   * Return: true if @dev belongs to @bridge PCI sub-hierarchy, else false.
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  729   */
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  730  static bool
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  731  is_downstream_to_pci_bridge(struct device *dev, struct device *bridge)
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  732  {
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  733  	struct pci_dev *pdev, *pbridge;
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  734  
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  735  	if (!dev_is_pci(dev) || !dev_is_pci(bridge))
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  736  		return false;
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  737  
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  738  	pdev = to_pci_dev(dev);
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  739  	pbridge = to_pci_dev(bridge);
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  740  
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  741  	if (pbridge->subordinate &&
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  742  	    pbridge->subordinate->number <= pdev->bus->number &&
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  743  	    pbridge->subordinate->busn_res.end >= pdev->bus->number)
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  744  		return true;
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  745  
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  746  	return false;
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  747  }
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  748  
156baca8d31e1a drivers/iommu/intel-iommu.c David Woodhouse 2014-03-09  749  static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devfn)
c7151a8dfefd11 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  750  {
c7151a8dfefd11 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  751  	struct dmar_drhd_unit *drhd = NULL;
b683b230a244c3 drivers/iommu/intel-iommu.c Jiang Liu       2014-02-19  752  	struct intel_iommu *iommu;
156baca8d31e1a drivers/iommu/intel-iommu.c David Woodhouse 2014-03-09  753  	struct device *tmp;
b9a7f9816483b1 drivers/iommu/intel-iommu.c Eric Auger      2019-06-03  754  	struct pci_dev *pdev = NULL;
aa4d066a2a8041 drivers/iommu/intel-iommu.c Yijing Wang     2014-05-26  755  	u16 segment = 0;
c7151a8dfefd11 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08 @756  	int i;
c7151a8dfefd11 drivers/pci/intel-iommu.c   Weidong Han     2008-12-08  757  
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  758  	if (iommu_dummy(dev))
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  759  		return NULL;
4ed6a540fab8ea drivers/iommu/intel-iommu.c David Woodhouse 2015-05-11  760  
156baca8d31e1a drivers/iommu/intel-iommu.c David Woodhouse 2014-03-09  761  	if (dev_is_pci(dev)) {
1c387188c60f53 drivers/iommu/intel-iommu.c Ashok Raj       2016-10-21  762  		struct pci_dev *pf_pdev;
1c387188c60f53 drivers/iommu/intel-iommu.c Ashok Raj       2016-10-21  763  
156baca8d31e1a drivers/iommu/intel-iommu.c David Woodhouse 2014-03-09  764  		pdev = to_pci_dev(dev);
5823e330b58c52 drivers/iommu/intel-iommu.c Jon Derrick     2017-08-30  765  

:::::: The code at line 622 was first introduced by commit
:::::: d05019608746240d86a406fbf8d8c1fc71a87101 iommu/vt-d: Be less pessimistic about domain coherency where possible

:::::: TO: David Woodhouse <dwmw2 at infradead.org>
:::::: CC: David Woodhouse <David.Woodhouse at intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 30749 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20190910/33cee289/attachment-0001.gz>


More information about the Intel-gfx mailing list