From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (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 17EAF803B1 for ; Wed, 22 Mar 2017 07:12:35 -0700 (PDT) Received: by mail-it0-x22e.google.com with SMTP id y18so24949179itc.0 for ; Wed, 22 Mar 2017 07:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0/gQGjQcTHdpYNhkOBDXfFP6RjPtk59ayi+8FCuHhMg=; b=dKuSRZzeiyvEOvzLCElFJxxDCu0y1pT3l4Sv/JsOv3Jqm637tTPG7J/XwB9Pme2qzG 2GzZqY9QiYbLwQlpeAU7hx8RA8bISNtueTGdd/l3LZPgSg3Uw1xOnv9laH1mMPCKZ7wh dslLILcr/QbSXardoc6cqPPlGkr2m0QJjflnE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0/gQGjQcTHdpYNhkOBDXfFP6RjPtk59ayi+8FCuHhMg=; b=JnMDEgnas0KmIfO3s9MuiS/0+ZL4Sk5K7SGQnurVYweE+tUPwL6xG7aG83bOk/gSqc 2Fg2ptILrc6jkcGbVg89rzuU8WiK4iyb/Qq5stLwtUidwGijVCplqCLQbSy8KEHgULjM I0aZicyTCSMxTOoswIlxIKyR/MFzEfC8esyysP23ASbWUYlxM56tx2FaCcfhoF8Mppz+ WNItT6Wl9yJMFe5McjJwZ+XQGS7e6E60xz03zgG/6V85BOw3V35+5OqmbvWDjuhr4ley v6BtCDa1NKhGLNJFBFdf5LWYw+k3tkJSPaedGur6OixATSjk3cKvOol2cwALRSIzv0FP xPOA== X-Gm-Message-State: AFeK/H3u9c6tFKi+96Z7JL0kxm1MqANyFwRKvp1tUZLceGfDr7p8Con/WMH2hiy2zPtw65DGbUeEYIBiVOXR3qH+ X-Received: by 10.36.207.212 with SMTP id y203mr7831080itf.63.1490191954353; Wed, 22 Mar 2017 07:12:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.27 with HTTP; Wed, 22 Mar 2017 07:12:33 -0700 (PDT) In-Reply-To: <20170317204731.31488-2-lersek@redhat.com> References: <20170317204731.31488-1-lersek@redhat.com> <20170317204731.31488-2-lersek@redhat.com> From: Ard Biesheuvel Date: Wed, 22 Mar 2017 14:12:33 +0000 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 , Leif Lindholm Subject: Re: [PATCH v2 01/12] Revert "ArmVirtPkg/FdtClientDxe: make DT table installation !ACPI dependent" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2017 14:12:35 -0000 Content-Type: text/plain; charset=UTF-8 On 17 March 2017 at 20:47, Laszlo Ersek wrote: > This reverts commit 78c41ff519b187d8979cda7074f007a6323f9acd. > > We realized that DXE drivers that are independent of AcpiPlatformDxe (that > is, independent of QEMU's ACPI generation), such as RamDiskDxe and > BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables, > at driver dispatch or even at Ready To Boot. > > This makes it unsafe for us to check for ACPI presence in the UEFI system > config table in a Ready To Boot callback, in order to decide about > exposing the DT. > > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel > --- > ArmVirtPkg/ArmVirtPkg.dec | 10 ++++++++++ > ArmVirtPkg/ArmVirtQemu.dsc | 5 +++++ > ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 5 +++-- > ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 16 +++++----------- > 4 files changed, 23 insertions(+), 13 deletions(-) > > diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec > index efe83a383d55..a5ec42166445 100644 > --- a/ArmVirtPkg/ArmVirtPkg.dec > +++ b/ArmVirtPkg/ArmVirtPkg.dec > @@ -58,3 +58,13 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] > # EFI_VT_100_GUID. > # > gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007 > + > +[PcdsFeatureFlag] > + # > + # Pure ACPI boot > + # > + # Inhibit installation of the FDT as a configuration table if this feature > + # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI > + # description of the platform, and it is up to the OS to choose. > + # > + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|FALSE|BOOLEAN|0x0000000a > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 0bbbe4a7aa4a..d6b3c0db5530 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -34,6 +34,7 @@ [Defines] > # -D FLAG=VALUE > # > DEFINE SECURE_BOOT_ENABLE = FALSE > + DEFINE PURE_ACPI_BOOT_ENABLE = FALSE > > !include ArmVirtPkg/ArmVirt.dsc.inc > > @@ -94,6 +95,10 @@ [PcdsFeatureFlag.common] > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE > > +!if $(PURE_ACPI_BOOT_ENABLE) == TRUE > + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE > +!endif > + > [PcdsFixedAtBuild.common] > gArmPlatformTokenSpaceGuid.PcdCoreCount|1 > !if $(ARCH) == AARCH64 > diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf > index 9861f41e968b..00017727c32c 100644 > --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf > +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf > @@ -37,16 +37,17 @@ [LibraryClasses] > HobLib > UefiBootServicesTableLib > UefiDriverEntryPoint > - UefiLib > > [Protocols] > gFdtClientProtocolGuid ## PRODUCES > > [Guids] > - gEfiAcpi20TableGuid > gEfiEventReadyToBootGuid > gFdtHobGuid > gFdtTableGuid > > +[FeaturePcd] > + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot > + > [Depex] > TRUE > diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c > index 21c1074e331c..4cf79f70cb2a 100644 > --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c > +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c > @@ -17,11 +17,9 @@ > #include > #include > #include > -#include > #include > #include > > -#include > #include > #include > #include > @@ -318,16 +316,12 @@ OnReadyToBoot ( > ) > { > EFI_STATUS Status; > - VOID *Table; > > - // > - // Only install the FDT as a configuration table if we are not exposing > - // ACPI 2.0 (or later) tables. Note that the legacy ACPI table GUID has > - // no meaning on ARM since we need at least ACPI 5.0 support, and the > - // 64-bit ACPI 2.0 table GUID is mandatory in that case. > - // > - Status = EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Table); > - if (EFI_ERROR (Status) || Table == NULL) { > + if (!FeaturePcdGet (PcdPureAcpiBoot)) { > + // > + // Only install the FDT as a configuration table if we want to leave it up > + // to the OS to decide whether it prefers ACPI over DT. > + // > Status = gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTreeBase); > ASSERT_EFI_ERROR (Status); > } > -- > 2.9.3 > >