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::243; helo=mail-lj1-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (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 8C826210FCF5D for ; Thu, 23 Aug 2018 04:12:33 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id j19-v6so3832992ljc.7 for ; Thu, 23 Aug 2018 04:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pi5yV4SiKw5gri+cgZd/VLYrLs08cb5AEZtOj3kJmIo=; b=TPOz0IUuVj0bKwQy6YU0iMFX9dXJZHvc8k9wkfob3WeQsMGg1Tn+Cp9XGKH/64AfzX u76e5HYMLG9CYP9KCjqLd9r0r0FEeI0sz+RrWq8++/rPXMPV9TrjsyySM4L/kTayy6Oh QPXC7my5BnKERA1jd0iPqC0WM4nSlvI0JGOc0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pi5yV4SiKw5gri+cgZd/VLYrLs08cb5AEZtOj3kJmIo=; b=ZlAAiuBtQojAB3+4Kuq8h0JxGD1Gtp5fGVCsI/DEUcra19Xs/taZlsUcyMU5tRYezj P8eCijK/VU5juL3lC8p1Zs9IGWeEY3lpTMxZx+gU+eREP552vo4IqxcjMIier0yK34Vt H48JJXhyHHbjUKIfhP67MxA91abuUNumA1dsP23XX+1Iox7Phwl6WQ1kOt79r7hsmmfx eOpIP5UOuWSeE+qWKLJL1eQno5As7yj7TLisPGQqALAtoDrG01MXXJwtqiVCFbUGvlWS xZ2Cz5T0LL685k0n9/d8HyuLxOzBMp2Z2jrUytAG42OVFt6JXYx85GHCtPkIGzWLt2UB HRVg== X-Gm-Message-State: AOUpUlG/X1xya1g20bSXHYdNjrmNvnZF8N72maa2KZivHT0UDL/ju2RW F899NYxL/iVGFlAos3e23snErU1tEjBdkImSh+5Kyg== X-Google-Smtp-Source: AA+uWPyVkB4wd2LtfdNrRWUWae/8E/6UQBzllgn04rtQvhVs/+9C/IkWWe1VQUita//WbLLl3xndltR2Rrld/f616Z8= X-Received: by 2002:a2e:80d3:: with SMTP id r19-v6mr22995439ljg.85.1535022751907; Thu, 23 Aug 2018 04:12:31 -0700 (PDT) MIME-Version: 1.0 References: <20180816121239.44129-1-ming.huang@linaro.org> <20180816121239.44129-33-ming.huang@linaro.org> <20180821211145.yn2fgvgjdwkepwel@bivouac.eciton.net> <6cf5a20d-b648-1ae8-043d-75f241fc4123@linaro.org> In-Reply-To: From: Leif Lindholm Date: Thu, 23 Aug 2018 12:12:21 +0100 Message-ID: To: Ming Huang Cc: Linaro UEFI , "edk2-devel (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 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Thu, 23 Aug 2018 11:12:35 -0000 Content-Type: text/plain; charset="UTF-8" I don't see how it would be less risky to include new code rather than using the existing and well-tested solution for the same problem. On Thu, 23 Aug 2018, 11:51 Ming, wrote: > Hi Leif, > > Is it ok replace with ConsolePrefDxe after ERP 18.08? > > > On 8/22/2018 10:49 AM, Ming wrote: > > > > > > On 8/22/2018 5:11 AM, Leif Lindholm wrote: > >> 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? > > > > Yes, I will take a look ConsolePrefDxe and replace with it after ERP > 18.08. > > > >> > >> / > >> 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 > >>> >