lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00bd08d8caecad2d684ecdd485cffe6ad79672c2.camel@imgtec.com>
Date:   Thu, 12 Oct 2023 09:57:33 +0000
From:   Donald Robson <Donald.Robson@...tec.com>
To:     "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "dakr@...hat.com" <dakr@...hat.com>,
        Sarah Walker <Sarah.Walker@...tec.com>
CC:     "corbet@....net" <corbet@....net>,
        "luben.tuikov@....com" <luben.tuikov@....com>,
        "christian.koenig@....com" <christian.koenig@....com>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "tzimmermann@...e.de" <tzimmermann@...e.de>,
        "hns@...delico.com" <hns@...delico.com>,
        "matthew.brost@...el.com" <matthew.brost@...el.com>,
        "afd@...com" <afd@...com>, "daniel@...ll.ch" <daniel@...ll.ch>,
        "maarten.lankhorst@...ux.intel.com" 
        <maarten.lankhorst@...ux.intel.com>,
        "boris.brezillon@...labora.com" <boris.brezillon@...labora.com>,
        "mripard@...nel.org" <mripard@...nel.org>,
        "conor+dt@...nel.org" <conor+dt@...nel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        Frank Binns <Frank.Binns@...tec.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "airlied@...il.com" <airlied@...il.com>,
        "faith.ekstrand@...labora.com" <faith.ekstrand@...labora.com>
Subject: Re: [EXTERNAL] Re: [PATCH v7 02/20] drm/gpuvm: Helper to get range of
 unmap from a remap op.

Hi Danilo,

Thanks for the feedback. The change has been made and will be in the next version.

Thanks,
Donald

On Tue, 2023-10-10 at 18:31 +0200, Danilo Krummrich wrote:
> *** CAUTION: This email originates from a source not known to Imagination Technologies. Think before you click a link or open an attachment ***
> 
> On 10/10/23 15:37, Sarah Walker wrote:
> > From: Donald Robson <donald.robson@...tec.com>
> > 
> > Determining the start and range of the unmap stage of a remap op is a
> > common piece of code currently implemented by multiple drivers. Add a
> > helper for this.
> > 
> > Changes since v6:
> > - Remove use of __always_inline
> > 
> > Signed-off-by: Donald Robson <donald.robson@...tec.com>
> > Signed-off-by: Sarah Walker <sarah.walker@...tec.com>
> > ---
> >   include/drm/drm_gpuvm.h | 27 +++++++++++++++++++++++++++
> >   1 file changed, 27 insertions(+)
> > 
> > diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> > index c7ed6bf441d4..932e942da921 100644
> > --- a/include/drm/drm_gpuvm.h
> > +++ b/include/drm/drm_gpuvm.h
> > @@ -702,4 +702,31 @@ void drm_gpuva_remap(struct drm_gpuva *prev,
> >   
> >   void drm_gpuva_unmap(struct drm_gpuva_op_unmap *op);
> >   
> > +/**
> > + * drm_gpuva_op_remap_get_unmap_range() - Helper to get the start and range of
> 
> Not a strong opinion on that, but maybe drm_gpuva_op_remap_to_unmap_range() would
> be a bit better.
> 
> > + * the unmap stage of a remap op.
> > + * @op: Remap op.
> > + * @start_addr: Output pointer for the start of the required unmap.
> > + * @range: Output pointer for the length of the required unmap.
> > + *
> > + * These parameters can then be used by the caller to unmap memory pages that
> > + * are no longer required.
> 
> I think we should be a bit more precise on what this is good for. Maybe something
> like: "The given start address and range will be set such that they represent the
> range of the address space that was previously covered by the mapping getting
> re-mapped, but is empty now."
> 
> > + */
> > +static inline void
> > +drm_gpuva_op_remap_get_unmap_range(const struct drm_gpuva_op_remap *op,
> > +				   u64 *start_addr, u64 *range)
> > +{
> > +	const u64 va_start = op->prev ?
> > +			     op->prev->va.addr + op->prev->va.range :
> > +			     op->unmap->va->va.addr;
> > +	const u64 va_end = op->next ?
> > +			   op->next->va.addr :
> > +			   op->unmap->va->va.addr + op->unmap->va->va.range;
> > +
> > +	if (start_addr)
> > +		*start_addr = va_start;
> > +	if (range)
> > +		*range = va_end - va_start;
> > +}
> > +
> >   #endif /* __DRM_GPUVM_H__ */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ