On Tue, Oct 18, 2011 at 03:20:43PM +0200, Michael S. Tsirkin wrote:
> Ah. Right. Good catch. It's probably best to just make that
> state be !enabled || masked. Like the below? (compiled only):
> 
> --->
> 
> msix: track function masked in pci device state
> 
> Only go over the table when function is masked.
> This optimization is not really important for qemu.git but helps
> qemu-kvm.git.
> 
> Signed-off-by: Michael S. Tsirkin <[email protected]>

...

> diff --git a/hw/pci.h b/hw/pci.h
> index 86a81c8..da4c9c3 100644
> --- a/hw/pci.h
> +++ b/hw/pci.h
> @@ -178,6 +178,8 @@ struct PCIDevice {
>      unsigned *msix_entry_used;
>      /* Region including the MSI-X table */
>      uint32_t msix_bar_size;
> +    /* MSIX function mask set or MSIX disabled */
> +    bool msix_function_masked;
>      /* Version id needed for VMState */
>      int32_t version_id;

BTW, since code checks msix_function_masked consistently,
this also covers the case your other patch addressed,
where there's a table access while msix is disabled, right?

-- 
MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to