From patchwork Tue Aug 30 11:30:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 1112832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7UBUjlp008867 for ; Tue, 30 Aug 2011 11:30:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752139Ab1H3Lan (ORCPT ); Tue, 30 Aug 2011 07:30:43 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42008 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751044Ab1H3Lan (ORCPT ); Tue, 30 Aug 2011 07:30:43 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 32F8A89471; Tue, 30 Aug 2011 13:30:42 +0200 (CEST) From: Thomas Renninger Organization: SUSE Products GmbH To: lenb@kernel.org Subject: [PATCH] ACPICA: Fix wrongly mapped acpi table header when overriding via initrd Date: Tue, 30 Aug 2011 13:30:40 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.7-desktop; KDE/4.6.0; x86_64; ; ) Cc: eric.piel@tremplin-utc.net, jnelson-suse@jamponi.net, devel@acpica.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, mchang@suse.com References: <1314179290-31526-1-git-send-email-trenn@suse.de> <1314179290-31526-2-git-send-email-trenn@suse.de> In-Reply-To: <1314179290-31526-2-git-send-email-trenn@suse.de> MIME-Version: 1.0 Message-Id: <201108301330.40955.trenn@suse.de> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 30 Aug 2011 11:30:45 +0000 (UTC) From: Michael Chang Fix the overriding ACPI table header do not override the existing ACPI header thus the existing one is still in use. This caused a discrepency of header and body, which would introdce a serios side effect that when overriding DSDT, system might have error with "Unable to load the System Description Tables" due to DSDT table verified failed. Most field in ACPI table is static, but the length field is dyamically changed and corresponds the new assembled *.aml size. We reserve the ACPI data region using the overridden table size but attemps to map it with existing ACPI table size introduced by above discrepency. It would lead to remap fail during verifying DSDT able if length difference cross a page boundary. Signed-off-by: Michael Chang --- drivers/acpi/acpica/tbutils.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index df85afe..2e797d9 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -511,9 +511,9 @@ acpi_tb_install_table(acpi_physical_address address, ACPI_CAST_PTR(void, address))); acpi_os_unmap_memory(mapped_table, sizeof(struct acpi_table_header)); + address = tmp_addr; mapped_table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); - address = tmp_addr; } flags = ACPI_TABLE_ORIGIN_MAPPED; table_to_install = mapped_table;