From patchwork Tue Feb 9 01:32:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 61467 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1766821lbl; Mon, 8 Feb 2016 17:34:08 -0800 (PST) X-Received: by 10.60.227.74 with SMTP id ry10mr27592344oec.48.1454981638662; Mon, 08 Feb 2016 17:33:58 -0800 (PST) Return-Path: Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com. [2607:f8b0:4003:c06::22f]) by mx.google.com with ESMTPS id cl10si18737414oec.48.2016.02.08.17.33.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 17:33:58 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::22f as permitted sender) client-ip=2607:f8b0:4003:c06::22f; Authentication-Results: mx.google.com; spf=pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::22f as permitted sender) smtp.mailfrom=al.stone@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-oi0-x22f.google.com with SMTP id j125so7153977oih.1 for ; Mon, 08 Feb 2016 17:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y8dq2N7cMB7Tb9EtoN5PAp7SpuSZBY+/XYhc1+4datE=; b=b7GHNl9QZiEQXOyuISv0nTl7t2KOtJkyYc5KmFOVRVMS55P0l9TtraneO41GPSaShs j4M9qOxh3NpgPzxtKEwbGGKZSpc56hT6RWKGcv3XuKIBJXFn32ZaBqdjrGDh5gX09ZRk TVf7mq3UJTo0Ut26su2asOwbt9yG2BBUCy/Gs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y8dq2N7cMB7Tb9EtoN5PAp7SpuSZBY+/XYhc1+4datE=; b=IB1AU9/zfvHANRi/uSVXywEKm94RUDa2/0Cx7sxtMh20KK8on8Z6kPUZ8KmJ8uCSAy vw3H2pzZtKgJB5V/7JeEPW//OJcmz2pMbui/71CEEv0lBfSesxsdudO7vmnj9YEX3csR CXXnfGZgvSD16ncReNqPRz5frjKJawD9ECxB4t/zLo1aRrI3pnrizyLM461AKbUi7Q7M CH6Y34sN6uSbFrDyln0Y+uXzg+vQC7RMux5wAwoBpTMpO5EDnZ1495x7RtGHnljXH1nP ILrqZukPXWPw4cUWyMpEdO+BjJN+n2PVDTupazR2UxoIhKKU0pFANCNeEZz+IVHgPwuP LSnw== X-Gm-Message-State: AG10YOQGn4Lb+x+i7R6jk460tMv+bk1Rw6xcFp8utUlQCeO99G1uFQZgEle/X+vFQAIXaDgM5/8= X-Received: by 10.202.234.2 with SMTP id i2mr1588292oih.37.1454981638384; Mon, 08 Feb 2016 17:33:58 -0800 (PST) Return-Path: Received: from fidelio.ahs3 (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by smtp.googlemail.com with ESMTPSA id qp4sm19097135obc.9.2016.02.08.17.33.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Feb 2016 17:33:57 -0800 (PST) From: Al Stone To: fwts-devel@lists.ubuntu.com Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, Al Stone Subject: [PATCH 14/21] FADT: add compliance tests for the ACPI_ENABLE and ACPI_DISABLE fields Date: Mon, 8 Feb 2016 18:32:56 -0700 Message-Id: <1454981583-31872-15-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454981583-31872-1-git-send-email-al.stone@linaro.org> References: <1454981583-31872-1-git-send-email-al.stone@linaro.org> Do some checking of allowed values for ACPI_ENABLE and ACPI_DISABLE fields, particularly if SMI_CMD is defined. Signed-off-by: Al Stone --- src/acpi/fadt/fadt.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) -- 2.5.0 diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c index 3da297e..a2535e8 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -716,6 +716,59 @@ static void acpi_table_check_fadt_smi_cmd(fwts_framework *fw) } } +static void acpi_table_check_fadt_acpi_enable(fwts_framework *fw) +{ + if (fadt->acpi_enable == 0) + if (fadt->smi_cmd == 0) + fwts_passed(fw, "FADT SMI ACPI enable command is zero, " + "which is allowed since SMM is not " + "supported, or machine is in legacy mode."); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "SMMHasNoAcpiEnableCmd", + "FADT SMI ACPI enable command is zero, " + "but this is not allowed when SMM " + "is supported."); + else + if (fadt->smi_cmd == 0) + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "SMMNeedsAcpiEnableCmd", + "FADT SMI ACPI enable command is non-zero, " + "but SMM is not supported."); + else + fwts_passed(fw, "FADT SMI ACPI enable command is " + "non-zero, and SMM is supported."); + + return; +} + +static void acpi_table_check_fadt_acpi_disable(fwts_framework *fw) +{ + if (fadt->acpi_disable == 0) + if (fadt->smi_cmd == 0) + fwts_passed(fw, + "FADT SMI ACPI disable command is zero, " + "which is allowed since SMM is not " + "supported, or machine is in legacy mode."); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "SMMHasNoAcpiDisableCmd", + "FADT SMI ACPI disable command is zero, " + "but this is not allowed when SMM " + "is supported."); + else + if (fadt->smi_cmd == 0) + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "SMMNeedsAcpiDisableCmd", + "FADT SMI ACPI disable command is " + "non-zero, but SMM is not supported."); + else + fwts_passed(fw, "FADT SMI ACPI disable command is " + "non-zero, and SMM is supported."); + + return; +} + static void acpi_table_check_fadt_pm_tmr( fwts_framework *fw, const fwts_acpi_table_fadt *fadt, @@ -859,6 +912,8 @@ static int fadt_test1(fwts_framework *fw) if (!fwts_acpi_is_reduced_hardware(fadt)) { fwts_log_info(fw, "FADT SCI_INT is %" PRIu8, fadt->sci_int); acpi_table_check_fadt_smi_cmd(fw); + acpi_table_check_fadt_acpi_enable(fw); + acpi_table_check_fadt_acpi_disable(fw); acpi_table_check_fadt_pm_tmr(fw, fadt, &passed); acpi_table_check_fadt_gpe(fw, fadt, &passed); acpi_table_check_fadt_pm_addr(fw, fadt, &passed);