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: <20240205153526.462e32b0.alex.williamson@redhat.com>
Date: Mon, 5 Feb 2024 15:35:26 -0700
From: Alex Williamson <alex.williamson@...hat.com>
To: Reinette Chatre <reinette.chatre@...el.com>
Cc: jgg@...dia.com, yishaih@...dia.com,
 shameerali.kolothum.thodi@...wei.com, kevin.tian@...el.com,
 kvm@...r.kernel.org, dave.jiang@...el.com, ashok.raj@...el.com,
 linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH 12/17] vfio/pci: Remove msi term from generic code

On Thu,  1 Feb 2024 20:57:06 -0800
Reinette Chatre <reinette.chatre@...el.com> wrote:

> vfio_msi_set_vector_signal() and by extension vfio_msi_set_block()
> are no longer specific to MSI and MSI-X interrupts.
> 
> Change the name of these functions in preparation for them
> to be used for management of INTx interrupts.
> 
> Signed-off-by: Reinette Chatre <reinette.chatre@...el.com>
> ---
>  drivers/vfio/pci/vfio_pci_intrs.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
> index 07dc388c4513..7f9dc81cb97f 100644
> --- a/drivers/vfio/pci/vfio_pci_intrs.c
> +++ b/drivers/vfio/pci/vfio_pci_intrs.c
> @@ -557,7 +557,7 @@ static struct vfio_pci_intr_ops intr_ops[] = {
>  	},
>  };
>  
> -static int vfio_msi_set_vector_signal(struct vfio_pci_core_device *vdev,
> +static int vfio_irq_set_vector_signal(struct vfio_pci_core_device *vdev,
>  				      unsigned int vector, int fd,
>  				      unsigned int index)
>  {
> @@ -617,7 +617,7 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_core_device *vdev,
>  	return ret;
>  }
>  
> -static int vfio_msi_set_block(struct vfio_pci_core_device *vdev,
> +static int vfio_irq_set_block(struct vfio_pci_core_device *vdev,
>  			      unsigned int start, unsigned int count,
>  			      int32_t *fds, unsigned int index)
>  {
> @@ -626,12 +626,12 @@ static int vfio_msi_set_block(struct vfio_pci_core_device *vdev,
>  
>  	for (i = 0, j = start; i < count && !ret; i++, j++) {
>  		int fd = fds ? fds[i] : -1;
> -		ret = vfio_msi_set_vector_signal(vdev, j, fd, index);
> +		ret = vfio_irq_set_vector_signal(vdev, j, fd, index);
>  	}
>  
>  	if (ret) {
>  		for (i = start; i < j; i++)
> -			vfio_msi_set_vector_signal(vdev, i, -1, index);
> +			vfio_irq_set_vector_signal(vdev, i, -1, index);
>  	}
>  
>  	return ret;
> @@ -648,7 +648,7 @@ static void vfio_msi_disable(struct vfio_pci_core_device *vdev,
>  	xa_for_each(&vdev->ctx, i, ctx) {
>  		vfio_virqfd_disable(&ctx->unmask);
>  		vfio_virqfd_disable(&ctx->mask);
> -		vfio_msi_set_vector_signal(vdev, i, -1, index);
> +		vfio_irq_set_vector_signal(vdev, i, -1, index);
>  		vfio_irq_ctx_free(vdev, ctx, i);
>  	}
>  
> @@ -786,14 +786,14 @@ static int vfio_pci_set_msi_trigger(struct vfio_pci_core_device *vdev,
>  		int ret;
>  
>  		if (vdev->irq_type == index)

It's unfortunate that the one place in the code that doesn't use
irq_is() is the one that turns into the central callout function, maybe
we can fix it along the way.  Thanks,

Alex


> -			return vfio_msi_set_block(vdev, start, count,
> +			return vfio_irq_set_block(vdev, start, count,
>  						  fds, index);
>  
>  		ret = vfio_msi_enable(vdev, start + count, index);
>  		if (ret)
>  			return ret;
>  
> -		ret = vfio_msi_set_block(vdev, start, count, fds, index);
> +		ret = vfio_irq_set_block(vdev, start, count, fds, index);
>  		if (ret)
>  			vfio_msi_disable(vdev, index);
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ