[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 13/14] vfio-user: handle device interrupts
|
From: |
Stefan Hajnoczi |
|
Subject: |
Re: [PATCH v11 13/14] vfio-user: handle device interrupts |
|
Date: |
Mon, 13 Jun 2022 16:30:12 +0100 |
On Fri, Jun 10, 2022 at 03:50:40PM -0400, Jagannathan Raman wrote:
> @@ -307,6 +315,38 @@ bool msi_is_masked(const PCIDevice *dev, unsigned int
> vector)
> return mask & (1U << vector);
> }
>
> +void msi_set_irq_state(PCIDevice *dev, int vector, bool mask, Error **errp)
The function name is non-obvious. This function masks or unmasks an MSI
vector. Maybe call it msi_set_mask()?
> +{
> + ERRP_GUARD();
> + uint16_t flags = pci_get_word(dev->config + msi_flags_off(dev));
> + bool msi64bit = flags & PCI_MSI_FLAGS_64BIT;
> + uint32_t irq_state, vector_mask, pending;
> +
> + if (vector > PCI_MSI_VECTORS_MAX) {
> + error_setg(errp, "msi: vector %d not allocated. max vector is %d",
> + vector, PCI_MSI_VECTORS_MAX);
> + }
Missing return statement?
> @@ -131,6 +136,31 @@ static void msix_handle_mask_update(PCIDevice *dev, int
> vector, bool was_masked)
> }
> }
>
> +void msix_set_irq_state(PCIDevice *dev, int vector, bool mask, Error **errp)
Same naming question here.
signature.asc
Description: PGP signature
- [PATCH v11 04/14] vfio-user: build library, (continued)
- [PATCH v11 04/14] vfio-user: build library, Jagannathan Raman, 2022/06/10
- [PATCH v11 02/14] remote/machine: add HotplugHandler for remote machine, Jagannathan Raman, 2022/06/10
- [PATCH v11 06/14] vfio-user: instantiate vfio-user context, Jagannathan Raman, 2022/06/10
- [PATCH v11 07/14] vfio-user: find and init PCI device, Jagannathan Raman, 2022/06/10
- [PATCH v11 08/14] vfio-user: run vfio-user context, Jagannathan Raman, 2022/06/10
- [PATCH v11 10/14] vfio-user: IOMMU support for remote device, Jagannathan Raman, 2022/06/10
- [PATCH v11 11/14] vfio-user: handle DMA mappings, Jagannathan Raman, 2022/06/10
- [PATCH v11 09/14] vfio-user: handle PCI config space accesses, Jagannathan Raman, 2022/06/10
- [PATCH v11 12/14] vfio-user: handle PCI BAR accesses, Jagannathan Raman, 2022/06/10
- [PATCH v11 13/14] vfio-user: handle device interrupts, Jagannathan Raman, 2022/06/10
- Re: [PATCH v11 13/14] vfio-user: handle device interrupts,
Stefan Hajnoczi <=
- [PATCH v11 14/14] vfio-user: handle reset of remote device, Jagannathan Raman, 2022/06/10