Lines Matching full:apm

157 		if (test_bit_inv(AP_QID_CARD(apqn), matrix_mdev->matrix.apm) &&  in get_update_locks_by_apqn()
657 matrix_mdev->shadow_apcb.apm, in vfio_ap_mdev_update_guest_apcb()
718 bitmap_copy(prev_shadow_apm, matrix_mdev->shadow_apcb.apm, AP_DEVICES); in vfio_ap_mdev_filter_matrix()
728 bitmap_and(matrix_mdev->shadow_apcb.apm, matrix_mdev->matrix.apm, in vfio_ap_mdev_filter_matrix()
729 (unsigned long *)matrix_dev->info.apm, AP_DEVICES); in vfio_ap_mdev_filter_matrix()
733 for_each_set_bit_inv(apid, matrix_mdev->shadow_apcb.apm, AP_DEVICES) { in vfio_ap_mdev_filter_matrix()
746 clear_bit_inv(apid, matrix_mdev->shadow_apcb.apm); in vfio_ap_mdev_filter_matrix()
761 return !bitmap_equal(prev_shadow_apm, matrix_mdev->shadow_apcb.apm, in vfio_ap_mdev_filter_matrix()
839 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) { in vfio_ap_mdev_unlink_fr_queues()
870 unsigned long *apm, in vfio_ap_mdev_log_sharing_err() argument
877 for_each_set_bit_inv(apid, apm, AP_DEVICES) in vfio_ap_mdev_log_sharing_err()
898 DECLARE_BITMAP(apm, AP_DEVICES); in vfio_ap_mdev_verify_no_sharing()
903 * If the input apm and aqm are fields of the matrix_mdev in vfio_ap_mdev_verify_no_sharing()
906 if (mdev_apm == matrix_mdev->matrix.apm && in vfio_ap_mdev_verify_no_sharing()
910 memset(apm, 0, sizeof(apm)); in vfio_ap_mdev_verify_no_sharing()
917 if (!bitmap_and(apm, mdev_apm, matrix_mdev->matrix.apm, in vfio_ap_mdev_verify_no_sharing()
925 vfio_ap_mdev_log_sharing_err(matrix_mdev, apm, aqm); in vfio_ap_mdev_verify_no_sharing()
950 if (ap_apqn_in_matrix_owned_by_def_drv(matrix_mdev->matrix.apm, in vfio_ap_mdev_validate_masks()
954 return vfio_ap_mdev_verify_no_sharing(matrix_mdev->matrix.apm, in vfio_ap_mdev_validate_masks()
1011 * corresponding bit in the mediated matrix device's APM
1064 if (test_bit_inv(apid, matrix_mdev->matrix.apm)) { in assign_adapter_store()
1069 set_bit_inv(apid, matrix_mdev->matrix.apm); in assign_adapter_store()
1073 clear_bit_inv(apid, matrix_mdev->matrix.apm); in assign_adapter_store()
1127 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in vfio_ap_mdev_unlink_adapter()
1147 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm)) { in vfio_ap_mdev_hot_unplug_adapters()
1148 clear_bit_inv(apid, matrix_mdev->shadow_apcb.apm); in vfio_ap_mdev_hot_unplug_adapters()
1177 * corresponding bit in the mediated matrix device's APM
1209 if (!test_bit_inv(apid, matrix_mdev->matrix.apm)) { in unassign_adapter_store()
1214 clear_bit_inv((unsigned long)apid, matrix_mdev->matrix.apm); in unassign_adapter_store()
1228 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) in vfio_ap_mdev_link_domain()
1324 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, AP_DEVICES) { in vfio_ap_mdev_unlink_domain()
1328 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in vfio_ap_mdev_unlink_domain()
1559 apid1 = find_first_bit_inv(matrix->apm, napm_bits); in vfio_ap_mdev_matrix_show()
1563 for_each_set_bit_inv(apid, matrix->apm, napm_bits) { in vfio_ap_mdev_matrix_show()
1568 for_each_set_bit_inv(apid, matrix->apm, napm_bits) in vfio_ap_mdev_matrix_show()
1618 idx += write_ap_bitmap(matrix_mdev->matrix.apm, buf, idx, ','); in ap_config_show()
1646 for_each_set_bit_inv(bit, matrix_mdev->matrix.apm, AP_DEVICES) { in ap_matrix_overflow_check()
1670 bitmap_copy(dst->apm, src->apm, AP_DEVICES); in ap_matrix_copy()
1696 if (parse_bitmap(&rest, m_new.apm, AP_DEVICES) || in ap_config_store()
1703 bitmap_andnot(m_removed.apm, m_old.apm, m_new.apm, AP_DEVICES); in ap_config_store()
1705 bitmap_andnot(m_added.apm, m_new.apm, m_old.apm, AP_DEVICES); in ap_config_store()
1728 vfio_ap_mdev_hot_unplug_adapters(matrix_mdev, m_removed.apm); in ap_config_store()
1735 for_each_set_bit_inv(newbit, m_added.apm, AP_DEVICES) in ap_config_store()
2223 if (test_bit_inv(apid, matrix_mdev->matrix.apm) && in vfio_ap_mdev_for_queue()
2258 test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in status_show()
2407 if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) && in vfio_ap_mdev_remove_queue()
2414 clear_bit_inv(apid, matrix_mdev->shadow_apcb.apm); in vfio_ap_mdev_remove_queue()
2426 if (test_bit_inv(apid, (unsigned long *)matrix_dev->info.apm) && in vfio_ap_mdev_remove_queue()
2446 * @apm: a bitmap specifying a set of APIDs comprising the APQNs to check.
2450 * * -EADDRINUSE if one or more of the APQNs specified via @apm/@aqm are
2455 int vfio_ap_mdev_resource_in_use(unsigned long *apm, unsigned long *aqm) in vfio_ap_mdev_resource_in_use() argument
2461 ret = vfio_ap_mdev_verify_no_sharing(apm, aqm); in vfio_ap_mdev_resource_in_use()
2487 do_hotplug |= bitmap_andnot(matrix_mdev->shadow_apcb.apm, in vfio_ap_mdev_hot_unplug_cfg()
2488 matrix_mdev->shadow_apcb.apm, in vfio_ap_mdev_hot_unplug_cfg()
2535 matrix_mdev->matrix.apm, in vfio_ap_mdev_cfg_remove()
2570 (unsigned long *)prev_config_info->apm, in vfio_ap_mdev_on_cfg_remove()
2571 (unsigned long *)cur_config_info->apm, in vfio_ap_mdev_on_cfg_remove()
2589 * @apm: a bitmap of the APIDs to examine
2592 static void vfio_ap_filter_apid_by_qtype(unsigned long *apm, unsigned long *aqm) in vfio_ap_filter_apid_by_qtype() argument
2599 for_each_set_bit_inv(apid, apm, AP_DEVICES) { in vfio_ap_filter_apid_by_qtype()
2621 clear_bit_inv(apid, apm); in vfio_ap_filter_apid_by_qtype()
2634 clear_bit_inv(apid, apm); in vfio_ap_filter_apid_by_qtype()
2640 * If we've already cleared the APID from the apm, there in vfio_ap_filter_apid_by_qtype()
2675 matrix_mdev->matrix.apm, apm_add, AP_DEVICES); in vfio_ap_mdev_cfg_add()
2703 (unsigned long *)cur_config_info->apm, in vfio_ap_mdev_on_cfg_add()
2704 (unsigned long *)prev_config_info->apm, in vfio_ap_mdev_on_cfg_add()
2749 filter_adapters = bitmap_intersects(matrix_mdev->matrix.apm, in vfio_ap_mdev_hot_plug_cfg()