diff mbox series

[v2,4/4] tests/qtest/virtio-iommu-test: Check bypass config

Message ID 20220127142940.671333-5-jean-philippe@linaro.org (mailing list archive)
State New, archived
Headers show
Series virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG | expand

Commit Message

Jean-Philippe Brucker Jan. 27, 2022, 2:29 p.m. UTC
The bypass config field should be initialized to 1 by default.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 tests/qtest/virtio-iommu-test.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Eric Auger Jan. 31, 2022, 9:14 a.m. UTC | #1
On 1/27/22 3:29 PM, Jean-Philippe Brucker wrote:
> The bypass config field should be initialized to 1 by default.
>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
> ---
>  tests/qtest/virtio-iommu-test.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/qtest/virtio-iommu-test.c b/tests/qtest/virtio-iommu-test.c
> index 47e68388a0..068e7a9e6c 100644
> --- a/tests/qtest/virtio-iommu-test.c
> +++ b/tests/qtest/virtio-iommu-test.c
> @@ -31,11 +31,13 @@ static void pci_config(void *obj, void *data, QGuestAllocator *t_alloc)
>      uint64_t input_range_end = qvirtio_config_readq(dev, 16);
>      uint32_t domain_range_start = qvirtio_config_readl(dev, 24);
>      uint32_t domain_range_end = qvirtio_config_readl(dev, 28);
> +    uint8_t bypass = qvirtio_config_readb(dev, 36);
>  
>      g_assert_cmpint(input_range_start, ==, 0);
>      g_assert_cmphex(input_range_end, ==, UINT64_MAX);
>      g_assert_cmpint(domain_range_start, ==, 0);
>      g_assert_cmpint(domain_range_end, ==, UINT32_MAX);
> +    g_assert_cmpint(bypass, ==, 1);
>  }
>  
>  static int read_tail_status(struct virtio_iommu_req_tail *buffer)
diff mbox series

Patch

diff --git a/tests/qtest/virtio-iommu-test.c b/tests/qtest/virtio-iommu-test.c
index 47e68388a0..068e7a9e6c 100644
--- a/tests/qtest/virtio-iommu-test.c
+++ b/tests/qtest/virtio-iommu-test.c
@@ -31,11 +31,13 @@  static void pci_config(void *obj, void *data, QGuestAllocator *t_alloc)
     uint64_t input_range_end = qvirtio_config_readq(dev, 16);
     uint32_t domain_range_start = qvirtio_config_readl(dev, 24);
     uint32_t domain_range_end = qvirtio_config_readl(dev, 28);
+    uint8_t bypass = qvirtio_config_readb(dev, 36);
 
     g_assert_cmpint(input_range_start, ==, 0);
     g_assert_cmphex(input_range_end, ==, UINT64_MAX);
     g_assert_cmpint(domain_range_start, ==, 0);
     g_assert_cmpint(domain_range_end, ==, UINT32_MAX);
+    g_assert_cmpint(bypass, ==, 1);
 }
 
 static int read_tail_status(struct virtio_iommu_req_tail *buffer)