From patchwork Tue Aug 14 08:08:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144147 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4050914ljj; Tue, 14 Aug 2018 01:12:48 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwabn8xFyo/D6r/0BvoxXMi/62r13nuhUDQGxczP/sRptjQqNsbtTQANp0kea+7B33DmGgX X-Received: by 2002:a17:902:4201:: with SMTP id g1-v6mr19596186pld.203.1534234368800; Tue, 14 Aug 2018 01:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534234368; cv=none; d=google.com; s=arc-20160816; b=IRb1Nrpj+to/gAeEQLaEkHqJFQdUeYRLrfRqpVPi2oy/8OfvtALHsnX1bVXL6hxG9s 0/XSI0GF0mIak2bZmx97EXpHkyMwXrUsqy2q9cCMguj74k3jVLE4i50kyYfslXTo6Asx BMHUwG+Kwqv5JxRYBAJFslTDcenCdjw57JgiJ8RS48xwUR69pKcIJGWMFFiruYgbR0ak biHunAV42cJuB++RplYzulxB4Vk1yA8pyUsscCcKUIks6IbHSCyL1fz6skkOkOk5kDxK My/Xa94bwgdj1w51x59gVlnynxphMMZiiiItzJyu/eUCA6F4B3p1GkxGUuaG9Z/M1DCd 5n1w== 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=I/+K4HsYVfCvgRTlrpjRdERGyzrLPv/PX/Blerp4CLH2DLirvZC5amGoKrljG4uuZh tQ8xfsgUdrx2V2zWHzDcbsLb7lKpo3jOUMLsKB72r8qgnoZ4FW4T5+4YnhEbAja0DBIQ 0HDeesBDE0cRAJ2SD44n8rI+GroaHhmClL2c4QnarijAfHHZeA3AkqXVJhoWmlYo69MY U0WCi+KekfQ9Apjpe6aQnsAC3XmwMctxvVxanrbOhRKZvcHZk73OJo/3Km4+yTDx/iWF 3bKYIigc+e7DFatQfwrFVu1WTuNv3ZBBlVkw5EJt+VS8XXIp/x5jHLTNsRktqnndo/pm K2KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SPoO+IcK; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id k15-v6si15889234pls.463.2018.08.14.01.12.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 01:12:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SPoO+IcK; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 24978210F2549; Tue, 14 Aug 2018 01:11:41 -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 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) 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-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr19588212plg.293.1534234300090; 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) 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 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; }