Lines Matching defs:device
159 * @dte_esz: device table entry size
207 * Find and returns a device in the device table for an ITS.
212 struct its_device *device;
214 list_for_each_entry(device, &its->device_list, dev_list)
215 if (device_id == device->device_id)
216 return device;
229 struct its_device *device;
232 device = find_its_device(its, device_id);
233 if (device == NULL)
236 list_for_each_entry(ite, &device->itt_head, ite_list)
405 struct its_device *device;
408 for_each_lpi_its(device, ite, its) {
993 * Translation Table, which starts at device->itt_addr.
995 static bool vgic_its_check_event_id(struct vgic_its *its, struct its_device *device,
1002 /* max table size is: BIT_ULL(device->num_eventid_bits) * ite_esz */
1003 if (event_id >= BIT_ULL(device->num_eventid_bits))
1006 gpa = device->itt_addr + event_id * ite_esz;
1036 struct its_device *device;
1048 for_each_lpi_its(device, ite, its)
1058 static struct its_ite *vgic_its_alloc_ite(struct its_device *device,
1071 list_add_tail(&ite->ite_list, &device->itt_head);
1087 struct its_device *device;
1092 device = find_its_device(its, device_id);
1093 if (!device)
1096 if (!vgic_its_check_event_id(its, device, event_id))
1124 ite = vgic_its_alloc_ite(device, collection, event_id);
1147 static void vgic_its_free_device(struct kvm *kvm, struct its_device *device)
1152 * The spec says that unmapping a device with still valid
1156 list_for_each_entry_safe(ite, temp, &device->itt_head, ite_list)
1161 list_del(&device->dev_list);
1162 kfree(device);
1188 struct its_device *device;
1190 device = kzalloc(sizeof(*device), GFP_KERNEL_ACCOUNT);
1191 if (!device)
1194 device->device_id = device_id;
1195 device->itt_addr = itt_addr;
1196 device->num_eventid_bits = num_eventid_bits;
1197 INIT_LIST_HEAD(&device->itt_head);
1199 list_add_tail(&device->dev_list, &its->device_list);
1200 return device;
1204 * MAPD maps or unmaps a device ID to Interrupt Translation Tables (ITTs).
1214 struct its_device *device;
1222 device = find_its_device(its, device_id);
1225 * The spec says that calling MAPD on an already mapped device
1226 * invalidates all cached data for this device. We implement this
1229 if (device)
1230 vgic_its_free_device(kvm, device);
1233 * The spec does not say whether unmapping a not-mapped device
1239 device = vgic_its_alloc_device(its, device_id, itt_addr,
1242 return PTR_ERR_OR_ZERO(device);
1784 * device/collection BASER are invalid
2295 static int vgic_its_save_itt(struct vgic_its *its, struct its_device *device)
2298 gpa_t base = device->itt_addr;
2303 list_sort(NULL, &device->itt_head, vgic_its_ite_cmp);
2305 list_for_each_entry(ite, &device->itt_head, ite_list) {
2317 ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz);
2325 * vgic_its_restore_itt - restore the ITT of a device
2328 * @dev: device handle
2351 * vgic_its_save_dte - Save a device table entry at a given GPA
2354 * @dev: ITS device
2375 * vgic_its_restore_dte - restore a device table entry
2378 * @id: device id the DTE corresponds to
2439 * vgic_its_save_device_tables - Save the device table and all ITT
2443 * returns the GPA of the device entry
2477 * handle_l1_dte - callback used for L1 device table entries (2 stage case)
2512 * vgic_its_restore_device_tables - Restore the device table and all ITT