[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/6] ACPI 5.0: Implement hardware-reduced option


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxx>
  • From: "Jan Beulich" <JBeulich@xxxxxxxx>
  • Date: Thu, 21 Feb 2013 12:59:17 +0000
  • Delivery-date: Thu, 21 Feb 2013 12:58:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

If HW-reduced flag is set in the FADT, do not attempt to access
or initialize any ACPI hardware, including SCI and global lock.
No FACS will be present.

Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx>

Also adjust acpi_fadt_parse_sleep_info().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -328,6 +328,9 @@ acpi_fadt_parse_sleep_info(struct acpi_t
        struct acpi_table_facs *facs = NULL;
        uint64_t facs_pa;
 
+       if (fadt->flags & ACPI_FADT_HW_REDUCED)
+               goto bad;
+
        acpi_fadt_copy_address(pm1a_cnt, pm1a_control, pm1_control);
        acpi_fadt_copy_address(pm1b_cnt, pm1b_control, pm1_control);
        acpi_fadt_copy_address(pm1a_evt, pm1a_event, pm1_event);
@@ -351,6 +354,8 @@ acpi_fadt_parse_sleep_info(struct acpi_t
                       fadt->facs, facs_pa);
                facs_pa = (uint64_t)fadt->facs;
        }
+       if (!facs_pa)
+               goto bad;
 
        facs = (struct acpi_table_facs *)
                __acpi_map_table(facs_pa, sizeof(struct acpi_table_facs));
--- a/xen/include/acpi/acglobal.h
+++ b/xen/include/acpi/acglobal.h
@@ -78,6 +78,13 @@ ACPI_EXTERN struct acpi_table_fadt acpi_
 ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
 ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
 
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+ACPI_EXTERN u8 acpi_gbl_reduced_hardware;
+
 /*****************************************************************************
  *
  * Miscellaneous globals
--- a/xen/drivers/acpi/tables/tbfadt.c
+++ b/xen/drivers/acpi/tables/tbfadt.c
@@ -197,8 +197,13 @@ void __init acpi_tb_parse_fadt(acpi_nati
        acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
                              flags, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
 
-       acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
-                             flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
+       /* If Hardware Reduced flag is set, there is no FACS */
+
+       if (!acpi_gbl_reduced_hardware) {
+               acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.
+                                     Xfacs, flags, ACPI_SIG_FACS,
+                                     ACPI_TABLE_INDEX_FACS);
+       }
 }
 
 
/*******************************************************************************
@@ -242,6 +247,13 @@ void __init acpi_tb_create_local_fadt(st
        ACPI_MEMCPY(&acpi_gbl_FADT, table,
                    ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
 
+       /* Take a copy of the Hardware Reduced flag */
+
+       acpi_gbl_reduced_hardware = FALSE;
+       if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) {
+               acpi_gbl_reduced_hardware = TRUE;
+       }
+
        /*
         * 1) Convert the local copy of the FADT to the common internal format
         * 2) Validate some of the important values within the FADT
@@ -401,6 +413,12 @@ static void __init acpi_tb_validate_fadt
        u8 length;
        acpi_native_uint i;
 
+       /* If Hardware Reduced flag is set, we are all done */
+
+       if (acpi_gbl_reduced_hardware) {
+               return;
+       }
+
        /* Examine all of the 64-bit extended address fields (X fields) */
 
        for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {



Attachment: ACPI-v5-reduced-HW.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.