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.8221.1578574470671515439 for ; Thu, 09 Jan 2020 04:54:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=CBapwtLy; 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 w15so7309520wru.4 for ; Thu, 09 Jan 2020 04:54:30 -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=VdHk8on3daeBJJqEKEdfu+4v8MXvEGl5olIIX2s0rOA=; b=CBapwtLyXtyExb+qJ1JWOjrR7/uOtVVXt+8gG6nLEJF08jn0WywjW/napb4Bo/9wjN 8sI+ZcRqZoN9SZ1UEUIG4fQgiGjS3wNgrMdgwd5Y/P82ziJn5a9A+XqgZuorsEHXN6vN KdI/tgj3ZGzEg5x4SJbWTMO+Xj7DUOjthz/OHB/LUcsdMOtU2MxP/I51BWNuSH75cd3G YIb2VPt+zB8AkFJc0s1lOagqJMY9hwStl6Yt3w4A8Xc8+AvhTNNHI7+4btLVHiB5cu4s GjdZezS8nA09oFDCiCH8CgRG5jAvSYbBelIFY3SJFvQbvAK6PsvSnDJDCYoxVv13dJSI twzw== 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=VdHk8on3daeBJJqEKEdfu+4v8MXvEGl5olIIX2s0rOA=; b=XvCGC3SgsC3rdc5z89SioH8xDcRJWm27Dls3f3dntxyRbTI4d1T7djWPigGFsOYy6w hrKaEAtw5RNN/rrCPFzNg8vS7YldBRfqVx4FsAH0SDs+8WF4z92Tv93CL+mV4MNs0aHM s32RReSgnTFv7Khcv2fQTYmWx25RwJ7NyYzVV0JzvtfKSX0BeBmNgSdeppK5jG8MGJEu IVAjLC2lKJmW9eQiiwfSN3a0qahV3yT7yvwzWN5rBdY9kDANbbl+4aZ+taD5tKlLKxoe 8JB1aq4jKZHRbPbrW5pOG1cfMGJu6o6WMG9Dw29C97j1NRqRXuBulLb3SXrEMfcBxueK lYZQ== X-Gm-Message-State: APjAAAWO7lD8uUKowI/+D+6iJUNJiGKLixnOl5Y1EeGnFMVukMNO0IXe +UDCV851ZS0scelNDgF+s2p0L/x2lkkOvk26Lz4/ww== X-Google-Smtp-Source: APXvYqxbsEbcsjEebfmGYFiZgIL4doO/OXQAzUUviKXITtAKht4XqGB9r14XsGYgEbyp0gB6qpS1F5Z+fiKhi79JojI= X-Received: by 2002:a5d:6652:: with SMTP id f18mr11183720wrw.246.1578574469249; Thu, 09 Jan 2020 04:54:29 -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: Thu, 9 Jan 2020 13:54:18 +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 Mon, 23 Dec 2019 at 15:09, Ard Biesheuvel wrote: > > 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? > > Ping again? > > > > > > > > > > > -----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? > > > > > > > > > > >