From patchwork Mon Aug 28 03:11:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1826597 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=cgLHrHP/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) X-Greylist: delayed 1950 seconds by postgrey-1.37 at legolas; Mon, 28 Aug 2023 13:44:11 AEST Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RYxHv0RsJz1yZ9 for ; Mon, 28 Aug 2023 13:44:10 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qaSf3-0002Ae-Is; Mon, 28 Aug 2023 03:11:29 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qaSf1-0002AX-Ml for fwts-devel@lists.ubuntu.com; Mon, 28 Aug 2023 03:11:27 +0000 Received: from canonical.com (unknown [106.104.136.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id ED6EC3F596 for ; Mon, 28 Aug 2023 03:11:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1693192287; bh=sClp6QYBLL9lP3QK+gqNE+rThGY+7xeaY7F2iDjwWy8=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=cgLHrHP/8GvD36V9SN4d/QmkTRZNX2UMm9dkStvmWksODB53CMa2TsgkhHw5EwhI5 u3P7OJmyBIH36xhCFyZlRXKACyBtzMeqfdoPN1V8QrjJ620lfl8ZUU9+XSFL7aqZVD 2W+rOkdV8Zy/X0pkEyI3aczltOPWurboEcSkhdxsAFX6PLS89ga2WuT40lCIG+aLTN omZKvCZ2pC6demPJKKgx3wYTRo2EJPDhdjwZ1SJ59y1gdp8321fDGdzUKuvC2knsm8 a7IGBWfZgWmlHN+Wg3922WeaDLZ3lC0zMA39FoF3UxK857+JH2GVAgfKj2QFnxbW/G rmtMnqPilBlDg== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: fadt: remove the tests for expecting smi_cmd is zero Date: Mon, 28 Aug 2023 11:11:20 +0800 Message-Id: <20230828031120.7439-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" BugLink: https://bugs.launchpad.net/fwts/+bug/2032158 We should not ecpect smi_cmd to be zero if acpi_enable/acpi_disable is zero. Checking the ACPI specification, ACPI_ENABLE This field is reserved and must be zero on systems that do not support Legacy Mode. ACPI_DISABLE This field is reserved and must be zero on systems that do not support Legacy Mode. SMI_CMD This field is reserved and must be zero on system that does not support System Management mode. It doesn't force the SMI_COM shoud be zero if acpi_enable/acpi_disable is zero. Some projects enable ACPI mode with DXE_DRIVER and doesn't switch back to legacy mode once booted to OS. They support SMM as well. So it got, SMI_CMD is not zero ACPI_ENABLE is zero ACPI_DISABLE is zero Signed-off-by: Ivan Hu --- src/acpi/fadt/fadt.c | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c index fb6aca5f..d3663443 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -758,53 +758,33 @@ 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->acpi_enable != 0) { if (fadt->smi_cmd == 0) - fwts_failed(fw, LOG_LEVEL_MEDIUM, + fwts_failed(fw, LOG_LEVEL_HIGH, "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->acpi_disable != 0) { if (fadt->smi_cmd == 0) - fwts_failed(fw, LOG_LEVEL_MEDIUM, + fwts_failed(fw, LOG_LEVEL_HIGH, "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; }