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) {
1009 struct its_device *device;
1021 for_each_lpi_its(device, ite, its)
1031 static struct its_ite *vgic_its_alloc_ite(struct its_device *device,
1044 list_add_tail(&ite->ite_list, &device->itt_head);
1060 struct its_device *device;
1065 device = find_its_device(its, device_id);
1066 if (!device)
1069 if (event_id >= BIT_ULL(device->num_eventid_bits))
1092 ite = vgic_its_alloc_ite(device, collection, event_id);
1115 static void vgic_its_free_device(struct kvm *kvm, struct its_device *device)
1120 * The spec says that unmapping a device with still valid
1124 list_for_each_entry_safe(ite, temp, &device->itt_head, ite_list)
1129 list_del(&device->dev_list);
1130 kfree(device);
1156 struct its_device *device;
1158 device = kzalloc(sizeof(*device), GFP_KERNEL);
1159 if (!device)
1162 device->device_id = device_id;
1163 device->itt_addr = itt_addr;
1164 device->num_eventid_bits = num_eventid_bits;
1165 INIT_LIST_HEAD(&device->itt_head);
1167 list_add_tail(&device->dev_list, &its->device_list);
1168 return device;
1172 * MAPD maps or unmaps a device ID to Interrupt Translation Tables (ITTs).
1182 struct its_device *device;
1190 device = find_its_device(its, device_id);
1193 * The spec says that calling MAPD on an already mapped device
1194 * invalidates all cached data for this device. We implement this
1197 if (device)
1198 vgic_its_free_device(kvm, device);
1201 * The spec does not say whether unmapping a not-mapped device
1207 device = vgic_its_alloc_device(its, device_id, itt_addr,
1210 return PTR_ERR_OR_ZERO(device);
1726 * device/collection BASER are invalid
2213 static int vgic_its_save_itt(struct vgic_its *its, struct its_device *device)
2216 gpa_t base = device->itt_addr;
2221 list_sort(NULL, &device->itt_head, vgic_its_ite_cmp);
2223 list_for_each_entry(ite, &device->itt_head, ite_list) {
2235 ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz);
2243 * vgic_its_restore_itt - restore the ITT of a device
2246 * @dev: device handle
2269 * vgic_its_save_dte - Save a device table entry at a given GPA
2272 * @dev: ITS device
2293 * vgic_its_restore_dte - restore a device table entry
2296 * @id: device id the DTE corresponds to
2353 * vgic_its_save_device_tables - Save the device table and all ITT
2357 * returns the GPA of the device entry
2391 * handle_l1_dte - callback used for L1 device table entries (2 stage case)
2426 * vgic_its_restore_device_tables - Restore the device table and all ITT