From patchwork Fri Feb 19 23:39:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 62428 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp78624lbl; Fri, 19 Feb 2016 15:40:57 -0800 (PST) X-Received: by 10.60.140.129 with SMTP id rg1mr13935144oeb.25.1455925257799; Fri, 19 Feb 2016 15:40:57 -0800 (PST) Return-Path: Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com. [2607:f8b0:4003:c01::236]) by mx.google.com with ESMTPS id q6si18932933oia.98.2016.02.19.15.40.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 15:40:57 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c01::236 as permitted sender) client-ip=2607:f8b0:4003:c01::236; Authentication-Results: mx.google.com; spf=pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c01::236 as permitted sender) smtp.mailfrom=al.stone@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-ob0-x236.google.com with SMTP id jq7so122506370obb.0 for ; Fri, 19 Feb 2016 15:40:57 -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=UsJ7ax6lfGK5RRzKExmgNJ4l3j7yQ5Jqz1yxQiWblBQ=; b=OY6qm7JCavbnCWbsNW/b0E1Wr+QWyR8lUSJx01DDpqisn+FmLh2sUtGbEDVQJKMV1G kNqr4caPIfWCgirsa6FzcJDoTNybn2VElO4UaJAq+h3ExsERyoVIdztMlQ0Ehn0thhT7 xODftfYuZiJOS10yN493ikjDtES3PY1BGh4T4= 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=UsJ7ax6lfGK5RRzKExmgNJ4l3j7yQ5Jqz1yxQiWblBQ=; b=NhfobFGtYhiuN8F5LIDQwaYxoms2DKHPUVCrGNveWtjvFhyfZxpvJAwgvTJZ2g3HKs HCMGY8qmwsb0jFj8c6iL0DTI80bLfBVJW0hvnGSuEofRpfj6J2GwzXBMQuDNxE20gBf1 zIoJYoN3+3FtWTYF/+kPAQMHajMIKuTL85c81tCTpLscpFB4Dc2k5Z4jdDMYBVOoZ5ey JXK997dwucgnniU5C6AkXuf8gGRB3YDmhwugBwy2SO2NSTmFfZuNy5yIA/6n1ZcqlkkU 0aCaf2Tkbf2SclIdZ5n/NkyPmDk4K++4GWwYHhcgKjllMdtQZrRUYeTNXvoOLtAkN+QT 9NVQ== X-Gm-Message-State: AG10YOT4iq45IDz1I1g0Dd2ZqF+oHHo9eaiG1SZiVxUvcoLPTkzbHeBUICdD39sA6EFTV8ftb2Y= X-Received: by 10.60.246.161 with SMTP id xx1mr13647480oec.70.1455925257480; Fri, 19 Feb 2016 15:40:57 -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.40.55 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Feb 2016 15:40:56 -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 12/23] FADT: restructure test sequence around reduced hardware mode Date: Fri, 19 Feb 2016 16:39:48 -0700 Message-Id: <1455925199-8587-13-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> Since a prior patch added a test of of the reduced hardware fields, we can now resequence the tests so that we only test the fields we must. If we are not in reduced hardware mode, we test everything. If we are, we ignore tests for many fields. They are simply irrelevant, and if the fields are non-zero, that would have been caught in the prior patch. There are also several fields that really cannot be reliably tested; we cannot gather enough info to know whether they are correct or not, or the field is allowed to be any value that it can hold. Simply log the value for these fields, but only when in the proper mode. Signed-off-by: Al Stone Acked-by: Colin Ian King Acked-by: Alex Hung --- src/acpi/fadt/fadt.c | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) -- 2.5.0 diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c index 5b126fb..ad3531c 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -872,10 +872,34 @@ static int fadt_test1(fwts_framework *fw) acpi_table_check_fadt_reserved(fw); acpi_table_check_fadt_pm_profile(fw); acpi_table_check_fadt_reduced_hardware(fw); - acpi_table_check_fadt_smi(fw, fadt, &passed); - 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); + + /* + * If a field can be tested, we call a function to do so. If + * any value is reasonable and allowable, we simply log the value. + * For example, the SCI_INT is one byte and can be from 0..255, and + * there is no other info (as far as this author knows) that can be + * used to verify that the value is correct. + */ + if (!fwts_acpi_is_reduced_hardware(fadt)) { + fwts_log_info(fw, "FADT SCI_INT is %" PRIu8, fadt->sci_int); + acpi_table_check_fadt_smi(fw, fadt, &passed); + 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); + fwts_log_info(fw, "FADT GPE1_BASE is %" PRIu8, fadt->gpe1_base); + + fwts_log_info(fw, "FADT FLUSH_SIZE is %" PRIu16, + fadt->flush_size); + fwts_log_info(fw, "FADT FLUSH_STRIDE is %" PRIu16, + fadt->flush_stride); + fwts_log_info(fw, "FADT DUTY_OFFSET is %" PRIu8, + fadt->duty_offset); + fwts_log_info(fw, "FADT DUTY_WIDTH is %" PRIu8, + fadt->duty_width); + fwts_log_info(fw, "FADT DAY_ALRM is %" PRIu8, fadt->day_alrm); + fwts_log_info(fw, "FADT MON_ALRM is %" PRIu8, fadt->mon_alrm); + fwts_log_info(fw, "FADT CENTURY is %" PRIu8, fadt->century); + } /* * Bug LP: #833644 @@ -902,6 +926,14 @@ static int fadt_test1(fwts_framework *fw) } */ + /* + * Cannot really test the Hypervisor Vendor Identity since + * the value is provided by the hypervisor to the OS (as a + * sign that the ACPI tables have been fabricated), if it + * being used at all. Or, it's set to zero. + */ + fwts_log_info(fw, "FADT Hypervisor Vendor Identity is %" PRIu64, + fadt->hypervisor_id); if (passed) fwts_passed(fw, "No issues found in FADT table.");