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.

Attachment: signature.asc
Description: PGP signature

Reply via email to