From patchwork Tue Feb 12 02:39:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1040332 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43z6Lc1WxTz9s3x; Tue, 12 Feb 2019 13:39:35 +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 1gtNyu-0001Ih-Ck; Tue, 12 Feb 2019 02:39:32 +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 1gtNys-0001IZ-Th for fwts-devel@lists.ubuntu.com; Tue, 12 Feb 2019 02:39:30 +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_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gtNys-0003FY-6d; Tue, 12 Feb 2019 02:39:30 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH][V2] acpi/nfit: update memory mapping attributes (mantis 1873 for ACPI 6.3) Date: Mon, 11 Feb 2019 18:39:27 -0800 Message-Id: <20190212023927.8683-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.17.1 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: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/acpi/nfit/nfit.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c index 491ac1b2..729875f8 100644 --- a/src/acpi/nfit/nfit.c +++ b/src/acpi/nfit/nfit.c @@ -27,6 +27,23 @@ #include #include +#define EFI_MEMORY_UC 0x00000001 +#define EFI_MEMORY_WC 0x00000002 +#define EFI_MEMORY_WT 0x00000004 +#define EFI_MEMORY_WB 0x00000008 +#define EFI_MEMORY_UCE 0x00000010 +#define EFI_MEMORY_WP 0x00001000 +#define EFI_MEMORY_RP 0x00002000 +#define EFI_MEMORY_XP 0x00004000 +#define EFI_MEMORY_NV 0x00008000 +#define EFI_MEMORY_MORE_RELIABLE 0x00010000 +#define EFI_MEMORY_RO 0x00020000 +#define EFI_MEMORY_SP 0x00040000 + +#define EFI_MEMORY_ALL (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | \ + EFI_MEMORY_UCE | EFI_MEMORY_WP | EFI_MEMORY_RP | EFI_MEMORY_XP | \ + EFI_MEMORY_NV | EFI_MEMORY_MORE_RELIABLE | EFI_MEMORY_RO | EFI_MEMORY_SP) + static const uint8_t guid_virtual_device[4][16] = { // Virtual Disk Region - Volatile { 0x5a, 0x53, 0xab, 0x77, 0xfc, 0x45, 0x4b, 0x62, 0x55, 0x60, 0xf7, 0xb2, 0x81, 0xd1, 0xf9, 0x6e }, @@ -231,7 +248,7 @@ static int nfit_test1(fwts_framework *fw) /* TODO check Proximity Domain with SRAT table */ - if (nfit_struct->memory_mapping & ~0x01F01F) { + if (nfit_struct->memory_mapping & ~EFI_MEMORY_ALL) { passed = false; fwts_failed(fw, LOG_LEVEL_HIGH, "NFITBadMemoryMappingAttribute",