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: <20110613164403.4cb74675@lxorguk.ukuu.org.uk>
Date:	Mon, 13 Jun 2011 16:44:03 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Daniel Vetter <daniel@...ll.ch>
Cc:	Patrik Jakobsson <patrik.r.jakobsson@...il.com>,
	Dave Airlie <airlied@...hat.com>, linux-kernel@...r.kernel.org,
	dri-devel@...ts.freedesktop.org, greg@...ah.com
Subject: Re: [PATCH 14/15] gma500: nuke the PSB debug stuff

> Given that I've mucked around in drm_mm quite a bit I'd be very interested
> in your opinion about what's weird in it (and presumably what could be
> improved). Can you elaborate?

Mostly the API, which is also somewhat poorly documented. I've not dug
into the internals beyond trying to figure out how to use it. Looking at
the users the API is non-obvious, the interface involves a mix of calls
and digging deep into struct internals.

I'd have expected an API that had allocate/free type methods and exposed
the needed information directly or very easily not one that has drivers
doing. drm_sman seems to be attempt in that direction but its also rather
odd with interfaces like


        item = drm_sman_alloc(&dev_priv->sman, mem->type, tmpSize, 0,
                              (unsigned long)file_priv);
        mutex_unlock(&dev->struct_mutex);
        if (item) {
                mem->offset = ((mem->type == VIA_MEM_VIDEO) ?
                              dev_priv->vram_offset :
        dev_priv->agp_offset) + (item->mm->
                     offset(item->mm, item->mm_info) <<
        VIA_MM_ALIGN_SHIFT); mem->index = item->user_hash.key;


where the item->... gymnastics are spectacular to say the least given the
basic function of the allocator appears to be to provide said offset in
the first place.

And ultimately this is why I went with using allocate_region and friends
plus using GEM to do handles, which was a good choice for other reasons
as GEM is rather nicely designed barring the lack of a couple of helpers
and the few lines needed to split the shmem/handle abstraction properly.

Possibly drm_sman and friends should just wrap whatever simple native
allocator exists on the OS ?

Alan


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ