[RFC 2/6] udmabuf: add ability to set access flags on udmabuf

Gerd Hoffmann kraxel at redhat.com
Thu Aug 1 06:40:23 UTC 2019


On Wed, Jul 31, 2019 at 07:25:13PM -0700, Gurchetan Singh wrote:
> The main use for udmabuf is sending guest memory pages
> to the host.
> 
> It's generally a bad idea to have to separate mappings with
> different attributes. For example, a WC mapping the guest
> kernel and cached mapping on the host is problematic.
> 
> Add creation time flags so the user has responsibility for
> the specific use case.

> -#define UDMABUF_FLAGS_CLOEXEC	0x01
> +#define UDMABUF_FLAGS_CLOEXEC    0x01
> +#define UDMABUF_FLAGS_PROT_NONE  0x02
> +#define UDMABUF_FLAGS_PROT_READ  0x04
> +#define UDMABUF_FLAGS_PROT_WRITE 0x08

[ didn't look at followup patches yet ]

You can't have readonly/writeonly dmabufs.
So that isn't going to fly.

The commit message suggests this is for cache attributes not protection,
so having the flags might make sense, but please don't name the flags
PROT_* then.

cheers,
  Gerd



More information about the dri-devel mailing list