From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-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) 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 Cc: ard.biesheuvel@linaro.org, michael.d.kinney@intel.com, lersek@redhat.com, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, xinliang.liu@linaro.org, Ming Huang , Heyi Guo 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: [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: , X-List-Received-Date: Tue, 14 Aug 2018 08:11:40 -0000 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 @@ [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; } -- 2.17.0