[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: qtest: Add virtio-iommu test
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH] tests: qtest: Add virtio-iommu test |
Date: |
Thu, 7 Oct 2021 12:56:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
On 10/7/21 11:34, Eric Auger wrote:
> Add the framework to test the virtio-iommu-pci device
> and tests exercising the attach/detach, map/unmap API.
>
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>
> ---
> +static void pci_config(void *obj, void *data, QGuestAllocator *t_alloc)
> +{
> + QVirtioIOMMU *v_iommu = obj;
> + QVirtioDevice *dev = v_iommu->vdev;
> + uint64_t input_range_start = qvirtio_config_readq(dev, 8);
> + 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);
> +
> + g_assert_cmpint(input_range_start, ==, 0);
> + g_assert_cmphex(input_range_end, ==, 0xFFFFFFFFFFFFFFFF);
Maybe explicit ull suffix for for 32-bit hosts?
> + g_assert_cmpint(domain_range_start, ==, 0);
> + g_assert_cmpint(domain_range_end, ==, 32);
> +}