From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::241; helo=mail-wm0-x241.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (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 EAC302194D387 for ; Tue, 21 Aug 2018 14:11:50 -0700 (PDT) Received: by mail-wm0-x241.google.com with SMTP id i134-v6so10510987wmf.0 for ; Tue, 21 Aug 2018 14:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dB0al0LbpvCSxWFW/DTQ2sjKCkGib/Xr2r5Yp2m1wZg=; b=aQHElIyR6N6VUYAYfA3UZ5PhutvzYyfonijIrGfJTznBv6nXh/EN1dCn0BmNnuxFY5 2jVsSGUJKQ5OAOW60n+ZzUV8YLMiSYVFLfxJpK2dAUKHWXa41wf8FVNDiTOp4WMO61Jo YxWvvwulFY161IrVGOksW6BCzHmaUJSSXe/uY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dB0al0LbpvCSxWFW/DTQ2sjKCkGib/Xr2r5Yp2m1wZg=; b=NAaCIL9TTl8dZ13sROjH6YKTBTOy1C4nnL48NPLLW4u+xCpxXGSttZr6njoFdSVlrt SjjV9VN5qJQrY6LXXI4qXu3wIQ9WsPVVq7pd5Kw6CMH1eYkfpPEPFzUtjuCf3t6VKoOr Xqo8tpTD8azHCMI0rEc9+HW6iq5usZibCa8DqDk2rYc50tGEPMG6g1kHENMgaqWNQxK0 hUwZ5GfqOUMwSJ/UClhxBkwoqvCNZx65iDOYSTuoPcca+dqSS+RunBjE0fh+3wyRUVqZ Fkisqm5Gs9mPhdSEXQW9QYBtfojzlvcpTucccm1BmZybvzjJw49EXtPrClsUjHkBPX9O AuZQ== X-Gm-Message-State: APzg51CwkTSU2rbbFkvq+B9GZr20xWpQuQN0hjED6daWrN2TcIc7GS0g tz46TWL2On0cHClzA6wRomJZnQ== X-Google-Smtp-Source: ANB0VdbCiitVwBd34h1uxTyYpaAQt3EZvMyJjUJhvkqHQ3FwKHU2Q2QSLxs8ER9uFRtDh71DS70T/w== X-Received: by 2002:a1c:9692:: with SMTP id y140-v6mr639120wmd.82.1534885908528; Tue, 21 Aug 2018 14:11:48 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id e137-v6sm181942wma.20.2018.08.21.14.11.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Aug 2018 14:11:47 -0700 (PDT) Date: Tue, 21 Aug 2018 22:11:45 +0100 From: Leif Lindholm To: Ming Huang Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org, 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, Heyi Guo Message-ID: <20180821211145.yn2fgvgjdwkepwel@bivouac.eciton.net> References: <20180816121239.44129-1-ming.huang@linaro.org> <20180816121239.44129-33-ming.huang@linaro.org> MIME-Version: 1.0 In-Reply-To: <20180816121239.44129-33-ming.huang@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2018 21:11:51 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 16, 2018 at 08:12:35PM +0800, Ming Huang wrote: > 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. This one was supposed to be replaced with EmbeddedPkg/Drivers/ConsolePrefDxe, right? / Leif > 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 >