ACK: [PATCH 20/21] FADT: add in SLEEP_CONTROL_REG and SLEEP_STATUS_REG compliance tests
Colin Ian King
colin.king at canonical.com
Tue Feb 9 12:32:53 UTC 2016
On 09/02/16 01:33, Al Stone wrote:
> When in reduced hardware mode, these fields may or may not be used. If
> they are, there are rules to check to make the values are reasonable.
> It is also possible that these fields are simple null and not used at all.
>
> Signed-off-by: Al Stone <al.stone at linaro.org>
> ---
> src/acpi/fadt/fadt.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 63 insertions(+)
>
> diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
> index a2ed70c..05205cb 100644
> --- a/src/acpi/fadt/fadt.c
> +++ b/src/acpi/fadt/fadt.c
> @@ -1452,6 +1452,66 @@ static void acpi_table_check_fadt_p_lvl3_lat(fwts_framework *fw, uint64_t pblk)
> return;
> }
>
> +static void acpi_table_check_fadt_sleep_control_reg(fwts_framework *fw)
> +{
> + if (fwts_acpi_is_reduced_hardware(fadt)) {
> + if (fadt->sleep_control_reg.address == 0)
> + fwts_passed(fw, "FADT SLEEP_CONTROL_REG not in use.");
> + else {
> + if (fadt->sleep_control_reg.register_bit_width == 8 &&
> + fadt->sleep_control_reg.register_bit_offset == 0)
> + fwts_passed(fw, "FADT SLEEP_CONTROL_REG is "
> + "in use and well-defined.");
> + else
> + fwts_failed(fw, LOG_LEVEL_MEDIUM,
> + "SleepControlRegHasBadGAS",
> + "FADT SLEEP_CONTROL_REG is "
> + "in use but register width or "
> + "offset is incorrect.");
> + }
> + } else {
> + if (fadt->sleep_control_reg.address == 0)
> + fwts_passed(fw, "FADT SLEEP_CONTROL_REG is null and "
> + "not available when not in reduced "
> + "hardware mode.");
> + else
> + fwts_failed(fw, LOG_LEVEL_MEDIUM,
> + "SleepControlRegNotAllowed",
> + "FADT SLEEP_CONTROL_REG is defined but "
> + "will be ignored reduced hardware mode.");
> + }
> +}
> +
> +static void acpi_table_check_fadt_sleep_status_reg(fwts_framework *fw)
> +{
> + if (fwts_acpi_is_reduced_hardware(fadt)) {
> + if (fadt->sleep_status_reg.address == 0)
> + fwts_passed(fw, "FADT SLEEP_STATUS_REG not in use.");
> + else {
> + if (fadt->sleep_status_reg.register_bit_width == 8 &&
> + fadt->sleep_status_reg.register_bit_offset == 0)
> + fwts_passed(fw, "FADT SLEEP_STATUS_REG is "
> + "in use and well-defined.");
> + else
> + fwts_failed(fw, LOG_LEVEL_MEDIUM,
> + "SleepStatusRegHasBadGAS",
> + "FADT SLEEP_STATUS_REG is "
> + "in use but register width or "
> + "offset is incorrect.");
> + }
> + } else {
> + if (fadt->sleep_status_reg.address == 0)
> + fwts_passed(fw, "FADT SLEEP_STATUS_REG is null and "
> + "not available when not in reduced "
> + "hardware mode.");
> + else
> + fwts_failed(fw, LOG_LEVEL_MEDIUM,
> + "SleepStatusRegNotAllowed",
> + "FADT SLEEP_STATUS_REG is defined but "
> + "will be ignored reduced hardware mode.");
> + }
> +}
> +
> static int fadt_test1(fwts_framework *fw)
> {
> bool passed = true;
> @@ -1518,6 +1578,9 @@ static int fadt_test1(fwts_framework *fw)
> fwts_log_info(fw, "FADT CENTURY is %" PRIu8, fadt->century);
> }
>
> + acpi_table_check_fadt_sleep_control_reg(fw);
> + acpi_table_check_fadt_sleep_status_reg(fw);
> +
> /*
> * Cannot really test the Hypervisor Vendor Identity since
> * the value is provided by the hypervisor to the OS (as a
>
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the fwts-devel
mailing list