* [PATCH 1/4] ACPI: Provide support for ACPI table adding via OS
[not found] <1393608241-31037-1-git-send-email-trenn@suse.de>
@ 2014-02-28 17:23 ` Thomas Renninger
2014-02-28 17:27 ` Thomas Renninger
2014-02-28 17:23 ` [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback Thomas Renninger
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Thomas Renninger @ 2014-02-28 17:23 UTC (permalink / raw)
To: robert.moore, lv.zheng, david.e.box, rafael.j.wysocki
Cc: Thomas Renninger, hpa, tglx, ck, linux-kernel, x86, mingo, rjw,
devel
This is done the same way as the previous ACPI physical table override
mechanism.
How to override or add tables via initrd, please look up:
Documentation/acpi/initrd_table_override.txt
SSDTs can only be overridden, not added.
Overriding only happens if the OEM id of the table header matches the one
with the BIOS provided one.
All table types (SSDTs are an exception), must only show up once.
So either you:
- Add a fresh new table for adding of which type (signature) none exists
in the BIOS -> OS ACPI table adding happens.
or
- Add a table which already exists in BIOS, but the OEM id must match the
one of the table of the same type (signature) that exists in BIOS already
-> OS ACPI table overriding happens
Typically one copies away the original ACPI table, disassembles,
modifies (for example adding debug strings), compiles it and provides
the table via initrd for overriding (will have the same OEM id).
But this is not necessary, one could also come up with a selfmade
table for overriding, by taking care that the signature and OEM id is
the same as the one provided by BIOS
In ACPI table overriding case you see in dmesg:
ACPI: Override [DSDT- BXDSDT], this is unsafe: tainting kernel
Disabling lock debugging due to kernel taint
In ACPI table adding case you see in dmesg (BGRT table got added):
ACPI: Add [BGRT-SLIC-WKS], this is unsafe: tainting kernel
ACPI: BGRT 000000007fffd1ba 000038 (v00 HPQOEM SLIC-WKS 01072009
INTL 20130823)
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: hpa@zytor.com
CC: tglx@linutronix.de
CC: ck@conrad-kostecki.de
CC: linux-kernel@vger.kernel.org
CC: x86@kernel.org
CC: mingo@redhat.com
CC: rjw@rjwysocki.net
CC: devel@acpica.org
---
drivers/acpi/osl.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 90 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index fc1aa79..7f9a865 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -566,6 +566,8 @@ static const char * const table_sigs[] = {
#define ACPI_OVERRIDE_TABLES 64
static struct cpio_data __initdata acpi_initrd_files[ACPI_OVERRIDE_TABLES];
+/* Remember physical address of overriden or added tables */
+static acpi_physical_address acpi_table_overridden[ACPI_OVERRIDE_TABLES];
#define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT)
@@ -715,7 +717,7 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
*address = 0;
return AE_OK;
#else
- int table_offset = 0;
+ int no, table_offset = 0;
struct acpi_table_header *table;
*table_length = 0;
@@ -759,6 +761,12 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
*table_length = table->length;
acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
*address = acpi_tables_addr + table_offset;
+ for (no = 0; no < ACPI_OVERRIDE_TABLES; no++) {
+ if (acpi_table_overridden[no] == 0) {
+ acpi_table_overridden[no] = *address;
+ break;
+ }
+ }
break;
} while (table_offset + ACPI_HEADER_SIZE < all_tables_size);
@@ -768,6 +776,87 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
#endif
}
+acpi_status
+acpi_os_physical_table_add(acpi_physical_address *address,
+ u32 *table_length)
+{
+#ifndef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
+ *table_length = 0;
+ *address = 0;
+ return AE_OK;
+#else
+ int no, table_offset = 0;
+ struct acpi_table_header *table;
+
+ *table_length = 0;
+ *address = 0;
+
+ if (!acpi_tables_addr)
+ return AE_OK;
+
+ do {
+ if (table_offset + ACPI_HEADER_SIZE > all_tables_size) {
+ WARN_ON(1);
+ return AE_OK;
+ }
+
+ table = acpi_os_map_memory(acpi_tables_addr + table_offset,
+ ACPI_HEADER_SIZE);
+
+ if (table_offset + table->length > all_tables_size) {
+ acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
+ WARN_ON(1);
+ return AE_OK;
+ }
+
+ table_offset += table->length;
+
+ /* Do not add SSDTs, only if acpi_no_auto_ssdt boot parameter
+ got set.
+ */
+ if (acpi_gbl_disable_ssdt_table_load == FALSE &&
+ !memcmp("SSDT", table->signature, 4)) {
+ pr_info("Will not add SSDT [%8.8s], use acpi_no_auto_ssdt to force\n", table->oem_table_id);
+ acpi_os_unmap_memory(table,
+ ACPI_HEADER_SIZE);
+ continue;
+ }
+
+ /* Only add tables that have not been overridden already */
+ for (no = 0; no < ACPI_OVERRIDE_TABLES; no++) {
+ if (acpi_table_overridden[no] == 0)
+ break;
+ if (acpi_table_overridden[no] ==
+ acpi_tables_addr + table_offset - table->length)
+ break;
+ }
+ /* All tables have been added or overridden */
+ if (acpi_table_overridden[no] != 0) {
+ acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
+ continue;
+ }
+ /* Max table override/add limit reached */
+ if (no == ACPI_OVERRIDE_TABLES) {
+ acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
+ return AE_ERROR;
+ }
+
+ table_offset -= table->length;
+ *table_length = table->length;
+ *address = acpi_tables_addr + table_offset;
+ /* do not add this table again */
+ acpi_table_overridden[no] = *address;
+ pr_warn(PREFIX
+ "Add [%4.4s-%8.8s], this is unsafe: tainting kernel\n",
+ table->signature, table->oem_table_id);
+ add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
+ acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
+ return AE_OK;
+ } while (table_offset + ACPI_HEADER_SIZE < all_tables_size);
+ return AE_OK;
+#endif
+}
+
static irqreturn_t acpi_irq(int irq, void *dev_id)
{
u32 handled;
--
1.7.6.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 1/4] ACPI: Provide support for ACPI table adding via OS
2014-02-28 17:23 ` [PATCH 1/4] ACPI: Provide support for ACPI table adding via OS Thomas Renninger
@ 2014-02-28 17:27 ` Thomas Renninger
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Renninger @ 2014-02-28 17:27 UTC (permalink / raw)
To: robert.moore
Cc: lv.zheng, david.e.box, rafael.j.wysocki, hpa, tglx, ck,
linux-kernel, x86, mingo, rjw, devel
Latest changes are compile tested only!
If this gets serialized/merged and accepted in acpica in
some form with whatever other stuff currently added,
please drop me a mail.
I can then submit the Linux parts again to the kernel people
with the documentation adjusted as well:
Documentation/acpi/initrd_table_override.txt
Thanks,
Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
[not found] <1393608241-31037-1-git-send-email-trenn@suse.de>
2014-02-28 17:23 ` [PATCH 1/4] ACPI: Provide support for ACPI table adding via OS Thomas Renninger
@ 2014-02-28 17:23 ` Thomas Renninger
2014-03-03 1:20 ` Zheng, Lv
2014-02-28 17:24 ` [PATCH 3/4] ACPICA: Add BGRT signature to known signatures Thomas Renninger
2014-02-28 17:24 ` [PATCH 4/4] ACPI: Add new table signatures that can be overridden/added Thomas Renninger
3 siblings, 1 reply; 12+ messages in thread
From: Thomas Renninger @ 2014-02-28 17:23 UTC (permalink / raw)
To: robert.moore, lv.zheng, david.e.box, rafael.j.wysocki
Cc: Thomas Renninger, hpa, tglx, ck, linux-kernel, x86, mingo, rjw,
devel
This one allows OS to add arbitrary ACPI tables.
ToDo: It should get checked whether a table with the same signature already
exists and if this is the case, adding should not happen.
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: hpa@zytor.com
CC: tglx@linutronix.de
CC: ck@conrad-kostecki.de
CC: linux-kernel@vger.kernel.org
CC: x86@kernel.org
CC: mingo@redhat.com
CC: rjw@rjwysocki.net
CC: devel@acpica.org
---
drivers/acpi/acpica/tbutils.c | 36 ++++++++++++++++++++++++++++++++++++
include/acpi/acpiosxf.h | 6 ++++++
2 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 6412d3c..a819d198 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -453,6 +453,8 @@ static acpi_status acpi_tb_validate_xsdt(acpi_physical_address xsdt_address)
*
******************************************************************************/
+#define ACPI_MAX_TABLE_ADD 64
+
acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
{
struct acpi_table_rsdp *rsdp;
@@ -623,5 +625,39 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
}
}
+ /*
+ * ACPI Table Add:
+ * Allow the OS to add additional tables to the global root table list
+ */
+ for (i = 0; i < ACPI_MAX_TABLE_ADD; i++) {
+ int tmp, k;
+ table_entry_size = 0;
+ address = 0;
+ status = acpi_os_physical_table_add(&address,
+ &table_entry_size);
+ if (status == AE_OK && table_entry_size && address) {
+ table = acpi_os_map_memory(address, table_entry_size);
+ for (k = 2; k < acpi_gbl_root_table_list.current_table_count; k++) {
+ /*
+ Always add SSDTs. Only allow adding of other
+ tables if none of such a signature already
+ exists. Use the override interface instead
+ in such a case.
+ */
+ if (ACPI_COMPARE_NAME("SSDT", table->signature) &&
+ !ACPI_COMPARE_NAME(&acpi_gbl_root_table_list.tables[i].signature, table->signature)) {
+ ACPI_INFO((AE_INFO, "OS table not added, signature already exists:"));
+ acpi_tb_print_table_header(address, table);
+ acpi_os_unmap_memory(table, table_entry_size);
+ } else {
+ ACPI_INFO((AE_INFO, "Add OS provided table:"));
+ acpi_tb_print_table_header(address, table);
+ status = acpi_tb_store_table(address, table, table_entry_size,
+ ACPI_TABLE_ORIGIN_MAPPED, &tmp);
+ }
+ }
+ } else
+ break;
+ }
return_ACPI_STATUS(AE_OK);
}
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 01e6c6d..70c00ed 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -111,6 +111,12 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
u32 *new_table_length);
#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_add
+acpi_status
+acpi_os_physical_table_add(acpi_physical_address * new_address,
+ u32 *new_table_length);
+#endif
+
/*
* Spinlock primitives
*/
--
1.7.6.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* RE: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
2014-02-28 17:23 ` [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback Thomas Renninger
@ 2014-03-03 1:20 ` Zheng, Lv
2014-03-03 12:41 ` Thomas Renninger
0 siblings, 1 reply; 12+ messages in thread
From: Zheng, Lv @ 2014-03-03 1:20 UTC (permalink / raw)
To: Thomas Renninger, Moore, Robert, Box, David E, Wysocki, Rafael J
Cc: hpa@zytor.com, tglx@linutronix.de, ck@conrad-kostecki.de,
linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
rjw@rjwysocki.net, devel@acpica.org
Hi, Thomas
I have a patch series that can cleanup the ACPICA table manager, and change the acpi_load_table into the following style:
acpi_status acpi_install_table(acpi_physical_address address, char *signature, u8 flags, bool override);
For the flags parameter, it will be:
ACPI_TABLE_ORIGIN_EXTERNAL_PHYSICAL (renamed from ACPI_TABLE_ORIGIN_UNKNOWN)
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (renamed from ACPI_TABLE_ORIGIN_OVERRIDE)
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (renamed from ACPI_TABLE_ORIGIN_MAPPED)
ACPI_TABLE_ORIGIN_INTERNAL_LOGICAL (renamed from ACPI_TABLE_ORIGIN_ALLOCATED)
So that we can have the following advantages:
1. the table signature can be validate in one single function.
2. the table checksum can always be validated before installing it to acpi_gbl_root_table_list.
3. acpi_os_table_override() and acpi_os_phsycal_table_override() can be merged
4. for acpi_load_table (renamed to acpi_install_table()) invocations, if it is invoked by OSPM, override can be avoided.
5. part of the acpi_tb_parse_root_table() code can be merged with the acpi_load_table() by invoking same installing API with flags specified.
And with this API, you don't have to introduce code into ACPICA to achieve acpi_os_physical_table_add().
You only need to invoke an OSPM only initialization step after acpi_initialize_tables(), inside of which, you can invoke acpi_install_table() to install new arbitrary tables serving for the purposes of OSPM.
For your cases, I think you can implement the code in this way:
Int __init acpi_table_init(void)
{
Status = acpi_initialize_tables()....
/* add all tables, if they haven't been overridden, they will be newly installed */
for (no = 0; no < no_of_overridden_tables; no++) {
acpi_install_table(the_phsycail_address, NULL, ACPI_TABLE_ORIGIN_EXTERNAL_PHYSICAL, false);
}
}
This function also has been carefully redesigned to ensure:
1. override can avoided for the newly added table.
2. checksum can be verified before adding it to the acpi_gbl_root_table_list, and it will only be verified once per table.
3. No need to save the table no that has already been physically overridden, it will be taken care by the new interfaces.
I can send out the cleanup series for you to confirm.
Thanks and best regards
-Lv
> -----Original Message-----
> From: Thomas Renninger [mailto:trenn@suse.de]
> Sent: Saturday, March 01, 2014 1:24 AM
> To: Moore, Robert; Zheng, Lv; Box, David E; Wysocki, Rafael J
> Cc: Thomas Renninger; hpa@zytor.com; tglx@linutronix.de; ck@conrad-kostecki.de; linux-kernel@vger.kernel.org; x86@kernel.org;
> mingo@redhat.com; rjw@rjwysocki.net; devel@acpica.org
> Subject: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
>
> This one allows OS to add arbitrary ACPI tables.
>
> ToDo: It should get checked whether a table with the same signature already
> exists and if this is the case, adding should not happen.
>
> Signed-off-by: Thomas Renninger <trenn@suse.de>
> CC: hpa@zytor.com
> CC: tglx@linutronix.de
> CC: ck@conrad-kostecki.de
> CC: linux-kernel@vger.kernel.org
> CC: x86@kernel.org
> CC: mingo@redhat.com
> CC: rjw@rjwysocki.net
> CC: devel@acpica.org
> ---
> drivers/acpi/acpica/tbutils.c | 36 ++++++++++++++++++++++++++++++++++++
> include/acpi/acpiosxf.h | 6 ++++++
> 2 files changed, 42 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
> index 6412d3c..a819d198 100644
> --- a/drivers/acpi/acpica/tbutils.c
> +++ b/drivers/acpi/acpica/tbutils.c
> @@ -453,6 +453,8 @@ static acpi_status acpi_tb_validate_xsdt(acpi_physical_address xsdt_address)
> *
> ******************************************************************************/
>
> +#define ACPI_MAX_TABLE_ADD 64
> +
> acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
> {
> struct acpi_table_rsdp *rsdp;
> @@ -623,5 +625,39 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
> }
> }
>
> + /*
> + * ACPI Table Add:
> + * Allow the OS to add additional tables to the global root table list
> + */
> + for (i = 0; i < ACPI_MAX_TABLE_ADD; i++) {
> + int tmp, k;
> + table_entry_size = 0;
> + address = 0;
> + status = acpi_os_physical_table_add(&address,
> + &table_entry_size);
> + if (status == AE_OK && table_entry_size && address) {
> + table = acpi_os_map_memory(address, table_entry_size);
> + for (k = 2; k < acpi_gbl_root_table_list.current_table_count; k++) {
> + /*
> + Always add SSDTs. Only allow adding of other
> + tables if none of such a signature already
> + exists. Use the override interface instead
> + in such a case.
> + */
> + if (ACPI_COMPARE_NAME("SSDT", table->signature) &&
> + !ACPI_COMPARE_NAME(&acpi_gbl_root_table_list.tables[i].signature, table->signature)) {
> + ACPI_INFO((AE_INFO, "OS table not added, signature already exists:"));
> + acpi_tb_print_table_header(address, table);
> + acpi_os_unmap_memory(table, table_entry_size);
> + } else {
> + ACPI_INFO((AE_INFO, "Add OS provided table:"));
> + acpi_tb_print_table_header(address, table);
> + status = acpi_tb_store_table(address, table, table_entry_size,
> + ACPI_TABLE_ORIGIN_MAPPED, &tmp);
> + }
> + }
> + } else
> + break;
> + }
> return_ACPI_STATUS(AE_OK);
> }
> diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
> index 01e6c6d..70c00ed 100644
> --- a/include/acpi/acpiosxf.h
> +++ b/include/acpi/acpiosxf.h
> @@ -111,6 +111,12 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
> u32 *new_table_length);
> #endif
>
> +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_add
> +acpi_status
> +acpi_os_physical_table_add(acpi_physical_address * new_address,
> + u32 *new_table_length);
> +#endif
> +
> /*
> * Spinlock primitives
> */
> --
> 1.7.6.1
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
2014-03-03 1:20 ` Zheng, Lv
@ 2014-03-03 12:41 ` Thomas Renninger
2014-03-04 0:31 ` Zheng, Lv
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Renninger @ 2014-03-03 12:41 UTC (permalink / raw)
To: Zheng, Lv
Cc: Moore, Robert, Box, David E, Wysocki, Rafael J, hpa@zytor.com,
tglx@linutronix.de, ck@conrad-kostecki.de,
linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
rjw@rjwysocki.net, devel@acpica.org
Hi Lv,
On Monday, March 03, 2014 01:20:31 AM Zheng, Lv wrote:
> Hi, Thomas
>
> I have a patch series that can cleanup the ACPICA table manager, and change
> the acpi_load_table into the following style:
Ok. I suggest that:
1) If Thomas (Gleixner) or whoever wants to try out or needs it urgently, he
can (must) use a recent kernel with my patches applied.
2) You continue to get your changes into ACPICA.
Eventually or best would be if you add whatever is needed to
allow adding of tables as well (which will be there automatically if
I understood the description of your changes correctly).
3) Either you give it a try yourself or give me short description for
what I have to look out for and I can re-post the Linux patches
based on your ACPICA changes, once they show up in the Linux kernel.
Best give me a ping as soon as I should look at it.
Thanks!
Thomas
PS: You might want to add the BGRT definition in ACPICA already, the
tiny one line-liner...
^ permalink raw reply [flat|nested] 12+ messages in thread* RE: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
2014-03-03 12:41 ` Thomas Renninger
@ 2014-03-04 0:31 ` Zheng, Lv
2014-03-04 11:54 ` Thomas Renninger
0 siblings, 1 reply; 12+ messages in thread
From: Zheng, Lv @ 2014-03-04 0:31 UTC (permalink / raw)
To: Thomas Renninger
Cc: Moore, Robert, Box, David E, Wysocki, Rafael J, hpa@zytor.com,
tglx@linutronix.de, ck@conrad-kostecki.de,
linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
rjw@rjwysocki.net, devel@acpica.org
Hi, Thomas
> From: Thomas Renninger [mailto:trenn@suse.de]
> Sent: Monday, March 03, 2014 8:42 PM
>
> Hi Lv,
>
> On Monday, March 03, 2014 01:20:31 AM Zheng, Lv wrote:
> > Hi, Thomas
> >
> > I have a patch series that can cleanup the ACPICA table manager, and change
> > the acpi_load_table into the following style:
>
> Ok. I suggest that:
> 1) If Thomas (Gleixner) or whoever wants to try out or needs it urgently, he
> can (must) use a recent kernel with my patches applied.
> 2) You continue to get your changes into ACPICA.
> Eventually or best would be if you add whatever is needed to
> allow adding of tables as well (which will be there automatically if
> I understood the description of your changes correctly).
> 3) Either you give it a try yourself or give me short description for
> what I have to look out for and I can re-post the Linux patches
> based on your ACPICA changes, once they show up in the Linux kernel.
> Best give me a ping as soon as I should look at it.
That sounds good.
Or it can be more efficient for productions:
Linux can merge your patches and ACPICA just stop to take them.
This will leave us divergences.
After the table manager cleanups are tested and shipped in the ACPICA repo, the new facilities will automatically be rolled into Linux branches.
Then I can help to reduce the divergences using the new ACPICA facilities.
At that time I may ask whoever that can test to offer help to review the cleanup patch.
Thanks and best regards
-Lv
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
2014-03-04 0:31 ` Zheng, Lv
@ 2014-03-04 11:54 ` Thomas Renninger
2014-03-05 6:26 ` Zheng, Lv
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Renninger @ 2014-03-04 11:54 UTC (permalink / raw)
To: Zheng, Lv
Cc: Moore, Robert, Box, David E, Wysocki, Rafael J, hpa@zytor.com,
tglx@linutronix.de, ck@conrad-kostecki.de,
linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
rjw@rjwysocki.net, devel@acpica.org
On Tuesday, March 04, 2014 12:31:57 AM Zheng, Lv wrote:
> Hi, Thomas
>
> > From: Thomas Renninger [mailto:trenn@suse.de]
> > Sent: Monday, March 03, 2014 8:42 PM
> >
> > Hi Lv,
> >
> > On Monday, March 03, 2014 01:20:31 AM Zheng, Lv wrote:
> > > Hi, Thomas
> > >
> > > I have a patch series that can cleanup the ACPICA table manager, and
> > > change
> >
> > > the acpi_load_table into the following style:
> > Ok. I suggest that:
> > 1) If Thomas (Gleixner) or whoever wants to try out or needs it urgently,
> > he>
> > can (must) use a recent kernel with my patches applied.
> >
> > 2) You continue to get your changes into ACPICA.
> >
> > Eventually or best would be if you add whatever is needed to
> > allow adding of tables as well (which will be there automatically if
> > I understood the description of your changes correctly).
> >
> > 3) Either you give it a try yourself or give me short description for
> >
> > what I have to look out for and I can re-post the Linux patches
> > based on your ACPICA changes, once they show up in the Linux kernel.
> > Best give me a ping as soon as I should look at it.
>
> That sounds good.
>
> Or it can be more efficient for productions:
> Linux can merge your patches and ACPICA just stop to take them.
You mean add my stuff to drivers/acpi/acpica in Linux kernel without
pushing them into the ACPICA repository?
I cannot remember that this ever happened (beside small important fixes)
and I doubt Rafael is willing to do that.
If it would be super critical, but I cannot see that it is.
> This will leave us divergences.
Yes, that would be bad.
> After the table manager cleanups are tested and shipped in the ACPICA repo,
> the new facilities will automatically be rolled into Linux branches.
I'd suggest to just wait for that.
Best already try to integrate the ACPI table override/add part as you think
it should work without additional changes in drivers/acpi/acpica.
If this happened and things are submitted to get integrated into the Linux
kernel, please add me to CC or point me to the patchset.
> Then I
> can help to reduce the divergences using the new ACPICA facilities. At that
> time I may ask whoever that can test to offer help to review the cleanup
> patch.
I can then give your new patcheset some testing and try to get the Linux
(drivers/acpi/osl.c) parts (re-)implemented based on your stuff.
There might still be the one or other minor fix needed that has to go
into acpica as well, but that should not be that hard to manage and
might end up in acpica and Linux kernel in parallel without much
extra overhead.
Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread* RE: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
2014-03-04 11:54 ` Thomas Renninger
@ 2014-03-05 6:26 ` Zheng, Lv
2014-03-05 16:12 ` Thomas Renninger
0 siblings, 1 reply; 12+ messages in thread
From: Zheng, Lv @ 2014-03-05 6:26 UTC (permalink / raw)
To: Thomas Renninger
Cc: Moore, Robert, Box, David E, Wysocki, Rafael J, hpa@zytor.com,
tglx@linutronix.de, ck@conrad-kostecki.de,
linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
rjw@rjwysocki.net, devel@acpica.org
Hi, Thomas
> From: Thomas Renninger [mailto:trenn@suse.de]
> Sent: Tuesday, March 04, 2014 7:55 PM
>
> On Tuesday, March 04, 2014 12:31:57 AM Zheng, Lv wrote:
> > Hi, Thomas
> >
> > > From: Thomas Renninger [mailto:trenn@suse.de]
> > > Sent: Monday, March 03, 2014 8:42 PM
> > >
> > > Hi Lv,
> > >
> > > On Monday, March 03, 2014 01:20:31 AM Zheng, Lv wrote:
> > > > Hi, Thomas
> > > >
> > > > I have a patch series that can cleanup the ACPICA table manager, and
> > > > change
> > >
> > > > the acpi_load_table into the following style:
> > > Ok. I suggest that:
> > > 1) If Thomas (Gleixner) or whoever wants to try out or needs it urgently,
> > > he>
> > > can (must) use a recent kernel with my patches applied.
> > >
> > > 2) You continue to get your changes into ACPICA.
> > >
> > > Eventually or best would be if you add whatever is needed to
> > > allow adding of tables as well (which will be there automatically if
> > > I understood the description of your changes correctly).
> > >
> > > 3) Either you give it a try yourself or give me short description for
> > >
> > > what I have to look out for and I can re-post the Linux patches
> > > based on your ACPICA changes, once they show up in the Linux kernel.
> > > Best give me a ping as soon as I should look at it.
> >
> > That sounds good.
> >
> > Or it can be more efficient for productions:
> > Linux can merge your patches and ACPICA just stop to take them.
> You mean add my stuff to drivers/acpi/acpica in Linux kernel without
> pushing them into the ACPICA repository?
>
> I cannot remember that this ever happened (beside small important fixes)
> and I doubt Rafael is willing to do that.
> If it would be super critical, but I cannot see that it is.
OK.
> > This will leave us divergences.
> Yes, that would be bad.
Yes.
> > After the table manager cleanups are tested and shipped in the ACPICA repo,
> > the new facilities will automatically be rolled into Linux branches.
> I'd suggest to just wait for that.
> Best already try to integrate the ACPI table override/add part as you think
> it should work without additional changes in drivers/acpi/acpica.
>
> If this happened and things are submitted to get integrated into the Linux
> kernel, please add me to CC or point me to the patchset.
Fortunately, there is a kernel bugzilla entry requires this series.
I've posted it on the kernel bugzilla.
Here is the patchset:
https://bugzilla.kernel.org/show_bug.cgi?id=69711
You need to apply 9 patches:
attachment 128061 - attachment 128141
The last patch has introduced an early boot API:
acpi_install_table.
This can be used to enhance this series.
> > Then I
> > can help to reduce the divergences using the new ACPICA facilities. At that
> > time I may ask whoever that can test to offer help to review the cleanup
> > patch.
>
> I can then give your new patcheset some testing and try to get the Linux
> (drivers/acpi/osl.c) parts (re-)implemented based on your stuff.
> There might still be the one or other minor fix needed that has to go
> into acpica as well, but that should not be that hard to manage and
> might end up in acpica and Linux kernel in parallel without much
> extra overhead.
If you found any issues in using this series, let me know.
Thanks and best regards
-Lv
>
> Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback
2014-03-05 6:26 ` Zheng, Lv
@ 2014-03-05 16:12 ` Thomas Renninger
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Renninger @ 2014-03-05 16:12 UTC (permalink / raw)
To: Zheng, Lv
Cc: Moore, Robert, Box, David E, Wysocki, Rafael J, hpa@zytor.com,
tglx@linutronix.de, ck@conrad-kostecki.de,
linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
rjw@rjwysocki.net, devel@acpica.org
On Wednesday, March 05, 2014 06:26:54 AM Zheng, Lv wrote:
...
> > > After the table manager cleanups are tested and shipped in the ACPICA
> > > repo,
> > > the new facilities will automatically be rolled into Linux branches.
> >
> > I'd suggest to just wait for that.
> > Best already try to integrate the ACPI table override/add part as you
> > think
> > it should work without additional changes in drivers/acpi/acpica.
> >
> > If this happened and things are submitted to get integrated into the Linux
> > kernel, please add me to CC or point me to the patchset.
>
> Fortunately, there is a kernel bugzilla entry requires this series.
> I've posted it on the kernel bugzilla.
> Here is the patchset:
> https://bugzilla.kernel.org/show_bug.cgi?id=69711
> You need to apply 9 patches:
> attachment 128061 - attachment 128141
> The last patch has introduced an early boot API:
> acpi_install_table.
> This can be used to enhance this series.
Ok, thanks.
Be aware that I am super busy right now. This week is impossible,
I cannot promise when I will have time for that.
Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/4] ACPICA: Add BGRT signature to known signatures
[not found] <1393608241-31037-1-git-send-email-trenn@suse.de>
2014-02-28 17:23 ` [PATCH 1/4] ACPI: Provide support for ACPI table adding via OS Thomas Renninger
2014-02-28 17:23 ` [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback Thomas Renninger
@ 2014-02-28 17:24 ` Thomas Renninger
2014-02-28 17:24 ` [PATCH 4/4] ACPI: Add new table signatures that can be overridden/added Thomas Renninger
3 siblings, 0 replies; 12+ messages in thread
From: Thomas Renninger @ 2014-02-28 17:24 UTC (permalink / raw)
To: robert.moore, lv.zheng, david.e.box, rafael.j.wysocki
Cc: Thomas Renninger, hpa, tglx, ck, linux-kernel, x86, mingo, rjw,
devel
In Linux there even exists a driver already making use of this table:
drivers/acpi/bgrt.c:MODULE_DESCRIPTION("BGRT boot graphic support");
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: hpa@zytor.com
CC: tglx@linutronix.de
CC: ck@conrad-kostecki.de
CC: linux-kernel@vger.kernel.org
CC: x86@kernel.org
CC: mingo@redhat.com
CC: rjw@rjwysocki.net
CC: devel@acpica.org
---
include/acpi/actbl2.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 094a906..9ed1c20 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -83,6 +83,7 @@
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
+#define ACPI_SIG_BGRT "BGRT" /* Boot Graphic Support */
#ifdef ACPI_UNDEFINED_TABLES
/*
--
1.7.6.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 4/4] ACPI: Add new table signatures that can be overridden/added.
[not found] <1393608241-31037-1-git-send-email-trenn@suse.de>
` (2 preceding siblings ...)
2014-02-28 17:24 ` [PATCH 3/4] ACPICA: Add BGRT signature to known signatures Thomas Renninger
@ 2014-02-28 17:24 ` Thomas Renninger
3 siblings, 0 replies; 12+ messages in thread
From: Thomas Renninger @ 2014-02-28 17:24 UTC (permalink / raw)
To: robert.moore, lv.zheng, david.e.box, rafael.j.wysocki
Cc: Thomas Renninger, hpa, tglx, ck, linux-kernel, x86, mingo, rjw,
devel
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: hpa@zytor.com
CC: tglx@linutronix.de
CC: ck@conrad-kostecki.de
CC: linux-kernel@vger.kernel.org
CC: x86@kernel.org
CC: mingo@redhat.com
CC: rjw@rjwysocki.net
CC: devel@acpica.org
---
drivers/acpi/osl.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 7f9a865..23ce5b1 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -38,6 +38,7 @@
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/nmi.h>
+# define ACPI_UNDEFINED_TABLES 1
#include <linux/acpi.h>
#include <linux/efi.h>
#include <linux/ioport.h>
@@ -559,7 +560,8 @@ static const char * const table_sigs[] = {
ACPI_SIG_IBFT, ACPI_SIG_IVRS, ACPI_SIG_MCFG, ACPI_SIG_MCHI,
ACPI_SIG_SLIC, ACPI_SIG_SPCR, ACPI_SIG_SPMI, ACPI_SIG_TCPA,
ACPI_SIG_UEFI, ACPI_SIG_WAET, ACPI_SIG_WDAT, ACPI_SIG_WDDT,
- ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT,
+ ACPI_SIG_WDRT, ACPI_SIG_BGRT, ACPI_SIG_ATKG, ACPI_SIG_GSCI,
+ ACPI_SIG_IEIT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT,
ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, NULL };
#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
--
1.7.6.1
^ permalink raw reply related [flat|nested] 12+ messages in thread