ACPI 5.0: Implement hardware-reduced option
authorBob Moore <robert.moore@intel.com>
Fri, 22 Feb 2013 10:46:32 +0000 (11:46 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Feb 2013 10:46:32 +0000 (11:46 +0100)
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@intel.com>
Also adjust acpi_fadt_parse_sleep_info().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/acpi/boot.c
xen/drivers/acpi/tables/tbfadt.c
xen/include/acpi/acglobal.h

index 24bc2ad13b31bbc160c311c9044f702da66ca679..b2dc35eadeeb236cd104c3e066102b51f201738f 100644 (file)
@@ -328,6 +328,9 @@ acpi_fadt_parse_sleep_info(struct acpi_table_fadt *fadt)
        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_table_fadt *fadt)
                       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));
index e3644f4927dd574c5a92f3bd610dcc5c2d570872..2ab4588f0bb48123414955a5671ca8345b931118 100644 (file)
@@ -197,8 +197,13 @@ void __init acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
        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(struct acpi_table_header *table, u32 lengt
        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(void)
        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++) {
index 87dcfcc99d012a770d92fecae53b07ec154aadb1..c2a96097b982bae3f912f294e29e7f05edc4a0de 100644 (file)
@@ -78,6 +78,13 @@ ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
 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