From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (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 97D5C210E3DE5 for ; Thu, 9 Aug 2018 08:40:28 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id r5-v6so2937008pgv.0 for ; Thu, 09 Aug 2018 08:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=emNrbkAH+nobWcp/BXwMQjADeo3CSqG7QPPPXzKz1fM=; b=MDU4vyDiqSM/eH/1tDNzm7ZWsekydIscVehhnr1dPLpdG0IPPIiQzhcsq6WeMhL/n2 pVJL5KkLAm7xUZhYKAJ3QgGzmG6ZTHdxUimNLMGzD0yuubsizL+LD75sFQ/hZScleJVw xbXVOF/fnb2l5AhZ4Mr7T9/lqeOpZUfZhD+rU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=emNrbkAH+nobWcp/BXwMQjADeo3CSqG7QPPPXzKz1fM=; b=s9l22+Z/1ZC1sHYFfNoopjQV5913o25Hf9bZ7PCDswvzqakLhXZtpKk4QLp3ROMSyf Kl8KRPdm1J6eh4gt6Xcb2SDDo5UJLDgW4zxyOcjGrx+eDeDsm5pGNkYoa3XTEuQAjmgI U4c+oytr1P8IzltyBf0Vua5p57tGam/89KvNA4xDwTwhyDoXazC/UwtElFJ5nZUKcTet s+GG/sNwMliTqMg1jhucy+nggdN93nt6xtELYyUHZcV78KMaZXJx+te9V6vSyImypHPl nRyUNx7Q5OHubTdRB9QwIzMo98B7+OfxieCmW9Edp7TIcTJsO4x52RkEBTxqf7YQVxEA 0fwQ== X-Gm-Message-State: AOUpUlFkvn2joWGn6qz6ApZWCVVTIezbLGb8b+hjlkiuOEPPbV1qtES7 wnWQVQHWmRhX2uJntwOgY90/SQ== X-Google-Smtp-Source: AA+uWPzvGDAOfHvy3yMk25zXN1n+HcMOeuft6pZBTSC9pVYWjKZmboQB8vkibfyv6DYx1pixjjm9qA== X-Received: by 2002:a63:3c0c:: with SMTP id j12-v6mr2625552pga.440.1533829228077; Thu, 09 Aug 2018 08:40:28 -0700 (PDT) Received: from [10.199.0.182] ([64.64.108.224]) by smtp.gmail.com with ESMTPSA id g11-v6sm18872042pgi.90.2018.08.09.08.40.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 08:40:27 -0700 (PDT) To: Leif Lindholm 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 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> From: Ming Message-ID: <568e1549-1395-528a-852a-996699854aef@linaro.org> Date: Thu, 9 Aug 2018 23:40:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180809144449.gjvtawgcae23z7ru@bivouac.eciton.net> 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:40:28 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 在 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? Do you suggest this patch is not need and add ConsolePrefDxe to dsc/fdf? > > / > 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 >>>>