linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zheng, Lv" <lv.zheng@intel.com>
To: "Purdila, Octavian" <octavian.purdila@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	"Matt Fleming" <matt@codeblueprint.co.uk>,
	Mark Brown <broonie@kernel.org>,
	"Wolfram Sang" <wsa@the-dreams.de>,
	Joel Becker <jlbec@evilplan.org>, Christoph Hellwig <hch@lst.de>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Tirdea, Irina" <irina.tirdea@intel.com>
Subject: RE: [RFC PATCH 10/10] acpi: add support for loading SSDTs via configfs
Date: Thu, 7 Apr 2016 02:42:50 +0000	[thread overview]
Message-ID: <1AE640813FDE7649BE1B193DEA596E883BB66E60@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <CAE1zotKa+t5cxznWfPyQ599k9ZB=akOuEDZusWcJgzux8wqp5A@mail.gmail.com>

Hi,

> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> owner@vger.kernel.org] On Behalf Of Octavian Purdila
> Subject: Re: [RFC PATCH 10/10] acpi: add support for loading SSDTs via configfs
> 
> On Wed, Apr 6, 2016 at 9:05 AM, Zheng, Lv <lv.zheng@intel.com> wrote:
> 
> >> It is hard to create new kernel objects from sysfs. You need to resort
> >> to hacks like using new_table sysfs entries which does not map to a
> >> kernel object. Writes larger then PAGE_SIZE are impossible to handle
> >> with multiple open files because you have no open callback to create a
> >> file context. It is also not possible to do any clean-up because there
> >> is no close callback and if something goes wrong for example when
> >> trying to install the table you will leak the allocated memory.
> >>
> >> configfs was designed for the specific purpose of creating kernel
> >> objects from userspace and addresses all of the limitations above (and
> >> some more).
> >>
> >> Initially I started to implement this functionality via sysfs but I
> >> run into the issues mentioned above and decided to use configfs.
> > [Lv Zheng]
> > I can sense different difficulties from your descriptions.
> > Let me break it down into details.
> >
> > We already have acpi_table_handler working there for creating new ACPI
> table entries for us.
> > Based on this facility, let's think about the following solution:
> > 1. sysfs presenting change
> > We can change the table file to a table directory whose name is in the
> following format:
> > TableSignature-OemId-OemTableId
> > Then we can get rid of the annoying numbered table name suffix first.
> > The numbered table name suffix cannot be kept consistent to reflect the real
> index if we allow tables to be dynamically loaded/unloaded.
> >
> > This is the first design difficulty we need to solve.
> >
> > 2. acpi_table_handler change
> > Now we can append 2 new events to acpi_table_handler -
> ACPI_TABLE_INSTALL/ACPI_TABLE_UNINSTALL.
> > With which, the sysfs entries can be created/deleted when the table is added
> to/removed from the global table list.
> > And this should be the working mechanism for us
> > So we actually don't have the trouble to deal with the new kernel object
> creation/deletion from sysfs.
> >
> > I agree the dynamic kernel object creation/deletion need special care.
> > But this actually is what a kernel engineer should do because this kind of
> things happen here and there throughout the kernel.
> > We should have already been used to that.
> >
> > This is the second engineering difficulty we need to face.
> >
> > 3. load/unload commanding
> > Now we need a character device in sysfs to handle load/unload command.
> > Well, there are many such kind of files in sysfs, for example, device nodes.
> > So this is not a non-achievable task, but just a difficult engineering task.
> > The system engineers need to be skillful enough to implement this.
> > Like the dynamic kernel object handling, we should have already been used to
> this.
> >
> >
> > If you still think this is difficult, the alternative choice is to use acpidbg char
> device's ioctl interface.
> > That could simplifies this task.
> > And since the ioctl interface is required by ACPICA disassembler, the work on
> that will be inherited by the disassembler porting.
> >
> 
> Why can't the dissembler access the tables through the existing sysfs interface?
[Lv Zheng] 
The acpidbg utility should be self-contained.
It will be back ported to ACPICA.
So it might be ported to other OSPMs.
>From this point of view, acpidbg need such kind of design - doing everything it need from an OSPM kernel using a single char device.

Thanks and best regards
-Lv

> 
> > This is the last engineering difficulty we need to face.
> >
> > So why can't these solutions work for us?
> >
> 
> It can be done, but it is not the right way to do it, IMO.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-04-07  2:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31  9:36 [RFC PATCH 00/10] ACPI overlays Octavian Purdila
2016-03-31  9:36 ` [RFC PATCH 01/10] kernel: add TAINT_OVERLAY_ACPI_TABLE Octavian Purdila
2016-03-31  9:36 ` [RFC PATCH 02/10] acpi: install SSDT tables from initrd Octavian Purdila
2016-04-01  5:05   ` Zheng, Lv
2016-04-01 10:11     ` Octavian Purdila
2016-04-04 13:07       ` Octavian Purdila
2016-04-05  0:49         ` Zheng, Lv
2016-04-05  7:23           ` Octavian Purdila
2016-04-06  6:15             ` Zheng, Lv
2016-04-05  0:57       ` Zheng, Lv
2016-03-31  9:36 ` [RFC PATCH 03/10] acpi: add support for ACPI reconfiguration notifiers Octavian Purdila
2016-03-31  9:37 ` [RFC PATCH 04/10] acpi: fix enumeration (visited) flags for bus rescans Octavian Purdila
2016-03-31  9:37 ` [RFC PATCH 05/10] i2c: add support for ACPI reconfigure notifications Octavian Purdila
2016-03-31  9:37 ` [RFC PATCH 06/10] spi: " Octavian Purdila
2016-03-31 17:29   ` Mark Brown
2016-04-01 10:54     ` Octavian Purdila
2016-04-01 14:08       ` Mark Brown
2016-04-01 19:26         ` Rafael J. Wysocki
2016-04-02 16:24           ` Mark Brown
2016-04-04 10:25             ` Octavian Purdila
2016-04-04 16:03               ` Mark Brown
2016-04-04 19:34                 ` Octavian Purdila
2016-04-04 21:18                   ` Rafael J. Wysocki
2016-04-05 11:49                     ` Octavian Purdila
2016-04-05 18:32                       ` Mark Brown
2016-04-05 19:16                         ` Octavian Purdila
2016-04-05 21:20                           ` Mark Brown
2016-04-05 18:24                   ` Mark Brown
2016-03-31  9:37 ` [RFC PATCH 07/10] efi: load SSTDs from EFI variables Octavian Purdila
2016-03-31  9:37 ` [RFC PATCH 08/10] configfs: fix CONFIGFS_BIN_ATTR_[RW]O definitions Octavian Purdila
2016-03-31  9:37 ` [RFC PATCH 09/10] acpi: add support for configfs Octavian Purdila
2016-03-31  9:37 ` [RFC PATCH 10/10] acpi: add support for loading SSDTs via configfs Octavian Purdila
2016-04-01  4:55   ` Zheng, Lv
2016-04-01 10:01     ` Octavian Purdila
2016-04-05  3:11       ` Zheng, Lv
2016-04-05  8:21         ` Octavian Purdila
2016-04-06  6:05           ` Zheng, Lv
2016-04-06 18:46             ` Octavian Purdila
2016-04-07  2:42               ` Zheng, Lv [this message]

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=1AE640813FDE7649BE1B193DEA596E883BB66E60@SHSMSX101.ccr.corp.intel.com \
    --to=lv.zheng@intel.com \
    --cc=broonie@kernel.org \
    --cc=hch@lst.de \
    --cc=irina.tirdea@intel.com \
    --cc=jlbec@evilplan.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=octavian.purdila@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=wsa@the-dreams.de \
    /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;
as well as URLs for NNTP newsgroup(s).