From nobody Fri May 9 19:06:55 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1534234369790488.2417583960025; Tue, 14 Aug 2018 01:12:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 24978210F2549; Tue, 14 Aug 2018 01:11:41 -0700 (PDT) Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 67117210F2544 for ; Tue, 14 Aug 2018 01:11:40 -0700 (PDT) Received: by mail-pl0-x243.google.com with SMTP id b90-v6so8044222plb.0 for ; Tue, 14 Aug 2018 01:11:40 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id h130-v6sm72905670pgc.88.2018.08.14.01.11.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Aug 2018 01:11:39 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::243; helo=mail-pl0-x243.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org 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=wgDkX6wgY40o5xsARKA0/kmSWeKzj9oTo1MIqFID3Uo=; b=SPoO+IcKoSX5yCKMMXfsHSi94/gtWr5SlhS+oYmJVQUJC5fpnLrlQkhSCR1md212GB 5GVxWYjtyR+jBGFVT0S5HhprMmtZNGETSMaNXQbwgv8ive94qmO71en86CoMTRgac0rN 4rSFFbhEy73mLawJYhpEUN1+90jyDmAm1zHpY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wgDkX6wgY40o5xsARKA0/kmSWeKzj9oTo1MIqFID3Uo=; b=nUAumEap8eJwm+5YNzLxQ4yVd10zzT0C1mDr6FtTtNnUNSmJQJxPFjtcZhHIOapmS/ WoOQqH5v1rNWqdhp5blwYQ139woWEZK8i7IsGHx2FXYtmaDchwqiwP8eOSpzXktXk1F/ +5hG2/jqfCM3GiDvqvvN64+c+/8MYSpCpJ6u8hVpKcr7c2fwO3Sbg6BYBYcYWoO+t1aJ VF5U4FaBLhHSmRFOTVOXQiZkgDSnm2DqBQ1teXVyVL+aWfWnh8Inp2enGXJgb+OeOhBL 7DRb+vdeap17YEWsWPtyZAKu+gvtNhFyXuvs/bfo8NZHRBlrvSaNPRxNevcNZTNtAo39 HUkg== X-Gm-Message-State: AOUpUlHMsx4NfS8fI7PwHnBhZyF/qlNHHRR2I50I1Evd8zRQK5yh2tSj sxWYTF1prWzqwCFKdH6oFwQYeA== X-Google-Smtp-Source: AA+uWPzYo74VK24xW3BKoKx5Yi1p46VPTRAUdRkMnewU2deUw2JyjQeor5te6JCc5jYlyBfdiI0sWA== X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr19588212plg.293.1534234300090; Tue, 14 Aug 2018 01:11:40 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Tue, 14 Aug 2018 16:08:59 +0800 Message-Id: <20180814080903.50466-40-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180814080903.50466-1-ming.huang@linaro.org> References: <20180814080903.50466-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v2 39/43] Silicon/Hisilicon/Setup: Support SPCR table switch X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangming23@huawei.com, xinliang.liu@linaro.org, john.garry@huawei.com, zhangjinsong2@huawei.com, guoheyi@huawei.com, huangdaode@hisilicon.com, michael.d.kinney@intel.com, lersek@redhat.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If install SPCR table, KVM will not output while install or boot some OS, like ubuntu, so add SPCR switch setup item and set it disable by default. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c | 24 +++= +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.= inf b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf index 281a4f2ebd..3d133aff85 100644 --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf @@ -51,6 +51,7 @@ =20 [Guids] gHisiEfiMemoryMapGuid + gOemConfigGuid =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile ## CONSUMES diff --git a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.= c b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c index 54f49977c3..32878ca4f9 100644 --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c @@ -16,8 +16,10 @@ #include #include #include +#include #include #include +#include #include =20 #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET) @@ -114,6 +116,25 @@ UpdateSlit ( return EFI_SUCCESS; } =20 +STATIC +EFI_STATUS +IsNeedSpcr ( + IN OUT EFI_ACPI_DESCRIPTION_HEADER *Table + ) +{ + EFI_STATUS Status; + OEM_CONFIG_DATA SetupData; + UINTN DataSize =3D sizeof (OEM_CONFIG_DATA); + + Status =3D gRT->GetVariable (OEM_CONFIG_NAME, &gOemConfigGuid, NULL, &Da= taSize, &SetupData); + if (!EFI_ERROR (Status) && (SetupData.EnableSpcr =3D=3D FALSE)) { + return EFI_ABORTED; + } + + return EFI_SUCCESS; +} + + EFI_STATUS UpdateAcpiTable ( IN OUT EFI_ACPI_DESCRIPTION_HEADER *TableHeader @@ -130,6 +151,9 @@ UpdateAcpiTable ( case EFI_ACPI_6_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE: Status =3D UpdateSlit (TableHeader); break; + case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE: + Status =3D IsNeedSpcr (TableHeader); + break; } return Status; } --=20 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel