On 25.06.2010 17:07, Matthieu Herrb wrote:
On Fri, Jun 25, 2010 at 03:25:10PM +0100, Stuart Henderson wrote:
On 2010/06/25 11:57, Carl-Daniel Hailfinger wrote:
Hi Jonathan,
you're in CC of this mail because you sent the "unbreak pciutils" mail to this list, and the failure mode is related. http://marc.info/?l=openbsd-ports&m=126918139214769
Hmmm... So why is PCIOCWRITE failing, even when securelevel is 0 and allowaperture=2...
Probably because you do un-aligned PCI config space access. Our /dev/pci only supports 32 bit wide read/write, aligned on 4 bytes boundaries.
If you need to write to PCI config space, you'll need a separate kernel interface, with a high-level interface, so that you don't allow random changes in the PCI config space from userland.
Wouldn't allowing 16 bit and 8 bit reads/writes at native alignments in /dev/pci work for that? I could modify flashrom to use read/modify/write cycles to emulate 8/16 bit reads/writes with 32 bit reads/writes, but that may have undesirable side effects on some chipsets.
The rest of the discussion about not abusing the aperture driver for this also stays.
I never fully understood how /dev/mem and the aperture driver are related. flashrom uses /dev/mem for memory access. The allowaperture stuff is something I guessed from reading various OpenBSD docs and mailing list posts.
Regards, Carl-Daniel