Lines Matching refs:devid
109 u16 devid; member
127 u16 devid; member
145 u16 devid; member
286 static inline void update_last_devid(u16 devid) in update_last_devid() argument
288 if (devid > amd_iommu_last_bdf) in update_last_devid()
289 amd_iommu_last_bdf = devid; in update_last_devid()
583 update_last_devid(dev->devid); in find_last_devid_from_ivhd()
919 static void set_dev_entry_bit(u16 devid, u8 bit) in set_dev_entry_bit() argument
924 amd_iommu_dev_table[devid].data[i] |= (1UL << _bit); in set_dev_entry_bit()
927 static int get_dev_entry_bit(u16 devid, u8 bit) in get_dev_entry_bit() argument
932 return (amd_iommu_dev_table[devid].data[i] & (1UL << _bit)) >> _bit; in get_dev_entry_bit()
940 u32 lo, hi, devid, old_devtb_size; in copy_device_table() local
998 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) { in copy_device_table()
999 old_dev_tbl_cpy[devid] = old_devtb[devid]; in copy_device_table()
1000 dom_id = old_devtb[devid].data[1] & DEV_DOMID_MASK; in copy_device_table()
1001 dte_v = old_devtb[devid].data[0] & DTE_FLAG_V; in copy_device_table()
1004 old_dev_tbl_cpy[devid].data[0] = old_devtb[devid].data[0]; in copy_device_table()
1005 old_dev_tbl_cpy[devid].data[1] = old_devtb[devid].data[1]; in copy_device_table()
1008 if (old_devtb[devid].data[0] & DTE_FLAG_GV) { in copy_device_table()
1011 old_dev_tbl_cpy[devid].data[1] &= ~tmp; in copy_device_table()
1014 old_dev_tbl_cpy[devid].data[0] &= ~tmp; in copy_device_table()
1018 irq_v = old_devtb[devid].data[2] & DTE_IRQ_REMAP_ENABLE; in copy_device_table()
1019 int_ctl = old_devtb[devid].data[2] & DTE_IRQ_REMAP_INTCTL_MASK; in copy_device_table()
1020 int_tab_len = old_devtb[devid].data[2] & DTE_INTTABLEN_MASK; in copy_device_table()
1024 pr_err("Wrong old irq remapping flag: %#x\n", devid); in copy_device_table()
1028 old_dev_tbl_cpy[devid].data[2] = old_devtb[devid].data[2]; in copy_device_table()
1036 void amd_iommu_apply_erratum_63(u16 devid) in amd_iommu_apply_erratum_63() argument
1040 sysmgt = get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1) | in amd_iommu_apply_erratum_63()
1041 (get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2) << 1); in amd_iommu_apply_erratum_63()
1044 set_dev_entry_bit(devid, DEV_ENTRY_IW); in amd_iommu_apply_erratum_63()
1048 static void __init set_iommu_for_device(struct amd_iommu *iommu, u16 devid) in set_iommu_for_device() argument
1050 amd_iommu_rlookup_table[devid] = iommu; in set_iommu_for_device()
1058 u16 devid, u32 flags, u32 ext_flags) in set_dev_entry_from_acpi() argument
1061 set_dev_entry_bit(devid, DEV_ENTRY_INIT_PASS); in set_dev_entry_from_acpi()
1063 set_dev_entry_bit(devid, DEV_ENTRY_EINT_PASS); in set_dev_entry_from_acpi()
1065 set_dev_entry_bit(devid, DEV_ENTRY_NMI_PASS); in set_dev_entry_from_acpi()
1067 set_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1); in set_dev_entry_from_acpi()
1069 set_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2); in set_dev_entry_from_acpi()
1071 set_dev_entry_bit(devid, DEV_ENTRY_LINT0_PASS); in set_dev_entry_from_acpi()
1073 set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS); in set_dev_entry_from_acpi()
1075 amd_iommu_apply_erratum_63(devid); in set_dev_entry_from_acpi()
1077 set_iommu_for_device(iommu, devid); in set_dev_entry_from_acpi()
1080 int __init add_special_device(u8 type, u8 id, u16 *devid, bool cmd_line) in add_special_device() argument
1099 *devid = entry->devid; in add_special_device()
1109 entry->devid = *devid; in add_special_device()
1117 static int __init add_acpi_hid_device(u8 *hid, u8 *uid, u16 *devid, in add_acpi_hid_device() argument
1131 *devid = entry->devid; in add_acpi_hid_device()
1141 entry->devid = *devid; in add_acpi_hid_device()
1143 entry->root_devid = (entry->devid & (~0x7)); in add_acpi_hid_device()
1160 &early_ioapic_map[i].devid, in add_early_maps()
1169 &early_hpet_map[i].devid, in add_early_maps()
1178 &early_acpihid_map[i].devid, in add_early_maps()
1196 u16 devid = 0, devid_start = 0, devid_to = 0; in init_iommu_from_acpi() local
1243 PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1244 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1245 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1248 devid = e->devid; in init_iommu_from_acpi()
1249 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); in init_iommu_from_acpi()
1255 PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1256 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1257 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1260 devid_start = e->devid; in init_iommu_from_acpi()
1269 PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1270 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1271 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1277 devid = e->devid; in init_iommu_from_acpi()
1279 set_dev_entry_from_acpi(iommu, devid , e->flags, 0); in init_iommu_from_acpi()
1281 amd_iommu_alias_table[devid] = devid_to; in init_iommu_from_acpi()
1288 PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1289 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1290 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1296 devid_start = e->devid; in init_iommu_from_acpi()
1306 PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1307 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1308 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1311 devid = e->devid; in init_iommu_from_acpi()
1312 set_dev_entry_from_acpi(iommu, devid, e->flags, in init_iommu_from_acpi()
1319 PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1320 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1321 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1324 devid_start = e->devid; in init_iommu_from_acpi()
1332 PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1333 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1334 PCI_FUNC(e->devid)); in init_iommu_from_acpi()
1336 devid = e->devid; in init_iommu_from_acpi()
1337 for (dev_i = devid_start; dev_i <= devid; ++dev_i) { in init_iommu_from_acpi()
1350 u16 devid; in init_iommu_from_acpi() local
1354 devid = (e->ext >> 8) & 0xffff; in init_iommu_from_acpi()
1366 PCI_BUS_NUM(devid), in init_iommu_from_acpi()
1367 PCI_SLOT(devid), in init_iommu_from_acpi()
1368 PCI_FUNC(devid)); in init_iommu_from_acpi()
1370 ret = add_special_device(type, handle, &devid, false); in init_iommu_from_acpi()
1379 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); in init_iommu_from_acpi()
1384 u16 devid; in init_iommu_from_acpi() local
1426 devid = e->devid; in init_iommu_from_acpi()
1429 PCI_BUS_NUM(devid), in init_iommu_from_acpi()
1430 PCI_SLOT(devid), in init_iommu_from_acpi()
1431 PCI_FUNC(devid)); in init_iommu_from_acpi()
1435 ret = add_acpi_hid_device(hid, uid, &devid, false); in init_iommu_from_acpi()
1444 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); in init_iommu_from_acpi()
1564 iommu->devid = h->devid; in init_iommu_one()
1656 amd_iommu_rlookup_table[iommu->devid] = NULL; in init_iommu_one()
1673 u16 devid = ivhd->devid; in get_highest_supported_ivhd_type() local
1679 if (ivhd->devid == devid) in get_highest_supported_ivhd_type()
1707 PCI_BUS_NUM(h->devid), PCI_SLOT(h->devid), in init_iommu_all()
1708 PCI_FUNC(h->devid), h->cap_ptr, in init_iommu_all()
1816 iommu->dev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(iommu->devid), in iommu_init_pci()
1817 iommu->devid & 0xff); in iommu_init_pci()
2265 e->devid_start = e->devid_end = m->devid; in init_unity_map_range()
2274 e->devid_start = m->devid; in init_unity_map_range()
2329 u32 devid; in init_device_table_dma() local
2331 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) { in init_device_table_dma()
2332 set_dev_entry_bit(devid, DEV_ENTRY_VALID); in init_device_table_dma()
2333 set_dev_entry_bit(devid, DEV_ENTRY_TRANSLATION); in init_device_table_dma()
2339 u32 devid; in uninit_device_table_dma() local
2341 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) { in uninit_device_table_dma()
2342 amd_iommu_dev_table[devid].data[0] = 0ULL; in uninit_device_table_dma()
2343 amd_iommu_dev_table[devid].data[1] = 0ULL; in uninit_device_table_dma()
2349 u32 devid; in init_device_table() local
2354 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) in init_device_table()
2355 set_dev_entry_bit(devid, DEV_ENTRY_IRQ_TBL_EN); in init_device_table()
2627 int devid, id = mpc_ioapic_id(idx); in check_ioapic_information() local
2629 devid = get_ioapic_devid(id); in check_ioapic_information()
2630 if (devid < 0) { in check_ioapic_information()
2634 } else if (devid == IOAPIC_SB_DEVID) { in check_ioapic_information()
3155 u32 devid; in parse_ivrs_ioapic() local
3178 devid = IVRS_GET_SBDF_ID(seg, bus, dev, fn); in parse_ivrs_ioapic()
3183 early_ioapic_map[i].devid = devid; in parse_ivrs_ioapic()
3193 u32 devid; in parse_ivrs_hpet() local
3216 devid = IVRS_GET_SBDF_ID(seg, bus, dev, fn); in parse_ivrs_hpet()
3221 early_hpet_map[i].devid = devid; in parse_ivrs_hpet()
3293 early_acpihid_map[i].devid = IVRS_GET_SBDF_ID(seg, bus, dev, fn); in parse_ivrs_acpihid()