From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web09.3134.1577110169029798562 for ; Mon, 23 Dec 2019 06:09:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=PDLdjTOX; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f65.google.com with SMTP id c14so16723703wrn.7 for ; Mon, 23 Dec 2019 06:09:28 -0800 (PST) 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=GV9Kiw8GqgqEDSMZS2z90lFp2usZRAhiFjyOtL8H3y8=; b=PDLdjTOXnwm0pgQ9I31K7IE6vwBkNzboS4pMJ7D/OwdtwJCe8lThJ6Nqc2XmwGrFN4 O3TK0AQjQap8ED5rdSsY+4N3eAPEYapTyZy8ZH6qzSxTZqo87ZYWY13cmbbmtWf5pkwe DtEM0JfiDQSTUrYrK1DYeX4eZonTSMg0VjWwf5rRTIZofK0EKdhqq6Ce+n8nrrVj9rfD tHy24NEk1CxJDsr0xWK1PwV19zY6jJ8dEkDcWTrbHMABpsr4xCjGvlbVwKWhQNQIdE1q iDbLHvA08I+ZsSWEEXGU0fc8DPGQRpvOzCri2GWkW5z9tRrKf4n23kv4j7cGLFRv53If Yrkg== 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=GV9Kiw8GqgqEDSMZS2z90lFp2usZRAhiFjyOtL8H3y8=; b=YjaZsunAZy5si37O9mrTqnINB6qUDlFQaSx7DpGUlXw0SqbSqSZjeNdMaLsWjEJxHd 1atiKtjg8XuUKH5TJ2c1cPR5LRvt1qs5Wg/gtv6X9b3blZsYt7W9aUYffTdKL/qT42uN +inDE4y6dxlMTxcUk5hrXViynNLJSaBg+pr7VuLtsvV7/94Lm/KVkEVF+caYUlpGJPb+ JPXOkNqpv9jGqnBlYxV1bmwC5lAL70GPWD2Bhcja+ahiVtIXUnfrV61RrsDIBNktjx+B lczASRe2npUI7mgDs5n6kpZViEtsjBuhd/o/cQDh+lCCnraRqrBdc6ntryxh9OcLR6pq 89Ow== X-Gm-Message-State: APjAAAU+g0mF0AywxcsI8JWW3u+P7VAilFgBK9eR9So/61aHDacpHPyR XfFdvFA51CwI+dkJjS6aEBa5ax9JbPJvqDScmm/ycA== X-Google-Smtp-Source: APXvYqyuXngjh38mXpfeeT7KYUQWUSy0RVClhJWfnudWZro1yTwd00eFkMZmGUSA4UzKlePPQpNcYCRdJZgAg2LIqSg= X-Received: by 2002:a5d:5345:: with SMTP id t5mr31761949wrv.0.1577110167619; Mon, 23 Dec 2019 06:09:27 -0800 (PST) MIME-Version: 1.0 References: <20191206143128.19371-1-ard.biesheuvel@linaro.org> <20191206143128.19371-3-ard.biesheuvel@linaro.org> <8d49cca6-b1b9-cddc-0590-4e4a84643e4f@redhat.com> <734D49CCEBEEF84792F5B80ED585239D5C39604F@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C399C9C@SHSMSX104.ccr.corp.intel.com> In-Reply-To: From: "Ard Biesheuvel" Date: Mon, 23 Dec 2019 15:09:16 +0100 Message-ID: Subject: Re: [edk2-devel] [RFC PATCH 2/2] MdeModulePkg/BdsDxe: allow consoles on drivers loaded via Driver#### To: "Ni, Ray" Cc: "devel@edk2.groups.io" , Laszlo Ersek , Leif Lindholm , "Gao, Zhichao" , "Ma, Maurice" , "Dong, Guo" , "You, Benjamin" Content-Type: text/plain; charset="UTF-8" On Thu, 12 Dec 2019 at 10:05, Ard Biesheuvel wrote: > > On Thu, 12 Dec 2019 at 09:59, Ni, Ray wrote: > > > > Ard, > > I still cannot understand it. > > > > Since Driver#### are processed (process = LoadImage + StartImage) after EndOfDxe, they are not deferred. > > It means the Driver#### entrypoints are called directly. > > Inside the entrypoints, driverbinding protocols are installed. > > > > After that, EfiBootManagerConnectAllDefaultConsoles () uses driver model logic to start the proper GOP driver. > > > > It only does that if the GOP console is already in the > ConIn/ConOut/ConErr variables, no? > > Today, we have code in the PlatformBdsLib to traverse the PCI > hierarchy to populate those ConXXX variables if we encounter any PCI > graphics cards, but this is done in > PlatformBootManagerBeforeConsole(), so if the Driver#### is loaded > *after* PlatformBootManagerBeforeConsole(), it will not be added to > ConXXX. So we need to process Driver#### before calling > PlatformBootManagerBeforeConsole(), so that the driver is dispatches > right after we call DispatchDeferredImages() but before we do the > traversal and populate the COnXXX variables. > > How else do you propose we could make PCI graphics controllers > supported by Driver#### options appear in COnXXX before > EfiBootManagerConnectAllDefaultConsoles() is called? > Ping? > > > > > > > -----Original Message----- > > > From: devel@edk2.groups.io On Behalf Of Ard Biesheuvel > > > Sent: Wednesday, December 11, 2019 6:40 PM > > > To: Ni, Ray > > > Cc: Laszlo Ersek ; edk2-devel-groups-io ; Leif Lindholm > > > ; Gao, Zhichao ; Ma, Maurice ; Dong, Guo > > > ; You, Benjamin > > > Subject: Re: [edk2-devel] [RFC PATCH 2/2] MdeModulePkg/BdsDxe: allow consoles on drivers loaded via Driver#### > > > > > > On Mon, 9 Dec 2019 at 09:42, Ard Biesheuvel wrote: > > > > > > > > On Mon, 9 Dec 2019 at 03:12, Ni, Ray wrote: > > > > > > > > > > > Exactly. This flow is identical to how option ROMs are processed if > > > > > > they are discovered before EndOfDxe signalling completes (which is why > > > > > > the Juno platform was broken without the call to > > > > > > EfiBootManagerDispatchDeferredImages() in > > > > > > PlatformBootManagerBeforeConsole()) > > > > > > > > > > > > > > > > Ard, > > > > > I checked ArmPkg's PlatformBootManagerLib and found it doesn't > > > > > call *DispatchDeferredImages() after signaling EndOfDxe. > > > > > > > > > > > > > It does. We just added this in 0f9395d7c5cc6ae2beaa2d87008fe158d04a8069 > > > > > > > > > The deferred image dispatch mechanism assumes the platform > > > > > needs to call the *DispatchDeferredImages() after signaling EndOfDxe. > > > > > > > > > > > > > Indeed. > > > > > > > > > I don't understand why the deferred image can be loaded with your patch. > > > > > They are still deferred because the loading time is before EndOfDxe. > > > > > > > > > > > > > Yes, but because PlatformBootManagerBeforeConsole () does all of this, > > > > the only way to get Driver#### to work for consoles on GOP drivers, we > > > > need to move it before that call. > > > > > > Any further comments on this patch? > > > > > > > >