add SMBIOS information to /proc/smbios -- UPDATED
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Michael Brown
Below is an updated patch to add SMBIOS information to
/proc/smbios.
Updates have been made per Al's previous comments. Please apply.
What is this good for? There are tools to read this from /dev/mem; and that is fine because the information is static. There is no reason to bloat the kernel with this.
-Andi
Quoted 8 lines · Andi Kleen
Quoted 2 lines · Michael Brown
Below is an updated patch to add SMBIOS information to
/proc/smbios.
Updates have been made per Al's previous comments. Please apply.What is this good for? There are tools to read this from
/dev/mem; and that is fine because the information is static. There is no reason to bloat the kernel with this.
As I mentioned in my first posting of this to l-k, there are three reasons why this driver is necessary:
-- This information is, in the very near future, _not_ going to be static anymore. There will be systems that update the information in dynamically during SMIs.
-- SMBIOS consists of two things, the table entry point and the table itself. The table entry point is always in 0xF0000 - 0xFFFFF. Traditionally, the actual table has been here as well. BIOS is running out of space here and future systems are moving this information to high memory. /dev/mem will not allow access to memory above top of system RAM.
-- Red Hat has a /dev/mem patch in their tree that restricts access to RAM above 1MB.
Because of all of these reasons, we feel it is a good thing to have a stable method to get to the SMBIOS information that will work into the future. Our userspace libs will try to use this driver to access SMBIOS, but fall back to /dev/mem if this driver is not available. (with the caveat that nothing will work if table >1MB and this driver not present.)
As for the "bloat" argument: this driver is about the most trivial driver I can conceive of that does useful work. It is 250 raw lines of code, comparable in size to /proc/meminfo or /proc/cpuinfo.
This 250 line driver allows us to move a few thousand lines of code from Dell's current, proprietary systems management driver into userspace. If this approach is accepted, I am pushing to work on opening up other pieces of Dell's current proprietary drivers. This work is a proof-of-concept to management that this approach can work. --
Michael
Quoted 9 lines · Michael Brown
Quoted 8 lines · Andi Kleen
Quoted 2 lines · Michael Brown
Below is an updated patch to add SMBIOS information to
/proc/smbios.
Updates have been made per Al's previous comments. Please apply.What is this good for? There are tools to read this from
/dev/mem; and that is fine because the information is static. There is no reason to bloat the kernel with this.
Sorry, I missed one other reason.
This procfs/sysfs driver allows access to smbios information by non-root, non CAP_SYS_RAWIO users. I've had several occasions where I have been bitten by having to be root to read smbios when I did not need root for anything else.
--
Michael
Quoted 3 lines
-- This information is, in the very near future, _not_ going to be static anymore. There will be systems that update the information in dynamically during SMIs.
That's fine - /dev/mem can handle that too. An user will have to poll for changes anyways, so having it it /proc does not have any advantages.
I would see the sense if there was an interrupt to notify the the system of changes, but there isn't ;-)
Quoted 7 lines
-- SMBIOS consists of two things, the table entry point and the table itself. The table entry point is always in
0xF0000-0xFFFFF. Traditionally, the actual table has been here as well. BIOS is running out of space here and future systems are moving this information to high memory./dev/memwill not allow access to memory above top of system RAM.
mmap /dev/mem of high memory should work. Did you try it? For read/write it would be fairly easy to add, just needs a kmap.
Quoted 2 lines
-- Red Hat has a
/dev/mempatch in their tree that restricts access to RAM above 1MB.
That's their breakage.
Clearly it is a useless change anyways because you can easily circumvent it by just accessing any bus master hardware in the system.
Quoted 4 lines
This procfs/sysfs driver allows access to smbios information by non-root, non
CAP_SYS_RAWIOusers. I've had several occasions where I have been bitten by having to be root to read smbios when I did not need root for anything else.
That is what suid root was invented for. It is a fairly nifty mechanism, did you ever try it? I know that some sysadmins try to get away from it, but that is clearly misguided because it is not any more dangerous than adding more kernel code.
-Andi