From patchwork Tue Nov 14 04:47:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 837682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3ybZkg5cRFz9s0g; Tue, 14 Nov 2017 15:47:55 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eET8c-00042o-KT; Tue, 14 Nov 2017 04:47:54 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eET8b-00042B-BI for fwts-devel@lists.ubuntu.com; Tue, 14 Nov 2017 04:47:53 +0000 Received: from 1.general.alexhung.us.vpn ([10.172.65.254] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1eET8a-0007QW-9d; Tue, 14 Nov 2017 04:47:52 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] Add ACPI 1.0 RSDP test to make sure RSDT field isn't null Date: Tue, 14 Nov 2017 12:47:44 +0800 Message-Id: <1510634864-678-2-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510634864-678-1-git-send-email-alex.hung@canonical.com> References: <1510634864-678-1-git-send-email-alex.hung@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: goldswo@amazon.de, Chris Goldsworthy MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Chris Goldsworthy Given that a RSDP follows ACPI 1.0, perform a test to ensure that the RSDT address field is not null. The addition of this test ensures that there are tests for each RSDP field for any ACPI specification. Signed-off-by: Christopher Goldsworthy Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/acpi/rsdp/rsdp.c | 21 +++++-- test.patch | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c index 2f537be..0fcb430 100644 --- a/src/acpi/rsdp/rsdp.c +++ b/src/acpi/rsdp/rsdp.c @@ -115,11 +115,24 @@ static int rsdp_test1(fwts_framework *fw) "RSDP: revision is %" PRIu8 ", expected " "value to be 0 or 2.", rsdp->revision); - /* all proceeding tests involve fields which are only - * defined in ACPI specifications 2.0 and greater, skip - * if ACPI version is 1.0 */ - if (rsdp->revision == 0) + /* check if RSDP follows ACPI 1.0 - if so, make sure rsdt_address + * is not null. */ + if (rsdp->revision == 0) { + if (rsdp->rsdt_address != 0) + fwts_passed(fw, + "RSDP: RSDP follows ACPI 1.0 " + "and RsdtAddress is set."); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "RSDPNullRSDTPointer", + "RSDP: RSDP follows ACPI 1.0, but " + "RsdtAddress isn't set."); + + /* all proceeding tests involve fields which are only + * defined in ACPI specifications 2.0 and greater, skip + * if ACPI version is 1.0 */ return FWTS_OK; + } /* whether RSDT or XSDT depends arch */ if (rsdp->rsdt_address == 0 && rsdp->xsdt_address == 0)