qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V7 6/6] Adding VMXNET3 device implementation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH V7 6/6] Adding VMXNET3 device implementation
Date: Fri, 30 Nov 2012 17:37:32 +0100

On Fri, Nov 16, 2012 at 2:55 PM, Dmitry Fleytman <address@hidden> wrote:
> +        /* Whether MSI-X support was installed successfully */
> +        uint8_t msix_used;
> +        /* Whether MSI support was installed successfully */
> +        uint8_t msi_used;

These two fields should be bool.

> +        /* Whether automatic interrupts masking enabled */
> +        uint8_t auto_int_masking;

bool

> +static inline void vmxnet3_flush_shmem_changes(void)
> +{
> +    /*
> +     * Flush shared memory changes
> +     * Needed before sending interrupt to guest to ensure
> +     * it gets consistent memory state
> +     */
> +    smp_wmb();
> +}

It's useful to document why a memory barrier is being used in each
instance.  Therefore hiding smp_wmb() inside a wrapper function isn't
great.

Also, it's suspicious that smb_wmb() is used but no other barriers are
used.  What about a read memory barrier when accessing shared memory
written by the guest?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]