public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: lenb@kernel.org
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
Subject: [PATCH] ACPICA: Fix wrongly mapped acpi table header when overriding via initrd
Date: Tue, 30 Aug 2011 13:30:40 +0200	[thread overview]
Message-ID: <201108301330.40955.trenn@suse.de> (raw)
In-Reply-To: <1314179290-31526-2-git-send-email-trenn@suse.de>

From: Michael Chang <mchang@suse.com>

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 <mchang@suse.com>
---
 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;
-- 
1.7.3.4


  parent reply	other threads:[~2011-08-30 11:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24  9:48 [PATCH 0/2] Implement overriding of arbitrary ACPI tables via initrd Thomas Renninger
2011-08-24  9:48 ` [PATCH 1/2] ACPICA: Introduce acpi_os_phys_table_override function Thomas Renninger
2011-08-29  8:24   ` Joey Lee
2011-08-30 11:30   ` Thomas Renninger [this message]
2011-08-31  2:43   ` [Devel] " Lin Ming
2011-08-31  9:28     ` Thomas Renninger
2011-08-24  9:48 ` [PATCH 2/2] ACPI: Implement overriding of arbitrary ACPI tables via initrd Thomas Renninger
2011-08-29  8:31   ` Joey Lee
2011-08-29  8:39     ` Joey Lee
2011-08-30  7:32       ` Joey Lee
2011-08-30 11:41 ` [PATCH 0/2] " Thomas Renninger
2011-08-30 14:55   ` Moore, Robert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201108301330.40955.trenn@suse.de \
    --to=trenn@suse.de \
    --cc=devel@acpica.org \
    --cc=eric.piel@tremplin-utc.net \
    --cc=hpa@zytor.com \
    --cc=jnelson-suse@jamponi.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchang@suse.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox