WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86: Fix FADT parsing for PM event blocks

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Fix FADT parsing for PM event blocks.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 May 2008 05:20:10 -0700
Delivery-date: Thu, 01 May 2008 08:30:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1209644192 -3600
# Node ID 806e7fa302640eed99f439087519c3645eb56b78
# Parent  9fd00ff95068a613dac994a6a3d7025d7dd465d9
x86: Fix FADT parsing for PM event blocks.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/acpi/boot.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff -r 9fd00ff95068 -r 806e7fa30264 xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c  Thu May 01 11:34:56 2008 +0100
+++ b/xen/arch/x86/acpi/boot.c  Thu May 01 13:16:32 2008 +0100
@@ -465,15 +465,18 @@ static void __init
 static void __init
 acpi_fadt_parse_reg(struct acpi_table_fadt *fadt)
 {
-       memcpy(&acpi_gbl_FADT, fadt, sizeof(acpi_gbl_FADT));
-
-       memcpy(&acpi_gbl_xpm1a_enable, &(fadt->xpm1a_event_block),
-               sizeof(acpi_gbl_xpm1a_enable));
-       memcpy(&acpi_gbl_xpm1b_enable, &(fadt->xpm1b_event_block),
-               sizeof(acpi_gbl_xpm1b_enable));
-
-       acpi_gbl_xpm1a_enable.address += 2;
-       acpi_gbl_xpm1b_enable.address += 2;
+       unsigned int len = min(fadt->header.length, sizeof(*fadt));
+
+       memcpy(&acpi_gbl_FADT, fadt, len);
+
+       if (len > offsetof(struct acpi_table_fadt, xpm1b_event_block)) {
+               memcpy(&acpi_gbl_xpm1a_enable, &fadt->xpm1a_event_block,
+                      sizeof(acpi_gbl_xpm1a_enable));
+               memcpy(&acpi_gbl_xpm1b_enable, &fadt->xpm1b_event_block,
+                      sizeof(acpi_gbl_xpm1b_enable));
+               acpi_gbl_xpm1a_enable.address += 2;
+               acpi_gbl_xpm1b_enable.address += 2;
+       }
 }
 
 static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
@@ -523,11 +526,11 @@ static int __init acpi_parse_fadt(unsign
        acpi_enable_value  = fadt->acpi_enable;
        acpi_disable_value = fadt->acpi_disable;
 
+       acpi_fadt_parse_reg(fadt);
+
 #ifdef CONFIG_ACPI_SLEEP
        acpi_fadt_parse_sleep_info(fadt);
 #endif
-
-       acpi_fadt_parse_reg(fadt);
 
        return 0;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Fix FADT parsing for PM event blocks., Xen patchbot-unstable <=