From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web11.1642.1575626563988083940 for ; Fri, 06 Dec 2019 02:02:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=z0Y2WM8k; spf=pass (domain: linaro.org, ip: 209.85.221.68, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f68.google.com with SMTP id z3so7112981wru.3 for ; Fri, 06 Dec 2019 02:02:43 -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=cX5m1GASo9237PcGHlIBueDmsD/32pt40bVt8aLV0Ww=; b=z0Y2WM8kiGdPkBAo7Jw9l/HpvjefAbGxDJw78gCZTbRzUomRsRxrrjIKqOR4sfS5u5 84HBEV8v0/etueUz4Q4XdipErDd6kMEuSYZPCFAVh8wiy1oaf34vB6nlnOGmgdjDA2aO OHcdHNFI0Awb5SxkZ9EQdkHre7otLQDvYwtUiNPSryH/Acdqtq0V67/O6B685WCfcooL D84qTwo7s8UDprzbSQcdnnjoruymIt3rZUJVeQRWqZZ6JlLglrpC6uRsjjt4rT5/aOk4 mAB6J1kr6Wf6tgNjVXnsP/oHe5QVu0eHcKTQ4A7zVhne47WpPUPNm6zb8bnBmFIsi8Hw LefQ== 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=cX5m1GASo9237PcGHlIBueDmsD/32pt40bVt8aLV0Ww=; b=RmdN45K6CeURqZuHUSQzVjERIS5cheRnWpARWXITEhoCCB02O8mGeuEHZWtFguieUa 8donl3yjzaWHSj4B3paa9qxhY56CHuRIoE2nL7HfPSsEprHNBBcF2MXYt1GFCNiFnZW4 oN/qz29/AyxtcNO41e76ic9Klgi52Eusiw3xp63ZAhi6kTyyzx+v6Gj66eyjRYno5qge 9ljPUxNRTMsnE2iitafiIN/sPdorX4zA1md3JpmQdRkiUOn3KKzjaN1JXe3QXEvXe7BE EfRuOA/FvjbV9qFjjrjWY+hZiJoD56ZNvKQdZd3owMK0u3++hsrLjHcO4+dMtYV1NIrb DrVQ== X-Gm-Message-State: APjAAAVFyzJ1qkXK9rFCJti8VEYlVh+uSI5irQ4NklEQ6lZLw2hyi22J JAV2+z3CDLGKLe3KKe1IX2Q0sGfFlmhXWsRpBAkcCA== X-Google-Smtp-Source: APXvYqzPFReQF9yk4aBgJmEcxQsWlozcJasRBPjBktJg2ZnCw6hqgAt6gnfkytOVt6RmrI3Z9QYs0BS24LaBKUaHYtc= X-Received: by 2002:a5d:46c1:: with SMTP id g1mr14565818wrs.200.1575626562424; Fri, 06 Dec 2019 02:02:42 -0800 (PST) MIME-Version: 1.0 References: <20190501140146.33224-1-sami.mujawar@arm.com> <2689eabf-b2a4-466b-d0cc-f8786e7a35ee@redhat.com> <65b6fbb9-200f-1a78-db72-f75ea65f5919@redhat.com> In-Reply-To: <65b6fbb9-200f-1a78-db72-f75ea65f5919@redhat.com> From: "Ard Biesheuvel" Date: Fri, 6 Dec 2019 10:02:39 +0000 Message-ID: Subject: Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: Dispatch deferred images after EndOfDxe To: Laszlo Ersek Cc: edk2-devel-groups-io , Sami Mujawar , Leif Lindholm , Matteo Carlini , nd Content-Type: text/plain; charset="UTF-8" On Fri, 6 Dec 2019 at 00:05, Laszlo Ersek wrote: > > On 12/06/19 00:54, Laszlo Ersek wrote: > > On 12/05/19 21:25, Ard Biesheuvel wrote: > >> On Wed, 1 May 2019 at 15:02, Sami Mujawar > >> wrote: > > >> I'm still curious why this difference exists, > > > > What difference do you mean? > > > > (I can't see the original patch posting in my list folder, so I could > > be missing parts of the discussion thus far.) > > Haha, I missed that Sami's email, which you just replied to, is dated "1 > May 2019" -- that's the reason I couldn't find the original posting in > my edk2-devel folder. That message has already been moved into one of my > archive folders :) > > But, now I do see it, and I also see that your first question in > response was spot-on: > > https://edk2.groups.io/g/devel/message/39901 > > (alternative link: > > http://mid.mail-archive.com/CAKv+Gu92gPzGvGZ3M9B52q1TOAvnBjgxpvykbAZPevMULkcF6w@mail.gmail.com > ) > > Your question there had a small typo -- I think you meant, "It might be > that the PCI hierarchy is enumerated *after* EndOfDxe on Juno, and > *before* on the other platforms." > > And yes, that would explain the difference between Juno and {SynQuacer, > Overdrive} very well -- i.e. why Juno was broken and the other platforms > were OK. (Assuming in all cases, the 3rd party dispatch occurred after > EndOfDxe, where it is supposed to.) > Hi Laszlo, Thanks for chiming in. My question did not have a typo: if Juno enumerates PCI before EndOfDxe, any option ROMs it encounters will not be dispatched and put on the deferred list, which never gets processed. If it enumerates after EndOfDxe, they just get dispatched immediately. That would explain this behavior, *except* for the fact that these platforms use the same PCI host bridge and bus drivers, the only difference is the PciHostBridgeLib used. The difference is probably explained by the explicit gBS->ConnectController () connecting the PCI root bridge that takes place in ArmJunoDxe in an EndOfDxe handler, which seems to be there so we can set the MAC address on the Marvell Yukon. We should probably move that to a protocol registration notification callback on the PciIo protocol, and remove the ConnectController altogether. Concerning your analysis regarding the order of connecting the PCI root bridge and signalling EndOfDxe: I agree the OvmfPkg order is better, since it permits builtin drivers (which are 'trusted') to attach to devices in the PCIe hierarchy before EndOfDxe is signalled, which may be useful.