From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web12.36798.1591017549279475663 for ; Mon, 01 Jun 2020 06:19:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=Q956tmil; spf=pass (domain: nuviainc.com, ip: 209.85.128.47, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f47.google.com with SMTP id l26so10646913wme.3 for ; Mon, 01 Jun 2020 06:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TbsORUBelWkp77NSGZdncaR0iDGPfu16VdElLl6iJ9c=; b=Q956tmil3dh6srCpTxF3mDafVLAe9JYUTrrgXJSK7qY4FEYZcQS0SrH1vLZyfwCce4 25wIv8UE1akq3KVZxEoG9nNTZ2dMj9YBy9qoH5XR6uAIBt/0lJPjelETUZ7DwRAs/oCW qCHvsfkfT++1sZCGxKPMoasTE0pZzkyO/p7aeXVBg3g51qFNzfedAgtwbIpjS9Y/knTA ATHHbj4YlfnAVeFrU+hw3QLKsKo9l2kdTsSyqXZ+GGFsHRG3TSMVpOOGeVkGgOQyAXS0 sT4IqS4M2JGUATgmRddlVL5sLMHNgjtOEHhd4hPMiUuhzo+qi7hVNPUpQ3AXxQhCQHiF qJxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TbsORUBelWkp77NSGZdncaR0iDGPfu16VdElLl6iJ9c=; b=I2cRXjZn87jXQhctMFCYlWMrozGeqMsrbO8WCPKEbC2cq+SBc1pfkmdv7q4gVCJen0 apgr7JsObs9UvgoD2knW1fOpYg+uMBhC+YikEz+w/3ENL6sMtr0dVK5UN3DwVNmFY9E5 7OWHdpOfaxd/UQDOUMoRmmrAC1KI2AGI76/Djv3XX5U96FNQxZhV7JUV65YzPin4L4Km 0H1vYif+H0RizJRRkPzs0WV4G1iScjRqqRY+jwrrBH7pfj5EHC5RiaA/dHueGioKUJVd zc2c70IshHETnaf9sG3aqBStmnZQJnKMvswH5OKtJWCcYj+0HJJw9Xcljr8SkKSBxrhV 9dgw== X-Gm-Message-State: AOAM530WKQ75QUL+HcwSVt++noRF9mR9Ia78OXO0fYYNjB3mUfSa60Ad Kl9N7I4oKA21FGSBNU1XEDsa1eCAxPH+U86/2HOvWyy3sCXEr4r0HEIqb8D3a4SfHO5Vgvf4WNH WIz8NpE16viFCMDSO8banZnT3XBz6H0ybz2lj9SHDOBboQ+YwKJNLgJvDyyWkXTXzOg== X-Google-Smtp-Source: ABdhPJwOwTfjQJ6kjGVbBcO1R7F5KLa415+yeK1fEAbUp7EHmj1XOAAUvVS+HhWTTG2jHhv3R94PmQ== X-Received: by 2002:a1c:7fc5:: with SMTP id a188mr22980665wmd.59.1591017547535; Mon, 01 Jun 2020 06:19:07 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id a10sm11283000wmf.46.2020.06.01.06.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 06:19:07 -0700 (PDT) Date: Mon, 1 Jun 2020 14:19:05 +0100 From: "Leif Lindholm" To: devel@edk2.groups.io, ard.biesheuvel@arm.com Cc: alan@softiron.com Subject: Re: [edk2-devel] [PATCH edk2-platforms] Platform/OverdriveBoard: work around network ConnectAll() dependency Message-ID: <20200601131905.GF28566@vanye> References: <20200529214019.6063-1-ard.biesheuvel@arm.com> MIME-Version: 1.0 In-Reply-To: <20200529214019.6063-1-ard.biesheuvel@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, May 29, 2020 at 23:40:19 +0200, Ard Biesheuvel wrote: > The AMD Seattle based platforms have been kept up to date in recent > years, even though the hardware is obsolete and was never available > that widely in the first place. > > However, one aspect that has sadly been left behind is the support for > the builtin network controllers. These are only wired up and enabled > on the Overdrive board to begin with, and the driver was only made > available as two separate binary blobs implementing the SNP protocol > for each controller separately, without taking the UEFI driver model > into account. > > Even worse, the PHY initialization code that needs to run at boot in > order for the OS to be able to use the device never executes unless > the upper networking layers start the SNP protocol, which doesn't > happen on a fast boot (one that does not use ConnectAll()) unless the > boot target is a network device path. > > We cannot fix the driver, but fortunately, there is another way out: > protocols that are installed on a handle during the execution of the > entrypoint of a driver will be connected by the DXE core, and so we > can ensure that the old behavior is retained regardless of whether > ConnectAll() is ever invoked, by reordering the load sequence so that > the upper layer drivers have all been registered by the time the > entrypoints of the SNP drivers are called. > > This relies on FV contents to be dispatched in the order they appear > in the .FDF file. The AMD SNP driver as well as the upper layer > drivers in NetworkPkg are UEFI_DRIVER modules, which means their > DEPEXes are implicitly defined as the full set of architectural > PI protocols. This means that all these modules become available for > dispatch at the same time, and their dispatch order is fully defined > by the order of appearance in the FV. Unfortunately, this is an > implementation detail rather than something that is supported by the > PI spec, but this is unlikely to ever change since other platforms > undoubtedly exist that depend on this behavior as well. > > Signed-off-by: Ard Biesheuvel I'm holding my nose a bit, but: Reviewed-by: Leif Lindholm > --- > > This is a preparatory patch to ensure that this platform does not break > when core EDK2 drops the EfiBootManagerConnectAll() from the ArmPkg > version of PlatformBootManagerLib. > > Platform/AMD/OverdriveBoard/OverdriveBoard.fdf | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf b/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf > index 851ae65b5be9..15b5b1bc317f 100644 > --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf > +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf > @@ -178,18 +178,18 @@ [FV.FvMain] > INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > > - # > - # SNP support > - # > - INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort0.inf > - INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort1.inf > - > # > # Networking stack > # > !include NetworkPkg/Network.fdf.inc > INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf > > + # > + # SNP support > + # > + INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort0.inf > + INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort1.inf > + > # > # Core Info > # > -- > 2.26.2 > > > >