47d68c7f68
It is reported that Linux x86 kernel cannot map large tables. The following
large SSDT table on such platform fails to pass checksum verification and
cannot be installed:
ACPI: SSDT 0x00000000B9638018 07A0C4 (v02 INTEL S2600CP 00004000 INTL 20100331)
It sounds strange that in the 64-bit virtual memory address space, we
cannot map a single ACPI table to do checksum verification. The root cause
is:
1. ACPICA doesn't split IO memory mapping and table mapping;
2. Linux x86 OSL implements acpi_os_map_memory() using a size limited fix-map
mechanism during early boot stage, which is more suitable for only IO
mappings.
ACPICA originally only mapped table header for signature validation, and
this header mapping is required by OSL override mechanism. There was no
checksum verification because we could not map the whole table using this
OSL. While the following ACPICA commit enforces checksum verification by
mapping the whole table during Linux boot stage and it finally triggers
this issue on some platforms:
Commit: 86dfc6f339
Subject: ACPICA: Tables: Fix table checksums verification before installation.
Before doing further cleanups for the OSL table mapping and override
implementation, this patch introduces an option for such OSPMs to
temporarily discard the checksum verification feature. It then can be
re-enabled easily when the ACPICA and the underlying OSL is ready.
This patch also deletes a comment around the limitation of mappings because
it is not correct. The limitation is not how many times we can map in the
early stage, but the OSL mapping facility may not be suitable for mapping
the ACPI tables and thus may complain us the size limitation.
The acpi_tb_verify_table() is renamed to acpi_tb_verify_temp_table() due to the
work around added, it now only applies to the table descriptor that hasn't
been installed and cannot be used in other cases. Lv Zheng.
Tested-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
169 lines
5.3 KiB
C
169 lines
5.3 KiB
C
/******************************************************************************
|
|
*
|
|
* Name: actables.h - ACPI table management
|
|
*
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
* Copyright (C) 2000 - 2014, Intel Corp.
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions, and the following disclaimer,
|
|
* without modification.
|
|
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
|
* substantially similar to the "NO WARRANTY" disclaimer below
|
|
* ("Disclaimer") and any redistribution must be conditioned upon
|
|
* including a substantially similar Disclaimer requirement for further
|
|
* binary redistribution.
|
|
* 3. Neither the names of the above-listed copyright holders nor the names
|
|
* of any contributors may be used to endorse or promote products derived
|
|
* from this software without specific prior written permission.
|
|
*
|
|
* Alternatively, this software may be distributed under the terms of the
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
* Software Foundation.
|
|
*
|
|
* NO WARRANTY
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
* POSSIBILITY OF SUCH DAMAGES.
|
|
*/
|
|
|
|
#ifndef __ACTABLES_H__
|
|
#define __ACTABLES_H__
|
|
|
|
acpi_status acpi_allocate_root_table(u32 initial_table_count);
|
|
|
|
/*
|
|
* tbxfroot - Root pointer utilities
|
|
*/
|
|
acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
|
|
|
|
u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length);
|
|
|
|
/*
|
|
* tbdata - table data structure management
|
|
*/
|
|
acpi_status acpi_tb_get_next_root_index(u32 *table_index);
|
|
|
|
void
|
|
acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc,
|
|
acpi_physical_address address,
|
|
u8 flags, struct acpi_table_header *table);
|
|
|
|
acpi_status
|
|
acpi_tb_acquire_temp_table(struct acpi_table_desc *table_desc,
|
|
acpi_physical_address address, u8 flags);
|
|
|
|
void acpi_tb_release_temp_table(struct acpi_table_desc *table_desc);
|
|
|
|
acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc);
|
|
|
|
acpi_status
|
|
acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature);
|
|
|
|
u8 acpi_tb_is_table_loaded(u32 table_index);
|
|
|
|
void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded);
|
|
|
|
/*
|
|
* tbfadt - FADT parse/convert/validate
|
|
*/
|
|
void acpi_tb_parse_fadt(u32 table_index);
|
|
|
|
void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
|
|
|
|
/*
|
|
* tbfind - find ACPI table
|
|
*/
|
|
acpi_status
|
|
acpi_tb_find_table(char *signature,
|
|
char *oem_id, char *oem_table_id, u32 *table_index);
|
|
|
|
/*
|
|
* tbinstal - Table removal and deletion
|
|
*/
|
|
acpi_status acpi_tb_resize_root_table_list(void);
|
|
|
|
acpi_status acpi_tb_validate_table(struct acpi_table_desc *table_desc);
|
|
|
|
void acpi_tb_invalidate_table(struct acpi_table_desc *table_desc);
|
|
|
|
void acpi_tb_override_table(struct acpi_table_desc *old_table_desc);
|
|
|
|
acpi_status
|
|
acpi_tb_acquire_table(struct acpi_table_desc *table_desc,
|
|
struct acpi_table_header **table_ptr,
|
|
u32 *table_length, u8 *table_flags);
|
|
|
|
void
|
|
acpi_tb_release_table(struct acpi_table_header *table,
|
|
u32 table_length, u8 table_flags);
|
|
|
|
acpi_status
|
|
acpi_tb_install_standard_table(acpi_physical_address address,
|
|
u8 flags,
|
|
u8 reload, u8 override, u32 *table_index);
|
|
|
|
acpi_status
|
|
acpi_tb_store_table(acpi_physical_address address,
|
|
struct acpi_table_header *table,
|
|
u32 length, u8 flags, u32 *table_index);
|
|
|
|
void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc);
|
|
|
|
void acpi_tb_terminate(void);
|
|
|
|
acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index);
|
|
|
|
acpi_status acpi_tb_allocate_owner_id(u32 table_index);
|
|
|
|
acpi_status acpi_tb_release_owner_id(u32 table_index);
|
|
|
|
acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id);
|
|
|
|
/*
|
|
* tbutils - table manager utilities
|
|
*/
|
|
acpi_status acpi_tb_initialize_facs(void);
|
|
|
|
u8 acpi_tb_tables_loaded(void);
|
|
|
|
void
|
|
acpi_tb_print_table_header(acpi_physical_address address,
|
|
struct acpi_table_header *header);
|
|
|
|
u8 acpi_tb_checksum(u8 *buffer, u32 length);
|
|
|
|
acpi_status
|
|
acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
|
|
|
|
void acpi_tb_check_dsdt_header(void);
|
|
|
|
struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index);
|
|
|
|
void
|
|
acpi_tb_install_table_with_override(u32 table_index,
|
|
struct acpi_table_desc *new_table_desc,
|
|
u8 override);
|
|
|
|
acpi_status
|
|
acpi_tb_install_fixed_table(acpi_physical_address address,
|
|
char *signature, u32 table_index);
|
|
|
|
acpi_status acpi_tb_parse_root_table(acpi_physical_address rsdp_address);
|
|
|
|
#endif /* __ACTABLES_H__ */
|