From: Nathan Lutchansky <lutchann@litech.org>
To: Michael E Brown <Michael_E_Brown@dell.com>
Cc: Kyle Moffett <mrmacman_g4@mac.com>,
linux-kernel@vger.kernel.org, Douglas_Warzecha@Dell.com,
Matt_Domsch@Dell.com
Subject: Re: [RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support
Date: Tue, 16 Aug 2005 01:59:40 -0400 [thread overview]
Message-ID: <20050816055940.GJ24959@litech.org> (raw)
In-Reply-To: <1124161828.10755.87.camel@soltek.michaels-house.net>
On Mon, Aug 15, 2005 at 10:10:28PM -0500, Michael E Brown wrote:
> On Mon, 2005-08-15 at 21:29 -0400, Kyle Moffett wrote:
> > On Aug 15, 2005, at 18:58:56, Michael_E_Brown@Dell.com wrote:
> > >> Why can't you just implement the system management actions in
> > >> the kernel driver? This is tantamount to a binary SMI hook to
> > >> userspace. What functionality does this provide on a dell
> > >> system from an administrator's point of view?
> >
> > > The second alternative is not entirely feasible. We have over 60
> > > SMI functions, and we would have to write a kernel-mode wrapper for
> > > each and every one. I hope you agree that code that doesn't exist is
> > > less buggy than code that is, and that code that is in userspace is a
> > > whole lot less likely to cause a kernel crash than code that is in
> > > the kernel.
Where is this list of SMI functions? I looked through your library
documentation and it wasn't clear. Is this it?
http://linux.dell.com/libsmbios/main/namespacesmbios.html#a156a6
> > I think the second alternative is actually feasible and preferable. The
> > point of the kernel is to provide safe and secure access to two things:
> > 1) Hardware through an abstraction layer
> > 2) Software services (like IP stack) that are not feasible to do in
> > userspace.
[...]
> Sorry, but I think you mis-understand the whole point behind this
> driver. This _is_ an abstraction.
Not really. You've just created a little interface so you can diddle
hardware directly from userspace. That's about as far from a proper
abstraction as you can get.
There appears to be no validation of any of the data that your library
attempts to poke into the hardware. Is it possible to crash or
irrepairably confuse the hardware from userspace using this interface?
If so, you're circumventing one of the basic functions of the
kernel/application separation.
> In our case, we have a whole bunch of unrelated SMI calls to the BIOS
> that have absolutely nothing in common except that they use the SMI
> calling method. We have abstracted down to the lowest common denominator
> of what we can put into the kernel to enable our whole managment stack.
Being that Linux isn't a microkernel, that's not the way we go about
things. If we were trying to move as much as possible to userspace,
every USB driver would be implemented as a library talking to usbfs, and
ACPI tables would be interpreted by a little app run at boot.
Your interface between userspace and the kernel needs to expose to
userspace only the functionality it provides while hiding the details of
actually twiddling the hardware. Preferably, the sysfs files you need
can be structured so that the same type of management interface can be
implemented by other vendors and it will look roughly the same to
userspace. (Creating standard interfaces to similar but different
hardware is what sysfs is all about.)
> To take a concrete example, I suggested to Doug to mention fan status. I
> get the feeling that you possibly think that this would be better
> integrated into lmsensors, or something like that. That really isn't the
> case, as lmsensors is really geared towards bit-banging lm81 (for
> example) chips to get fan status. In our case, we have a standardized
> BIOS interface to get this info, and that standardized method involves
> SMI and not bit-banging interfaces. Once this driver is accepted into
> the kernel, we can go and add support in the _userspace_ lmsensors libs
> to poll fan and temp using this driver.
Actually, that's what the new hwmon class is for. Your kernel driver
should provide access to the (raw) fan status values through hwmon
files, and the lm_sensors library will read it from there just like
every other fan sensor device.
If the hwmon class doesn't provide the functionality you need for this,
bring it up for discussion here, rather than going off and inventing
your own proprietary interface.
> What you are asking us to do is just not feasible on many levels. First,
> just from the number of functions we would have to implement. We would
> have to implement about 60 new sysfs files, with at least 120 separate
> functions for read/write.
lutchann@faboo ~ $ find /sys -type f | wc -l
1561
lutchann@faboo ~ $
Adding 60 more files isn't going to horribly bloat sysfs, and your
implementation cost is probably lower than adding functions to your
library.
> Each function would have to take into account
> the specific calling requirements of that specific function. Then, we
> would have to implement all of the bugfixes and platform-specific
> workarounds in the kernel for each of those functions for each Dell
> platform.
That's kind of the point of sysfs--exposing system and hardware knobs
and gauges in a safe manner. Again, if you're not able to validate what
userspace gives you before stuffing it into the hardware, you need to
rethink your interface.
> Each time another function is added to BIOS, we would have to
> go out and patch everybody's kernel to support the new function.
How is this different from requiring everyone to download a new version
of your library?
> there just isn't
> the manpower to maintain all of these in the kernel along with the
> requisite testing for each update,
I suspect that saying, "I don't have time to do this properly so please
merge this anyway" is not a very good way to get your patch accepted.
> not to mention the lag between when
> we have to submit something and when it would show up in a vendor
> kernel.
Maybe this could be helped by working more closely with vendors to get
your changes integrated into their kernel packages?
> > > We are trying to keep our kernel bloat down. We don't really think
> > > that
> > > customers of IBM or HP really want their Red Hat kernels loaded
> > > down with
> > > a bunch of Dell-only code.
> >
> > That's what kconfig is for. My G4 Powerbook doesn't have support for
> > hardware found in my G4 desktop any more than an IBM box should be
> > forced
> > to have support for Dell hardware, yet all platforms work fine from the
> > same kernel tree.
>
> Vendor kernels? Red Hat and SuSE (to pick two) ship, basically, one i386
> kernel (granted, with UP/SMP/bigmem flavors), and we would like to make
> it easy for them to enable this by default.
That's why we have modules. Red Hat and SuSE ship support for a lot
more network cards, for example, than most people own, but that doesn't
mean they're all compiled into the kernel all the time.
I really like what you're trying to do here, but please rethink your
kernel API. It makes much more sense to have a standard interface for
providing system management functions than for each vendor to create
their own proprietary libraries. -Nathan
next prev parent reply other threads:[~2005-08-16 5:59 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-15 22:58 [RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support Michael_E_Brown
2005-08-16 1:29 ` Kyle Moffett
2005-08-16 3:10 ` Michael E Brown
2005-08-16 5:59 ` Nathan Lutchansky [this message]
2005-08-16 8:16 ` Greg KH
2005-08-16 13:34 ` Michael E Brown
2005-08-16 20:31 ` Pavel Machek
2005-08-16 20:37 ` Greg KH
2005-08-16 23:11 ` Michael_E_Brown
2005-08-16 23:23 ` Greg KH
[not found] <4277B1B44843BA48B0173B5B0A0DED4352817E@ausx3mps301.aus.amer.dell.com.suse.lists.linux.kernel>
[not found] ` <DEFA2736-585A-4F84-9262-C3EB53E8E2A0@mac.com.suse.lists.linux.kernel>
[not found] ` <1124161828.10755.87.camel@soltek.michaels-house.net.suse.lists.linux.kernel>
[not found] ` <20050816081622.GA22625@kroah.com.suse.lists.linux.kernel>
[not found] ` <1124199265.10755.310.camel@soltek.michaels-house.net.suse.lists.linux.kernel>
[not found] ` <20050816203706.GA27198@kroah.com.suse.lists.linux.kernel>
[not found] ` <4277B1B44843BA48B0173B5B0A0DED43528192@ausx3mps301.aus.amer.dell.com.suse.lists.linux.kernel>
2005-08-17 0:23 ` Andi Kleen
2005-08-17 0:41 ` Michael E Brown
-- strict thread matches above, loose matches on Subject: below --
2005-08-16 23:47 Michael_E_Brown
2005-08-17 5:33 ` Matt Domsch
2005-08-17 7:32 ` Kyle Moffett
2005-08-16 5:19 Michael E Brown
2005-08-16 5:35 ` Chris Wedgwood
2005-08-16 5:50 ` Michael E Brown
2005-08-16 4:58 Michael E Brown
2005-08-16 5:36 ` Valdis.Kletnieks
2005-08-16 6:10 ` Michael E Brown
2005-08-16 6:45 ` Valdis.Kletnieks
2005-08-16 12:15 ` Andrey Panin
2005-08-16 4:09 Michael E Brown
2005-08-16 5:17 ` Valdis.Kletnieks
2005-08-16 5:30 ` Michael E Brown
2005-08-15 20:05 Doug Warzecha
2005-08-15 20:23 ` Kyle Moffett
2005-08-15 23:38 ` Doug Warzecha
2005-08-16 1:44 ` Kyle Moffett
2005-08-16 2:43 ` Valdis.Kletnieks
2005-08-16 4:34 ` Chris Wedgwood
2005-08-16 4:55 ` Kyle Moffett
2005-08-16 5:14 ` Chris Wedgwood
2005-08-16 5:52 ` Greg KH
2005-08-17 0:02 ` Doug Warzecha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050816055940.GJ24959@litech.org \
--to=lutchann@litech.org \
--cc=Douglas_Warzecha@Dell.com \
--cc=Matt_Domsch@Dell.com \
--cc=Michael_E_Brown@dell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mrmacman_g4@mac.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox