Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932496AbcDEDLb (ORCPT ); Mon, 4 Apr 2016 23:11:31 -0400 Received: from mga01.intel.com ([192.55.52.88]:2837 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753935AbcDEDL1 (ORCPT ); Mon, 4 Apr 2016 23:11:27 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,442,1455004800"; d="scan'208";a="680880797" From: "Zheng, Lv" To: "Purdila, Octavian" CC: "Rafael J. Wysocki" , Len Brown , Matt Fleming , Mark Brown , Wolfram Sang , Joel Becker , Christoph Hellwig , "linux-acpi@vger.kernel.org" , "linux-efi@vger.kernel.org" , "linux-i2c@vger.kernel.org" , "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Tirdea, Irina" Subject: RE: [RFC PATCH 10/10] acpi: add support for loading SSDTs via configfs Thread-Topic: [RFC PATCH 10/10] acpi: add support for loading SSDTs via configfs Thread-Index: AQHRizE6e+pEvLq6o0qNmDH8tBt2hp90ja9A///QvwCABlgQEA== Date: Tue, 5 Apr 2016 03:11:21 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E883BB6677B@SHSMSX101.ccr.corp.intel.com> References: <1459417026-6697-1-git-send-email-octavian.purdila@intel.com> <1459417026-6697-11-git-send-email-octavian.purdila@intel.com> <1AE640813FDE7649BE1B193DEA596E883BB66233@SHSMSX101.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjdmZDllMzAtOTA5NC00YzA2LWIzODEtNTc2ZTA1YzY2MWE1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik5kU0diaWZ4YlFGU0hOVUNhOWdjRlwvWEJUaFlwaUVMSlpReWprK1dqd0hvPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u353BaTZ024138 Content-Length: 2833 Lines: 63 Hi, > From: Octavian Purdila [mailto:octavian.purdila@intel.com] > Subject: Re: [RFC PATCH 10/10] acpi: add support for loading SSDTs via configfs > > On Fri, Apr 1, 2016 at 7:55 AM, Zheng, Lv wrote: > > Hi, > > Hi Lv, > > >> Add support for acpi_user_table configfs items that allows the user to > >> load new tables. The data attributes contains the table data and once it > >> is filled from userspace the table is loaded and ACPI devices are > >> enumerated. > > [Lv Zheng] > > We've been considering to implement this facility before. > > The 2 alternative solutions are: > > 1. implement LOAD/UNLOAD ioctl for /sys/kernel/debug/acpi/acpidbg - this > will be useful for extracting AML byte stream from kernel to be used by a > userspace disassembler. > > AFAIK adding new ioctls is discouraged. [Lv Zheng] Tools/power/acpi/tools/acpidbg is a file descriptor based utility. And it needs a method to obtain an AML byte stream from kernel. Using ioctl is a best fit design for acpidbg so that it needn't to access any other files. > > > 2. transition /sys/firmware/acpi/tables/xxx into directory and implement > /sys/firmware/acpi/tables/load, /sys/firmware/acpi/tables/unload - this should > be able to meet your requirement. > > We can't do that as it would break the ABI. [Lv Zheng] The only user of this directory hierarchy is acpidump. And the user of this tool are all developers/reporters on the kernel bugzilla. We've been asking the Bugzilla users to use the up-to-date acpidump instead of the distribution vendor provided one for so many years. So IMO, this is not a serious problem you should consider. You only need to think about an acceptable way for the distribution vendors to synchronize the kernel change and the acpidump change. IMO: You may expose a version file from /sys/firmware/acpi. acpidump can be changed accordingly by referencing the version file. And old directory hierarchy support could be kept in acpidump. Note that acpidump is also a part of the kernel, so your change could be consistent. For example, If you changed acpidump prior than making the kernel change, the distribution vendors might have already released the new acpidump for all old kernels before you transitioned the directory hierarchy. > > > So my first question is: > > Why do you use configfs rather than the existing mechanisms? > > sysfs is not a good choice for dealing with objects created from > userspace, configfs was created to address this specific need. Since > we want to be able to create and load new tables from userspace this > use-case fits very well with configfs. [Lv Zheng] Was the table binary stream still maintained by the userspace? If not, I couldn't see the difference/advantages from using /sys/firmware/acpi/tables to using configfs. Thanks and best regards -Lv