From patchwork Tue Jul 24 07:09:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142737 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6941399ljj; Tue, 24 Jul 2018 00:24:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcgK38yv6/g7A1DXxTev3w+n1RAMADV7u5r1R23fkz7OAcZPvJ4/gaaJutCW3LLw2vhJtnV X-Received: by 2002:a17:902:1005:: with SMTP id b5-v6mr16053443pla.207.1532417077251; Tue, 24 Jul 2018 00:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532417077; cv=none; d=google.com; s=arc-20160816; b=gmOj9qa2MdOFqzNcWHepkfTkSLFkyasDYSeizae8haRErR1MStFvtVlJPZo8uXJn9e Cib1o1TB6zYs/hCrdfuVq3gfO09gQPqyB6kwX0gMI3ctphUcR/9I7/VOPQHUacppzHMh HdpWt9QJ8b6qvmp9Yl+rZbKyS8ZIxLeZIYEVEX6fKLL3mjLXIt3jPwc35TSM2VmvfJYI TkrW95623CQMVgoQo836NqeOJnAcN0T6tDNob+xPZj25ZJaZNRC/tpfVbssMnXrxJVWV voMua61Klf8m42afIA1fkvqloDs2PzGyIfSmvYl+m4Q/D/zSpzAbj8zbT6reE+McQXoE +tAA== 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=qe65nsl3DdXaGN78XRWXOy1EY6C7vjST3JZwrIpqXHA=; b=Nre9D2JRorX+460kXLh/8RWJPSkYdhlG/r41Ywyf/EHRIlNI6uR/+dAQs6YUCyVZbZ ufS1bIAUMlkjAs5522RSzn0HQkwcxMtxdpdS+P1LuF5HDrvIzk2xMTbrXhqr+pOUSs4X hrY1ts06qBXi+f/0Swn8/KlfDu+qiuKWbc53M7P/11Qdgq9Iq8YrQHfUlXtPh1zqU7E2 0YTRfHiTGRozS8W0d5nRivZpcra0yIOvGtYEEtwY2DKFR/RG5xJPYLsmO6vRvpc/8VRZ g2UhZmOUByd3fUc/Cq8S8fqBf6SsezpANYI94mSuM0FNQ2zaMuSwMR9yOezkPRH8xUbG RP3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CU2NSsvt; 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 y126-v6si10272325pgb.23.2018.07.24.00.24.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 00:24:37 -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=CU2NSsvt; 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 DD655210C1B69; Tue, 24 Jul 2018 00:24:36 -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:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (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 39CA5210C123B for ; Tue, 24 Jul 2018 00:24:35 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id q7-v6so639467pff.2 for ; Tue, 24 Jul 2018 00:24:35 -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=R2AjY+FOdGZZi2bYhpKDLZPTXQYv2dzyhRmXNodOHtE=; b=CU2NSsvt+W4yfd9Cblc1dmlcgSGrIsaQ/fHa9smcAUHeU6LGtVcQRBeH0K1cs4Twlu 8dSZqILgbHvMRvEFKszQZSK+Fcg9491+jKLLXgJ9kcfKMdxbQBDSxWQC3AJCxXC8WPeX X5VZlpTgDOYJ1eILeWVvDONhjGPdYdvjs8Lf8= 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=R2AjY+FOdGZZi2bYhpKDLZPTXQYv2dzyhRmXNodOHtE=; b=KQDtAWH1MidC9LnwvGYvmi6chG7FAG7Td0FQBvJGK+IGkN77y26QSLMTE+8zlE3WXB DFrJu/PacJwgCUw7BD4amrM1nYpMr1kFY+Hfalc0r0CESjXDoJlFNvw5fHMC8FMBix9Y +c/8/4trWkK5E/6F8R0fpJpy9VW/WoS6No/1sdUrYimvWjxrMjZI2gZYa2vpN0Ap7ggw eb2tS3pK1qt4UV2qC23Kv4xpy077X/ql1tw0IQcDB3/zApXNtwDhuXATASXGZy6XerwV JrOa+Khrdw6Xy8JTm2sENPA9C5acKIR700q0FMOXL6ePiYo9TrvYzJ9tcFE09xWctlcy dCqw== X-Gm-Message-State: AOUpUlHntC8PB2c0qs0OYhENjkBRhhUtKG62/sMTTDNVic97AdXhHoKQ zde8TBHSBH19ymgolquTyknSoQ== X-Received: by 2002:a63:5204:: with SMTP id g4-v6mr15421759pgb.274.1532417074993; Tue, 24 Jul 2018 00:24:34 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id t14-v6sm11449788pgu.0.2018.07.24.00.24.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:24:34 -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, 24 Jul 2018 15:09:19 +0800 Message-Id: <20180724070922.63362-36-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180724070922.63362-1-ming.huang@linaro.org> References: <20180724070922.63362-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v1 35/38] 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, huangdaode@hisilicon.com, guoheyi@huawei.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 e268a56bbd..c32fe42d60 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; }