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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 31, 2019 at 11:40 PM Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote:
>
> 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.

Okay, I'll change the flags to CACHED / UNCACHED / WRITE_COMBINE (like
msm_drm.h).  And since the dma api doesn't work on x86 [1], we'll have
to call drm_cflush_pages in the guest.  Since caching is privileged on
ARM and not on x86, that *should* get us write-combine guest buffers.

[1] https://lists.freedesktop.org/archives/dri-devel/2019-August/229161.html

>
> cheers,
>   Gerd
>
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux