lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ae77590-8401-a06b-eec5-713319c21017@de.ibm.com>
Date:   Tue, 16 Jun 2020 19:50:44 +0200
From:   Christian Borntraeger <borntraeger@...ibm.com>
To:     Tony Krowiak <akrowiak@...ux.ibm.com>, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc:     freude@...ux.ibm.com, cohuck@...hat.com, mjrosato@...ux.ibm.com,
        pasic@...ux.ibm.com, alex.williamson@...hat.com,
        kwankhede@...dia.com, fiuczy@...ux.ibm.com
Subject: Re: [PATCH v8 03/16] s390/vfio-ap: manage link between queue struct
 and matrix mdev



On 05.06.20 23:39, Tony Krowiak wrote:
[...]
> +static void vfio_ap_mdev_link_queues(struct ap_matrix_mdev *matrix_mdev,
> +				     enum qlink_type type,
> +				     unsigned long qlink_id)
> +{
> +	unsigned long id;
> +	struct vfio_ap_queue *q;
> +
> +	switch (type) {
> +	case LINK_APID:
> +	case UNLINK_APID:
> +		for_each_set_bit_inv(id, matrix_mdev->matrix.aqm,
> +				     matrix_mdev->matrix.aqm_max + 1) {
> +			q = vfio_ap_get_queue(AP_MKQID(qlink_id, id));
> +			if (q) {
> +				if (type == LINK_APID)
> +					q->matrix_mdev = matrix_mdev;
> +				else
> +					q->matrix_mdev = NULL;> +			}
> +		}
> +		break;
> +	default:

Can you rather use
	case LINK_APQI:
	case UNLINK_APQI:

and add a default case with a WARN_ON_ONCE?

> +		for_each_set_bit_inv(id, matrix_mdev->matrix.apm,
> +				     matrix_mdev->matrix.apm_max + 1) {
> +			q = vfio_ap_get_queue(AP_MKQID(id, qlink_id));
> +			if (q) {
> +				if (type == LINK_APQI)
> +					q->matrix_mdev = matrix_mdev;
> +				else
> +					q->matrix_mdev = NULL;
> +			}
> +		}
> +		break;
> +	}
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ