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 30269210D225D for ; Thu, 9 Aug 2018 08:48:55 -0700 (PDT) Received: by mail-wm0-x241.google.com with SMTP id l2-v6so2684609wme.1 for ; Thu, 09 Aug 2018 08:48:55 -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:content-transfer-encoding:in-reply-to :user-agent; bh=cAM5n1s1bMOfxDH2PBoyoHgeUmvNsJA7lPGP/s03tMs=; b=UC5hp9Ud3qA4Vk2BqiZkxIFcJAsziDBjTGAFxODrPqgy7qAcsXMBMhXZeI7Uh30NkT xL+EyYZrPlyfeZbvhbTixk/j507eIqFfLYo++JCPYsGzlP5xtZQlntVmo421AFUamOcu 8Qf/1dUaTbXvn8I62k9WypfmzPWIzclG01tCI= 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:content-transfer-encoding :in-reply-to:user-agent; bh=cAM5n1s1bMOfxDH2PBoyoHgeUmvNsJA7lPGP/s03tMs=; b=NTKWXLJPI1Pu83sCjlKZn/JGAL575Kr0nkrg0GtBXYdqWMmSaD98FSSRQ2Ku3FH/3B c6EVIpPp4zL2cwVNAecf2Jza/qyOFF4K36SXpgvW8lfLMaRhUMp0YDeO0/3kHBwZkONg b7UQhi8Ru7nbP+PMwwPRnEYvSL/zzc6P5sIQHEUC+1bEuFRYa74vpMVxwB7tohCYKap7 ay6Ap4Z8VsoFK8MQXZmYBeYSMoa+gDxKSMq8tEFG/2e2n+AdPdghtZTUYtR4qxplD1qY g8NJpUakFKcefIEi/26Fk5ghDiJF5R93BO45M9oyVXmfjjoHWveLxaRU2XJyzfvHU1TK hvbw== X-Gm-Message-State: AOUpUlEcxEX1/yrovt5wxD2WTFWGgOHYDU5MFokAZz4M5VoMcBOm3DUO AD4QSlgJ9wd41EDqenxOA5W5xQ== X-Google-Smtp-Source: AA+uWPxWivqmGNip8SM0uHKluqCi+/THKIBhkWbsNlsy/PXFh3mQj1hQWW0B1n56DJJK+nBTF4RmZQ== X-Received: by 2002:a1c:8587:: with SMTP id h129-v6mr1845645wmd.105.1533829734588; Thu, 09 Aug 2018 08:48:54 -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 r140-v6sm19344803wmd.7.2018.08.09.08.48.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 08:48:53 -0700 (PDT) Date: Thu, 9 Aug 2018 16:48:51 +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, 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: <20180809154851.37ekczlbdbnlox7l@bivouac.eciton.net> References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-36-ming.huang@linaro.org> <20180804152039.hhbfyeyxqwv64itg@bivouac.eciton.net> <20180809144449.gjvtawgcae23z7ru@bivouac.eciton.net> <568e1549-1395-528a-852a-996699854aef@linaro.org> MIME-Version: 1.0 In-Reply-To: <568e1549-1395-528a-852a-996699854aef@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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: , X-List-Received-Date: Thu, 09 Aug 2018 15:48:56 -0000 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Aug 09, 2018 at 11:40:12PM +0800, Ming wrote: > > > 在 8/9/2018 10:44 PM, Leif Lindholm 写道: > > On Thu, Aug 09, 2018 at 10:17:43PM +0800, Ming wrote: > >> > >> > >> 在 8/4/2018 11:20 PM, Leif Lindholm 写道: > >>> On Tue, Jul 24, 2018 at 03:09:19PM +0800, Ming Huang wrote: > >>>> If install SPCR table, KVM will not output while install or boot > >>>> some OS, like ubuntu, > >>> > >>> Will not output? > >>> Do you mean it disables the graphical output of the OS? > >> > >> Yes, the behaviour of OS is like description above. > >> I guess some OS select serial for output and disable > >> graphical output when SPCR is installed. > > > > OK. Then I'm OK with the idea. But we already have > > EmbeddedPkg/Drivers/ConsolePrefDxe to do the same thing, via HII form > > instead of magic values in environment variables. > > Can you use that instead? > > Can ConsolePreDxe provide a setup item for selecting by user? That is exactly what it does. > Do you suggest this patch is not need and add ConsolePrefDxe to dsc/fdf? Yes. Look at Platforms/AMD/OverdriveBoard for an example. / Leif > > > > / > > Leif > > > >>> / > >>> Leif > >>> > >>>> 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 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; > >>>> } > >>>> -- > >>>> 2.17.0 > >>>>