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>] [day] [month] [year] [list]
Message-ID: <5cb62a8f48f639af132dfd4a1543750d.squirrel@localhost>
Date:	Fri, 17 Sep 2010 10:45:54 -0500
From:	david.hagood@...il.com
To:	linux-kernel@...r.kernel.org
Subject: Rescan/resize/reallocate PCI device BAR when it changes?

I have a PCI device which can, at run time, change the size of the BARs it
makes visible (e.g. a BAR which was disabled can become enabled, a BAR
that was 64kiByte becomes 128kiByte, etc.

I would like to get the kernel to reallocate the resources for that device
without having to shut the device down and reload the device driver - the
device driver will "know" how to handle this sort of event (actually, the
driver will be the one that caused the event).

I've tried various combinations of pci_scan_bus, pci_request_resources,
etc. to no avail: I can see the hardware change size, but the kernel data
structures for the PCI device steadfastly remain unchanged.

This is a fairly common issue for us embedded programmers: we have things
like FPGAs and microprocessors as endpoints that, as the device driver
finishes programming them, will suddenly have a need for different sized
BARs.

I realize that in some cases, it may not be possible to simply resize
things (e.g. not enough resources exist within the space allocated for the
bridge the device lives on to resize things), and I am prepared to handle
such events.


--
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