Lines Matching full:apid
710 * driver, its APID will be filtered from the guest's APCB. The matrix
711 * structure precludes filtering an individual APQN, so its APID will be
723 unsigned long apid, apqi, apqn; in vfio_ap_mdev_filter_matrix() local
742 for_each_set_bit_inv(apid, matrix_mdev->shadow_apcb.apm, AP_DEVICES) { in vfio_ap_mdev_filter_matrix()
750 * the APID since an adapter represents a physical in vfio_ap_mdev_filter_matrix()
753 apqn = AP_MKQID(apid, apqi); in vfio_ap_mdev_filter_matrix()
755 clear_bit_inv(apid, matrix_mdev->shadow_apcb.apm); in vfio_ap_mdev_filter_matrix()
760 * the APID was filtered. in vfio_ap_mdev_filter_matrix()
762 if (test_bit_inv(apid, prev_shadow_apm)) in vfio_ap_mdev_filter_matrix()
763 set_bit_inv(apid, apm_filtered); in vfio_ap_mdev_filter_matrix()
847 unsigned long apid, apqi; in vfio_ap_mdev_unlink_fr_queues() local
849 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) { in vfio_ap_mdev_unlink_fr_queues()
853 AP_MKQID(apid, apqi)); in vfio_ap_mdev_unlink_fr_queues()
884 unsigned long apid, apqi; in vfio_ap_mdev_log_sharing_err() local
886 for_each_set_bit_inv(apid, apm, AP_DEVICES) { in vfio_ap_mdev_log_sharing_err()
889 apid, apqi, dev_name(mdev_dev(assigned_to->mdev))); in vfio_ap_mdev_log_sharing_err()
897 unsigned long apid, apqi; in vfio_ap_mdev_log_in_use_err() local
899 for_each_set_bit_inv(apid, apm, AP_DEVICES) { in vfio_ap_mdev_log_in_use_err()
901 dev_warn(mdev_dev(assignee->mdev), MDEV_IN_USE_ERR, apid, apqi); in vfio_ap_mdev_log_in_use_err()
989 unsigned long apid) in vfio_ap_mdev_link_adapter() argument
995 AP_MKQID(apid, apqi)); in vfio_ap_mdev_link_adapter()
999 unsigned long apid, in collect_queues_to_reset() argument
1006 q = vfio_ap_mdev_get_queue(matrix_mdev, AP_MKQID(apid, apqi)); in collect_queues_to_reset()
1013 unsigned long apid) in reset_queues_for_apid() argument
1018 collect_queues_to_reset(matrix_mdev, apid, &qlist); in reset_queues_for_apid()
1026 unsigned long apid; in reset_queues_for_apids() local
1033 for_each_set_bit_inv(apid, apm_reset, AP_DEVICES) in reset_queues_for_apids()
1034 collect_queues_to_reset(matrix_mdev, apid, &qlist); in reset_queues_for_apids()
1040 * assign_adapter_store - parses the APID from @buf and sets the
1045 * @buf: a buffer containing the AP adapter number (APID) to
1049 * Return: the number of bytes processed if the APID is valid; otherwise,
1053 * The APID is not a valid number
1056 * The APID exceeds the maximum value configured for the system
1059 * An APQN derived from the cross product of the APID being assigned
1061 * driver; or, if no APQIs have yet been assigned, the APID is not
1065 * An APQN derived from the cross product of the APID being assigned
1078 unsigned long apid; in assign_adapter_store() local
1085 ret = kstrtoul(buf, 0, &apid); in assign_adapter_store()
1089 if (apid > matrix_mdev->matrix.apm_max) { in assign_adapter_store()
1094 if (test_bit_inv(apid, matrix_mdev->matrix.apm)) { in assign_adapter_store()
1099 set_bit_inv(apid, matrix_mdev->matrix.apm); in assign_adapter_store()
1103 clear_bit_inv(apid, matrix_mdev->matrix.apm); in assign_adapter_store()
1107 vfio_ap_mdev_link_adapter(matrix_mdev, apid); in assign_adapter_store()
1125 unsigned long apid, unsigned long apqi) in vfio_ap_unlink_apqn_fr_mdev() argument
1129 q = vfio_ap_mdev_get_queue(matrix_mdev, AP_MKQID(apid, apqi)); in vfio_ap_unlink_apqn_fr_mdev()
1142 * @apid: the APID of the unassigned adapter.
1147 unsigned long apid, in vfio_ap_mdev_unlink_adapter() argument
1154 q = vfio_ap_unlink_apqn_fr_mdev(matrix_mdev, apid, apqi); in vfio_ap_mdev_unlink_adapter()
1157 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in vfio_ap_mdev_unlink_adapter()
1169 unsigned long apid; in vfio_ap_mdev_hot_unplug_adapters() local
1174 for_each_set_bit_inv(apid, apids, AP_DEVICES) { in vfio_ap_mdev_hot_unplug_adapters()
1175 vfio_ap_mdev_unlink_adapter(matrix_mdev, apid, &qlist); in vfio_ap_mdev_hot_unplug_adapters()
1177 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm)) { in vfio_ap_mdev_hot_unplug_adapters()
1178 clear_bit_inv(apid, matrix_mdev->shadow_apcb.apm); in vfio_ap_mdev_hot_unplug_adapters()
1196 unsigned long apid) in vfio_ap_mdev_hot_unplug_adapter() argument
1201 set_bit_inv(apid, apids); in vfio_ap_mdev_hot_unplug_adapter()
1206 * unassign_adapter_store - parses the APID from @buf and clears the
1211 * @buf: a buffer containing the adapter number (APID) to be unassigned
1214 * Return: the number of bytes processed if the APID is valid; otherwise,
1216 * -EINVAL if the APID is not a number
1217 * -ENODEV if the APID it exceeds the maximum value configured for the
1225 unsigned long apid; in unassign_adapter_store() local
1230 ret = kstrtoul(buf, 0, &apid); in unassign_adapter_store()
1234 if (apid > matrix_mdev->matrix.apm_max) { in unassign_adapter_store()
1239 if (!test_bit_inv(apid, matrix_mdev->matrix.apm)) { in unassign_adapter_store()
1244 clear_bit_inv((unsigned long)apid, matrix_mdev->matrix.apm); in unassign_adapter_store()
1245 vfio_ap_mdev_hot_unplug_adapter(matrix_mdev, apid); in unassign_adapter_store()
1256 unsigned long apid; in vfio_ap_mdev_link_domain() local
1258 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) in vfio_ap_mdev_link_domain()
1260 AP_MKQID(apid, apqi)); in vfio_ap_mdev_link_domain()
1351 unsigned long apid; in vfio_ap_mdev_unlink_domain() local
1354 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) { in vfio_ap_mdev_unlink_domain()
1355 q = vfio_ap_unlink_apqn_fr_mdev(matrix_mdev, apid, apqi); in vfio_ap_mdev_unlink_domain()
1358 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in vfio_ap_mdev_unlink_domain()
1581 unsigned long apid; in vfio_ap_mdev_matrix_show() local
1593 for_each_set_bit_inv(apid, matrix->apm, napm_bits) { in vfio_ap_mdev_matrix_show()
1595 nchars += sysfs_emit_at(buf, nchars, "%02lx.%04lx\n", apid, apqi); in vfio_ap_mdev_matrix_show()
1598 for_each_set_bit_inv(apid, matrix->apm, napm_bits) in vfio_ap_mdev_matrix_show()
1599 nchars += sysfs_emit_at(buf, nchars, "%02lx.\n", apid); in vfio_ap_mdev_matrix_show()
2297 unsigned long apid = AP_QID_CARD(q->apqn); in vfio_ap_mdev_for_queue() local
2301 if (test_bit_inv(apid, matrix_mdev->matrix.apm) && in vfio_ap_mdev_for_queue()
2315 unsigned long apid, apqi; in status_show() local
2328 apid = AP_QID_CARD(q->apqn); in status_show()
2336 test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in status_show()
2472 unsigned long apid, apqi; in vfio_ap_mdev_remove_queue() local
2480 apid = AP_QID_CARD(q->apqn); in vfio_ap_mdev_remove_queue()
2485 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in vfio_ap_mdev_remove_queue()
2492 clear_bit_inv(apid, matrix_mdev->shadow_apcb.apm); in vfio_ap_mdev_remove_queue()
2494 reset_queues_for_apid(matrix_mdev, apid); in vfio_ap_mdev_remove_queue()
2504 if (test_bit_inv(apid, (unsigned long *)matrix_dev->info.apm) && in vfio_ap_mdev_remove_queue()
2674 unsigned long apid, apqi; in vfio_ap_filter_apid_by_qtype() local
2677 for_each_set_bit_inv(apid, apm, AP_DEVICES) { in vfio_ap_filter_apid_by_qtype()
2681 status = ap_test_queue(AP_MKQID(apid, apqi), 1, &info); in vfio_ap_filter_apid_by_qtype()
2695 * remove the APID if the adapter is in vfio_ap_filter_apid_by_qtype()
2699 clear_bit_inv(apid, apm); in vfio_ap_filter_apid_by_qtype()
2708 * clear its APID since it can't be in vfio_ap_filter_apid_by_qtype()
2712 clear_bit_inv(apid, apm); in vfio_ap_filter_apid_by_qtype()
2718 * If we've already cleared the APID from the apm, there in vfio_ap_filter_apid_by_qtype()