From patchwork Thu Aug 16 12:12:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144382 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2001864ljj; Thu, 16 Aug 2018 05:15:33 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyiQJh1eF4Bb+y2BTks7fL9Onr9grw/O4Et+XVtxotj/gPQ9Fxhtwenuwj6tb4gSsLBMkws X-Received: by 2002:a17:902:27a8:: with SMTP id d37-v6mr29140341plb.290.1534421733585; Thu, 16 Aug 2018 05:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534421733; cv=none; d=google.com; s=arc-20160816; b=jnhQTRgrbSVz0LdcTDaK8Ja7J4dnQkiafKs4JVvyyL7UEFm7/CEkTfsLFnwzoZGlOC B1zLavQ4mX6vm+riYVmED8H3Crd+gZAJHlb/wNtVaNrPLyKu95yQMmqbyIeelCJhN4dc Zn1JLL9V3oeD3efchoizDZI5fcXjrPE/55PmPJhfbzGk1t1xC4fZPkN3pyphEc5tOCvY IqGCTTgccLgelGHlqd1k9IjOvaHR17/Ng4dk8qqwU+4tT9iwwBbmwXT8cE3UCO2PMwwr grV7APBydznhJhvW7qI8KdftfwnRU4Cm9NXAH8ZQHEOMLaGFJmYvEBA7msuPBTbosqYS 0t3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=kn3TQjFJa9/v1rf2mssgU6vtOROePC53s73Xphoe+ho=; b=wiTbU/QYgfGu8l/t22bSWSFMATBKnXAjYwgKQKEBQxu5kRRwwp2k1QNBCmuNWpWolQ b5+VeVRgbUzssvg1uQ3XFz5t22K775N98kTMWc2lq3BNOzA6aIxRdKo++IiuLqWBrMAQ 582Eui61XVWnsggR2pGKC1z1Tyja2aBTTVQkggZOs98+PMUPggnX6TmKC9NoXG6S8loS hMUSnHNkdKU2giTGHNWDUCo1JCLG9afK2R890E09sYeSSw1/xWwFu6BCK3PU4CMgiQTh lxxco5JtYViORp5w6DASo8jVwpRsCrPlBqPPjSZHUcFi9yOyaxMSw/7fjhtFhzy9ZQ56 tMdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QWDuX43o; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id g21-v6si26915563pgh.686.2018.08.16.05.15.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 05:15:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QWDuX43o; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1455F210F41C5; Thu, 16 Aug 2018 05:14:55 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.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 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 07B74210F41C3 for ; Thu, 16 Aug 2018 05:14:53 -0700 (PDT) Received: by mail-pl0-x243.google.com with SMTP id g1-v6so2025228plo.2 for ; Thu, 16 Aug 2018 05:14:53 -0700 (PDT) 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=QWDuX43oEKoITxiHBiwPgyys8O1XMfBdefu2cf/MhxBJg/swzuS+Zj8+ZuAPia4mKE xFSMpS18CQUo1ZKHl7F1JFr4hgIpMBEJhFFBWjhNmm3xfzC8696hs4Hw5Hzlkhub3Ak8 c8knFMyIV0haghBfpAAqDikY9xMPtC/awG3Ag= 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=Ksh3+xcQLhu3hYXPgT4oWdeP90wr8alZeGITux+s0UbROd/8TGb/rIVOzX0sp9slJk jzNCRmk+La1An/suQnO6CyKcy0Igts42Q4A7+rhp2l5+e9l2zZhs4GKcE9hgSanHNqca Wgyc2ojQfR9ffLu9foXKos5IHF+DjZEbHiBOkDrH7hP1Qor64/NrZAY3wFJx0A22484l Bz//3Ni0P6uEIZBuK1b56870MjSzUdpU+e2G/729hTUKQ+hOloJj4CHGucvmrf8Cn69L wE4ILPtJLvBXBcExzj4TpO+31CJZC99F5ZNzUXPa9GclEiPifvWBJDajTBGb7WQSKsAc q2iQ== X-Gm-Message-State: AOUpUlElFvwf4AGFnnubi8B6ZJ3ogiWdaLMEoZ222yPyk3TThBMuo5dp Z1ZkRY2qE0puNsTyvdFw6H44uw== X-Received: by 2002:a17:902:4001:: with SMTP id b1-v6mr28978661pld.208.1534421693752; Thu, 16 Aug 2018 05:14:53 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id j27-v6sm46736311pfj.91.2018.08.16.05.14.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 05:14:53 -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: Thu, 16 Aug 2018 20:12:35 +0800 Message-Id: <20180816121239.44129-33-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180816121239.44129-1-ming.huang@linaro.org> References: <20180816121239.44129-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v3 32/36] 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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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 @@ [Guids] gHisiEfiMemoryMapGuid + gOemConfigGuid [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 #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET) @@ -114,6 +116,25 @@ UpdateSlit ( return EFI_SUCCESS; } +STATIC +EFI_STATUS +IsNeedSpcr ( + IN OUT EFI_ACPI_DESCRIPTION_HEADER *Table + ) +{ + EFI_STATUS Status; + OEM_CONFIG_DATA SetupData; + UINTN DataSize = sizeof (OEM_CONFIG_DATA); + + Status = gRT->GetVariable (OEM_CONFIG_NAME, &gOemConfigGuid, NULL, &DataSize, &SetupData); + if (!EFI_ERROR (Status) && (SetupData.EnableSpcr == 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 = UpdateSlit (TableHeader); break; + case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE: + Status = IsNeedSpcr (TableHeader); + break; } return Status; }