On Thu, 26 Jul 2018 21:54:21 +0200 Christian Borntraeger <borntraeger@xxxxxxxxxx> wrote: Regardless whether the activation approach is a good idea... > +static int vfio_ap_verify_queues_reserved(struct ap_matrix_mdev *matrix_mdev) > +{ > + unsigned long apid, apqi; > + int ret = 0; > + > + for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, > + matrix_mdev->matrix.apm_max + 1) { > + for_each_set_bit_inv(apqi, matrix_mdev->matrix.aqm, > + matrix_mdev->matrix.aqm_max + 1) { > + if (!ap_owned_by_def_drv((int)apid, (int)apqi)) > + continue; > + > + /* > + * We want to log every APQN that is not reserved by > + * the driver, so record the return code, log a message > + * and allow the loop to continue > + */ > + ret = -EPERM; > + pr_warn("%s: activate for %s failed: queue %02lx.%04lx owned by default driver\n", > + VFIO_AP_MODULE_NAME, matrix_mdev->name, apid, > + apqi); ...I do not think that the syslog is a good place to log those errors. AFAICS these are setup/administration errors, and the admin may want to inspect the data to find out what went wrong. Maybe better to log attempts to assign APQNs reserved to the default drivers into a dedicated dbf or somesuch, and log it in a format that can also be digested by scripts? > + } > + } > + > + return ret; > +} > + > +static void vfio_ap_mdev_log_sharing_err(struct ap_matrix_mdev *matrix_mdev, > + unsigned long apid, unsigned long apqi) > +{ > + pr_warn("%s: AP queue %02lx.%04lx is assigned to %s device\n", __func__, > + apid, apqi, matrix_mdev->name); > +} Same applies to cross-vm misconfigurations.