All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC:  vfio / iommu driver for hardware with no iommu
@ 2013-04-23 16:13 Yoder Stuart-B08248
       [not found] ` <9F6FE96B71CF29479FF1CDC8046E15035BE0A3-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 21+ messages in thread
From: Yoder Stuart-B08248 @ 2013-04-23 16:13 UTC (permalink / raw)
  To: Joerg Roedel, Alex Williamson
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org

Joerg/Alex,

We have embedded systems where we use QEMU/KVM and have
the requirement to do device assignment, but have no
iommu.  So we would like to get vfio-pci working on
systems like this.

We're aware of the obvious limitations-- no protection,
DMA'able memory must be physically contiguous and will
have no iova->phy translation.  But there are use cases
where all OSes involved are trusted and customers can
live with those limitations.   Virtualization is used
here not to sandbox untrusted code, but to consolidate
multiple OSes.

We would like to get your feedback on the rough idea.  There
are two parts-- iommu driver and vfio-pci.

1.  iommu driver

First, we still need device groups created because vfio
is based on that, so we envision a 'dummy' iommu
driver that implements only  the add/remove device
ops.  Something like:

    static struct iommu_ops fsl_none_ops = {
            .add_device     = fsl_none_add_device,
            .remove_device  = fsl_none_remove_device,
    };
    
    int fsl_iommu_none_init()
    {
            int ret = 0;
    
            ret = iommu_init_mempool();
            if (ret)
                    return ret;
    
            bus_set_iommu(&platform_bus_type, &fsl_none_ops);
            bus_set_iommu(&pci_bus_type, &fsl_none_ops);
    
            return ret;
    }

2.  vfio-pci

For vfio-pci, we would ideally like to keep user space mostly
unchanged.  User space will have to follow the semantics
of mapping only physically contiguous chunks...and iova
will equal phys.

So, we propose to implement a new vfio iommu type,
called VFIO_TYPE_NONE_IOMMU.  This implements
any needed vfio interfaces, but there are no calls
to the iommu layer...e.g. map_dma() is a noop.

Would like your feedback.

Thanks,
Stuart Yoder

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-04-30 21:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-23 16:13 RFC: vfio / iommu driver for hardware with no iommu Yoder Stuart-B08248
     [not found] ` <9F6FE96B71CF29479FF1CDC8046E15035BE0A3-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-04-23 16:56   ` Alex Williamson
     [not found]     ` <1366736189.2918.573.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-23 18:36       ` Sethi Varun-B16395
2013-04-23 19:16       ` Yoder Stuart-B08248
     [not found]         ` <9F6FE96B71CF29479FF1CDC8046E15035BE2BD-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-04-23 19:47           ` Alex Williamson
     [not found]             ` <1366746427.2918.650.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-24 19:41               ` Don Dutile
     [not found]                 ` <51783553.80202-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-25  2:49                   ` Sethi Varun-B16395
     [not found]                     ` <C5ECD7A89D1DC44195F34B25E172658D4BA91B-RL0Hj/+nBVCMXPU/2EZmt64g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-04-25 22:23                       ` Don Dutile
     [not found]                         ` <5179ACE8.2030506-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-27  4:22                           ` Andrew Cooks
2013-04-30 17:28                             ` Konrad Rzeszutek Wilk
     [not found]                               ` <20130430172849.GB22752-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-04-30 17:54                                 ` Alex Williamson
2013-04-30 18:13                                 ` Don Dutile
     [not found]                                   ` <518009D3.2050304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-30 19:11                                     ` Konrad Rzeszutek Wilk
     [not found]                                       ` <20130430191131.GC24298-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-04-30 20:48                                         ` Don Dutile
     [not found]                                           ` <51802E19.9050601-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-30 21:15                                             ` Alex Williamson
     [not found]                                               ` <1367356521.22436.7.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2013-04-30 21:51                                                 ` Don Dutile
2013-04-30 18:25                                 ` Don Dutile
2013-04-24 10:57   ` Joerg Roedel
     [not found]     ` <20130424105718.GJ17148-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2013-04-24 11:04       ` Bhushan Bharat-R65777
     [not found]         ` <6A3DF150A5B70D4F9B66A25E3F7C888D06FF5799-RL0Hj/+nBVCMXPU/2EZmt64g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-04-24 15:22           ` Yoder Stuart-B08248
2013-04-24 11:52       ` Sethi Varun-B16395

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.