• Home
  • Raw
  • Download

Lines Matching refs:devid

118 			return p->devid;  in get_acpihid_device_id()
126 int devid; in get_device_id() local
129 devid = get_pci_device_id(dev); in get_device_id()
131 devid = get_acpihid_device_id(dev, NULL); in get_device_id()
133 return devid; in get_device_id()
141 static struct iommu_dev_data *alloc_dev_data(u16 devid) in alloc_dev_data() argument
150 dev_data->devid = devid; in alloc_dev_data()
157 static struct iommu_dev_data *search_dev_data(u16 devid) in search_dev_data() argument
167 if (dev_data->devid == devid) in search_dev_data()
176 u16 devid = pci_dev_id(pdev); in clone_alias() local
178 if (devid == alias) in clone_alias()
182 amd_iommu_rlookup_table[devid]; in clone_alias()
184 amd_iommu_dev_table[devid].data, in clone_alias()
228 static struct iommu_dev_data *find_dev_data(u16 devid) in find_dev_data() argument
231 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; in find_dev_data()
233 dev_data = search_dev_data(devid); in find_dev_data()
236 dev_data = alloc_dev_data(devid); in find_dev_data()
253 int devid; in acpihid_device_group() local
255 devid = get_acpihid_device_id(dev, &entry); in acpihid_device_group()
256 if (devid < 0) in acpihid_device_group()
257 return ERR_PTR(devid); in acpihid_device_group()
260 if ((devid == p->devid) && p->group) in acpihid_device_group()
298 int devid; in check_device() local
303 devid = get_device_id(dev); in check_device()
304 if (devid < 0) in check_device()
308 if (devid > amd_iommu_last_bdf) in check_device()
311 if (amd_iommu_rlookup_table[devid] == NULL) in check_device()
320 int devid; in iommu_init_device() local
325 devid = get_device_id(dev); in iommu_init_device()
326 if (devid < 0) in iommu_init_device()
327 return devid; in iommu_init_device()
329 dev_data = find_dev_data(devid); in iommu_init_device()
345 iommu = amd_iommu_rlookup_table[dev_data->devid]; in iommu_init_device()
356 int devid; in iommu_ignore_device() local
358 devid = get_device_id(dev); in iommu_ignore_device()
359 if (devid < 0) in iommu_ignore_device()
362 amd_iommu_rlookup_table[devid] = NULL; in iommu_ignore_device()
363 memset(&amd_iommu_dev_table[devid], 0, sizeof(struct dev_table_entry)); in iommu_ignore_device()
393 static void dump_dte_entry(u16 devid) in dump_dte_entry() argument
399 amd_iommu_dev_table[devid].data[i]); in dump_dte_entry()
414 int devid, vmg_tag, flags; in amd_iommu_report_rmp_hw_error() local
418 devid = (event[0] >> EVENT_DEVID_SHIFT) & EVENT_DEVID_MASK; in amd_iommu_report_rmp_hw_error()
423 pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid), in amd_iommu_report_rmp_hw_error()
424 devid & 0xff); in amd_iommu_report_rmp_hw_error()
435 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in amd_iommu_report_rmp_hw_error()
446 int devid, flags_rmp, vmg_tag, flags; in amd_iommu_report_rmp_fault() local
450 devid = (event[0] >> EVENT_DEVID_SHIFT) & EVENT_DEVID_MASK; in amd_iommu_report_rmp_fault()
456 pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid), in amd_iommu_report_rmp_fault()
457 devid & 0xff); in amd_iommu_report_rmp_fault()
468 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in amd_iommu_report_rmp_fault()
476 static void amd_iommu_report_page_fault(u16 devid, u16 domain_id, in amd_iommu_report_page_fault() argument
482 pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid), in amd_iommu_report_page_fault()
483 devid & 0xff); in amd_iommu_report_page_fault()
494 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in amd_iommu_report_page_fault()
505 int type, devid, flags, tag; in iommu_print_event() local
513 devid = (event[0] >> EVENT_DEVID_SHIFT) & EVENT_DEVID_MASK; in iommu_print_event()
530 amd_iommu_report_page_fault(devid, pasid, address, flags); in iommu_print_event()
537 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in iommu_print_event()
539 dump_dte_entry(devid); in iommu_print_event()
544 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in iommu_print_event()
549 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in iommu_print_event()
562 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in iommu_print_event()
567 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in iommu_print_event()
580 PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), in iommu_print_event()
860 static void build_inv_dte(struct iommu_cmd *cmd, u16 devid) in build_inv_dte() argument
863 cmd->data[0] = devid; in build_inv_dte()
923 static void build_inv_iotlb_pages(struct iommu_cmd *cmd, u16 devid, int qdep, in build_inv_iotlb_pages() argument
929 cmd->data[0] = devid; in build_inv_iotlb_pages()
931 cmd->data[1] = devid; in build_inv_iotlb_pages()
955 static void build_inv_iotlb_pasid(struct iommu_cmd *cmd, u16 devid, u32 pasid, in build_inv_iotlb_pasid() argument
962 cmd->data[0] = devid; in build_inv_iotlb_pasid()
965 cmd->data[1] = devid; in build_inv_iotlb_pasid()
975 static void build_complete_ppr(struct iommu_cmd *cmd, u16 devid, u32 pasid, in build_complete_ppr() argument
980 cmd->data[0] = devid; in build_complete_ppr()
997 static void build_inv_irt(struct iommu_cmd *cmd, u16 devid) in build_inv_irt() argument
1000 cmd->data[0] = devid; in build_inv_irt()
1095 static int iommu_flush_dte(struct amd_iommu *iommu, u16 devid) in iommu_flush_dte() argument
1099 build_inv_dte(&cmd, devid); in iommu_flush_dte()
1106 u32 devid; in amd_iommu_flush_dte_all() local
1108 for (devid = 0; devid <= 0xffff; ++devid) in amd_iommu_flush_dte_all()
1109 iommu_flush_dte(iommu, devid); in amd_iommu_flush_dte_all()
1153 static void iommu_flush_irt(struct amd_iommu *iommu, u16 devid) in iommu_flush_irt() argument
1157 build_inv_irt(&cmd, devid); in iommu_flush_irt()
1164 u32 devid; in amd_iommu_flush_irt_all() local
1166 for (devid = 0; devid <= MAX_DEV_TABLE_ENTRIES; devid++) in amd_iommu_flush_irt_all()
1167 iommu_flush_irt(iommu, devid); in amd_iommu_flush_irt_all()
1194 iommu = amd_iommu_rlookup_table[dev_data->devid]; in device_flush_iotlb()
1196 build_inv_iotlb_pages(&cmd, dev_data->devid, qdep, address, size); in device_flush_iotlb()
1217 iommu = amd_iommu_rlookup_table[dev_data->devid]; in device_flush_dte()
1223 ret = iommu_flush_dte(iommu, dev_data->devid); in device_flush_dte()
1227 alias = amd_iommu_alias_table[dev_data->devid]; in device_flush_dte()
1228 if (alias != dev_data->devid) { in device_flush_dte()
1443 static void set_dte_entry(u16 devid, struct protection_domain *domain, in set_dte_entry() argument
1457 flags = amd_iommu_dev_table[devid].data[1]; in set_dte_entry()
1463 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; in set_dte_entry()
1498 old_domid = amd_iommu_dev_table[devid].data[1] & DEV_DOMID_MASK; in set_dte_entry()
1499 amd_iommu_dev_table[devid].data[1] = flags; in set_dte_entry()
1500 amd_iommu_dev_table[devid].data[0] = pte_root; in set_dte_entry()
1508 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; in set_dte_entry()
1514 static void clear_dte_entry(u16 devid) in clear_dte_entry() argument
1517 amd_iommu_dev_table[devid].data[0] = DTE_FLAG_V | DTE_FLAG_TV; in clear_dte_entry()
1518 amd_iommu_dev_table[devid].data[1] &= DTE_FLAG_MASK; in clear_dte_entry()
1520 amd_iommu_apply_erratum_63(devid); in clear_dte_entry()
1529 iommu = amd_iommu_rlookup_table[dev_data->devid]; in do_attach()
1541 set_dte_entry(dev_data->devid, domain, in do_attach()
1553 iommu = amd_iommu_rlookup_table[dev_data->devid]; in do_detach()
1558 clear_dte_entry(dev_data->devid); in do_detach()
1733 int ret, devid; in amd_iommu_probe_device() local
1738 devid = get_device_id(dev); in amd_iommu_probe_device()
1739 iommu = amd_iommu_rlookup_table[devid]; in amd_iommu_probe_device()
1769 int devid = get_device_id(dev); in amd_iommu_release_device() local
1775 iommu = amd_iommu_rlookup_table[devid]; in amd_iommu_release_device()
1800 set_dte_entry(dev_data->devid, domain, in update_device_table()
1988 int devid = get_device_id(dev); in amd_iommu_detach_device() local
1997 iommu = amd_iommu_rlookup_table[devid]; in amd_iommu_detach_device()
2024 iommu = amd_iommu_rlookup_table[dev_data->devid]; in amd_iommu_attach_device()
2151 int devid; in amd_iommu_get_resv_regions() local
2153 devid = get_device_id(dev); in amd_iommu_get_resv_regions()
2154 if (devid < 0) in amd_iommu_get_resv_regions()
2161 if (devid < entry->devid_start || devid > entry->devid_end) in amd_iommu_get_resv_regions()
2393 iommu = amd_iommu_rlookup_table[dev_data->devid]; in __flush_pasid()
2395 build_inv_iotlb_pasid(&cmd, dev_data->devid, pasid, in __flush_pasid()
2556 iommu = amd_iommu_rlookup_table[dev_data->devid]; in amd_iommu_complete_ppr()
2558 build_complete_ppr(&cmd, dev_data->devid, pasid, status, in amd_iommu_complete_ppr()
2618 static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) in set_dte_irq_entry() argument
2622 dte = amd_iommu_dev_table[devid].data[2]; in set_dte_irq_entry()
2629 amd_iommu_dev_table[devid].data[2] = dte; in set_dte_irq_entry()
2632 static struct irq_remap_table *get_irq_table(u16 devid) in get_irq_table() argument
2636 if (WARN_ONCE(!amd_iommu_rlookup_table[devid], in get_irq_table()
2637 "%s: no iommu for devid %x\n", __func__, devid)) in get_irq_table()
2640 table = irq_lookup_table[devid]; in get_irq_table()
2641 if (WARN_ONCE(!table, "%s: no table for devid %x\n", __func__, devid)) in get_irq_table()
2671 static void set_remap_table_entry(struct amd_iommu *iommu, u16 devid, in set_remap_table_entry() argument
2674 irq_lookup_table[devid] = table; in set_remap_table_entry()
2675 set_dte_irq_entry(devid, table); in set_remap_table_entry()
2676 iommu_flush_dte(iommu, devid); in set_remap_table_entry()
2692 static struct irq_remap_table *alloc_irq_table(u16 devid, struct pci_dev *pdev) in alloc_irq_table() argument
2702 iommu = amd_iommu_rlookup_table[devid]; in alloc_irq_table()
2706 table = irq_lookup_table[devid]; in alloc_irq_table()
2710 alias = amd_iommu_alias_table[devid]; in alloc_irq_table()
2713 set_remap_table_entry(iommu, devid, table); in alloc_irq_table()
2725 table = irq_lookup_table[devid]; in alloc_irq_table()
2731 set_remap_table_entry(iommu, devid, table); in alloc_irq_table()
2742 set_remap_table_entry(iommu, devid, table); in alloc_irq_table()
2744 if (devid != alias) in alloc_irq_table()
2760 static int alloc_irq_index(u16 devid, int count, bool align, in alloc_irq_index() argument
2766 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; in alloc_irq_index()
2771 table = alloc_irq_table(devid, pdev); in alloc_irq_index()
2810 static int modify_irte_ga(u16 devid, int index, struct irte_ga *irte, in modify_irte_ga() argument
2819 iommu = amd_iommu_rlookup_table[devid]; in modify_irte_ga()
2823 table = get_irq_table(devid); in modify_irte_ga()
2848 iommu_flush_irt(iommu, devid); in modify_irte_ga()
2854 static int modify_irte(u16 devid, int index, union irte *irte) in modify_irte() argument
2860 iommu = amd_iommu_rlookup_table[devid]; in modify_irte()
2864 table = get_irq_table(devid); in modify_irte()
2872 iommu_flush_irt(iommu, devid); in modify_irte()
2878 static void free_irte(u16 devid, int index) in free_irte() argument
2884 iommu = amd_iommu_rlookup_table[devid]; in free_irte()
2888 table = get_irq_table(devid); in free_irte()
2896 iommu_flush_irt(iommu, devid); in free_irte()
2902 u8 vector, u32 dest_apicid, int devid) in irte_prepare() argument
2916 u8 vector, u32 dest_apicid, int devid) in irte_ga_prepare() argument
2930 static void irte_activate(void *entry, u16 devid, u16 index) in irte_activate() argument
2935 modify_irte(devid, index, irte); in irte_activate()
2938 static void irte_ga_activate(void *entry, u16 devid, u16 index) in irte_ga_activate() argument
2943 modify_irte_ga(devid, index, irte, NULL); in irte_ga_activate()
2946 static void irte_deactivate(void *entry, u16 devid, u16 index) in irte_deactivate() argument
2951 modify_irte(devid, index, irte); in irte_deactivate()
2954 static void irte_ga_deactivate(void *entry, u16 devid, u16 index) in irte_ga_deactivate() argument
2959 modify_irte_ga(devid, index, irte, NULL); in irte_ga_deactivate()
2962 static void irte_set_affinity(void *entry, u16 devid, u16 index, in irte_set_affinity() argument
2969 modify_irte(devid, index, irte); in irte_set_affinity()
2972 static void irte_ga_set_affinity(void *entry, u16 devid, u16 index, in irte_ga_set_affinity() argument
2983 modify_irte_ga(devid, index, irte, NULL); in irte_ga_set_affinity()
3037 return get_ioapic_devid(info->devid); in get_devid()
3039 return get_hpet_devid(info->devid); in get_devid()
3068 int devid, int index, int sub_handle) in irq_remapping_prepare_irte() argument
3071 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; in irq_remapping_prepare_irte()
3076 data->irq_2_irte.devid = devid; in irq_remapping_prepare_irte()
3080 irq_cfg->dest_apicid, devid); in irq_remapping_prepare_irte()
3123 int i, ret, devid; in irq_remapping_alloc() local
3139 devid = get_devid(info); in irq_remapping_alloc()
3140 if (devid < 0) in irq_remapping_alloc()
3151 table = alloc_irq_table(devid, NULL); in irq_remapping_alloc()
3159 iommu = amd_iommu_rlookup_table[devid]; in irq_remapping_alloc()
3172 index = alloc_irq_index(devid, nr_irqs, align, in irq_remapping_alloc()
3175 index = alloc_irq_index(devid, nr_irqs, false, NULL); in irq_remapping_alloc()
3207 irq_data->hwirq = (devid << 16) + i; in irq_remapping_alloc()
3210 irq_remapping_prepare_irte(data, cfg, info, devid, index, i); in irq_remapping_alloc()
3223 free_irte(devid, index + i); in irq_remapping_alloc()
3242 free_irte(irte_info->devid, irte_info->index); in irq_remapping_free()
3260 struct amd_iommu *iommu = amd_iommu_rlookup_table[irte_info->devid]; in irq_remapping_activate()
3266 iommu->irte_ops->activate(data->entry, irte_info->devid, in irq_remapping_activate()
3277 struct amd_iommu *iommu = amd_iommu_rlookup_table[irte_info->devid]; in irq_remapping_deactivate()
3280 iommu->irte_ops->deactivate(data->entry, irte_info->devid, in irq_remapping_deactivate()
3288 int devid = -1; in irq_remapping_select() local
3294 devid = get_ioapic_devid(fwspec->param[0]); in irq_remapping_select()
3296 devid = get_hpet_devid(fwspec->param[0]); in irq_remapping_select()
3298 if (devid < 0) in irq_remapping_select()
3301 iommu = amd_iommu_rlookup_table[devid]; in irq_remapping_select()
3334 return modify_irte_ga(ir_data->irq_2_irte.devid, in amd_iommu_activate_guest_mode()
3364 return modify_irte_ga(ir_data->irq_2_irte.devid, in amd_iommu_deactivate_guest_mode()
3377 struct iommu_dev_data *dev_data = search_dev_data(irte_info->devid); in amd_ir_set_vcpu_affinity()
3399 iommu = amd_iommu_rlookup_table[irte_info->devid]; in amd_ir_set_vcpu_affinity()
3436 iommu->irte_ops->set_affinity(ir_data->entry, irte_info->devid, in amd_ir_update_irte()
3448 struct amd_iommu *iommu = amd_iommu_rlookup_table[irte_info->devid]; in amd_ir_set_affinity()
3510 int devid = ir_data->irq_2_irte.devid; in amd_iommu_update_ga() local
3518 iommu = amd_iommu_rlookup_table[devid]; in amd_iommu_update_ga()
3522 table = get_irq_table(devid); in amd_iommu_update_ga()
3541 iommu_flush_irt(iommu, devid); in amd_iommu_update_ga()