[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 07/16] libqos: enforce Device Initialization order
From: |
Thomas Huth |
Subject: |
Re: [PATCH v3 07/16] libqos: enforce Device Initialization order |
Date: |
Mon, 21 Oct 2019 14:15:53 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 19/10/2019 08.38, Stefan Hajnoczi wrote:
> According to VIRTIO 1.1 "3.1.1 Driver Requirements: Device
> Initialization", configuration space and virtqueues cannot be accessed
> before features have been negotiated. Enforce this requirement.
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> tests/libqos/virtio.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c
> index 4f7e6bb8a1..2593996c98 100644
> --- a/tests/libqos/virtio.c
> +++ b/tests/libqos/virtio.c
> @@ -13,23 +13,33 @@
> #include "standard-headers/linux/virtio_config.h"
> #include "standard-headers/linux/virtio_ring.h"
>
> +/* Features must be negotiated before config space or virtqueue access */
> +static void check_features_negotiated(QVirtioDevice *d)
> +{
> + g_assert_cmphex(d->features, !=, 0);
> +}
Isn't it "legal" to negotiate 0 feature bits, too (for legacy devices)?
Thomas
- Re: [PATCH v3 03/16] libqos: extend feature bits to 64-bit, (continued)
[PATCH v3 08/16] libqos: implement VIRTIO 1.0 FEATURES_OK step, Stefan Hajnoczi, 2019/10/19
[PATCH v3 09/16] libqos: access VIRTIO 1.0 vring in little-endian, Stefan Hajnoczi, 2019/10/19