* [PATCH v5 0/5] Provide better MADT subtable sanity checks
@ 2015-09-29 23:45 Al Stone
2015-09-29 23:45 ` [PATCH v5 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Al Stone
` (5 more replies)
0 siblings, 6 replies; 25+ messages in thread
From: Al Stone @ 2015-09-29 23:45 UTC (permalink / raw)
To: linux-acpi, linux-arm-kernel
Cc: linux-kernel, linux-ia64, linux-pm, linaro-acpi, linaro-kernel,
patches, Al Stone
NB: this patch set is for use against the linux-pm bleeding edge branch.
Currently, the BAD_MADT_ENTRY macro is used to do a very simple sanity
check on the various subtables that are defined for the MADT. The check
compares the size of the subtable data structure as defined by ACPICA to
the length entry in the subtable. If they are not the same, the assumption
is that the subtable is incorrect.
Over time, the ACPI spec has allowed for MADT subtables where this can
never be true (the local SAPIC subtable, for example). Or, more recently,
the spec has accumulated some minor flaws where there are three possible
sizes for a subtable, all of which are valid, but only for specific versions
of the spec (the GICC subtable). In both cases, BAD_MADT_ENTRY reports these
subtables as bad when they are not. In order to retain some sanity check
on the MADT subtables, we now have to special case these subtables. Of
necessity, these special cases have ended up in arch-dependent code (arm64)
or an arch has simply decided to forgo the check (ia64).
This patch set replaces the BAD_MADT_ENTRY macro with a function called
bad_madt_entry(). This function uses a data set of details about the
subtables to provide more sanity checking than before:
-- is the subtable legal for the version given in the FADT?
-- is the subtable legal for the revision of the MADT in use?
-- is the subtable of the proper length (including checking
on the one variable length subtable that is currently ignored),
given the FADT version and the MADT revision?
Further, this patch set adds in the call to bad_madt_entry() from the
acpi_table_parse_madt() function, allowing it to be used consistently
by all architectures, for all subtables, and removing the need for each
of the subtable traversal callback functions to use BAD_MADT_ENTRY.
In theory, as the ACPI specification changes, we would only have to add
additional information to the data set describing the MADT subtables in
order to continue providing sanity checks, even when new subtables are
added.
These patches have been tested on an APM Mustang (arm64) and are known to
work there. They have also been cross-compiled for x86 and ia64 with no
known failures.
Changes for v5:
-- 0-day found incorrect data in the table describing allowed MADT
subtables; this only affected ACPI 1.0 firmware. Corrected the
data to meet the 1.0b spec.
-- Rebase to bleeding-edge branch for Rafael Wysocki; this patch set
now requires that a patch set from Marc Zyngier be applied first:
https://lkml.org/lkml/2015/9/28/421
-- Tested on AMD Seattle (linux-pm tree) also
Changes for v4:
-- Remove extraneous white space change (Graeme Gregory)
-- acpi_parse_entries() changes also needed a check to make sure that
only MADT entries used bad_madt_entry() (Sudeep Holla)
-- inadvertent use of 01day build noted that bad_madt_entry() can be
static, so added it (Sudeep Holla, Fengguang Wu)
Changes for v3:
-- Reviewed-and-tested-by from Sudeep Holla for arm64 parts
-- Clearer language in error messages (Graeme Gregory, Timur Tabi)
-- Double checked that inserting call to bad_madt_entry() into the
function acpi_parse_entries() does not impact current behavior
(Sudeep Holla)
Changes for v2:
-- Acked-by on 2/5 from Marc Zyngier and Catalin Marinas for ARM
-- Correct faulty end of loop test found by Timur Tabi
Al Stone (5):
ACPI: add in a bad_madt_entry() function to eventually replace the
macro
ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY
ACPI / IA64: remove usage of BAD_MADT_ENTRY
ACPI / X86: remove usage of BAD_MADT_ENTRY
ACPI: remove definition of BAD_MADT_ENTRY macro
arch/arm64/include/asm/acpi.h | 8 --
arch/arm64/kernel/smp.c | 2 -
arch/ia64/kernel/acpi.c | 20 ----
arch/x86/kernel/acpi/boot.c | 27 -----
drivers/acpi/tables.c | 247 +++++++++++++++++++++++++++++++++++++++++-
drivers/irqchip/irq-gic.c | 3 -
include/linux/acpi.h | 4 -
7 files changed, 246 insertions(+), 65 deletions(-)
--
2.4.3
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v5 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro
2015-09-29 23:45 [PATCH v5 0/5] Provide better MADT subtable sanity checks Al Stone
@ 2015-09-29 23:45 ` Al Stone
2015-09-29 23:45 ` [PATCH v5 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY Al Stone
` (4 subsequent siblings)
5 siblings, 0 replies; 25+ messages in thread
From: Al Stone @ 2015-09-29 23:45 UTC (permalink / raw)
To: linux-acpi, linux-arm-kernel
Cc: linux-kernel, linux-ia64, linux-pm, linaro-acpi, linaro-kernel,
patches, Al Stone, Rafael J. Wysocki, Len Brown
The existing BAD_MADT_ENTRY macro only checks that the size of the data
structure for an MADT subtable matches the length entry in the subtable.
This is, unfortunately, not reliable. Nor, as it turns out, does it have
anything to do with what the length should be in any particular table.
We introduce the bad_madt_entry() function that uses a data set to
do some basic sanity checks on any given MADT subtable. Over time, as
the spec changes, we should just be able to add entries to the data set
to reflect the changes.
What the data set captures is the allowed MADT subtable length for each
type of subtable, for each revision of the specification. While there
is a revision number in the MADT that we should be able to use to figure
out the proper subtable length, it was not changed when subtables did.
And, while there is a major and minor revision in the FADT that could
also help, it was not always changed as the subtables changed either.
So, the data set captures for each published version of the ACPI spec
what the FADT revisions numbers should be, the corresponding MADT
revision number, and the subtable types and lengths that were defined
at that time.
The sanity checks done are:
-- is the length non-zero?
-- is the subtable type defined/allowed for the revision of
the FADT we're using?
-- is the subtable type defined/allowed for the revision of
the MADT we're using?
-- is the length entry what it should be for this revision
of the MADT and FADT?
These checks are more thorough than the previous macro provided, and
are now insulated from data structure size changes by ACPICA, which
have been the source of other patches in the past.
Now that the bad_madt_entry() function is available, we add code to
also invoke it before any subtable handlers are called to use the
info in the subtable. Subsequent patches will remove the use of the
BAD_MADT_ENTRY macro which is now redundant as a result. Any ACPI
functions that use acpi_parse_madt_entries() will always have all of
the MADT subtables checked from now on.
Signed-off-by: Al Stone <al.stone@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
---
drivers/acpi/tables.c | 247 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 246 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 6c0f079..a2ed38a 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -210,6 +210,247 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
}
}
+/*
+ * The Long, Sad, True Story of the MADT
+ * or
+ * What does bad_madt_entry() actually do?
+ *
+ * Once upon a time in ACPI 1.0, there was the MADT. It was a nice table,
+ * and it had two subtables all of its own. But, it was also a pretty
+ * busy table, too, so over time the MADT gathered up other nice little
+ * subtables. By the time ACPI 6.0 came around, the MADT had 16 of the
+ * little guys.
+ *
+ * Now, the MADT kept a little counter around for the subtables. In fact,
+ * it kept two counters: one was the revision level, which was supposed to
+ * change when new subtables came to be, or as the ones already around grew
+ * up. The second counter was a type number, because the MADT needed a unique
+ * type for each subtable so he could tell them apart. But, sometimes the
+ * MADT got so busy, he forgot to increment the revision level when he needed
+ * to. Fortunately, the type counter kept increasing since that's the only
+ * way the MADT could find each little subtable. It just wouldn't do to have
+ * every subtable called Number 6.
+ *
+ * In the next valley over, a castle full of wizards was watching the MADT
+ * and made a pact to keep their own counter. Every time the MADT found a
+ * new subtable, or a subtable grew up, the wizards promised they would
+ * increment their counter. Well, wizards being the forgetful sort, they
+ * didn't alway do that. And, since there quite a lot of them, they
+ * couldn't always remember who was supposed to keep track of the MADT,
+ * especially if dinner was coming up soon. Their counter was called the
+ * spec version.
+ *
+ * Every now and then, the MADT would gather up all its little subtables
+ * and take them in to the cobbler to get new boots. This was a very, very
+ * meticulous cobbler, so every time they came, he wrote down all the boot
+ * sizes for all of the little subtables. The cobbler would ask each subtable
+ * for its length, check that against his careful notes, and then go get the
+ * right boots. Sometimes, a little subtable would change a bit, and their
+ * length did not match what the cobbler had written down. If the wizards
+ * or the MADT had incremented their counters, the cobbler would breath a
+ * sigh of relief and write down the new length as the right one. But, if
+ * none of the counters had changed, this would make the cobbler very, very
+ * mad. He couldn't tell if he had the right size boots or not for the
+ * little subtable. He would have to *guess* and this really bugged him.
+ *
+ * Well, when the cobbler got mad like this, he would go into hiding. He
+ * would not make or sell any boots. He would not go out at all. Pretty
+ * soon, the coffee shop would have to close because the cobbler wasn't
+ * coming by twice a day any more. Then the grocery store would have to
+ * close because he wouldn't eat much. After a while, everyone would panic
+ * and have to move from the village and go live with all their relatives
+ * (usually the ones they didn't like very much).
+ *
+ * Eventually, the cobbler would work his way out of his bad mood, and
+ * open up his boot business again. Then, everyone else could move back
+ * to the village and restart their lives, too.
+ *
+ * Fortunately, we have been able to collect up all the cobbler's careful
+ * notes (and we wrote them down below). We'll have to keep checking these
+ * notes over time, too, just as the cobbler does. But, in the meantime,
+ * we can avoid the panic and the reboot since we can make sure that each
+ * subtable is doing okay. And that's what bad_madt_entry() does.
+ *
+ *
+ * FADT Major Version -> 1 3 4 4 5 5 6
+ * FADT Minor Version -> x x x x x 1 0
+ * MADT revision -> 1 1 2 3 3 3 3
+ * Spec Version -> 1.0 2.0 3.0b 4.0a 5.0b 5.1a 6.0
+ * Subtable Name Type Expected Length ->
+ * Processor Local APIC 0x0 8 8 8 8 8 8 8
+ * IO APIC 0x1 12 12 12 12 12 12 12
+ * Int Src Override 0x2 10 10 10 10 10 10 10
+ * NMI Src 0x3 8 8 8 8 8 8 8
+ * Local APIC NMI Struct 0x4 6 6 6 6 6 6 6
+ * Local APIC Addr Ovrrd 0x5 16 12 12 12 12 12
+ * IO SAPIC 0x6 20 16 16 16 16 16
+ * Local SAPIC 0x7 8 >16 >16 >16 >16 >16
+ * Platform Int Src 0x8 16 16 16 16 16 16
+ * Proc Local x2APIC 0x9 16 16 16 16
+ * Local x2APIC NMI 0xa 12 12 12 12
+ * GICC CPU I/F 0xb 40 76 80
+ * GICD 0xc 24 24 24
+ * GICv2m MSI 0xd 24 24
+ * GICR 0xe 16 16
+ * GIC ITS 0xf 16
+ *
+ * In the table, each length entry is what should be in the length
+ * field of the subtable, and -- in general -- it should match the
+ * size of the struct for the subtable. Any value that is not set
+ * (i.e., is zero) indicates that the subtable is not defined for
+ * that version of the ACPI spec.
+ *
+ */
+#define SUBTABLE_UNDEFINED 0x00
+#define SUBTABLE_VARIABLE 0xff
+#define NUM_SUBTABLE_TYPES 16
+
+struct acpi_madt_subtable_lengths {
+ unsigned short major_version; /* from revision in FADT header */
+ unsigned short minor_version; /* FADT field starting with 5.1 */
+ unsigned short madt_version; /* MADT revision */
+ unsigned short num_types; /* types possible for this version */
+ unsigned short lengths[NUM_SUBTABLE_TYPES];
+ /* subtable lengths, indexed by type */
+};
+
+static struct acpi_madt_subtable_lengths spec_info[] = {
+ { /* for ACPI 1.0b */
+ .major_version = 1,
+ .minor_version = 0,
+ .madt_version = 1,
+ .num_types = 5,
+ .lengths = { 8, 12, 10, 8, 6 }
+ },
+ { /* for ACPI 2.0 */
+ .major_version = 3,
+ .minor_version = 0,
+ .madt_version = 1,
+ .num_types = 9,
+ .lengths = { 8, 12, 10, 8, 6, 16, 20, 8, 16 }
+ },
+ { /* for ACPI 3.0b */
+ .major_version = 4,
+ .minor_version = 0,
+ .madt_version = 2,
+ .num_types = 9,
+ .lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE, 16 }
+ },
+ { /* for ACPI 4.0a */
+ .major_version = 4,
+ .minor_version = 0,
+ .madt_version = 3,
+ .num_types = 11,
+ .lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
+ 16, 16, 12 }
+ },
+ { /* for ACPI 5.0b */
+ .major_version = 5,
+ .minor_version = 0,
+ .madt_version = 3,
+ .num_types = 13,
+ .lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
+ 16, 16, 12, 40, 24 }
+ },
+ { /* for ACPI 5.1a */
+ .major_version = 5,
+ .minor_version = 1,
+ .madt_version = 3,
+ .num_types = 15,
+ .lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
+ 16, 16, 12, 76, 24, 24, 16 }
+ },
+ { /* for ACPI 6.0 */
+ .major_version = 6,
+ .minor_version = 0,
+ .madt_version = 3,
+ .num_types = 16,
+ .lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
+ 16, 16, 12, 80, 24, 24, 16, 16 }
+ },
+ { /* terminator */
+ .major_version = 0,
+ .minor_version = 0,
+ .madt_version = 0,
+ .num_types = 0,
+ .lengths = { 0 }
+ }
+};
+
+static int __init bad_madt_entry(struct acpi_table_header *table,
+ struct acpi_subtable_header *entry)
+{
+ struct acpi_madt_subtable_lengths *ms;
+ struct acpi_table_madt *madt;
+ unsigned short major;
+ unsigned short minor;
+ unsigned short len;
+
+ /* simple sanity checking on MADT subtable entries */
+ if (!entry || !table)
+ return 1;
+
+ /* FADT minor numbers were not introduced until ACPI 5.1 */
+ major = acpi_gbl_FADT.header.revision;
+ if (major >= 5 && acpi_gbl_FADT.header.length >= 268)
+ minor = acpi_gbl_FADT.minor_revision;
+ else
+ minor = 0;
+
+ madt = (struct acpi_table_madt *)table;
+ ms = spec_info;
+ while (ms->num_types != 0) {
+ if (ms->major_version = major &&
+ ms->minor_version = minor &&
+ ms->madt_version = madt->header.revision)
+ break;
+ ms++;
+ }
+ if (!ms->num_types) {
+ pr_err("undefined version for either FADT %d.%d or MADT %d\n",
+ major, minor, madt->header.revision);
+ return 1;
+ }
+
+ if (entry->type >= ms->num_types) {
+ pr_err("undefined MADT subtable type for FADT %d.%d: %d (length %d)\n",
+ major, minor, entry->type, entry->length);
+ return 1;
+ }
+
+ /* verify that the table is allowed for this version of the spec */
+ len = ms->lengths[entry->type];
+ if (!len) {
+ pr_err("MADT subtable %d not defined for FADT %d.%d\n",
+ entry->type, major, minor);
+ return 1;
+ }
+
+ /* verify that the length is what we expect */
+ if (len = SUBTABLE_VARIABLE) {
+ if (entry->type = ACPI_MADT_TYPE_LOCAL_SAPIC) {
+ struct acpi_madt_local_sapic *lsapic + (struct acpi_madt_local_sapic *)entry;
+ int proper_len = sizeof(struct acpi_madt_local_sapic) +
+ strlen(lsapic->uid_string) + 1;
+
+ if (proper_len != entry->length) {
+ pr_err("Variable length MADT subtable %d is wrong length: %d, should be: %d\n",
+ entry->type, entry->length, proper_len);
+ return 1;
+ }
+ }
+ } else {
+ if (entry->length != len) {
+ pr_err("MADT subtable %d is wrong length: %d, should be: %d\n",
+ entry->type, entry->length, len);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
/**
* acpi_parse_entries_array - for each proc_num find a suitable subtable
*
@@ -265,6 +506,10 @@ acpi_parse_entries_array(char *id, unsigned long table_size,
if (max_entries && count >= max_entries)
break;
+ if (!strncmp(id, ACPI_SIG_MADT, 4) &&
+ bad_madt_entry(table_header, entry))
+ return -EINVAL;
+
for (i = 0; i < proc_num; i++) {
if (entry->type != proc[i].id)
continue;
@@ -407,7 +652,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
return -ENODEV;
}
-/*
+/*
* The BIOS is supposed to supply a single APIC/MADT,
* but some report two. Provide a knob to use either.
* (don't you wish instance 0 and 1 were not the same?)
--
2.4.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY
2015-09-29 23:45 [PATCH v5 0/5] Provide better MADT subtable sanity checks Al Stone
2015-09-29 23:45 ` [PATCH v5 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Al Stone
@ 2015-09-29 23:45 ` Al Stone
2015-09-29 23:45 ` [PATCH v5 3/5] ACPI / IA64: remove usage of BAD_MADT_ENTRY Al Stone
` (3 subsequent siblings)
5 siblings, 0 replies; 25+ messages in thread
From: Al Stone @ 2015-09-29 23:45 UTC (permalink / raw)
To: linux-acpi, linux-arm-kernel
Cc: linux-kernel, linux-ia64, linux-pm, linaro-acpi, linaro-kernel,
patches, Al Stone, Will Deacon, Thomas Gleixner, Jason Cooper
Now that we have introduced the bad_madt_entry() function, and that
function is being invoked in acpi_table_parse_madt() for us, there
is no longer any need to use the BAD_MADT_ENTRY macro, or in the case
of arm64, the BAD_MADT_GICC_ENTRY, too.
Signed-off-by: Al Stone <al.stone@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-and-tested-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
---
arch/arm64/include/asm/acpi.h | 8 --------
arch/arm64/kernel/smp.c | 2 --
drivers/irqchip/irq-gic.c | 3 ---
3 files changed, 13 deletions(-)
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index 6894205..05656fc 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -18,14 +18,6 @@
#include <asm/cputype.h>
#include <asm/smp_plat.h>
-/* Macros for consistency checks of the GICC subtable of MADT */
-#define ACPI_MADT_GICC_LENGTH \
- (acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
-
-#define BAD_MADT_GICC_ENTRY(entry, end) \
- (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) || \
- (entry)->header.length != ACPI_MADT_GICC_LENGTH)
-
/* Basic configuration for ACPI */
#ifdef CONFIG_ACPI
/* ACPI table mapping after acpi_gbl_permanent_mmap is set */
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index dbdaacd..66cc8c4 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -451,8 +451,6 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header,
struct acpi_madt_generic_interrupt *processor;
processor = (struct acpi_madt_generic_interrupt *)header;
- if (BAD_MADT_GICC_ENTRY(processor, end))
- return -EINVAL;
acpi_table_print_madt_entry(header);
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index d4add30..67b7b48 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1206,9 +1206,6 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
processor = (struct acpi_madt_generic_interrupt *)header;
- if (BAD_MADT_GICC_ENTRY(processor, end))
- return -EINVAL;
-
/*
* There is no support for non-banked GICv1/2 register in ACPI spec.
* All CPU interface addresses have to be the same.
--
2.4.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 3/5] ACPI / IA64: remove usage of BAD_MADT_ENTRY
2015-09-29 23:45 [PATCH v5 0/5] Provide better MADT subtable sanity checks Al Stone
2015-09-29 23:45 ` [PATCH v5 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Al Stone
2015-09-29 23:45 ` [PATCH v5 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY Al Stone
@ 2015-09-29 23:45 ` Al Stone
2015-09-29 23:45 ` [PATCH v5 4/5] ACPI / X86: " Al Stone
` (2 subsequent siblings)
5 siblings, 0 replies; 25+ messages in thread
From: Al Stone @ 2015-09-29 23:45 UTC (permalink / raw)
To: linux-acpi, linux-arm-kernel
Cc: linux-kernel, linux-ia64, linux-pm, linaro-acpi, linaro-kernel,
patches, Al Stone, Tony Luck, Fenghua Yu
Now that we have introduced the bad_madt_entry() function, and that
function is being invoked in acpi_table_parse_madt() for us, there
is no longer any need to use the BAD_MADT_ENTRY macro.
Signed-off-by: Al Stone <al.stone@linaro.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
---
arch/ia64/kernel/acpi.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index b1698bc..efa3f0a 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -184,9 +184,6 @@ acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
lapic = (struct acpi_madt_local_apic_override *)header;
- if (BAD_MADT_ENTRY(lapic, end))
- return -EINVAL;
-
if (lapic->address) {
iounmap(ipi_base_addr);
ipi_base_addr = ioremap(lapic->address, 0);
@@ -201,8 +198,6 @@ acpi_parse_lsapic(struct acpi_subtable_header * header, const unsigned long end)
lsapic = (struct acpi_madt_local_sapic *)header;
- /*Skip BAD_MADT_ENTRY check, as lsapic size could vary */
-
if (lsapic->lapic_flags & ACPI_MADT_ENABLED) {
#ifdef CONFIG_SMP
smp_boot_data.cpu_phys_id[available_cpus] @@ -222,9 +217,6 @@ acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long e
lacpi_nmi = (struct acpi_madt_local_apic_nmi *)header;
- if (BAD_MADT_ENTRY(lacpi_nmi, end))
- return -EINVAL;
-
/* TBD: Support lapic_nmi entries */
return 0;
}
@@ -236,9 +228,6 @@ acpi_parse_iosapic(struct acpi_subtable_header * header, const unsigned long end
iosapic = (struct acpi_madt_io_sapic *)header;
- if (BAD_MADT_ENTRY(iosapic, end))
- return -EINVAL;
-
return iosapic_init(iosapic->address, iosapic->global_irq_base);
}
@@ -253,9 +242,6 @@ acpi_parse_plat_int_src(struct acpi_subtable_header * header,
plintsrc = (struct acpi_madt_interrupt_source *)header;
- if (BAD_MADT_ENTRY(plintsrc, end))
- return -EINVAL;
-
/*
* Get vector assignment for this interrupt, set attributes,
* and program the IOSAPIC routing table.
@@ -336,9 +322,6 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
p = (struct acpi_madt_interrupt_override *)header;
- if (BAD_MADT_ENTRY(p, end))
- return -EINVAL;
-
iosapic_override_isa_irq(p->source_irq, p->global_irq,
((p->inti_flags & ACPI_MADT_POLARITY_MASK) =
ACPI_MADT_POLARITY_ACTIVE_LOW) ?
@@ -356,9 +339,6 @@ acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end
nmi_src = (struct acpi_madt_nmi_source *)header;
- if (BAD_MADT_ENTRY(nmi_src, end))
- return -EINVAL;
-
/* TBD: Support nimsrc entries */
return 0;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 4/5] ACPI / X86: remove usage of BAD_MADT_ENTRY
2015-09-29 23:45 [PATCH v5 0/5] Provide better MADT subtable sanity checks Al Stone
` (2 preceding siblings ...)
2015-09-29 23:45 ` [PATCH v5 3/5] ACPI / IA64: remove usage of BAD_MADT_ENTRY Al Stone
@ 2015-09-29 23:45 ` Al Stone
2015-09-29 23:45 ` [PATCH v5 5/5] ACPI: remove definition of BAD_MADT_ENTRY macro Al Stone
2015-09-30 9:00 ` [PATCH v5 0/5] Provide better MADT subtable sanity checks Hanjun Guo
5 siblings, 0 replies; 25+ messages in thread
From: Al Stone @ 2015-09-29 23:45 UTC (permalink / raw)
To: linux-acpi, linux-arm-kernel
Cc: linux-kernel, linux-ia64, linux-pm, linaro-acpi, linaro-kernel,
patches, Al Stone, Rafael J. Wysocki, Len Brown, Pavel Machek,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86
Now that we have introduced the bad_madt_entry() function, and that
function is being invoked in acpi_table_parse_madt() for us, there
is no longer any need to use the BAD_MADT_ENTRY macro.
Signed-off-by: Al Stone <al.stone@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: x86@kernel.org
---
arch/x86/kernel/acpi/boot.c | 27 ---------------------------
1 file changed, 27 deletions(-)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index e759076..e65bcea 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -194,9 +194,6 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
processor = (struct acpi_madt_local_x2apic *)header;
- if (BAD_MADT_ENTRY(processor, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
apic_id = processor->local_apic_id;
@@ -227,9 +224,6 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
processor = (struct acpi_madt_local_apic *)header;
- if (BAD_MADT_ENTRY(processor, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
/*
@@ -252,9 +246,6 @@ acpi_parse_sapic(struct acpi_subtable_header *header, const unsigned long end)
processor = (struct acpi_madt_local_sapic *)header;
- if (BAD_MADT_ENTRY(processor, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
acpi_register_lapic((processor->id << 8) | processor->eid,/* APIC ID */
@@ -271,9 +262,6 @@ acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
lapic_addr_ovr = (struct acpi_madt_local_apic_override *)header;
- if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
- return -EINVAL;
-
acpi_lapic_addr = lapic_addr_ovr->address;
return 0;
@@ -287,9 +275,6 @@ acpi_parse_x2apic_nmi(struct acpi_subtable_header *header,
x2apic_nmi = (struct acpi_madt_local_x2apic_nmi *)header;
- if (BAD_MADT_ENTRY(x2apic_nmi, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
if (x2apic_nmi->lint != 1)
@@ -305,9 +290,6 @@ acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long e
lapic_nmi = (struct acpi_madt_local_apic_nmi *)header;
- if (BAD_MADT_ENTRY(lapic_nmi, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
if (lapic_nmi->lint != 1)
@@ -411,9 +393,6 @@ acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end)
ioapic = (struct acpi_madt_io_apic *)header;
- if (BAD_MADT_ENTRY(ioapic, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
/* Statically assign IRQ numbers for IOAPICs hosting legacy IRQs */
@@ -463,9 +442,6 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
intsrc = (struct acpi_madt_interrupt_override *)header;
- if (BAD_MADT_ENTRY(intsrc, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
if (intsrc->source_irq = acpi_gbl_FADT.sci_interrupt) {
@@ -504,9 +480,6 @@ acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end
nmi_src = (struct acpi_madt_nmi_source *)header;
- if (BAD_MADT_ENTRY(nmi_src, end))
- return -EINVAL;
-
acpi_table_print_madt_entry(header);
/* TBD: Support nimsrc entries? */
--
2.4.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v5 5/5] ACPI: remove definition of BAD_MADT_ENTRY macro
2015-09-29 23:45 [PATCH v5 0/5] Provide better MADT subtable sanity checks Al Stone
` (3 preceding siblings ...)
2015-09-29 23:45 ` [PATCH v5 4/5] ACPI / X86: " Al Stone
@ 2015-09-29 23:45 ` Al Stone
2015-09-30 9:00 ` [PATCH v5 0/5] Provide better MADT subtable sanity checks Hanjun Guo
5 siblings, 0 replies; 25+ messages in thread
From: Al Stone @ 2015-09-29 23:45 UTC (permalink / raw)
To: linux-acpi, linux-arm-kernel
Cc: linux-kernel, linux-ia64, linux-pm, linaro-acpi, linaro-kernel,
patches, Al Stone, Rafael J. Wysocki, Len Brown
Now that we have introduced to bad_madt_entry(), and we have removed
all the usages of the BAD_MADT_ENTRY macro from all of the various
architectures that use it (arm64, ia64, x86), we can remove the macro
definition since it is no longer used.
Signed-off-by: Al Stone <al.stone@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
---
include/linux/acpi.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 51a96a8..dd5bd228 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -127,10 +127,6 @@ static inline void acpi_initrd_override(void *data, size_t size)
}
#endif
-#define BAD_MADT_ENTRY(entry, end) ( \
- (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
- ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
-
struct acpi_subtable_proc {
int id;
acpi_tbl_entry_handler handler;
--
2.4.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-09-29 23:45 [PATCH v5 0/5] Provide better MADT subtable sanity checks Al Stone
` (4 preceding siblings ...)
2015-09-29 23:45 ` [PATCH v5 5/5] ACPI: remove definition of BAD_MADT_ENTRY macro Al Stone
@ 2015-09-30 9:00 ` Hanjun Guo
2015-09-30 16:10 ` Al Stone
5 siblings, 1 reply; 25+ messages in thread
From: Hanjun Guo @ 2015-09-30 9:00 UTC (permalink / raw)
To: Al Stone, linux-acpi, linux-arm-kernel
Cc: linaro-kernel, linux-ia64, patches, linux-pm, linaro-acpi,
linux-kernel
On 2015/9/30 7:45, Al Stone wrote:
> NB: this patch set is for use against the linux-pm bleeding edge branch.
>
> Currently, the BAD_MADT_ENTRY macro is used to do a very simple sanity
> check on the various subtables that are defined for the MADT. The check
> compares the size of the subtable data structure as defined by ACPICA to
> the length entry in the subtable. If they are not the same, the assumption
> is that the subtable is incorrect.
>
> Over time, the ACPI spec has allowed for MADT subtables where this can
> never be true (the local SAPIC subtable, for example). Or, more recently,
> the spec has accumulated some minor flaws where there are three possible
> sizes for a subtable, all of which are valid, but only for specific versions
> of the spec (the GICC subtable). In both cases, BAD_MADT_ENTRY reports these
> subtables as bad when they are not. In order to retain some sanity check
> on the MADT subtables, we now have to special case these subtables. Of
> necessity, these special cases have ended up in arch-dependent code (arm64)
> or an arch has simply decided to forgo the check (ia64).
>
> This patch set replaces the BAD_MADT_ENTRY macro with a function called
> bad_madt_entry(). This function uses a data set of details about the
> subtables to provide more sanity checking than before:
>
> -- is the subtable legal for the version given in the FADT?
>
> -- is the subtable legal for the revision of the MADT in use?
>
> -- is the subtable of the proper length (including checking
> on the one variable length subtable that is currently ignored),
> given the FADT version and the MADT revision?
>
> Further, this patch set adds in the call to bad_madt_entry() from the
> acpi_table_parse_madt() function, allowing it to be used consistently
> by all architectures, for all subtables, and removing the need for each
> of the subtable traversal callback functions to use BAD_MADT_ENTRY.
>
> In theory, as the ACPI specification changes, we would only have to add
> additional information to the data set describing the MADT subtables in
> order to continue providing sanity checks, even when new subtables are
> added.
>
> These patches have been tested on an APM Mustang (arm64) and are known to
> work there. They have also been cross-compiled for x86 and ia64 with no
> known failures.
>
> Changes for v5:
> -- 0-day found incorrect data in the table describing allowed MADT
> subtables; this only affected ACPI 1.0 firmware. Corrected the
> data to meet the 1.0b spec.
> -- Rebase to bleeding-edge branch for Rafael Wysocki; this patch set
> now requires that a patch set from Marc Zyngier be applied first:
> https://lkml.org/lkml/2015/9/28/421
> -- Tested on AMD Seattle (linux-pm tree) also
>
> Changes for v4:
> -- Remove extraneous white space change (Graeme Gregory)
> -- acpi_parse_entries() changes also needed a check to make sure that
> only MADT entries used bad_madt_entry() (Sudeep Holla)
> -- inadvertent use of 01day build noted that bad_madt_entry() can be
> static, so added it (Sudeep Holla, Fengguang Wu)
>
> Changes for v3:
> -- Reviewed-and-tested-by from Sudeep Holla for arm64 parts
> -- Clearer language in error messages (Graeme Gregory, Timur Tabi)
> -- Double checked that inserting call to bad_madt_entry() into the
> function acpi_parse_entries() does not impact current behavior
> (Sudeep Holla)
>
> Changes for v2:
> -- Acked-by on 2/5 from Marc Zyngier and Catalin Marinas for ARM
> -- Correct faulty end of loop test found by Timur Tabi
>
>
> Al Stone (5):
> ACPI: add in a bad_madt_entry() function to eventually replace the
> macro
> ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY
> ACPI / IA64: remove usage of BAD_MADT_ENTRY
> ACPI / X86: remove usage of BAD_MADT_ENTRY
> ACPI: remove definition of BAD_MADT_ENTRY macro
For this patch set,
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Thanks
Hanjun
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-09-30 9:00 ` [PATCH v5 0/5] Provide better MADT subtable sanity checks Hanjun Guo
@ 2015-09-30 16:10 ` Al Stone
2015-10-05 13:39 ` Rafael J. Wysocki
0 siblings, 1 reply; 25+ messages in thread
From: Al Stone @ 2015-09-30 16:10 UTC (permalink / raw)
To: Hanjun Guo, Al Stone, linux-acpi, linux-arm-kernel
Cc: linaro-kernel, linux-ia64, patches, linux-pm, linaro-acpi,
linux-kernel
On 09/30/2015 03:00 AM, Hanjun Guo wrote:
> On 2015/9/30 7:45, Al Stone wrote:
>> NB: this patch set is for use against the linux-pm bleeding edge branch.
>>
[snip...]
>
> For this patch set,
>
> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>
> Thanks
> Hanjun
Thanks, Hanjun!
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-09-30 16:10 ` Al Stone
@ 2015-10-05 13:39 ` Rafael J. Wysocki
2015-10-05 17:12 ` Al Stone
0 siblings, 1 reply; 25+ messages in thread
From: Rafael J. Wysocki @ 2015-10-05 13:39 UTC (permalink / raw)
To: Al Stone
Cc: Hanjun Guo, Al Stone, linux-acpi, linux-arm-kernel, linaro-kernel,
linux-ia64, patches, linux-pm, linaro-acpi, linux-kernel
On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
> > On 2015/9/30 7:45, Al Stone wrote:
> >> NB: this patch set is for use against the linux-pm bleeding edge branch.
> >>
>
> [snip...]
>
> >
> > For this patch set,
> >
> > Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
> >
> > Thanks
> > Hanjun
>
> Thanks, Hanjun!
Series applied, thanks!
Rafael
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-05 13:39 ` Rafael J. Wysocki
@ 2015-10-05 17:12 ` Al Stone
[not found] ` <561B2442.9050600@erley.org>
0 siblings, 1 reply; 25+ messages in thread
From: Al Stone @ 2015-10-05 17:12 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Hanjun Guo, Al Stone, linux-acpi, linux-arm-kernel, linaro-kernel,
linux-ia64, patches, linux-pm, linaro-acpi, linux-kernel
On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>> On 2015/9/30 7:45, Al Stone wrote:
>>>> NB: this patch set is for use against the linux-pm bleeding edge branch.
>>>>
>>
>> [snip...]
>>
>>>
>>> For this patch set,
>>>
>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>
>>> Thanks
>>> Hanjun
>>
>> Thanks, Hanjun!
>
> Series applied, thanks!
>
> Rafael
>
Thanks, Rafael!
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
[not found] ` <561B2442.9050600@erley.org>
@ 2015-10-12 3:49 ` Hanjun Guo
2015-10-12 3:58 ` Pat Erley
0 siblings, 1 reply; 25+ messages in thread
From: Hanjun Guo @ 2015-10-12 3:49 UTC (permalink / raw)
To: Pat Erley, Al Stone, Rafael J. Wysocki
Cc: linaro-kernel, linux-ia64, patches, linux-pm, linux-kernel,
linaro-acpi, linux-acpi, Hanjun Guo, linux-arm-kernel
On 10/12/2015 11:08 AM, Pat Erley wrote:
> On 10/05/2015 10:12 AM, Al Stone wrote:
>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>> branch.
>>>>>>
>>>>
>>>> [snip...]
>>>>
>>>>>
>>>>> For this patch set,
>>>>>
>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>
>>>>> Thanks
>>>>> Hanjun
>>>>
>>>> Thanks, Hanjun!
>>>
>>> Series applied, thanks!
>>>
>>> Rafael
>>>
>>
>> Thanks, Rafael!
>>
>
> Just decided to test out linux-next (to see the new nouveau cleanups).
> This change set prevents my Lenovo W510 from booting properly.
>
> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
> eventually replace the macro"
>
> Gets the system booting again. I'm attaching my dmesg from the failed
> boot, who wants the acpidump?
[ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
[ 0.000000] ACPI: Error parsing LAPIC address override entry
[ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
Seems the MADT revision is not right, could you dump the ACPI MADT
(APIC) table and send it out? I will take a look :)
Thanks
Hanjun
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 3:49 ` [Linaro-acpi] " Hanjun Guo
@ 2015-10-12 3:58 ` Pat Erley
2015-10-12 7:04 ` Hanjun Guo
2015-10-12 20:52 ` Al Stone
0 siblings, 2 replies; 25+ messages in thread
From: Pat Erley @ 2015-10-12 3:58 UTC (permalink / raw)
To: Hanjun Guo, Al Stone, Rafael J. Wysocki
Cc: linaro-kernel, linux-ia64, patches, linux-pm, linux-kernel,
linaro-acpi, linux-acpi, Hanjun Guo, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]
On 10/11/2015 08:49 PM, Hanjun Guo wrote:
> On 10/12/2015 11:08 AM, Pat Erley wrote:
>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>> branch.
>>>>>>>
>>>>>
>>>>> [snip...]
>>>>>
>>>>>>
>>>>>> For this patch set,
>>>>>>
>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>
>>>>>> Thanks
>>>>>> Hanjun
>>>>>
>>>>> Thanks, Hanjun!
>>>>
>>>> Series applied, thanks!
>>>>
>>>> Rafael
>>>>
>>>
>>> Thanks, Rafael!
>>>
>>
>> Just decided to test out linux-next (to see the new nouveau cleanups).
>> This change set prevents my Lenovo W510 from booting properly.
>>
>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>> eventually replace the macro"
>>
>> Gets the system booting again. I'm attaching my dmesg from the failed
>> boot, who wants the acpidump?
>
> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
> [ 0.000000] ACPI: Error parsing LAPIC address override entry
> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>
> Seems the MADT revision is not right, could you dump the ACPI MADT
> (APIC) table and send it out? I will take a look :)
>
> Thanks
> Hanjun
Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
[-- Attachment #2: apic.dat --]
[-- Type: application/x-ns-proxy-autoconfig, Size: 188 bytes --]
[-- Attachment #3: apic.dsl --]
[-- Type: text/x-dsl, Size: 8720 bytes --]
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20150717-64
* Copyright (c) 2000 - 2015 Intel Corporation
*
* Disassembly of apic.dat, Sun Oct 11 20:55:40 2015
*
* ACPI Data Table [APIC]
*
* Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
*/
[000h 0000 4] Signature : "APIC" [Multiple APIC Description Table (MADT)]
[004h 0004 4] Table Length : 000000BC
[008h 0008 1] Revision : 01
[009h 0009 1] Checksum : FA
[00Ah 0010 6] Oem ID : "LENOVO"
[010h 0016 8] Oem Table ID : "TP-6N "
[018h 0024 4] Oem Revision : 00001450
[01Ch 0028 4] Asl Compiler ID : "LNVO"
[020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 4] Local Apic Address : FEE00000
[028h 0040 4] Flags (decoded below) : 00000001
PC-AT Compatibility : 1
[02Ch 0044 1] Subtable Type : 00 [Processor Local APIC]
[02Dh 0045 1] Length : 08
[02Eh 0046 1] Processor ID : 00
[02Fh 0047 1] Local Apic ID : 00
[030h 0048 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[034h 0052 1] Subtable Type : 00 [Processor Local APIC]
[035h 0053 1] Length : 08
[036h 0054 1] Processor ID : 01
[037h 0055 1] Local Apic ID : 01
[038h 0056 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[03Ch 0060 1] Subtable Type : 00 [Processor Local APIC]
[03Dh 0061 1] Length : 08
[03Eh 0062 1] Processor ID : 02
[03Fh 0063 1] Local Apic ID : 02
[040h 0064 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[044h 0068 1] Subtable Type : 00 [Processor Local APIC]
[045h 0069 1] Length : 08
[046h 0070 1] Processor ID : 03
[047h 0071 1] Local Apic ID : 03
[048h 0072 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[04Ch 0076 1] Subtable Type : 00 [Processor Local APIC]
[04Dh 0077 1] Length : 08
[04Eh 0078 1] Processor ID : 04
[04Fh 0079 1] Local Apic ID : 04
[050h 0080 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[054h 0084 1] Subtable Type : 00 [Processor Local APIC]
[055h 0085 1] Length : 08
[056h 0086 1] Processor ID : 05
[057h 0087 1] Local Apic ID : 05
[058h 0088 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[05Ch 0092 1] Subtable Type : 00 [Processor Local APIC]
[05Dh 0093 1] Length : 08
[05Eh 0094 1] Processor ID : 06
[05Fh 0095 1] Local Apic ID : 06
[060h 0096 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[064h 0100 1] Subtable Type : 00 [Processor Local APIC]
[065h 0101 1] Length : 08
[066h 0102 1] Processor ID : 07
[067h 0103 1] Local Apic ID : 07
[068h 0104 4] Flags (decoded below) : 00000001
Processor Enabled : 1
[06Ch 0108 1] Subtable Type : 01 [I/O APIC]
[06Dh 0109 1] Length : 0C
[06Eh 0110 1] I/O Apic ID : 01
[06Fh 0111 1] Reserved : 00
[070h 0112 4] Address : FEC00000
[074h 0116 4] Interrupt : 00000000
[078h 0120 1] Subtable Type : 02 [Interrupt Source Override]
[079h 0121 1] Length : 0A
[07Ah 0122 1] Bus : 00
[07Bh 0123 1] Source : 00
[07Ch 0124 4] Interrupt : 00000002
[080h 0128 2] Flags (decoded below) : 0000
Polarity : 0
Trigger Mode : 0
[082h 0130 1] Subtable Type : 02 [Interrupt Source Override]
[083h 0131 1] Length : 0A
[084h 0132 1] Bus : 00
[085h 0133 1] Source : 09
[086h 0134 4] Interrupt : 00000009
[08Ah 0138 2] Flags (decoded below) : 000D
Polarity : 1
Trigger Mode : 3
[08Ch 0140 1] Subtable Type : 04 [Local APIC NMI]
[08Dh 0141 1] Length : 06
[08Eh 0142 1] Processor ID : 00
[08Fh 0143 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[091h 0145 1] Interrupt Input LINT : 01
[092h 0146 1] Subtable Type : 04 [Local APIC NMI]
[093h 0147 1] Length : 06
[094h 0148 1] Processor ID : 01
[095h 0149 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[097h 0151 1] Interrupt Input LINT : 01
[098h 0152 1] Subtable Type : 04 [Local APIC NMI]
[099h 0153 1] Length : 06
[09Ah 0154 1] Processor ID : 02
[09Bh 0155 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[09Dh 0157 1] Interrupt Input LINT : 01
[09Eh 0158 1] Subtable Type : 04 [Local APIC NMI]
[09Fh 0159 1] Length : 06
[0A0h 0160 1] Processor ID : 03
[0A1h 0161 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[0A3h 0163 1] Interrupt Input LINT : 01
[0A4h 0164 1] Subtable Type : 04 [Local APIC NMI]
[0A5h 0165 1] Length : 06
[0A6h 0166 1] Processor ID : 04
[0A7h 0167 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[0A9h 0169 1] Interrupt Input LINT : 01
[0AAh 0170 1] Subtable Type : 04 [Local APIC NMI]
[0ABh 0171 1] Length : 06
[0ACh 0172 1] Processor ID : 05
[0ADh 0173 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[0AFh 0175 1] Interrupt Input LINT : 01
[0B0h 0176 1] Subtable Type : 04 [Local APIC NMI]
[0B1h 0177 1] Length : 06
[0B2h 0178 1] Processor ID : 06
[0B3h 0179 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[0B5h 0181 1] Interrupt Input LINT : 01
[0B6h 0182 1] Subtable Type : 04 [Local APIC NMI]
[0B7h 0183 1] Length : 06
[0B8h 0184 1] Processor ID : 07
[0B9h 0185 2] Flags (decoded below) : 0005
Polarity : 1
Trigger Mode : 1
[0BBh 0187 1] Interrupt Input LINT : 01
Raw Table Data: Length 188 (0xBC)
0000: 41 50 49 43 BC 00 00 00 01 FA 4C 45 4E 4F 56 4F // APIC......LENOVO
0010: 54 50 2D 36 4E 20 20 20 50 14 00 00 4C 4E 56 4F // TP-6N P...LNVO
0020: 01 00 00 00 00 00 E0 FE 01 00 00 00 00 08 00 00 // ................
0030: 01 00 00 00 00 08 01 01 01 00 00 00 00 08 02 02 // ................
0040: 01 00 00 00 00 08 03 03 01 00 00 00 00 08 04 04 // ................
0050: 01 00 00 00 00 08 05 05 01 00 00 00 00 08 06 06 // ................
0060: 01 00 00 00 00 08 07 07 01 00 00 00 01 0C 01 00 // ................
0070: 00 00 C0 FE 00 00 00 00 02 0A 00 00 02 00 00 00 // ................
0080: 00 00 02 0A 00 09 09 00 00 00 0D 00 04 06 00 05 // ................
0090: 00 01 04 06 01 05 00 01 04 06 02 05 00 01 04 06 // ................
00A0: 03 05 00 01 04 06 04 05 00 01 04 06 05 05 00 01 // ................
00B0: 04 06 06 05 00 01 04 06 07 05 00 01 // ............
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 3:58 ` Pat Erley
@ 2015-10-12 7:04 ` Hanjun Guo
2015-10-12 9:44 ` Sudeep Holla
2015-10-12 18:53 ` Rafael J. Wysocki
2015-10-12 20:52 ` Al Stone
1 sibling, 2 replies; 25+ messages in thread
From: Hanjun Guo @ 2015-10-12 7:04 UTC (permalink / raw)
To: Pat Erley, Al Stone, Rafael J. Wysocki
Cc: linaro-kernel, linux-ia64, patches, linux-pm, linux-kernel,
linaro-acpi, linux-acpi, Hanjun Guo, linux-arm-kernel
On 10/12/2015 11:58 AM, Pat Erley wrote:
> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>> branch.
>>>>>>>>
>>>>>>
>>>>>> [snip...]
>>>>>>
>>>>>>>
>>>>>>> For this patch set,
>>>>>>>
>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>
>>>>>>> Thanks
>>>>>>> Hanjun
>>>>>>
>>>>>> Thanks, Hanjun!
>>>>>
>>>>> Series applied, thanks!
>>>>>
>>>>> Rafael
>>>>>
>>>>
>>>> Thanks, Rafael!
>>>>
>>>
>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>> This change set prevents my Lenovo W510 from booting properly.
>>>
>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>> eventually replace the macro"
>>>
>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>> boot, who wants the acpidump?
>>
>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>
>> Seems the MADT revision is not right, could you dump the ACPI MADT
>> (APIC) table and send it out? I will take a look :)
>>
>> Thanks
>> Hanjun
>
> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
Thanks! I think I had the right guess, the MADT revision is not right
for ACPI 4.0:
[000h 0000 4] Signature : "APIC" [Multiple APIC
Description Table (MADT)]
[004h 0004 4] Table Length : 000000BC
[008h 0008 1] *Revision : 01*
I encountered such problem before because the table was just copied from
previous version, and without the update for table revision.
I think we may need to ignore the table revision for x86, but restrict
it for ARM64, I'd like Al and Rafael's suggestion before I send out a
patch.
Thanks
Hanjun
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 7:04 ` Hanjun Guo
@ 2015-10-12 9:44 ` Sudeep Holla
2015-10-12 13:04 ` Hanjun Guo
2015-10-12 18:56 ` Rafael J. Wysocki
2015-10-12 18:53 ` Rafael J. Wysocki
1 sibling, 2 replies; 25+ messages in thread
From: Sudeep Holla @ 2015-10-12 9:44 UTC (permalink / raw)
To: Hanjun Guo, Pat Erley, Al Stone, Rafael J. Wysocki
Cc: Sudeep Holla, linaro-kernel, linux-ia64, patches, linux-pm,
linux-kernel, linaro-acpi, linux-acpi, Hanjun Guo,
linux-arm-kernel
On 12/10/15 08:04, Hanjun Guo wrote:
> On 10/12/2015 11:58 AM, Pat Erley wrote:
>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>>> branch.
>>>>>>>>>
>>>>>>>
>>>>>>> [snip...]
>>>>>>>
>>>>>>>>
>>>>>>>> For this patch set,
>>>>>>>>
>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Hanjun
>>>>>>>
>>>>>>> Thanks, Hanjun!
>>>>>>
>>>>>> Series applied, thanks!
>>>>>>
>>>>>> Rafael
>>>>>>
>>>>>
>>>>> Thanks, Rafael!
>>>>>
>>>>
>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>>> This change set prevents my Lenovo W510 from booting properly.
>>>>
>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>>> eventually replace the macro"
>>>>
>>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>>> boot, who wants the acpidump?
>>>
>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>>
>>> Seems the MADT revision is not right, could you dump the ACPI MADT
>>> (APIC) table and send it out? I will take a look :)
>>>
>>> Thanks
>>> Hanjun
>>
>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>
> Thanks! I think I had the right guess, the MADT revision is not right
> for ACPI 4.0:
>
> [000h 0000 4] Signature : "APIC" [Multiple APIC
> Description Table (MADT)]
> [004h 0004 4] Table Length : 000000BC
> [008h 0008 1] *Revision : 01*
>
> I encountered such problem before because the table was just copied from
> previous version, and without the update for table revision.
>
> I think we may need to ignore the table revision for x86, but restrict
> it for ARM64, I'd like Al and Rafael's suggestion before I send out a
> patch.
>
Instead of just removing the check completely on x86, IMO restrict it to
some newer/later version of ACPI so you can still force vendors to fix
their ACPI tables at-least in future.
It would be good to get such sanity check in the tools used to build
those tables, but yes since such static tables can be built in many
ways, its difficult to deal it in all those tools.
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 9:44 ` Sudeep Holla
@ 2015-10-12 13:04 ` Hanjun Guo
2015-10-12 18:56 ` Rafael J. Wysocki
1 sibling, 0 replies; 25+ messages in thread
From: Hanjun Guo @ 2015-10-12 13:04 UTC (permalink / raw)
To: Sudeep Holla, Pat Erley, Al Stone, Rafael J. Wysocki
Cc: linaro-kernel, linux-ia64, patches, linux-pm, linux-kernel,
linaro-acpi, linux-acpi, Hanjun Guo, linux-arm-kernel
On 10/12/2015 05:44 PM, Sudeep Holla wrote:
>
>
> On 12/10/15 08:04, Hanjun Guo wrote:
>> On 10/12/2015 11:58 AM, Pat Erley wrote:
>>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>>>> branch.
>>>>>>>>>>
>>>>>>>>
>>>>>>>> [snip...]
>>>>>>>>
>>>>>>>>>
>>>>>>>>> For this patch set,
>>>>>>>>>
>>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Hanjun
>>>>>>>>
>>>>>>>> Thanks, Hanjun!
>>>>>>>
>>>>>>> Series applied, thanks!
>>>>>>>
>>>>>>> Rafael
>>>>>>>
>>>>>>
>>>>>> Thanks, Rafael!
>>>>>>
>>>>>
>>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>>>> This change set prevents my Lenovo W510 from booting properly.
>>>>>
>>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>>>> eventually replace the macro"
>>>>>
>>>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>>>> boot, who wants the acpidump?
>>>>
>>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>>>
>>>> Seems the MADT revision is not right, could you dump the ACPI MADT
>>>> (APIC) table and send it out? I will take a look :)
>>>>
>>>> Thanks
>>>> Hanjun
>>>
>>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>>
>> Thanks! I think I had the right guess, the MADT revision is not right
>> for ACPI 4.0:
>>
>> [000h 0000 4] Signature : "APIC" [Multiple APIC
>> Description Table (MADT)]
>> [004h 0004 4] Table Length : 000000BC
>> [008h 0008 1] *Revision : 01*
>>
>> I encountered such problem before because the table was just copied from
>> previous version, and without the update for table revision.
>>
>> I think we may need to ignore the table revision for x86, but restrict
>> it for ARM64, I'd like Al and Rafael's suggestion before I send out a
>> patch.
>>
>
> Instead of just removing the check completely on x86, IMO restrict it to
> some newer/later version of ACPI so you can still force vendors to fix
> their ACPI tables at-least in future.
I agree.
>
> It would be good to get such sanity check in the tools used to build
> those tables, but yes since such static tables can be built in many
> ways, its difficult to deal it in all those tools.
At least we can check that in the FWTS. :)
Thanks
Hanjun
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 7:04 ` Hanjun Guo
2015-10-12 9:44 ` Sudeep Holla
@ 2015-10-12 18:53 ` Rafael J. Wysocki
2015-10-13 1:23 ` Hanjun Guo
1 sibling, 1 reply; 25+ messages in thread
From: Rafael J. Wysocki @ 2015-10-12 18:53 UTC (permalink / raw)
To: Hanjun Guo
Cc: Pat Erley, Al Stone, linaro-kernel, linux-ia64, patches, linux-pm,
linux-kernel, linaro-acpi, linux-acpi, Hanjun Guo,
linux-arm-kernel
On Monday, October 12, 2015 03:04:30 PM Hanjun Guo wrote:
> On 10/12/2015 11:58 AM, Pat Erley wrote:
> > On 10/11/2015 08:49 PM, Hanjun Guo wrote:
> >> On 10/12/2015 11:08 AM, Pat Erley wrote:
> >>> On 10/05/2015 10:12 AM, Al Stone wrote:
> >>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
> >>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
> >>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
> >>>>>>> On 2015/9/30 7:45, Al Stone wrote:
> >>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
> >>>>>>>> branch.
> >>>>>>>>
> >>>>>>
> >>>>>> [snip...]
> >>>>>>
> >>>>>>>
> >>>>>>> For this patch set,
> >>>>>>>
> >>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
> >>>>>>>
> >>>>>>> Thanks
> >>>>>>> Hanjun
> >>>>>>
> >>>>>> Thanks, Hanjun!
> >>>>>
> >>>>> Series applied, thanks!
> >>>>>
> >>>>> Rafael
> >>>>>
> >>>>
> >>>> Thanks, Rafael!
> >>>>
> >>>
> >>> Just decided to test out linux-next (to see the new nouveau cleanups).
> >>> This change set prevents my Lenovo W510 from booting properly.
> >>>
> >>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
> >>> eventually replace the macro"
> >>>
> >>> Gets the system booting again. I'm attaching my dmesg from the failed
> >>> boot, who wants the acpidump?
> >>
> >> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
> >> [ 0.000000] ACPI: Error parsing LAPIC address override entry
> >> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
> >>
> >> Seems the MADT revision is not right, could you dump the ACPI MADT
> >> (APIC) table and send it out? I will take a look :)
> >>
> >> Thanks
> >> Hanjun
> >
> > Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>
> Thanks! I think I had the right guess, the MADT revision is not right
> for ACPI 4.0:
>
> [000h 0000 4] Signature : "APIC" [Multiple APIC
> Description Table (MADT)]
> [004h 0004 4] Table Length : 000000BC
> [008h 0008 1] *Revision : 01*
>
> I encountered such problem before because the table was just copied from
> previous version, and without the update for table revision.
>
> I think we may need to ignore the table revision for x86, but restrict
> it for ARM64, I'd like Al and Rafael's suggestion before I send out a
> patch.
As I said before to Al, we definitely can't break systems that worked before
the commit in question.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 9:44 ` Sudeep Holla
2015-10-12 13:04 ` Hanjun Guo
@ 2015-10-12 18:56 ` Rafael J. Wysocki
2015-10-12 19:07 ` Al Stone
2015-10-13 8:43 ` Sudeep Holla
1 sibling, 2 replies; 25+ messages in thread
From: Rafael J. Wysocki @ 2015-10-12 18:56 UTC (permalink / raw)
To: Sudeep Holla
Cc: Hanjun Guo, Pat Erley, Al Stone, linaro-kernel, linux-ia64,
patches, linux-pm, linux-kernel, linaro-acpi, linux-acpi,
Hanjun Guo, linux-arm-kernel
On Monday, October 12, 2015 10:44:52 AM Sudeep Holla wrote:
>
> On 12/10/15 08:04, Hanjun Guo wrote:
> > On 10/12/2015 11:58 AM, Pat Erley wrote:
> >> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
> >>> On 10/12/2015 11:08 AM, Pat Erley wrote:
> >>>> On 10/05/2015 10:12 AM, Al Stone wrote:
> >>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
> >>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
> >>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
> >>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
> >>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
> >>>>>>>>> branch.
> >>>>>>>>>
> >>>>>>>
> >>>>>>> [snip...]
> >>>>>>>
> >>>>>>>>
> >>>>>>>> For this patch set,
> >>>>>>>>
> >>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
> >>>>>>>>
> >>>>>>>> Thanks
> >>>>>>>> Hanjun
> >>>>>>>
> >>>>>>> Thanks, Hanjun!
> >>>>>>
> >>>>>> Series applied, thanks!
> >>>>>>
> >>>>>> Rafael
> >>>>>>
> >>>>>
> >>>>> Thanks, Rafael!
> >>>>>
> >>>>
> >>>> Just decided to test out linux-next (to see the new nouveau cleanups).
> >>>> This change set prevents my Lenovo W510 from booting properly.
> >>>>
> >>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
> >>>> eventually replace the macro"
> >>>>
> >>>> Gets the system booting again. I'm attaching my dmesg from the failed
> >>>> boot, who wants the acpidump?
> >>>
> >>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
> >>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
> >>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
> >>>
> >>> Seems the MADT revision is not right, could you dump the ACPI MADT
> >>> (APIC) table and send it out? I will take a look :)
> >>>
> >>> Thanks
> >>> Hanjun
> >>
> >> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
> >
> > Thanks! I think I had the right guess, the MADT revision is not right
> > for ACPI 4.0:
> >
> > [000h 0000 4] Signature : "APIC" [Multiple APIC
> > Description Table (MADT)]
> > [004h 0004 4] Table Length : 000000BC
> > [008h 0008 1] *Revision : 01*
> >
> > I encountered such problem before because the table was just copied from
> > previous version, and without the update for table revision.
> >
> > I think we may need to ignore the table revision for x86, but restrict
> > it for ARM64, I'd like Al and Rafael's suggestion before I send out a
> > patch.
> >
>
> Instead of just removing the check completely on x86, IMO restrict it to
> some newer/later version of ACPI so you can still force vendors to fix
> their ACPI tables at-least in future.
No, we can't force vendors to fix their ACPI tables. This is completely
unrealistic.
We simly need to deal with the bugs in the ACPI tables in the kernel.
> It would be good to get such sanity check in the tools used to build
> those tables, but yes since such static tables can be built in many
> ways, its difficult to deal it in all those tools.
As I said to Al, we need those checks in firmware test suites. Having
them in the kernel is OK too, but they should cause warnings to be printed
to the kernel log instead of causing the kernel to panic.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 18:56 ` Rafael J. Wysocki
@ 2015-10-12 19:07 ` Al Stone
2015-10-13 8:43 ` Sudeep Holla
1 sibling, 0 replies; 25+ messages in thread
From: Al Stone @ 2015-10-12 19:07 UTC (permalink / raw)
To: Rafael J. Wysocki, Sudeep Holla
Cc: Hanjun Guo, Pat Erley, linaro-kernel, linux-ia64, patches,
linux-pm, linux-kernel, linaro-acpi, linux-acpi, Hanjun Guo,
linux-arm-kernel
On 10/12/2015 01:25 PM, Rafael J. Wysocki wrote:
> On Monday, October 12, 2015 10:44:52 AM Sudeep Holla wrote:
>>
>> On 12/10/15 08:04, Hanjun Guo wrote:
>>> On 10/12/2015 11:58 AM, Pat Erley wrote:
>>>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>>>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>>>>> branch.
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> [snip...]
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> For this patch set,
>>>>>>>>>>
>>>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Hanjun
>>>>>>>>>
>>>>>>>>> Thanks, Hanjun!
>>>>>>>>
>>>>>>>> Series applied, thanks!
>>>>>>>>
>>>>>>>> Rafael
>>>>>>>>
>>>>>>>
>>>>>>> Thanks, Rafael!
>>>>>>>
>>>>>>
>>>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>>>>> This change set prevents my Lenovo W510 from booting properly.
>>>>>>
>>>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>>>>> eventually replace the macro"
>>>>>>
>>>>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>>>>> boot, who wants the acpidump?
Thanks for sending this!
>>>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>>>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>>>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>>>>
>>>>> Seems the MADT revision is not right, could you dump the ACPI MADT
>>>>> (APIC) table and send it out? I will take a look :)
>>>>>
>>>>> Thanks
>>>>> Hanjun
>>>>
>>>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>>>
>>> Thanks! I think I had the right guess, the MADT revision is not right
>>> for ACPI 4.0:
>>>
>>> [000h 0000 4] Signature : "APIC" [Multiple APIC
>>> Description Table (MADT)]
>>> [004h 0004 4] Table Length : 000000BC
>>> [008h 0008 1] *Revision : 01*
>>>
>>> I encountered such problem before because the table was just copied from
>>> previous version, and without the update for table revision.
>>>
>>> I think we may need to ignore the table revision for x86, but restrict
>>> it for ARM64, I'd like Al and Rafael's suggestion before I send out a
>>> patch.
>>>
>>
>> Instead of just removing the check completely on x86, IMO restrict it to
>> some newer/later version of ACPI so you can still force vendors to fix
>> their ACPI tables at-least in future.
>
> No, we can't force vendors to fix their ACPI tables. This is completely
> unrealistic.
>
> We simly need to deal with the bugs in the ACPI tables in the kernel.
Unfortunately true. I've had a couple of reports to look at and think
through apart from this; it's really quite fascinating how much stuff
a slightly stricter table check is turning up. A little surprising,
too, but fascinating. A fix is in progress, still needs some testing...
>> It would be good to get such sanity check in the tools used to build
>> those tables, but yes since such static tables can be built in many
>> ways, its difficult to deal it in all those tools.
>
> As I said to Al, we need those checks in firmware test suites. Having
> them in the kernel is OK too, but they should cause warnings to be printed
> to the kernel log instead of causing the kernel to panic.
>
> Thanks,
> Rafael
>
Yup. Agreed. For x86, we can't induce kernel panics. Since arm64 is new to
the game, we'll be stricter since we can afford to be for now.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 3:58 ` Pat Erley
2015-10-12 7:04 ` Hanjun Guo
@ 2015-10-12 20:52 ` Al Stone
2015-10-13 4:06 ` Pat Erley
1 sibling, 1 reply; 25+ messages in thread
From: Al Stone @ 2015-10-12 20:52 UTC (permalink / raw)
To: Pat Erley, Hanjun Guo, Al Stone, Rafael J. Wysocki
Cc: linaro-kernel, linux-ia64, linaro-acpi, linux-pm, linux-kernel,
linux-acpi, patches, Hanjun Guo, linux-arm-kernel
On 10/11/2015 09:58 PM, Pat Erley wrote:
> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>> branch.
>>>>>>>>
>>>>>>
>>>>>> [snip...]
>>>>>>
>>>>>>>
>>>>>>> For this patch set,
>>>>>>>
>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>
>>>>>>> Thanks
>>>>>>> Hanjun
>>>>>>
>>>>>> Thanks, Hanjun!
>>>>>
>>>>> Series applied, thanks!
>>>>>
>>>>> Rafael
>>>>>
>>>>
>>>> Thanks, Rafael!
>>>>
>>>
>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>> This change set prevents my Lenovo W510 from booting properly.
>>>
>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>> eventually replace the macro"
>>>
>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>> boot, who wants the acpidump?
>>
>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>
>> Seems the MADT revision is not right, could you dump the ACPI MADT
>> (APIC) table and send it out? I will take a look :)
>>
>> Thanks
>> Hanjun
>
> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
Pat,
Would you mind sending a copy of the FADT, also, please? The first of the
ACPI messages is a check of version correspondence between the FADT and MADT,
while the second message is from looking at just an MADT subtable. Thanks
for sending the MADT out -- that helps me quite a lot in thinking this through.
BTW, whoever is providing the BIOS (Lenovo, I assume) may want to have a look
at these, also:
[ 0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in
FADT/Pm1aControlBlock: 16/32 (20150818/tbfadt-623)
[ 0.000000] ACPI BIOS Warning (bug): Invalid length for
FADT/Pm1aControlBlock: 32, using default 16 (20150818/tbfadt-704)
Not inherently dangerous, but definitely sloppy and mind-numbingly easy to
avoid, IIRC.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone@linaro.org
-----------------------------------
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 18:53 ` Rafael J. Wysocki
@ 2015-10-13 1:23 ` Hanjun Guo
0 siblings, 0 replies; 25+ messages in thread
From: Hanjun Guo @ 2015-10-13 1:23 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Pat Erley, Al Stone, linaro-kernel, linux-ia64, patches, linux-pm,
linux-kernel, linaro-acpi, linux-acpi, Hanjun Guo,
linux-arm-kernel
On 10/13/2015 03:21 AM, Rafael J. Wysocki wrote:
> On Monday, October 12, 2015 03:04:30 PM Hanjun Guo wrote:
>> On 10/12/2015 11:58 AM, Pat Erley wrote:
>>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>>>> branch.
>>>>>>>>>>
>>>>>>>>
>>>>>>>> [snip...]
>>>>>>>>
>>>>>>>>>
>>>>>>>>> For this patch set,
>>>>>>>>>
>>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Hanjun
>>>>>>>>
>>>>>>>> Thanks, Hanjun!
>>>>>>>
>>>>>>> Series applied, thanks!
>>>>>>>
>>>>>>> Rafael
>>>>>>>
>>>>>>
>>>>>> Thanks, Rafael!
>>>>>>
>>>>>
>>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>>>> This change set prevents my Lenovo W510 from booting properly.
>>>>>
>>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>>>> eventually replace the macro"
>>>>>
>>>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>>>> boot, who wants the acpidump?
>>>>
>>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>>>
>>>> Seems the MADT revision is not right, could you dump the ACPI MADT
>>>> (APIC) table and send it out? I will take a look :)
>>>>
>>>> Thanks
>>>> Hanjun
>>>
>>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>>
>> Thanks! I think I had the right guess, the MADT revision is not right
>> for ACPI 4.0:
>>
>> [000h 0000 4] Signature : "APIC" [Multiple APIC
>> Description Table (MADT)]
>> [004h 0004 4] Table Length : 000000BC
>> [008h 0008 1] *Revision : 01*
>>
>> I encountered such problem before because the table was just copied from
>> previous version, and without the update for table revision.
>>
>> I think we may need to ignore the table revision for x86, but restrict
>> it for ARM64, I'd like Al and Rafael's suggestion before I send out a
>> patch.
>
> As I said before to Al, we definitely can't break systems that worked before
> the commit in question.
Sure :)
Thanks
Hanjun
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 20:52 ` Al Stone
@ 2015-10-13 4:06 ` Pat Erley
2015-10-14 20:20 ` Al Stone
0 siblings, 1 reply; 25+ messages in thread
From: Pat Erley @ 2015-10-13 4:06 UTC (permalink / raw)
To: Al Stone, Hanjun Guo, Al Stone, Rafael J. Wysocki
Cc: linaro-kernel, linux-ia64, linaro-acpi, linux-pm, linux-kernel,
linux-acpi, patches, Hanjun Guo, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]
On 10/12/2015 01:52 PM, Al Stone wrote:
> On 10/11/2015 09:58 PM, Pat Erley wrote:
>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>>> branch.
>>>>>>>>>
>>>>>>>
>>>>>>> [snip...]
>>>>>>>
>>>>>>>>
>>>>>>>> For this patch set,
>>>>>>>>
>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Hanjun
>>>>>>>
>>>>>>> Thanks, Hanjun!
>>>>>>
>>>>>> Series applied, thanks!
>>>>>>
>>>>>> Rafael
>>>>>>
>>>>>
>>>>> Thanks, Rafael!
>>>>>
>>>>
>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>>> This change set prevents my Lenovo W510 from booting properly.
>>>>
>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>>> eventually replace the macro"
>>>>
>>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>>> boot, who wants the acpidump?
>>>
>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>>
>>> Seems the MADT revision is not right, could you dump the ACPI MADT
>>> (APIC) table and send it out? I will take a look :)
>>>
>>> Thanks
>>> Hanjun
>>
>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>
> Pat,
>
> Would you mind sending a copy of the FADT, also, please? The first of the
> ACPI messages is a check of version correspondence between the FADT and MADT,
> while the second message is from looking at just an MADT subtable. Thanks
> for sending the MADT out -- that helps me quite a lot in thinking this through.
>
> BTW, whoever is providing the BIOS (Lenovo, I assume) may want to have a look
> at these, also:
>
> [ 0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in
> FADT/Pm1aControlBlock: 16/32 (20150818/tbfadt-623)
> [ 0.000000] ACPI BIOS Warning (bug): Invalid length for
> FADT/Pm1aControlBlock: 32, using default 16 (20150818/tbfadt-704)
>
> Not inherently dangerous, but definitely sloppy and mind-numbingly easy to
> avoid, IIRC.
>
Here ya go.
[-- Attachment #2: facp.dsl --]
[-- Type: text/x-dsl, Size: 9173 bytes --]
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20150717-64
* Copyright (c) 2000 - 2015 Intel Corporation
*
* Disassembly of facp.dat, Mon Oct 12 21:06:03 2015
*
* ACPI Data Table [FACP]
*
* Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
*/
[000h 0000 4] Signature : "FACP" [Fixed ACPI Description Table (FADT)]
[004h 0004 4] Table Length : 000000F4
[008h 0008 1] Revision : 04
[009h 0009 1] Checksum : 59
[00Ah 0010 6] Oem ID : "LENOVO"
[010h 0016 8] Oem Table ID : "TP-6N "
[018h 0024 4] Oem Revision : 00001450
[01Ch 0028 4] Asl Compiler ID : "LNVO"
[020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 4] FACS Address : BBEE7000
[028h 0040 4] DSDT Address : BBFF1C9B
[02Ch 0044 1] Model : 00
[02Dh 0045 1] PM Profile : 02 [Mobile]
[02Eh 0046 2] SCI Interrupt : 0009
[030h 0048 4] SMI Command Port : 000000B2
[034h 0052 1] ACPI Enable Value : F0
[035h 0053 1] ACPI Disable Value : F1
[036h 0054 1] S4BIOS Command : 00
[037h 0055 1] P-State Control : 80
[038h 0056 4] PM1A Event Block Address : 00001000
[03Ch 0060 4] PM1B Event Block Address : 00000000
[040h 0064 4] PM1A Control Block Address : 00001004
[044h 0068 4] PM1B Control Block Address : 00000000
[048h 0072 4] PM2 Control Block Address : 00001050
[04Ch 0076 4] PM Timer Block Address : 00001008
[050h 0080 4] GPE0 Block Address : 00001020
[054h 0084 4] GPE1 Block Address : 00000000
[058h 0088 1] PM1 Event Block Length : 04
[059h 0089 1] PM1 Control Block Length : 02
[05Ah 0090 1] PM2 Control Block Length : 01
[05Bh 0091 1] PM Timer Block Length : 04
[05Ch 0092 1] GPE0 Block Length : 10
[05Dh 0093 1] GPE1 Block Length : 00
[05Eh 0094 1] GPE1 Base Offset : 00
[05Fh 0095 1] _CST Support : 85
[060h 0096 2] C2 Latency : 0001
[062h 0098 2] C3 Latency : 0039
[064h 0100 2] CPU Cache Size : 0000
[066h 0102 2] Cache Flush Stride : 0000
[068h 0104 1] Duty Cycle Offset : 01
[069h 0105 1] Duty Cycle Width : 03
[06Ah 0106 1] RTC Day Alarm Index : 0D
[06Bh 0107 1] RTC Month Alarm Index : 00
[06Ch 0108 1] RTC Century Index : 32
[06Dh 0109 2] Boot Flags (decoded below) : 0012
Legacy Devices Supported (V2) : 0
8042 Present on ports 60/64 (V2) : 1
VGA Not Present (V4) : 0
MSI Not Supported (V4) : 0
PCIe ASPM Not Supported (V4) : 1
CMOS RTC Not Present (V5) : 0
[06Fh 0111 1] Reserved : 00
[070h 0112 4] Flags (decoded below) : 0000C2AD
WBINVD instruction is operational (V1) : 1
WBINVD flushes all caches (V1) : 0
All CPUs support C1 (V1) : 1
C2 works on MP system (V1) : 1
Control Method Power Button (V1) : 0
Control Method Sleep Button (V1) : 1
RTC wake not in fixed reg space (V1) : 0
RTC can wake system from S4 (V1) : 1
32-bit PM Timer (V1) : 0
Docking Supported (V1) : 1
Reset Register Supported (V2) : 0
Sealed Case (V3) : 0
Headless - No Video (V3) : 0
Use native instr after SLP_TYPx (V3) : 0
PCIEXP_WAK Bits Supported (V4) : 1
Use Platform Timer (V4) : 1
RTC_STS valid on S4 wake (V4) : 0
Remote Power-on capable (V4) : 0
Use APIC Cluster Model (V4) : 0
Use APIC Physical Destination Mode (V4) : 0
Hardware Reduced (V5) : 0
Low Power S0 Idle (V5) : 0
[074h 0116 12] Reset Register : [Generic Address Structure]
[074h 0116 1] Space ID : 01 [SystemIO]
[075h 0117 1] Bit Width : 08
[076h 0118 1] Bit Offset : 00
[077h 0119 1] Encoded Access Width : 00 [Undefined/Legacy]
[078h 0120 8] Address : 0000000000000CF9
[080h 0128 1] Value to cause reset : 06
[081h 0129 2] ARM Flags (decoded below) : 0000
PSCI Compliant : 0
Must use HVC for PSCI : 0
[083h 0131 1] FADT Minor Revision : 00
[084h 0132 8] FACS Address : 00000000BBEE7000
[08Ch 0140 8] DSDT Address : 00000000BBFF1C9B
[094h 0148 12] PM1A Event Block : [Generic Address Structure]
[094h 0148 1] Space ID : 01 [SystemIO]
[095h 0149 1] Bit Width : 20
[096h 0150 1] Bit Offset : 00
[097h 0151 1] Encoded Access Width : 00 [Undefined/Legacy]
[098h 0152 8] Address : 0000000000001000
[0A0h 0160 12] PM1B Event Block : [Generic Address Structure]
[0A0h 0160 1] Space ID : 00 [SystemMemory]
[0A1h 0161 1] Bit Width : 00
[0A2h 0162 1] Bit Offset : 00
[0A3h 0163 1] Encoded Access Width : 00 [Undefined/Legacy]
[0A4h 0164 8] Address : 0000000000000000
[0ACh 0172 12] PM1A Control Block : [Generic Address Structure]
[0ACh 0172 1] Space ID : 01 [SystemIO]
[0ADh 0173 1] Bit Width : 20
[0AEh 0174 1] Bit Offset : 00
[0AFh 0175 1] Encoded Access Width : 00 [Undefined/Legacy]
[0B0h 0176 8] Address : 0000000000001004
[0B8h 0184 12] PM1B Control Block : [Generic Address Structure]
[0B8h 0184 1] Space ID : 00 [SystemMemory]
[0B9h 0185 1] Bit Width : 00
[0BAh 0186 1] Bit Offset : 00
[0BBh 0187 1] Encoded Access Width : 00 [Undefined/Legacy]
[0BCh 0188 8] Address : 0000000000000000
[0C4h 0196 12] PM2 Control Block : [Generic Address Structure]
[0C4h 0196 1] Space ID : 01 [SystemIO]
[0C5h 0197 1] Bit Width : 08
[0C6h 0198 1] Bit Offset : 00
[0C7h 0199 1] Encoded Access Width : 00 [Undefined/Legacy]
[0C8h 0200 8] Address : 0000000000001050
[0D0h 0208 12] PM Timer Block : [Generic Address Structure]
[0D0h 0208 1] Space ID : 01 [SystemIO]
[0D1h 0209 1] Bit Width : 20
[0D2h 0210 1] Bit Offset : 00
[0D3h 0211 1] Encoded Access Width : 00 [Undefined/Legacy]
[0D4h 0212 8] Address : 0000000000001008
[0DCh 0220 12] GPE0 Block : [Generic Address Structure]
[0DCh 0220 1] Space ID : 01 [SystemIO]
[0DDh 0221 1] Bit Width : 80
[0DEh 0222 1] Bit Offset : 00
[0DFh 0223 1] Encoded Access Width : 00 [Undefined/Legacy]
[0E0h 0224 8] Address : 0000000000001020
[0E8h 0232 12] GPE1 Block : [Generic Address Structure]
[0E8h 0232 1] Space ID : 00 [SystemMemory]
[0E9h 0233 1] Bit Width : 00
[0EAh 0234 1] Bit Offset : 00
[0EBh 0235 1] Encoded Access Width : 00 [Undefined/Legacy]
[0ECh 0236 8] Address : 0000000000000000
Raw Table Data: Length 244 (0xF4)
0000: 46 41 43 50 F4 00 00 00 04 59 4C 45 4E 4F 56 4F // FACP.....YLENOVO
0010: 54 50 2D 36 4E 20 20 20 50 14 00 00 4C 4E 56 4F // TP-6N P...LNVO
0020: 01 00 00 00 00 70 EE BB 9B 1C FF BB 00 02 09 00 // .....p..........
0030: B2 00 00 00 F0 F1 00 80 00 10 00 00 00 00 00 00 // ................
0040: 04 10 00 00 00 00 00 00 50 10 00 00 08 10 00 00 // ........P.......
0050: 20 10 00 00 00 00 00 00 04 02 01 04 10 00 00 85 // ...............
0060: 01 00 39 00 00 00 00 00 01 03 0D 00 32 12 00 00 // ..9.........2...
0070: AD C2 00 00 01 08 00 00 F9 0C 00 00 00 00 00 00 // ................
0080: 06 00 00 00 00 70 EE BB 00 00 00 00 9B 1C FF BB // .....p..........
0090: 00 00 00 00 01 20 00 00 00 10 00 00 00 00 00 00 // ..... ..........
00A0: 00 00 00 00 00 00 00 00 00 00 00 00 01 20 00 00 // ............. ..
00B0: 04 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
00C0: 00 00 00 00 01 08 00 00 50 10 00 00 00 00 00 00 // ........P.......
00D0: 01 20 00 00 08 10 00 00 00 00 00 00 01 80 00 00 // . ..............
00E0: 20 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ...............
00F0: 00 00 00 00 // ....
[-- Attachment #3: facp.dat --]
[-- Type: application/x-ns-proxy-autoconfig, Size: 244 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-12 18:56 ` Rafael J. Wysocki
2015-10-12 19:07 ` Al Stone
@ 2015-10-13 8:43 ` Sudeep Holla
1 sibling, 0 replies; 25+ messages in thread
From: Sudeep Holla @ 2015-10-13 8:43 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Sudeep Holla, Hanjun Guo, Pat Erley, Al Stone, linaro-kernel,
linux-ia64, patches, linux-pm, linux-kernel, linaro-acpi,
linux-acpi, Hanjun Guo, linux-arm-kernel
On 12/10/15 20:25, Rafael J. Wysocki wrote:
> On Monday, October 12, 2015 10:44:52 AM Sudeep Holla wrote:
[...]
>>
>> Instead of just removing the check completely on x86, IMO restrict
>> it to some newer/later version of ACPI so you can still force
>> vendors to fix their ACPI tables at-least in future.
>
> No, we can't force vendors to fix their ACPI tables. This is
> completely unrealistic.
>
No, I was referring to the future platforms *only*
> We simly need to deal with the bugs in the ACPI tables in the
> kernel.
>
Yes sadly true for existing systems, but if we now place a check for
ACPIv6.0 and above, we might avoid seeing such broken tables sometime in
future once the kernel with this check in place is used for validation.
>> It would be good to get such sanity check in the tools used to
>> build those tables, but yes since such static tables can be built
>> in many ways, its difficult to deal it in all those tools.
>
> As I said to Al, we need those checks in firmware test suites.
> Having them in the kernel is OK too, but they should cause warnings
> to be printed to the kernel log instead of causing the kernel to
> panic.
>
Agreed
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-13 4:06 ` Pat Erley
@ 2015-10-14 20:20 ` Al Stone
2015-10-14 20:57 ` Rafael J. Wysocki
0 siblings, 1 reply; 25+ messages in thread
From: Al Stone @ 2015-10-14 20:20 UTC (permalink / raw)
To: Pat Erley, Al Stone, Hanjun Guo, Rafael J. Wysocki
Cc: linaro-kernel, linux-ia64, linaro-acpi, linux-pm, linux-kernel,
linux-acpi, patches, Hanjun Guo, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 3355 bytes --]
On 10/12/2015 10:06 PM, Pat Erley wrote:
> On 10/12/2015 01:52 PM, Al Stone wrote:
>> On 10/11/2015 09:58 PM, Pat Erley wrote:
>>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>>>> branch.
>>>>>>>>>>
>>>>>>>>
>>>>>>>> [snip...]
>>>>>>>>
>>>>>>>>>
>>>>>>>>> For this patch set,
>>>>>>>>>
>>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Hanjun
>>>>>>>>
>>>>>>>> Thanks, Hanjun!
>>>>>>>
>>>>>>> Series applied, thanks!
>>>>>>>
>>>>>>> Rafael
>>>>>>>
>>>>>>
>>>>>> Thanks, Rafael!
>>>>>>
>>>>>
>>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>>>> This change set prevents my Lenovo W510 from booting properly.
>>>>>
>>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>>>> eventually replace the macro"
>>>>>
>>>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>>>> boot, who wants the acpidump?
>>>>
>>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>>>
>>>> Seems the MADT revision is not right, could you dump the ACPI MADT
>>>> (APIC) table and send it out? I will take a look :)
>>>>
>>>> Thanks
>>>> Hanjun
>>>
>>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>>
>> Pat,
>>
>> Would you mind sending a copy of the FADT, also, please? The first of the
>> ACPI messages is a check of version correspondence between the FADT and MADT,
>> while the second message is from looking at just an MADT subtable. Thanks
>> for sending the MADT out -- that helps me quite a lot in thinking this through.
>>
>> BTW, whoever is providing the BIOS (Lenovo, I assume) may want to have a look
>> at these, also:
>>
>> [ 0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in
>> FADT/Pm1aControlBlock: 16/32 (20150818/tbfadt-623)
>> [ 0.000000] ACPI BIOS Warning (bug): Invalid length for
>> FADT/Pm1aControlBlock: 32, using default 16 (20150818/tbfadt-704)
>>
>> Not inherently dangerous, but definitely sloppy and mind-numbingly easy to
>> avoid, IIRC.
>>
>
> Here ya go.
Okay. There's just a lot of weird stuff out there in ACPI-land. I've
attached four minor fixes for the special cases that have been reported
(well, the last one is actually a fix for a typo in the spec, but just
the same...).
These should apply on top of linux-next; would you mind trying them out
to make sure I didn't break anything else on your laptop? If they behave
as I hope they will, I think I'll have covered all the places where the
checking of MADT subtables needs to be be relaxed a bit. These work for
me on arm64, but if they work for you and a couple of other testers, then
I'll send them to Rafael properly.
Many thanks!
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
[-- Attachment #2: 0001-ACPI-workaround-x86-firmware-using-reserved-MADT-sub.patch --]
[-- Type: text/x-patch, Size: 1787 bytes --]
From 52a2011c4998674d80c4456e6fd8ba11beaee65c Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 13 Oct 2015 15:29:15 -0600
Subject: [PATCH 1/4] ACPI: workaround x86 firmware using reserved MADT
subtable IDs
According to the ACPI specification, version 6.0, table 5-46, MADT
subtable IDs in the range of 0x10-0x7f are reserved for possible
future use by the specification. The function bad_madt_entry() tries
to enforce the spec, but it turns out there are x86 machines that use
0x7f even though they should not.
So, continue to enforce this rule for arm64, since we're starting out
fresh, but relax it for systems already out there so we don't keep them
from booting.
Signed-off-by: Al Stone <al.stone@linaro.org>
---
drivers/acpi/tables.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index a2ed38a..e5cfd72 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -413,9 +413,17 @@ static int __init bad_madt_entry(struct acpi_table_header *table,
}
if (entry->type >= ms->num_types) {
- pr_err("undefined MADT subtable type for FADT %d.%d: %d (length %d)\n",
- major, minor, entry->type, entry->length);
- return 1;
+ if (IS_ENABLED(CONFIG_ARM64)) {
+ /* Enforce this stricture on arm64... */
+ pr_err("undefined MADT subtable type for FADT %d.%d: %d (length %d)\n",
+ major, minor, entry->type, entry->length);
+ return 1;
+ } else {
+ /* ... but relax it on legacy systems so they boot */
+ pr_warn("undefined MADT subtable type for FADT %d.%d: %d (length %d)\n",
+ major, minor, entry->type, entry->length);
+ return 0;
+ }
}
/* verify that the table is allowed for this version of the spec */
--
2.4.3
[-- Attachment #3: 0002-ACPI-workaround-x86-firmware-with-mis-matched-FADT-M.patch --]
[-- Type: text/x-patch, Size: 1755 bytes --]
From 8b7e93421a1bd3a35ed6200fb778b87e9bff34c5 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 13 Oct 2015 15:51:13 -0600
Subject: [PATCH 2/4] ACPI: workaround x86 firmware with mis-matched FADT/MADT
revisions
Looking across multiple versions of the ACPI specification, certain
versions introduce new revision numbers for the FADT and/or MADT
tables. So, for example, an FADT indicating it is revision 4 should
not be paired with an MADT revision of anything less than 2.
However, there are systems out there that do not update the revision
fields in the FADT and MADT tables as they should. So, for arm64, we
can be stricter in complying with the specification, but we need to
relax the checking for legacy systems.
Signed-off-by: Al Stone <al.stone@linaro.org>
---
drivers/acpi/tables.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index e5cfd72..3b5ddfb 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -407,9 +407,17 @@ static int __init bad_madt_entry(struct acpi_table_header *table,
ms++;
}
if (!ms->num_types) {
- pr_err("undefined version for either FADT %d.%d or MADT %d\n",
- major, minor, madt->header.revision);
- return 1;
+ if (IS_ENABLED(CONFIG_ARM64)) {
+ /* Enforce this stricture on arm64... */
+ pr_err("undefined version for either FADT %d.%d or MADT %d\n",
+ major, minor, madt->header.revision);
+ return 1;
+ } else {
+ /* ... but relax it on legacy systems so they boot */
+ pr_warn("undefined version for either FADT %d.%d or MADT %d\n",
+ major, minor, madt->header.revision);
+ return 0;
+ }
}
if (entry->type >= ms->num_types) {
--
2.4.3
[-- Attachment #4: 0003-ACPI-workaround-FADT-always-being-revision-2.patch --]
[-- Type: text/x-patch, Size: 2908 bytes --]
From 773dd448360098b6faf6c171dd716371d603f3ef Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 13 Oct 2015 16:23:21 -0600
Subject: [PATCH 3/4] ACPI: workaround FADT always being revision 2
In some environments, the FADT revision number is always 2, independent
of any other factors indicating that it may be a newer revision. So,
we cannot rely on the FADT and MADT revisions being in proper step. For
those environments, relax the checking so we only enforce the size check,
even if we do issue warnings on other problems.
If we do not relax the rules, these systems will not boot as they have in
the past.
Signed-off-by: Al Stone <al.stone@linaro.org>
---
drivers/acpi/tables.c | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 3b5ddfb..790d4b0 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -416,7 +416,6 @@ static int __init bad_madt_entry(struct acpi_table_header *table,
/* ... but relax it on legacy systems so they boot */
pr_warn("undefined version for either FADT %d.%d or MADT %d\n",
major, minor, madt->header.revision);
- return 0;
}
}
@@ -430,16 +429,41 @@ static int __init bad_madt_entry(struct acpi_table_header *table,
/* ... but relax it on legacy systems so they boot */
pr_warn("undefined MADT subtable type for FADT %d.%d: %d (length %d)\n",
major, minor, entry->type, entry->length);
- return 0;
}
}
/* verify that the table is allowed for this version of the spec */
len = ms->lengths[entry->type];
if (!len) {
- pr_err("MADT subtable %d not defined for FADT %d.%d\n",
- entry->type, major, minor);
- return 1;
+ if (IS_ENABLED(CONFIG_ARM64)) {
+ pr_err("MADT subtable %d not defined for FADT %d.%d\n",
+ entry->type, major, minor);
+ return 1;
+ } else {
+ pr_warn("MADT subtable %d not defined for FADT %d.%d\n",
+ entry->type, major, minor);
+ }
+ }
+
+ /*
+ * When we get this far, we may have issued warnings on either
+ * a mismatch in FADT/MADT revisions, or have noted that the subtable
+ * ID is not defined for the MADT revision we're using. On some
+ * architectures, this is an error, but for legacy systems, we need
+ * to push on with other checks of the subtable.
+ *
+ * In fact, there are environments where the *only* value the FADT
+ * revision will ever have is 2, regardless of anything else. So,
+ * for those systems to boot, we have to pretend the MADT is the
+ * latest version to allow all known subtables since we have no way
+ * to determine what revision it should be.
+ */
+ if (!IS_ENABLED(CONFIG_ARM64) && major == 2) {
+ ms = spec_info;
+ while (ms->num_types != 0)
+ ms++;
+ ms--;
+ len = ms->lengths[entry->type];
}
/* verify that the length is what we expect */
--
2.4.3
[-- Attachment #5: 0004-ACPI-for-bad_madt_entry-the-GIC-ITS-table-is-20-byte.patch --]
[-- Type: text/x-patch, Size: 1626 bytes --]
From 6d3189ccfcbac9a61e6502df70499bd2ee808509 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 13 Oct 2015 16:31:50 -0600
Subject: [PATCH 4/4] ACPI: for bad_madt_entry(), the GIC ITS table is 20 bytes
long, not 16
Correct a typo where bad_madt_entry() expected the MADT GIC ITS subtable
to be 16 bytes long, but it is actually 20 bytes. This is a cut'n'paste
error picked up from the spec and inadvertently replicated in code.
Signed-off-by: Al Stone <al.stone@linaro.org>
---
drivers/acpi/tables.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 790d4b0..1b7c13e 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -292,7 +292,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
* GICD 0xc 24 24 24
* GICv2m MSI 0xd 24 24
* GICR 0xe 16 16
- * GIC ITS 0xf 16
+ * GIC ITS 0xf 20
*
* In the table, each length entry is what should be in the length
* field of the subtable, and -- in general -- it should match the
@@ -366,7 +366,7 @@ static struct acpi_madt_subtable_lengths spec_info[] = {
.madt_version = 3,
.num_types = 16,
.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
- 16, 16, 12, 80, 24, 24, 16, 16 }
+ 16, 16, 12, 80, 24, 24, 16, 20 }
},
{ /* terminator */
.major_version = 0,
--
2.4.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-14 20:20 ` Al Stone
@ 2015-10-14 20:57 ` Rafael J. Wysocki
2015-10-14 21:27 ` Al Stone
0 siblings, 1 reply; 25+ messages in thread
From: Rafael J. Wysocki @ 2015-10-14 20:57 UTC (permalink / raw)
To: Al Stone
Cc: Pat Erley, Al Stone, Hanjun Guo, linaro-kernel, linux-ia64,
linaro-acpi, linux-pm, linux-kernel, linux-acpi, patches,
Hanjun Guo, linux-arm-kernel
On Wednesday, October 14, 2015 02:20:51 PM Al Stone wrote:
> This is a multi-part message in MIME format.
> --------------020400080004050109020606
> Content-Type: text/plain; charset=utf-8
> Content-Transfer-Encoding: 7bit
>
> On 10/12/2015 10:06 PM, Pat Erley wrote:
> > On 10/12/2015 01:52 PM, Al Stone wrote:
> >> On 10/11/2015 09:58 PM, Pat Erley wrote:
> >>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
> >>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
> >>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
> >>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
> >>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
> >>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
> >>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
> >>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
> >>>>>>>>>> branch.
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>>> [snip...]
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>> For this patch set,
> >>>>>>>>>
> >>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
> >>>>>>>>>
> >>>>>>>>> Thanks
> >>>>>>>>> Hanjun
> >>>>>>>>
> >>>>>>>> Thanks, Hanjun!
> >>>>>>>
> >>>>>>> Series applied, thanks!
> >>>>>>>
> >>>>>>> Rafael
> >>>>>>>
> >>>>>>
> >>>>>> Thanks, Rafael!
> >>>>>>
> >>>>>
> >>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
> >>>>> This change set prevents my Lenovo W510 from booting properly.
> >>>>>
> >>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
> >>>>> eventually replace the macro"
> >>>>>
> >>>>> Gets the system booting again. I'm attaching my dmesg from the failed
> >>>>> boot, who wants the acpidump?
> >>>>
> >>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
> >>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
> >>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
> >>>>
> >>>> Seems the MADT revision is not right, could you dump the ACPI MADT
> >>>> (APIC) table and send it out? I will take a look :)
> >>>>
> >>>> Thanks
> >>>> Hanjun
> >>>
> >>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
> >>
> >> Pat,
> >>
> >> Would you mind sending a copy of the FADT, also, please? The first of the
> >> ACPI messages is a check of version correspondence between the FADT and MADT,
> >> while the second message is from looking at just an MADT subtable. Thanks
> >> for sending the MADT out -- that helps me quite a lot in thinking this through.
> >>
> >> BTW, whoever is providing the BIOS (Lenovo, I assume) may want to have a look
> >> at these, also:
> >>
> >> [ 0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in
> >> FADT/Pm1aControlBlock: 16/32 (20150818/tbfadt-623)
> >> [ 0.000000] ACPI BIOS Warning (bug): Invalid length for
> >> FADT/Pm1aControlBlock: 32, using default 16 (20150818/tbfadt-704)
> >>
> >> Not inherently dangerous, but definitely sloppy and mind-numbingly easy to
> >> avoid, IIRC.
> >>
> >
> > Here ya go.
>
> Okay. There's just a lot of weird stuff out there in ACPI-land. I've
> attached four minor fixes for the special cases that have been reported
> (well, the last one is actually a fix for a typo in the spec, but just
> the same...).
>
> These should apply on top of linux-next; would you mind trying them out
> to make sure I didn't break anything else on your laptop? If they behave
> as I hope they will, I think I'll have covered all the places where the
> checking of MADT subtables needs to be be relaxed a bit. These work for
> me on arm64, but if they work for you and a couple of other testers, then
> I'll send them to Rafael properly.
Well, you might as well submit them properly right away, so I could pick
them up and put them into my linux-next branch, which then might make it
easier for some people to test them.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks
2015-10-14 20:57 ` Rafael J. Wysocki
@ 2015-10-14 21:27 ` Al Stone
0 siblings, 0 replies; 25+ messages in thread
From: Al Stone @ 2015-10-14 21:27 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Pat Erley, Al Stone, Hanjun Guo, linaro-kernel, linux-ia64,
linaro-acpi, linux-pm, linux-kernel, linux-acpi, patches,
Hanjun Guo, linux-arm-kernel
On 10/14/2015 03:25 PM, Rafael J. Wysocki wrote:
> On Wednesday, October 14, 2015 02:20:51 PM Al Stone wrote:
>> This is a multi-part message in MIME format.
>> --------------020400080004050109020606
>> Content-Type: text/plain; charset=utf-8
>> Content-Transfer-Encoding: 7bit
>>
>> On 10/12/2015 10:06 PM, Pat Erley wrote:
>>> On 10/12/2015 01:52 PM, Al Stone wrote:
>>>> On 10/11/2015 09:58 PM, Pat Erley wrote:
>>>>> On 10/11/2015 08:49 PM, Hanjun Guo wrote:
>>>>>> On 10/12/2015 11:08 AM, Pat Erley wrote:
>>>>>>> On 10/05/2015 10:12 AM, Al Stone wrote:
>>>>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote:
>>>>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote:
>>>>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote:
>>>>>>>>>>> On 2015/9/30 7:45, Al Stone wrote:
>>>>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge
>>>>>>>>>>>> branch.
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> [snip...]
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> For this patch set,
>>>>>>>>>>>
>>>>>>>>>>> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>> Hanjun
>>>>>>>>>>
>>>>>>>>>> Thanks, Hanjun!
>>>>>>>>>
>>>>>>>>> Series applied, thanks!
>>>>>>>>>
>>>>>>>>> Rafael
>>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks, Rafael!
>>>>>>>>
>>>>>>>
>>>>>>> Just decided to test out linux-next (to see the new nouveau cleanups).
>>>>>>> This change set prevents my Lenovo W510 from booting properly.
>>>>>>>
>>>>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to
>>>>>>> eventually replace the macro"
>>>>>>>
>>>>>>> Gets the system booting again. I'm attaching my dmesg from the failed
>>>>>>> boot, who wants the acpidump?
>>>>>>
>>>>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1
>>>>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry
>>>>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI
>>>>>>
>>>>>> Seems the MADT revision is not right, could you dump the ACPI MADT
>>>>>> (APIC) table and send it out? I will take a look :)
>>>>>>
>>>>>> Thanks
>>>>>> Hanjun
>>>>>
>>>>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it.
>>>>
>>>> Pat,
>>>>
>>>> Would you mind sending a copy of the FADT, also, please? The first of the
>>>> ACPI messages is a check of version correspondence between the FADT and MADT,
>>>> while the second message is from looking at just an MADT subtable. Thanks
>>>> for sending the MADT out -- that helps me quite a lot in thinking this through.
>>>>
>>>> BTW, whoever is providing the BIOS (Lenovo, I assume) may want to have a look
>>>> at these, also:
>>>>
>>>> [ 0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in
>>>> FADT/Pm1aControlBlock: 16/32 (20150818/tbfadt-623)
>>>> [ 0.000000] ACPI BIOS Warning (bug): Invalid length for
>>>> FADT/Pm1aControlBlock: 32, using default 16 (20150818/tbfadt-704)
>>>>
>>>> Not inherently dangerous, but definitely sloppy and mind-numbingly easy to
>>>> avoid, IIRC.
>>>>
>>>
>>> Here ya go.
>>
>> Okay. There's just a lot of weird stuff out there in ACPI-land. I've
>> attached four minor fixes for the special cases that have been reported
>> (well, the last one is actually a fix for a typo in the spec, but just
>> the same...).
>>
>> These should apply on top of linux-next; would you mind trying them out
>> to make sure I didn't break anything else on your laptop? If they behave
>> as I hope they will, I think I'll have covered all the places where the
>> checking of MADT subtables needs to be be relaxed a bit. These work for
>> me on arm64, but if they work for you and a couple of other testers, then
>> I'll send them to Rafael properly.
>
> Well, you might as well submit them properly right away, so I could pick
> them up and put them into my linux-next branch, which then might make it
> easier for some people to test them.
>
> Thanks,
> Rafael
>
Fair enough. I was just being overly cautious about possible further breakage.
Done. Patch series sent to the list.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2015-10-14 21:27 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-29 23:45 [PATCH v5 0/5] Provide better MADT subtable sanity checks Al Stone
2015-09-29 23:45 ` [PATCH v5 1/5] ACPI: add in a bad_madt_entry() function to eventually replace the macro Al Stone
2015-09-29 23:45 ` [PATCH v5 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY Al Stone
2015-09-29 23:45 ` [PATCH v5 3/5] ACPI / IA64: remove usage of BAD_MADT_ENTRY Al Stone
2015-09-29 23:45 ` [PATCH v5 4/5] ACPI / X86: " Al Stone
2015-09-29 23:45 ` [PATCH v5 5/5] ACPI: remove definition of BAD_MADT_ENTRY macro Al Stone
2015-09-30 9:00 ` [PATCH v5 0/5] Provide better MADT subtable sanity checks Hanjun Guo
2015-09-30 16:10 ` Al Stone
2015-10-05 13:39 ` Rafael J. Wysocki
2015-10-05 17:12 ` Al Stone
[not found] ` <561B2442.9050600@erley.org>
2015-10-12 3:49 ` [Linaro-acpi] " Hanjun Guo
2015-10-12 3:58 ` Pat Erley
2015-10-12 7:04 ` Hanjun Guo
2015-10-12 9:44 ` Sudeep Holla
2015-10-12 13:04 ` Hanjun Guo
2015-10-12 18:56 ` Rafael J. Wysocki
2015-10-12 19:07 ` Al Stone
2015-10-13 8:43 ` Sudeep Holla
2015-10-12 18:53 ` Rafael J. Wysocki
2015-10-13 1:23 ` Hanjun Guo
2015-10-12 20:52 ` Al Stone
2015-10-13 4:06 ` Pat Erley
2015-10-14 20:20 ` Al Stone
2015-10-14 20:57 ` Rafael J. Wysocki
2015-10-14 21:27 ` Al Stone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox