From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::443; helo=mail-wr1-x443.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 874E921103985 for ; Thu, 23 Aug 2018 02:57:42 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id g33-v6so4113008wrd.1 for ; Thu, 23 Aug 2018 02:57:42 -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=D42JYkyw2J2ENU+trrnwTMlW0js4vKIUTbtl9AkMIj8=; b=h7EjjllZxUmqTM6wyFdifFGPbWZtdN1R6W1VGKxob1ElEBL/hMduM7u9nEUy9+ueRO Nfe6QWBhM0XLoq2/bL1dems88rpkPWn9DDt8kXUJ1NfiZeGhM7ACTlfjW94UQvER0Ml1 oZxGDnAYqibskwMAWwa0H8AhMTnS/1WVuN6QY= 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=D42JYkyw2J2ENU+trrnwTMlW0js4vKIUTbtl9AkMIj8=; b=rXP0EaHZuJMY5tVHbqD4BVOfT7As0L6GbhPHHX+vFJ7OTtnCKE4bROtyroXYzgLX3Q EkMDj6RC44VkjOoEMT+YhF8IWxfiNImV4GOIjrN4xxZh6CzqrDzKaXU3evrEC78Qq5d4 cCkgw9ok5bCyVJtfwc3Omd2Wa6T2XRFAiYbjLVO2FjujQiMT2C0E2PhAfWx0Nxs1wigo 1Hw52aB1ktsANTDXEL9OWrDMxjFur7U8O9zUm8M65rxqIrO2VNbnhfqQwKhx5r1dA11Y 0L80q8ZTprsnLqF6rUURUoEEjkbG5l6Ye7YWrigG70BeWGXqUDMBFie+wRbS4MUBydW1 jrrA== X-Gm-Message-State: AOUpUlHxypebRiIUPCAzf6BGbDxNM9s7ib7iYfMcYpTLv1yge9VPAHpq nGEu/F8cOHifAclG7epTM5F+Kw== X-Google-Smtp-Source: AA+uWPyYYNUBb2n2mHT0d+fBhhO6fq/kmF7k1wC8FfRKXBTDJsMvZC+JboDXcuWTcXoCwt8BoXZd0A== X-Received: by 2002:adf:c554:: with SMTP id s20-v6mr36780343wrf.46.1535018260947; Thu, 23 Aug 2018 02:57:40 -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 o14-v6sm2920085wrp.57.2018.08.23.02.57.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Aug 2018 02:57:39 -0700 (PDT) Date: Thu, 23 Aug 2018 10:57:38 +0100 From: Leif Lindholm To: Ming 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: <20180823095738.5ve3tuomrlsqbxdf@bivouac.eciton.net> References: <20180814080903.50466-1-ming.huang@linaro.org> <20180814080903.50466-40-ming.huang@linaro.org> <0a8bf422-a3e0-8eff-c97d-82afd4d23f98@linaro.org> MIME-Version: 1.0 In-Reply-To: <0a8bf422-a3e0-8eff-c97d-82afd4d23f98@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2018 09:57:42 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 23, 2018 at 05:54:48PM +0800, Ming wrote: > Hi Leif, > > How about this patch? https://lists.01.org/pipermail/edk2-devel/2018-August/028823.html / Leif > On 8/14/2018 4:08 PM, 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. > > > > 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; > > } > >