Re: [PATCH v2 9/9] vfio/pci: Add mmap() attributes to DMABUF feature
From: Alex Williamson
Date: Tue Jun 02 2026 - 15:14:35 EST
On Tue, 2 Jun 2026 17:50:04 +0100
Matt Evans <mattev@xxxxxxxx> wrote:
> On 29/05/2026 00:14, Alex Williamson wrote:
> > On Wed, 27 May 2026 03:23:12 -0700
> > Matt Evans <mattev@xxxxxxxx> wrote:
> >> + uint32_t old_attr = priv->memattr;
> >> +
> >> + if (flags & VFIO_DEVICE_FEATURE_SET) {
> >> + switch(db_attr.memattr) {
> >> + case VFIO_DEVICE_FEATURE_DMA_BUF_MEMATTR_NC:
> >> + case VFIO_DEVICE_FEATURE_DMA_BUF_MEMATTR_WC:
> >> + priv->memattr = db_attr.memattr;
> >> + break;
> >> +
> >> + default:
> >> + ret = -ENOTSUPP;
> >
> > -EINVAL
>
> I'd like to push back on this one; ENOTSUPP distinguishes trying to use
> a wild attribute value from all manner of other screwups such as
> trying to GET (with it no longer supported), passing an fd that isn't a
> DMABUF, etc.
>
> I'm not wed to the value ENOTSUPP, just something distinctive versus the
> other errors userspace might see, and that value seems appropriate.
It needs to be a uAPI errno though, aiui ENOTSUPP is an internal NFS
errno. How about EOPNOTSUPP? Thanks,
Alex