From patchwork Tue Feb 9 01:32:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 61465 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1766773lbl; Mon, 8 Feb 2016 17:34:01 -0800 (PST) X-Received: by 10.60.46.102 with SMTP id u6mr29111924oem.78.1454981632566; Mon, 08 Feb 2016 17:33:52 -0800 (PST) Return-Path: Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com. [2607:f8b0:4003:c01::22d]) by mx.google.com with ESMTPS id wl7si7416563oeb.26.2016.02.08.17.33.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 17:33:52 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c01::22d as permitted sender) client-ip=2607:f8b0:4003:c01::22d; Authentication-Results: mx.google.com; spf=pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c01::22d as permitted sender) smtp.mailfrom=al.stone@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-ob0-x22d.google.com with SMTP id wb13so175739983obb.1 for ; Mon, 08 Feb 2016 17:33:52 -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=0zlKw1kEZj46Mlwm0z+IIP5eiMfjvSrRln4gYc3Wv2I=; b=X2mE6XfggezqbVhHBMCBtGRel5hg6QyKpQinqGxxXo4afTox6khnMszRVBNWZWyoXb KBVSK/VIyfOi5bbEOQSSIPmNZpeQ+48Dunnhio39VSxdZdG9nokP0lAMbjIWlVafmmCB CyQdoxKb/JAlenWR32z3hEP0cdMUaKYfLRW5w= 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=0zlKw1kEZj46Mlwm0z+IIP5eiMfjvSrRln4gYc3Wv2I=; b=BrDeOOZB/C5j2/Ev645Y/PilC8x9IOFipwhE4gKpBe/aWkhhz1d7DU+l/rvM+jKpgy Gdo6oAPho5K8TzPMutvhtXwNDmWulcOFJwRXm8FmvYzkr3HNy1vJta2/KqXI7nNfh0w2 LXE4RqEidXq9yiNsqGNIyBGNahEHhL2nghU/Zm7qZVCIjyJ0IllhCiamV/NtJRXkvFav 8BpdtOQMSOJOhA+xpStQhD4Tr4jUM55PZQ6zMZn7epjYLGhrNvf3qeAXp8QpJyPyEeqn PheAFeyexKx0EWvtmBjEgFbqeOO82Nj7rx8ys1yJiaYT4YMkLnMjuT1OvaSEPk9KrfDY ZGLw== X-Gm-Message-State: AG10YOTVykK4IPvxMBpSQd8TYU2LpYYvxX+Pn76hHsj3QkljDGuOEiIYxQxpmjXapqW3GwJZjC8= X-Received: by 10.60.147.137 with SMTP id tk9mr28898831oeb.45.1454981632285; Mon, 08 Feb 2016 17:33:52 -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.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Feb 2016 17:33:50 -0800 (PST) From: Al Stone To: fwts-devel@lists.ubuntu.com Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, Al Stone Subject: [PATCH 12/21] FADT: restructure test sequence around reduced hardware mode Date: Mon, 8 Feb 2016 18:32:54 -0700 Message-Id: <1454981583-31872-13-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> 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 --- 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 fd430ec..430bfd4 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -848,10 +848,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 @@ -878,6 +902,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.");