From patchwork Fri Feb 19 23:39:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 62430 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp78653lbl; Fri, 19 Feb 2016 15:41:04 -0800 (PST) X-Received: by 10.202.201.216 with SMTP id z207mr13658400oif.98.1455925263959; Fri, 19 Feb 2016 15:41:03 -0800 (PST) Return-Path: Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com. [2607:f8b0:4003:c06::232]) by mx.google.com with ESMTPS id j138si18899731oih.51.2016.02.19.15.41.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 15:41:03 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::232 as permitted sender) client-ip=2607:f8b0:4003:c06::232; Authentication-Results: mx.google.com; spf=pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::232 as permitted sender) smtp.mailfrom=al.stone@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-oi0-x232.google.com with SMTP id w5so22758559oie.3 for ; Fri, 19 Feb 2016 15:41:03 -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=vbZRcoo/GKWOaGmhC4XwgrBrJytW9n21RDIT60nfIFM=; b=A9SRKMQ1JA8DKQIk88h/ejPfV6Ig5V2vsMqrsQL0bsqeUih/JEJ2PupJNOjyWwDGoY PN/OFGpvOnTGjBl6zt6WGZ/MCmQdJtE4iJH9axerVMZCGNUfixn989uflDezd/dTgmz7 XlaVXdhYcSFDwLuxRLC1NqlDtzhEu0WOnCIeg= 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=vbZRcoo/GKWOaGmhC4XwgrBrJytW9n21RDIT60nfIFM=; b=moPomIzcuct7m8I0LQjxS9cB8BylaY0INrxk+YF6TchlQI/2vqysJGJ0p7zMQxMq6G 68m9gFUI9TRd4pV+cW+SO4Dj4YDbr+QQCPozrRgDlCllym8udVAl3mGLbCe1mw+9diHb h9kAbon3cFBcdXzmMfXDXJ2UwAf1Ekf4Zi5UIReNBA/wkBbLKk3TM1jV1w12yckRUi8n RL1UAxP+ZhMxSWp31Y4uu0FRPyKSL5sdVG0To7b6/bVMYocXhhM9ELWbHjT/inxn1OfU KW+f/RREaMhKN9UKBKCxbleoJch+MFw8/uXLuN/tBeE/Q46AE6plIzyTpNCObym0vjmw a1Wg== X-Gm-Message-State: AG10YOQ0qQa4pLanmLrvRlUJ5ms7UDiMEZv8F4qI69qsY/rHdDn/70z+BPg8gQk/ShipJ7BRFaY= X-Received: by 10.202.240.68 with SMTP id o65mr13129376oih.70.1455925263635; Fri, 19 Feb 2016 15:41:03 -0800 (PST) Return-Path: Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by smtp.googlemail.com with ESMTPSA id kg7sm8655217obb.27.2016.02.19.15.41.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Feb 2016 15:41:01 -0800 (PST) From: Al Stone To: fwts-devel@lists.ubuntu.com Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, Al Stone Subject: [PATCH v2 14/23] FADT: add compliance tests for the ACPI_ENABLE and ACPI_DISABLE fields Date: Fri, 19 Feb 2016 16:39:50 -0700 Message-Id: <1455925199-8587-15-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455925199-8587-1-git-send-email-al.stone@linaro.org> References: <1455925199-8587-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 Acked-by: Colin Ian King Acked-by: Alex Hung --- 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 32b3b77..2c56eba 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -740,6 +740,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, @@ -883,6 +936,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);