Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1740889 > unrolled thread
| Started by | Darren Hart <dvhart@infradead.org> |
|---|---|
| First post | 2017-09-27 19:00 +0200 |
| Last post | 2017-09-27 22:00 +0200 |
| Articles | 6 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface for SMBIOS tokens Darren Hart <dvhart@infradead.org> - 2017-09-27 19:00 +0200
RE: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface for SMBIOS tokens <Mario.Limonciello@dell.com> - 2017-09-27 20:30 +0200
Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface for SMBIOS tokens Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-09-27 20:40 +0200
Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface for SMBIOS tokens Darren Hart <dvhart@infradead.org> - 2017-09-27 21:00 +0200
Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface for SMBIOS tokens Andy Lutomirski <luto@kernel.org> - 2017-09-27 21:50 +0200
RE: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface for SMBIOS tokens <Mario.Limonciello@dell.com> - 2017-09-27 22:00 +0200
| From | Darren Hart <dvhart@infradead.org> |
|---|---|
| Date | 2017-09-27 19:00 +0200 |
| Subject | Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface for SMBIOS tokens |
| Message-ID | <uunQJ-5FA-7@gated-at.bofh.it> |
On Mon, Sep 25, 2017 at 05:31:05PM +0000, Mario.Limonciello@dell.com wrote: > > -----Original Message----- > > From: Andy Shevchenko [mailto:andy.shevchenko@gmail.com] > > Sent: Monday, September 25, 2017 1:04 PM > > To: Pali Rohár <pali.rohar@gmail.com> > > Cc: Limonciello, Mario <Mario_Limonciello@Dell.com>; dvhart@infradead.org; > > LKML <linux-kernel@vger.kernel.org>; Platform Driver <platform-driver- > > x86@vger.kernel.org>; quasisec@google.com > > Subject: Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface > > for SMBIOS tokens > > > > On Mon, Sep 25, 2017 at 7:23 PM, Pali Rohár <pali.rohar@gmail.com> wrote: > > > On Thursday 21 September 2017 08:57:11 Mario Limonciello wrote: > > >> Currently userspace tools can access system tokens via the dcdbas > > >> kernel module and a SMI call that will cause the platform to execute > > >> SMM code. > > >> > > >> With a goal in mind of deprecating the dcdbas kernel module a different > > >> method for accessing these tokens from userspace needs to be created. > > >> > > >> This is intentionally marked to only be readable as root as it can > > >> contain sensitive information about the platform's configuration. > > > > > > Darren, Andy, any comments? I'm not quite sure if such API is suitable > > > for long term in kernel. > > > > I would try to avoid sysfs interfaces for some particular devices. > > Besides we are creating a character device. Would it be suitable there? > > If the character device having 2 different ioctls for different needs is > acceptable I'm happy to adjust the series to do this instead. One piece of feedback I had re the char device was to see if we could avoid the need for the IOCTL altogether, I'd like to have that discussion before we add another. > > > > > > Basically tokens are list of tuples <id, location, value> with > > > possibility to active them, right? > > > > > I didn't add a way to activate them through this, it was only for > reading purpose. Activating them should be possible through the > SMBIOS calling interface though. > These are read-only as I understood it, and only with the right privileges. Sysfs seemed appropriate for this to me. -- Darren Hart VMware Open Source Technology Center
[toc] | [next] | [standalone]
| From | <Mario.Limonciello@dell.com> |
|---|---|
| Date | 2017-09-27 20:30 +0200 |
| Message-ID | <uupfP-6E9-15@gated-at.bofh.it> |
| In reply to | #1740889 |
> -----Original Message----- > From: Darren Hart [mailto:dvhart@infradead.org] > Sent: Wednesday, September 27, 2017 12:51 PM > To: Limonciello, Mario <Mario_Limonciello@Dell.com> > Cc: andy.shevchenko@gmail.com; pali.rohar@gmail.com; linux- > kernel@vger.kernel.org; platform-driver-x86@vger.kernel.org; > quasisec@google.com > Subject: Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface > for SMBIOS tokens > > On Mon, Sep 25, 2017 at 05:31:05PM +0000, Mario.Limonciello@dell.com wrote: > > > -----Original Message----- > > > From: Andy Shevchenko [mailto:andy.shevchenko@gmail.com] > > > Sent: Monday, September 25, 2017 1:04 PM > > > To: Pali Rohár <pali.rohar@gmail.com> > > > Cc: Limonciello, Mario <Mario_Limonciello@Dell.com>; dvhart@infradead.org; > > > LKML <linux-kernel@vger.kernel.org>; Platform Driver <platform-driver- > > > x86@vger.kernel.org>; quasisec@google.com > > > Subject: Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs > interface > > > for SMBIOS tokens > > > > > > On Mon, Sep 25, 2017 at 7:23 PM, Pali Rohár <pali.rohar@gmail.com> wrote: > > > > On Thursday 21 September 2017 08:57:11 Mario Limonciello wrote: > > > >> Currently userspace tools can access system tokens via the dcdbas > > > >> kernel module and a SMI call that will cause the platform to execute > > > >> SMM code. > > > >> > > > >> With a goal in mind of deprecating the dcdbas kernel module a different > > > >> method for accessing these tokens from userspace needs to be created. > > > >> > > > >> This is intentionally marked to only be readable as root as it can > > > >> contain sensitive information about the platform's configuration. > > > > > > > > Darren, Andy, any comments? I'm not quite sure if such API is suitable > > > > for long term in kernel. > > > > > > I would try to avoid sysfs interfaces for some particular devices. > > > Besides we are creating a character device. Would it be suitable there? > > > > If the character device having 2 different ioctls for different needs is > > acceptable I'm happy to adjust the series to do this instead. > > One piece of feedback I had re the char device was to see if we could avoid the > need for the IOCTL altogether, I'd like to have that discussion before we add > another. My original design was sysfs files for everything but it was raised by several folks that you run into the potential of two userspace processes stomping on each other's data when they run the ACPI call. That's why I need to have a mutex to protect and make sure that userspace calls get the right results. > > > > > > > > > > Basically tokens are list of tuples <id, location, value> with > > > > possibility to active them, right? > > > > > > > > I didn't add a way to activate them through this, it was only for > > reading purpose. Activating them should be possible through the > > SMBIOS calling interface though. > > > > These are read-only as I understood it, and only with the right privileges. > Sysfs seemed appropriate for this to me. Andy S was against having this data as another sysfs file. From a userspace perspective I think it's simpler to just parse a sysfs file with read only static data as root. With the current ioctl based solution it requires userspace to run an ioctl to determine how many tokens exist, then allocate a chunk of memory big enough to hold all the token data and then run another ioctl to get all the tokens. Andy S, given this change between v1 and v2 what do you feel is better?
[toc] | [prev] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2017-09-27 20:40 +0200 |
| Message-ID | <uuppv-6Hf-5@gated-at.bofh.it> |
| In reply to | #1740941 |
On Wed, Sep 27, 2017 at 9:27 PM, <Mario.Limonciello@dell.com> wrote: >> > > > Darren, Andy, any comments? I'm not quite sure if such API is suitable >> > > > for long term in kernel. >> > > >> > > I would try to avoid sysfs interfaces for some particular devices. >> > > Besides we are creating a character device. Would it be suitable there? >> > >> > If the character device having 2 different ioctls for different needs is >> > acceptable I'm happy to adjust the series to do this instead. >> >> One piece of feedback I had re the char device was to see if we could avoid the >> need for the IOCTL altogether, I'd like to have that discussion before we add >> another. > > My original design was sysfs files for everything but it was raised by several folks > that you run into the potential of two userspace processes stomping on each > other's data when they run the ACPI call. That's why I need to have a mutex to > protect and make sure that userspace calls get the right results. > >> > > > Basically tokens are list of tuples <id, location, value> with >> > > > possibility to active them, right? >> > > > >> > >> > I didn't add a way to activate them through this, it was only for >> > reading purpose. Activating them should be possible through the >> > SMBIOS calling interface though. >> > >> >> These are read-only as I understood it, and only with the right privileges. >> Sysfs seemed appropriate for this to me. > > Andy S was against having this data as another sysfs file. From a userspace > perspective I think it's simpler to just parse a sysfs file with read only static > data as root. With the current ioctl based solution it requires userspace to run > an ioctl to determine how many tokens exist, then allocate a chunk of memory > big enough to hold all the token data and then run another ioctl to get all the tokens. > > Andy S, given this change between v1 and v2 what do you feel is better? I have no strong opinion on this. That's why I recommended to listen to Andy L. -- With Best Regards, Andy Shevchenko
[toc] | [prev] | [next] | [standalone]
| From | Darren Hart <dvhart@infradead.org> |
|---|---|
| Date | 2017-09-27 21:00 +0200 |
| Message-ID | <uupIS-6NI-1@gated-at.bofh.it> |
| In reply to | #1740942 |
On Wed, Sep 27, 2017 at 09:31:47PM +0300, Andy Shevchenko wrote: > On Wed, Sep 27, 2017 at 9:27 PM, <Mario.Limonciello@dell.com> wrote: > > >> > > > Darren, Andy, any comments? I'm not quite sure if such API is suitable > >> > > > for long term in kernel. > >> > > > >> > > I would try to avoid sysfs interfaces for some particular devices. > >> > > Besides we are creating a character device. Would it be suitable there? > >> > > >> > If the character device having 2 different ioctls for different needs is > >> > acceptable I'm happy to adjust the series to do this instead. > >> > >> One piece of feedback I had re the char device was to see if we could avoid the > >> need for the IOCTL altogether, I'd like to have that discussion before we add > >> another. > > > > My original design was sysfs files for everything but it was raised by several folks > > that you run into the potential of two userspace processes stomping on each > > other's data when they run the ACPI call. That's why I need to have a mutex to > > protect and make sure that userspace calls get the right results. > > > > >> > > > Basically tokens are list of tuples <id, location, value> with > >> > > > possibility to active them, right? > >> > > > > >> > > >> > I didn't add a way to activate them through this, it was only for > >> > reading purpose. Activating them should be possible through the > >> > SMBIOS calling interface though. > >> > > >> > >> These are read-only as I understood it, and only with the right privileges. > >> Sysfs seemed appropriate for this to me. > > > > Andy S was against having this data as another sysfs file. From a userspace > > perspective I think it's simpler to just parse a sysfs file with read only static > > data as root. With the current ioctl based solution it requires userspace to run > > an ioctl to determine how many tokens exist, then allocate a chunk of memory > > big enough to hold all the token data and then run another ioctl to get all the tokens. > > > > Andy S, given this change between v1 and v2 what do you feel is better? > > I have no strong opinion on this. That's why I recommended to listen to Andy L. +Andy Lutomirski Andy L, any preference on your part regarding exporting these tokens via sysfs or through an additional IOCTL in the chardev? -- Darren Hart VMware Open Source Technology Center
[toc] | [prev] | [next] | [standalone]
| From | Andy Lutomirski <luto@kernel.org> |
|---|---|
| Date | 2017-09-27 21:50 +0200 |
| Message-ID | <uuqvf-7kB-5@gated-at.bofh.it> |
| In reply to | #1740950 |
On 09/27/2017 11:55 AM, Darren Hart wrote: > On Wed, Sep 27, 2017 at 09:31:47PM +0300, Andy Shevchenko wrote: >> On Wed, Sep 27, 2017 at 9:27 PM, <Mario.Limonciello@dell.com> wrote: >> >>>>>>> Darren, Andy, any comments? I'm not quite sure if such API is suitable >>>>>>> for long term in kernel. >>>>>> >>>>>> I would try to avoid sysfs interfaces for some particular devices. >>>>>> Besides we are creating a character device. Would it be suitable there? >>>>> >>>>> If the character device having 2 different ioctls for different needs is >>>>> acceptable I'm happy to adjust the series to do this instead. >>>> >>>> One piece of feedback I had re the char device was to see if we could avoid the >>>> need for the IOCTL altogether, I'd like to have that discussion before we add >>>> another. >>> >>> My original design was sysfs files for everything but it was raised by several folks >>> that you run into the potential of two userspace processes stomping on each >>> other's data when they run the ACPI call. That's why I need to have a mutex to >>> protect and make sure that userspace calls get the right results. >>> >> >>>>>>> Basically tokens are list of tuples <id, location, value> with >>>>>>> possibility to active them, right? >>>>>>> >>>>> >>>>> I didn't add a way to activate them through this, it was only for >>>>> reading purpose. Activating them should be possible through the >>>>> SMBIOS calling interface though. >>>>> >>>> >>>> These are read-only as I understood it, and only with the right privileges. >>>> Sysfs seemed appropriate for this to me. >>> >>> Andy S was against having this data as another sysfs file. From a userspace >>> perspective I think it's simpler to just parse a sysfs file with read only static >>> data as root. With the current ioctl based solution it requires userspace to run >>> an ioctl to determine how many tokens exist, then allocate a chunk of memory >>> big enough to hold all the token data and then run another ioctl to get all the tokens. >>> >>> Andy S, given this change between v1 and v2 what do you feel is better? >> >> I have no strong opinion on this. That's why I recommended to listen to Andy L. > > +Andy Lutomirski > > Andy L, any preference on your part regarding exporting these tokens via sysfs > or through an additional IOCTL in the chardev? > Not really. If this is indeed static data that is potentially useful for scripts and such, than sysfs is kind of nice.
[toc] | [prev] | [next] | [standalone]
| From | <Mario.Limonciello@dell.com> |
|---|---|
| Date | 2017-09-27 22:00 +0200 |
| Message-ID | <uuqEW-7nX-3@gated-at.bofh.it> |
| In reply to | #1740973 |
> -----Original Message----- > From: Andy Lutomirski [mailto:luto@kernel.org] > Sent: Wednesday, September 27, 2017 3:49 PM > To: Darren Hart <dvhart@infradead.org>; Andy Shevchenko > <andy.shevchenko@gmail.com>; Andy Lutomirski <luto@amacapital.net> > Cc: Limonciello, Mario <Mario_Limonciello@Dell.com>; Pali Rohár > <pali.rohar@gmail.com>; linux-kernel@vger.kernel.org; Platform Driver <platform- > driver-x86@vger.kernel.org>; quasisec@google.com > Subject: Re: [PATCH 06/12] platform/x86: dell-wmi-smbios: Add a sysfs interface > for SMBIOS tokens > > On 09/27/2017 11:55 AM, Darren Hart wrote: > > On Wed, Sep 27, 2017 at 09:31:47PM +0300, Andy Shevchenko wrote: > >> On Wed, Sep 27, 2017 at 9:27 PM, <Mario.Limonciello@dell.com> wrote: > >> > >>>>>>> Darren, Andy, any comments? I'm not quite sure if such API is suitable > >>>>>>> for long term in kernel. > >>>>>> > >>>>>> I would try to avoid sysfs interfaces for some particular devices. > >>>>>> Besides we are creating a character device. Would it be suitable there? > >>>>> > >>>>> If the character device having 2 different ioctls for different needs is > >>>>> acceptable I'm happy to adjust the series to do this instead. > >>>> > >>>> One piece of feedback I had re the char device was to see if we could avoid the > >>>> need for the IOCTL altogether, I'd like to have that discussion before we add > >>>> another. > >>> > >>> My original design was sysfs files for everything but it was raised by several > folks > >>> that you run into the potential of two userspace processes stomping on each > >>> other's data when they run the ACPI call. That's why I need to have a mutex to > >>> protect and make sure that userspace calls get the right results. > >>> > >> > >>>>>>> Basically tokens are list of tuples <id, location, value> with > >>>>>>> possibility to active them, right? > >>>>>>> > >>>>> > >>>>> I didn't add a way to activate them through this, it was only for > >>>>> reading purpose. Activating them should be possible through the > >>>>> SMBIOS calling interface though. > >>>>> > >>>> > >>>> These are read-only as I understood it, and only with the right privileges. > >>>> Sysfs seemed appropriate for this to me. > >>> > >>> Andy S was against having this data as another sysfs file. From a userspace > >>> perspective I think it's simpler to just parse a sysfs file with read only static > >>> data as root. With the current ioctl based solution it requires userspace to run > >>> an ioctl to determine how many tokens exist, then allocate a chunk of memory > >>> big enough to hold all the token data and then run another ioctl to get all the > tokens. > >>> > >>> Andy S, given this change between v1 and v2 what do you feel is better? > >> > >> I have no strong opinion on this. That's why I recommended to listen to Andy L. > > > > +Andy Lutomirski > > > > Andy L, any preference on your part regarding exporting these tokens via sysfs > > or through an additional IOCTL in the chardev? > > > > Not really. If this is indeed static data that is potentially useful > for scripts and such, than sysfs is kind of nice. OK thanks. I'll switch back to sysfs for v3.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web