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] [day] [month] [year] [list]
Date:	Thu, 25 Oct 2007 09:31:11 -0700
From:	David Brownell <david-b@...bell.net>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Jeff Garzik <jeff@...zik.org>,
	Linux Kernel list <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Greg KH <greg@...ah.com>
Subject: Re: [patch 2.6.24-rc1] resource_len() utility function

On Thursday 25 October 2007, Alan Cox wrote:
> > So you'd suggest having search utilities (as with platform_bus)
> > returning resource indices not resources?
> 
> That seems a bad idea to me

I'm assuming you mean they should continue to work like they
do today:  return the resource.  Your pseudocode below shows
an iomap utility taking a resource.


> > Thing is, BARs are usually well defined, but when folk glue
> > resources together they use whatever order is convenient on
> > that particular platform.  And different platforms can have
> > different numbers and types of resources, etc.
> 
> Far better I think that pci_ functions that take BAR values end up as
> wrappers of the form
> 
> 	pci_iomap(pdev, bar)
> 		return dev_iomap_resource(&pdev->resource[bar]);

Sure, for PCI ... where the meaning of BARs is a fixed part of the
hardware spec, and it's not uncommon to skip a few.

But as I noted, that notion doesn't apply cleanly outside PCI;
indexes aren't necessarily portable between systems.  So any
such interface should discourage their use.


One issue with a dev_iomap() is that only memory resources
really need mapping ... but *all* of them need claiming.
(Modulo the detail that the iomap morphs i/o addresses too.)

The $SUBJECT function is a (minor) simplification for both
the mapping and claiming steps.

I think I'd rather see a dev_resource_claim() which combines
the request_{,mem_}region() semantics with mapping ... that
way drivers could save code, not just unify the two types
of register addressing.

- Dave


-
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