linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Tom Lyon <pugs@cisco.com>
Cc: mst@redhat.com, hjk@linutronix.de, gregkh@suse.de,
	chrisw@sous-sol.org, joro@8bytes.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] drivers/uio/uio.c: DMA mapping, interrupt extensions, etc.
Date: Sat, 17 Apr 2010 21:34:32 +0300	[thread overview]
Message-ID: <4BC9FF38.7040009@redhat.com> (raw)
In-Reply-To: <4bc77d41.njZFTBp9Nkn93l72%pugs@cisco.com>

On 04/15/2010 11:55 PM, Tom Lyon wrote:
> This is the second of 2 related, but independent, patches. This is for
> uio.c, the previous is for uio_pci_generic.c.
>
> The 2 patches were previously one large patch. Changes for this version:
> - uio_pci_generic.c just gets extensions so that a single fd can be used
>    by non-privileged processes for interrupt control and mmaps
> - All of the DMA and IOMMU related stuff move to uio.c; no longer a need
>    to pass ioctls to individual uio drivers. It turns out that the code
>    is not PCI specific anyways.
> - A new ioctl to pin DMA buffers to certain IO virtual addresses for KVM.
> - New eventfd based interrupt notifications, including support for PCI
>    specific MSI and MSI-X interrupts.
> - PCI specific code to reset PCI functions before and after use
>
>
> @@ -122,4 +126,23 @@
>   #define UIO_PORT_GPIO	2
>   #define UIO_PORT_OTHER	3
>
> +#endif	/* __KERNEL__ */
> +
> +// Kernel&  User level defines for ioctls
> +
> +struct uio_dma_map {
> +	unsigned long	vaddr;
> +	unsigned long long dmaaddr;
>    

Use __u64 for both, otherwise you need to rewrite the structures in the 
kernel in case 32-bit userspace calls a 64-bit kernel.

> +	int	size;
>    

What units?  Size is probably too small.  Suggest unsigned type to avoid 
an extra check in the kernel.

> +	int	rdwr;
>    

What values can this hold?

> +};
> +
> +#define	UIO_DMA_MAP_ANYWHERE	_IOWR(';', 100, struct uio_dma_map)
>    

What does this do?  Ignore vaddr?

> +#define	UIO_DMA_MAP_IOVA	_IOWR(';', 101, struct uio_dma_map)
> +#define	UIO_DMA_UNMAP		_IOW(';', 102, struct uio_dma_map)
> +#define	UIO_DMA_MASK		_IOW(';', 103, unsigned long long)
> +#define	UIO_EVENTFD_IRQ		_IOW(';', 104, int)
> +#define	UIO_EVENTFD_MSI		_IOW(';', 105, int)
> +#define	UIO_EVENTFDS_MSIX	_IOW(';', 106, int)
>    

These three need some documentation.


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


      parent reply	other threads:[~2010-04-17 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 20:55 [PATCH V2] drivers/uio/uio.c: DMA mapping, interrupt extensions, etc Tom Lyon
2010-04-17 10:43 ` Joerg Roedel
2010-04-17 17:04   ` Tom Lyon
2010-04-17 18:34 ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC9FF38.7040009@redhat.com \
    --to=avi@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pugs@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).