[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [RFC v2 6/8] virtio-iommu: Implement the translation and
From: |
Jean-Philippe Brucker |
Subject: |
Re: [Qemu-arm] [RFC v2 6/8] virtio-iommu: Implement the translation and commands |
Date: |
Fri, 23 Jun 2017 17:09:51 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
On 07/06/17 17:01, Eric Auger wrote:
> This patch adds the actual implementation for the translation routine
> and the virtio-iommu commands.
>
> Signed-off-by: Eric Auger <address@hidden>
>
> ---[...]
> static int virtio_iommu_attach(VirtIOIOMMU *s,
> struct virtio_iommu_req_attach *req)
> @@ -95,10 +135,34 @@ static int virtio_iommu_attach(VirtIOIOMMU *s,
> uint32_t asid = le32_to_cpu(req->address_space);
> uint32_t devid = le32_to_cpu(req->device);
> uint32_t reserved = le32_to_cpu(req->reserved);
> + viommu_as *as;
> + viommu_dev *dev;
>
> trace_virtio_iommu_attach(asid, devid, reserved);
>
> - return VIRTIO_IOMMU_S_UNSUPP;
> + dev = g_tree_lookup(s->devices, GUINT_TO_POINTER(devid));
> + if (dev) {
> + return -1;
I guess you could return S_INVAL here. However, if the device is already
attached to AS0, it should be detached and attached to AS1. The Linux
driver relies on this behavior when moving a device from kernel to user
address space and back.
Thanks,
Jean
- [Qemu-arm] [RFC v2 0/8] VIRTIO-IOMMU device, Eric Auger, 2017/06/07
- [Qemu-arm] [RFC v2 1/8] update-linux-headers: import virtio_iommu.h, Eric Auger, 2017/06/07
- [Qemu-arm] [RFC v2 2/8] linux-headers: Update for virtio-iommu, Eric Auger, 2017/06/07
- [Qemu-arm] [RFC v2 3/8] virtio_iommu: add skeleton, Eric Auger, 2017/06/07
- [Qemu-arm] [RFC v2 4/8] virtio-iommu: Decode the command payload, Eric Auger, 2017/06/07
- [Qemu-arm] [RFC v2 5/8] virtio_iommu: Add the iommu regions, Eric Auger, 2017/06/07
- [Qemu-arm] [RFC v2 6/8] virtio-iommu: Implement the translation and commands, Eric Auger, 2017/06/07
- Re: [Qemu-arm] [RFC v2 6/8] virtio-iommu: Implement the translation and commands,
Jean-Philippe Brucker <=
- [Qemu-arm] [RFC v2 7/8] hw/arm/virt: Add 2.10 machine type, Eric Auger, 2017/06/07
- [Qemu-arm] [RFC v2 8/8] hw/arm/virt: Add virtio-iommu the virt board, Eric Auger, 2017/06/07
- Re: [Qemu-arm] [RFC v2 0/8] VIRTIO-IOMMU device, Bharat Bhushan, 2017/06/09
- Re: [Qemu-arm] [RFC v2 0/8] VIRTIO-IOMMU device, Auger Eric, 2017/06/09
- Re: [Qemu-arm] [RFC v2 0/8] VIRTIO-IOMMU device, Bharat Bhushan, 2017/06/09
- Re: [Qemu-arm] [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device, Auger Eric, 2017/06/09
- Re: [Qemu-arm] [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device, Bharat Bhushan, 2017/06/19
- Re: [Qemu-arm] [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device, Jean-Philippe Brucker, 2017/06/19
- Re: [Qemu-arm] [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device, Auger Eric, 2017/06/26
- Re: [Qemu-arm] [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device, Jean-Philippe Brucker, 2017/06/26