From: "Jan Beulich" Subject: [PATCH 2/6] ACPI 5.0: Implement hardware-reduced option Date: Thu, 21 Feb 2013 12:59:17 +0000 Message-ID: <5126283502000078000BFE83@nat28.tlf.novell.com> References: <512625DA02000078000BFE5D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part30004A35.0__=" Return-path: In-Reply-To: <512625DA02000078000BFE5D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part30004A35.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 Also adjust acpi_fadt_parse_sleep_info(). Signed-off-by: Jan Beulich --- 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 =3D NULL; uint64_t facs_pa; =20 + 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 =3D (uint64_t)fadt->facs; } + if (!facs_pa) + goto bad; =20 facs =3D (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; =20 +/* + * 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);= =20 - 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); + } } =20 /*************************************************************************= ****** @@ -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))); =20 + /* Take a copy of the Hardware Reduced flag */ + + acpi_gbl_reduced_hardware =3D FALSE; + if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) { + acpi_gbl_reduced_hardware =3D 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; =20 + /* 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) */ =20 for (i =3D 0; i < ACPI_FADT_INFO_ENTRIES; i++) { --=__Part30004A35.0__= Content-Type: text/plain; name="ACPI-v5-reduced-HW.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ACPI-v5-reduced-HW.patch" ACPI 5.0: Implement hardware-reduced option=0A=0AIf HW-reduced flag is set = in the FADT, do not attempt to access=0Aor initialize any ACPI hardware, = including SCI and global lock.=0ANo FACS will be present.=0A=0ASigned-off-b= y: Bob Moore =0A=0AAlso adjust acpi_fadt_parse_slee= p_info().=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/arch/x86/acpi/boot.c=0A+++ b/xen/arch/x86/acpi/boot.c=0A@@ -328,6 = +328,9 @@ acpi_fadt_parse_sleep_info(struct acpi_t=0A struct acpi_table_f= acs *facs =3D NULL;=0A uint64_t facs_pa;=0A =0A+ if (fadt->flags & = ACPI_FADT_HW_REDUCED)=0A+ goto bad;=0A+=0A acpi_fadt_c= opy_address(pm1a_cnt, pm1a_control, pm1_control);=0A acpi_fadt_copy_addr= ess(pm1b_cnt, pm1b_control, pm1_control);=0A acpi_fadt_copy_address(pm1a= _evt, pm1a_event, pm1_event);=0A@@ -351,6 +354,8 @@ acpi_fadt_parse_sleep_i= nfo(struct acpi_t=0A fadt->facs, facs_pa);=0A = facs_pa =3D (uint64_t)fadt->facs;=0A }=0A+ if (!facs_pa)=0A+ = goto bad;=0A =0A facs =3D (struct acpi_table_facs *)=0A = __acpi_map_table(facs_pa, sizeof(struct acpi_table_facs));=0A--- a/xen/incl= ude/acpi/acglobal.h=0A+++ b/xen/include/acpi/acglobal.h=0A@@ -78,6 +78,13 = @@ ACPI_EXTERN struct acpi_table_fadt acpi_=0A ACPI_EXTERN struct = acpi_generic_address acpi_gbl_xpm1a_enable;=0A ACPI_EXTERN struct = acpi_generic_address acpi_gbl_xpm1b_enable;=0A =0A+/*=0A+ * ACPI 5.0 = introduces the concept of a "reduced hardware platform", meaning=0A+ * = that the ACPI hardware is no longer required. A flag in the FADT = indicates=0A+ * a reduced HW machine, and that flag is duplicated here for = convenience.=0A+ */=0A+ACPI_EXTERN u8 acpi_gbl_reduced_hardware;=0A+=0A = /**************************************************************************= ***=0A *=0A * Miscellaneous globals=0A--- a/xen/drivers/acpi/tables/tbfad= t.c=0A+++ b/xen/drivers/acpi/tables/tbfadt.c=0A@@ -197,8 +197,13 @@ void = __init acpi_tb_parse_fadt(acpi_nati=0A acpi_tb_install_table((acpi_physica= l_address) acpi_gbl_FADT.Xdsdt,=0A flags, = ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);=0A =0A- acpi_tb_install_table((acpi= _physical_address) acpi_gbl_FADT.Xfacs,=0A- = flags, ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);=0A+ /* If Hardware = Reduced flag is set, there is no FACS */=0A+=0A+ if (!acpi_gbl_reduc= ed_hardware) {=0A+ acpi_tb_install_table((acpi_physical_addres= s) acpi_gbl_FADT.=0A+ Xfacs, flags, = ACPI_SIG_FACS,=0A+ ACPI_TABLE_INDEX_FACS= );=0A+ }=0A }=0A =0A /****************************************************= ***************************=0A@@ -242,6 +247,13 @@ void __init acpi_tb_crea= te_local_fadt(st=0A ACPI_MEMCPY(&acpi_gbl_FADT, table,=0A = ACPI_MIN(length, sizeof(struct acpi_table_fadt)));=0A =0A+ /* Take a = copy of the Hardware Reduced flag */=0A+=0A+ acpi_gbl_reduced_hardware = =3D FALSE;=0A+ if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) {=0A+ = acpi_gbl_reduced_hardware =3D TRUE;=0A+ }=0A+=0A /*=0A * 1) = Convert the local copy of the FADT to the common internal format=0A * = 2) Validate some of the important values within the FADT=0A@@ -401,6 = +413,12 @@ static void __init acpi_tb_validate_fadt=0A u8 length;=0A = acpi_native_uint i;=0A =0A+ /* If Hardware Reduced flag is set, we are = all done */=0A+=0A+ if (acpi_gbl_reduced_hardware) {=0A+ = return;=0A+ }=0A+=0A /* Examine all of the 64-bit extended = address fields (X fields) */=0A =0A for (i =3D 0; i < ACPI_FADT_INFO_EN= TRIES; i++) {=0A --=__Part30004A35.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part30004A35.0__=--