lkml.org 
[lkml]   [2009]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 6/8] SFI: add ACPI extensions
On Tue, 23 Jun 2009, Andi Kleen wrote:
> Len Brown <lenb@kernel.org> writes:

> > diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
> > @@ -277,6 +277,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)

> > + if (acpi_disabled)
> > + return 1;

> This seems like a weird place to hook this in. Shouldn't that be somewhere else, more
> high level?

acpi_table_parse() is actually a high-level API available to drivers.

Today, drivers tend to test acpi_disabled on their own,
which may be too high level...

The catalyst for this change, IIR, was the PCI code calling
and not checking the return value:

--- a/arch/x86/pci/mmconfig-shared.c
...
@@ -606,7 +607,8 @@ static void __init __pci_mmcfg_init(int early)
...
- acpi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg);
+ if (acpi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg))
+ sfi_acpi_table_parse(ACPI_SIG_MCFG, NULL, NULL, 0, pci_parse_mcfg);
...


> > + num_entries = (xsdt->header.length - sizeof(struct acpi_table_header) /
> > + sizeof(u64));
> > +
> > + pr_debug(PREFIX "XSDT has %d entries\n", num_entries);
> > +
> > + for (i = 0; i < num_entries; i++)
> > + sfi_tb_install_table(xsdt->table_offset_entry[i], SFI_ACPI_TABLE);
>
> Shouldn't this have some more sanity checking, e.g. for overflows?

good observation. Although we did already check the signature and
checksum, I don't see that we yet have a sanity check either here
or in sfi_tb_install_table() itself.

thanks,
-Len



\
 
 \ /
  Last update: 2009-06-23 18:55    [W:0.050 / U:2.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site