Lines Matching defs:matrix
3 * Adjunct processor matrix VFIO device driver callbacks.
157 if (test_bit_inv(AP_QID_CARD(apqn), matrix_mdev->matrix.apm) &&
158 test_bit_inv(AP_QID_QUEUE(apqn), matrix_mdev->matrix.aqm)) {
175 * KVM guest to which the matrix mdev linked to a
199 * hash table of queues assigned to a matrix mdev
200 * @matrix_mdev: the matrix mdev
631 struct ap_matrix *matrix)
633 matrix->apm_max = info->apxa ? info->na : 63;
634 matrix->aqm_max = info->apxa ? info->nd : 15;
635 matrix->adm_max = info->apxa ? info->nd : 15;
652 bitmap_and(matrix_mdev->shadow_apcb.adm, matrix_mdev->matrix.adm,
660 * vfio_ap_mdev_filter_matrix - filter the APQNs assigned to the matrix mdev
665 * @matrix_mdev: the matrix mdev whose matrix is to be filtered.
671 * driver, its APID will be filtered from the guest's APCB. The matrix
696 * from the matrix mdev, but only those that are assigned to the host's
699 bitmap_and(matrix_mdev->shadow_apcb.apm, matrix_mdev->matrix.apm,
701 bitmap_and(matrix_mdev->shadow_apcb.aqm, matrix_mdev->matrix.aqm,
745 vfio_ap_matrix_init(&matrix_dev->info, &matrix_mdev->matrix);
810 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) {
811 for_each_set_bit_inv(apqi, matrix_mdev->matrix.aqm,
854 * vfio_ap_mdev_verify_no_sharing - verify APQNs are not shared by matrix mdevs
860 * AP adapter IDs and AP queue indexes is not configured for any matrix
877 if (mdev_apm == matrix_mdev->matrix.apm &&
878 mdev_aqm == matrix_mdev->matrix.aqm)
888 if (!bitmap_and(apm, mdev_apm, matrix_mdev->matrix.apm,
892 if (!bitmap_and(aqm, mdev_aqm, matrix_mdev->matrix.aqm,
921 if (ap_apqn_in_matrix_owned_by_def_drv(matrix_mdev->matrix.apm,
922 matrix_mdev->matrix.aqm))
925 return vfio_ap_mdev_verify_no_sharing(matrix_mdev->matrix.apm,
926 matrix_mdev->matrix.aqm);
934 for_each_set_bit_inv(apqi, matrix_mdev->matrix.aqm, AP_DOMAINS)
982 * corresponding bit in the mediated matrix device's APM
984 * @dev: the matrix device
985 * @attr: the mediated matrix device's assign_adapter attribute
1008 * matrix device
1030 if (apid > matrix_mdev->matrix.apm_max) {
1035 if (test_bit_inv(apid, matrix_mdev->matrix.apm)) {
1040 set_bit_inv(apid, matrix_mdev->matrix.apm);
1044 clear_bit_inv(apid, matrix_mdev->matrix.apm);
1071 /* If the queue is assigned to the matrix mdev, unlink it. */
1080 * adapter from the matrix mdev to which the
1082 * @matrix_mdev: the matrix mediated device to which the adapter was assigned.
1094 for_each_set_bit_inv(apqi, matrix_mdev->matrix.aqm, AP_DOMAINS) {
1129 * corresponding bit in the mediated matrix device's APM
1131 * @dev: the matrix device
1132 * @attr: the mediated matrix device's unassign_adapter attribute
1156 if (apid > matrix_mdev->matrix.apm_max) {
1161 if (!test_bit_inv(apid, matrix_mdev->matrix.apm)) {
1166 clear_bit_inv((unsigned long)apid, matrix_mdev->matrix.apm);
1180 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES)
1187 * corresponding bit in the mediated matrix device's AQM
1189 * @dev: the matrix device
1190 * @attr: the mediated matrix device's assign_domain attribute
1213 * matrix device
1235 if (apqi > matrix_mdev->matrix.aqm_max) {
1240 if (test_bit_inv(apqi, matrix_mdev->matrix.aqm)) {
1245 set_bit_inv(apqi, matrix_mdev->matrix.aqm);
1249 clear_bit_inv(apqi, matrix_mdev->matrix.aqm);
1276 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) {
1311 * corresponding bit in the mediated matrix device's AQM
1313 * @dev: the matrix device
1314 * @attr: the mediated matrix device's unassign_domain attribute
1338 if (apqi > matrix_mdev->matrix.aqm_max) {
1343 if (!test_bit_inv(apqi, matrix_mdev->matrix.aqm)) {
1348 clear_bit_inv((unsigned long)apqi, matrix_mdev->matrix.aqm);
1360 * the corresponding bit in the mediated matrix device's ADM
1362 * @dev: the matrix device
1363 * @attr: the mediated matrix device's assign_control_domain attribute
1386 if (id > matrix_mdev->matrix.adm_max) {
1391 if (test_bit_inv(id, matrix_mdev->matrix.adm)) {
1401 set_bit_inv(id, matrix_mdev->matrix.adm);
1414 * clears the corresponding bit in the mediated matrix device's ADM
1416 * @dev: the matrix device
1417 * @attr: the mediated matrix device's unassign_control_domain attribute
1440 if (domid > matrix_mdev->matrix.adm_max) {
1445 if (!test_bit_inv(domid, matrix_mdev->matrix.adm)) {
1450 clear_bit_inv(domid, matrix_mdev->matrix.adm);
1473 unsigned long max_domid = matrix_mdev->matrix.adm_max;
1476 for_each_set_bit_inv(id, matrix_mdev->matrix.adm, max_domid + 1) {
1487 static ssize_t vfio_ap_mdev_matrix_show(struct ap_matrix *matrix, char *buf)
1494 unsigned long napm_bits = matrix->apm_max + 1;
1495 unsigned long naqm_bits = matrix->aqm_max + 1;
1499 apid1 = find_first_bit_inv(matrix->apm, napm_bits);
1500 apqi1 = find_first_bit_inv(matrix->aqm, naqm_bits);
1503 for_each_set_bit_inv(apid, matrix->apm, napm_bits) {
1504 for_each_set_bit_inv(apqi, matrix->aqm,
1513 for_each_set_bit_inv(apid, matrix->apm, napm_bits) {
1519 for_each_set_bit_inv(apqi, matrix->aqm, naqm_bits) {
1536 nchars = vfio_ap_mdev_matrix_show(&matrix_mdev->matrix, buf);
1541 static DEVICE_ATTR_RO(matrix);
1583 * @matrix_mdev: a mediated matrix device
1586 * Return: 0 if no other mediated matrix device has a reference to @kvm;
1647 * @matrix_mdev: a matrix mediated device
2033 if (test_bit_inv(apid, matrix_mdev->matrix.apm) &&
2034 test_bit_inv(apqi, matrix_mdev->matrix.aqm))
2055 /* If the queue is assigned to the matrix mediated device, then
2065 * merely assigned to a matrix mediated device.
2181 * matrix and update the guest's AP configuration after all of
2223 * Since the queues are defined via a matrix of adapters
2348 matrix_mdev->matrix.apm,
2351 matrix_mdev->matrix.aqm,
2354 matrix_mdev->matrix.adm,
2466 * AP configuration for each matrix mdev to which they
2488 matrix_mdev->matrix.apm, apm_add, AP_DEVICES);
2490 matrix_mdev->matrix.aqm, aqm_add, AP_DOMAINS);
2492 matrix_mdev->matrix.adm, adm_add, AP_DEVICES);
2562 filter_adapters = bitmap_intersects(matrix_mdev->matrix.apm,
2564 filter_domains = bitmap_intersects(matrix_mdev->matrix.aqm,
2566 filter_cdoms = bitmap_intersects(matrix_mdev->matrix.adm,