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::244; helo=mail-wm0-x244.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 ED4D1210E4355 for ; Thu, 9 Aug 2018 07:44:53 -0700 (PDT) Received: by mail-wm0-x244.google.com with SMTP id r24-v6so2535896wmh.0 for ; Thu, 09 Aug 2018 07:44:53 -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=H37mm/5qBes7Q13tjbjx5JO0XNXugPHmv/c3TBlwfHw=; b=O5GrozP9wd4gej4yxxlFOZziW9mrktXGYT2wqdOPZONbw686w9LgtYf6A7pV2JfBeP Tx89PhREYAjl1P+lWxJ8ymG1bvJp9iXj0azbpC8l3dhqVUW4gNzb2c20uTfgDW/dJMNW HLlW9J10nnEuK6y/YDfVN00XW658uLToQeex4= 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=H37mm/5qBes7Q13tjbjx5JO0XNXugPHmv/c3TBlwfHw=; b=MZnwylVnOx2vVOrm8ehDwa4T5++LmDsZQeOHiEfH5aIJsRJqKtZaSa+ISOcDrRirGj +dAoGVkje1fM7PAtYVsRd/M42RqhYmiVFcknAEDJcyxxCid82tepXh8CUY2e+2tu5UdV ksBt/pYtHUx5QN1l6OPQ+yk5CDkEmlSEpXS/+xTVZfaZ/RY5B3QLsbNIe5kGT/LGvhH+ fzTeT9NS2INTK9n4sMjTawJs/3l3QIMY9G/IcW1J4eFBTagGlp6aAXmh7roWxg4TKLlK VKkvXELqUKHSMu5OXsGESXAZa3BPfb5Tw9a9yOh3gHJ1ki2BjRjxdNlON92Wz3jiX59e qiIg== X-Gm-Message-State: AOUpUlEMuG6kAWIQK3i2Dnrv+h+iZLNBPwVh42Nt9Pd3K21lH8Dl/YQN YYYMyZgD8IaTogfVbS+wu4Q/MQ== X-Google-Smtp-Source: AA+uWPwKO1JuIpFbcF9hCGl4Z2N9Gb2nIULk2ptlk0Wf4JMVvj0rcfICSyaEmmUe47WQRTcrriX/6g== X-Received: by 2002:a1c:c95:: with SMTP id 143-v6mr1950674wmm.50.1533825892131; Thu, 09 Aug 2018 07:44:52 -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 u4-v6sm1621317wro.47.2018.08.09.07.44.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 07:44:51 -0700 (PDT) Date: Thu, 9 Aug 2018 15:44:49 +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: <20180809144449.gjvtawgcae23z7ru@bivouac.eciton.net> References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-36-ming.huang@linaro.org> <20180804152039.hhbfyeyxqwv64itg@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: 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 14:44:54 -0000 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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? / 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 > >>