Question regarding Virtio Console and Remoteproc

Ohad Ben-Cohen
Fri, 01 Jun 2012 07:51:38 -0000

On Fri, Jun 1, 2012 at 10:31 AM, Sjur BRENDELAND
<sjur.brandeland at stericsson.com> wrote:
> ? ? ? ?if (virtio_has_feature(vdev, VIRTIO_CONSOLE_USE_DMA_MEM)) {
> ? ? ? ? ? ? ? ?dma_addr_t dma;
> ? ? ? ? ? ? ? ?buf = dma_alloc_coherent(dev, size, &dma, GFP_KERNEL);
> ? ? ? ?} else
> ? ? ? ? ? ? ? ?buf = kmalloc(count, GFP_KERNEL);

Something along those lines is also needed for remote processors which
access memory via an IOMMU (e.g. OMAP4's M3 and DSP).

Allocating the memory via the DMA API will seamlessly configure the
relevant IOMMU as needed, and will make the buffers accessible to the
remote processors.

Thanks,
Ohad.