From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::244; helo=mail-pl0-x244.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::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 0AA2D210F3D98 for ; Thu, 23 Aug 2018 04:59:15 -0700 (PDT) Received: by mail-pl0-x244.google.com with SMTP id s17-v6so2315591plp.7 for ; Thu, 23 Aug 2018 04:59:15 -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-language:content-transfer-encoding; bh=/sudllTHcSL7JNiHZRW5gqDmT77JLfy2Linxh/RdDh0=; b=YQBWfAw7bMpnQzTeQoMG75vptJxNRs4feoaA7aBtDrLQQ8gNfE3O3q3TFgxxG5Rwun 0NIMWLk1/eDc9ozoA8viJYxLH1mTg88GHkfxaDky/ZSdhIRqTAwR36FcNHHGHzvlF/jz Uf8esz3XyNV8bCW+FhUhTIQAu1+WikH/7HtyM= 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-language :content-transfer-encoding; bh=/sudllTHcSL7JNiHZRW5gqDmT77JLfy2Linxh/RdDh0=; b=RWCx/rQtQgKm73IsHA508xGN7Bx4c8UnHbkzY2pqILjFuPQJsdoJxpDuMJ5QhLorbi i3ZhjjW/X8+reJjaKYsJELxSaL5aP+Wasd+8T1JD+WLzoM2inibmXfkCrSVkLEUk19NB 5T4iibWJ9/wVjNIPBYIY7NbkUaHZQhYctZQGbu1wzmfLMRM7oh7hMY4TZ4p0uncZ81PS GIXmRXQJHE9MayjPKytlR6PnzMaesWX0ic12DouRI9n4V2dxbDuNA/yX+8wS6L7FfMf7 eV+a6UIzsi3Z8vq8XAfd4nM3SQWNXFL4iAtlOKwC0IN+Bdi0F1HIA7qDwY2hga41VzmI ugSw== X-Gm-Message-State: APzg51DnZvU7pIyba94CARQburcCKAYJHfHM4+DjS+sxrGz7XlYZJ9Yd CGIvX35RLBkLbAx8g53+r2yA9Q== X-Google-Smtp-Source: ANB0Vdb5xEgJdOsIkLawJ871C/M2R3AiLOEL5/xWyK2VbWYYBOJ6iozOAfhHiFVq3z+xjvu4eKwCqg== X-Received: by 2002:a17:902:e85:: with SMTP id 5-v6mr6065342plx.73.1535025554808; Thu, 23 Aug 2018 04:59:14 -0700 (PDT) Received: from [10.84.0.214] ([64.64.108.140]) by smtp.gmail.com with ESMTPSA id n18-v6sm7031642pfa.50.2018.08.23.04.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 04:59:14 -0700 (PDT) To: Leif Lindholm 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 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> From: Ming Message-ID: <772dbc09-506b-37ba-999a-5f7c6f5c7692@linaro.org> Date: Thu, 23 Aug 2018 19:58:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: 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:59:16 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 8/23/2018 7:12 PM, Leif Lindholm wrote: > 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. OK, replace with ConsolePrefDxe in v4. > > 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 > >>> >