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: <78d085ac-3759-46ff-be75-f8c70604ac41@linux.ibm.com>
Date: Mon, 11 Mar 2024 11:27:53 -0400
From: Anthony Krowiak <akrowiak@...ux.ibm.com>
To: "Jason J. Herne" <jjherne@...ux.ibm.com>, linux-s390@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, pasic@...ux.ibm.com, borntraeger@...ibm.com,
        agordeev@...ux.ibm.com, gor@...ux.ibm.com
Subject: Re: [PATCH v2 3/5] s390/vfio-ap: Ignore duplicate link requests in
 vfio_ap_mdev_link_queue

While I don't necessarily object to this change, it is not necessary 
because this function is only called in situations where the link will 
not have been made:

* When an adapter or domain is assigned to the vfio_ap mdev, in which 
case no queue with the APID of the adaper or the APQI of the domain will 
have been linked.

* When a queue device is probed, in which case the vfio_ap_queue object 
is created and linked if the its APQN is assigned to the vfio_ap mdev.

In any case, it certainly doesn't hurt and if a future change is made 
such that this could come into play, the code is already there. So I'll 
leave it up to you if you want to keep this; if so, you already have my r-b.

On 3/6/24 9:08 AM, Jason J. Herne wrote:
> vfio_ap_mdev_link_queue is changed to detect if a matrix_mdev has
> already linked the given queue. If so, it bails out.
>
> Signed-off-by: Jason J. Herne <jjherne@...ux.ibm.com>
> Reviewed-by: Tony Krowiak <akrowiak@...ux.ibm.com>
> ---
>   drivers/s390/crypto/vfio_ap_ops.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
> index b1c1dc0233e1..259130347d00 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -781,10 +781,11 @@ static int vfio_ap_mdev_probe(struct mdev_device *mdev)
>   static void vfio_ap_mdev_link_queue(struct ap_matrix_mdev *matrix_mdev,
>   				    struct vfio_ap_queue *q)
>   {
> -	if (q) {
> -		q->matrix_mdev = matrix_mdev;
> -		hash_add(matrix_mdev->qtable.queues, &q->mdev_qnode, q->apqn);
> -	}
> +	if (!q || vfio_ap_mdev_get_queue(matrix_mdev, q->apqn))
> +		return;
> +
> +	q->matrix_mdev = matrix_mdev;
> +	hash_add(matrix_mdev->qtable.queues, &q->mdev_qnode, q->apqn);
>   }
>   
>   static void vfio_ap_mdev_link_apqn(struct ap_matrix_mdev *matrix_mdev, int apqn)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ