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.web12.4377.1575642698064257447 for ; Fri, 06 Dec 2019 06:31:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=X1gTOdcy; 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 g17so8026651wro.2 for ; Fri, 06 Dec 2019 06:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W80DOPT5Fjy3tEyVCCT+EZ0MjAI1KvAjVfJ26+bxPDw=; b=X1gTOdcySbL18NYPSiwQibGzSCENnQVe1WKgksUByv45z1w4VzSuYpmZfcjPR/gwmD BUS066HiDWCPfQah7uCs90MzXIr9xIMToUH1CVQBm7XkK3z/KVNHHTM8sh6EWDd1e1iP Xa4h3u/tisL6nmxyTTkb5OvPnBdAc6OqMqJ42QxqkGiFi/Qe/yIwh5UxOf5SaZLIdMgc dADNNnKXUI/SRwTmpx/3XYm5ayCj8ZC9+C2SIh5di0X8qAVmQrUFJr1BO+sP0QKr4J2p mdfyTdV/g+MxgB+CV4fqXlM7ha5XjKuLALtNvErw1IJA87W6wEnWtemmsYfBGI1P+WUF ru1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W80DOPT5Fjy3tEyVCCT+EZ0MjAI1KvAjVfJ26+bxPDw=; b=LpE2xvIDFG4K4imbkBYs+EVN93j8SUO3O6Mfbm6v/3xYYS391AQ1KtDORWaFf7FUW/ IQ7HrXAG1dyV1/Gr5PjEiWfa72C88Moi+t4Pw6MkdT6N3kM6HBeoP8uU+S6nDdi5ySWk EnntW31ZcP0vTqBMz3YeW2NHzEpZrsCo2r1kXhVNBpJHqZnVC2EGl1VWWG0Ee6AhkLAB j6xnE3MGq8IlV2WpXy9VcybtUhS3FeDsdJwE5y7zLlIwr1DDbRHuA57xjDFCBybJg1+Y +iFF/13/A6CpV5xd8PFy2ok/7PN26LZ074QOGW7ETGmOzstu9yePjpuSmZSIBg3fLpWb wZQQ== X-Gm-Message-State: APjAAAXbv/mf7bnoqOXkZa0pc9zpw92tS4ViS2u3V098RCYOXIDhRVWz SmElsJ3in96/wNg/6gtNXM2GWZYTNQqvTO2p X-Google-Smtp-Source: APXvYqz0KRHi/NNR1UR5XfRGhu7JK5guRZJ9mNP/9l4NYJQ5WHYJx2g8h4mzhrfhEoN7qo1ezNnV+w== X-Received: by 2002:adf:f88c:: with SMTP id u12mr16922426wrp.323.1575642696461; Fri, 06 Dec 2019 06:31:36 -0800 (PST) Return-Path: Received: from sudo.home ([2a01:cb1d:112:6f00:488a:43c8:1cd8:def8]) by smtp.gmail.com with ESMTPSA id b63sm3281032wmb.40.2019.12.06.06.31.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Dec 2019 06:31:35 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Laszlo Ersek , Zhichao Gao , Ray Ni , Maurice Ma , Guo Dong , Benjamin You Subject: [RFC PATCH 2/2] MdeModulePkg/BdsDxe: allow consoles on drivers loaded via Driver#### Date: Fri, 6 Dec 2019 15:31:28 +0100 Message-Id: <20191206143128.19371-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143128.19371-1-ard.biesheuvel@linaro.org> References: <20191206143128.19371-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently, we dispatch drivers specified via Driver#### entries after calling PlatformBootManagerBeforeConsole(), which prevents us from loading drivers that provide consoles via Driver#### entries. This is particularly annoying on AArch64 systems, given that it prevents us from loading AArch64 drivers from the ESP for PCIe graphics cards that shipped with x86 drivers in the option ROM, which is the common case today. So let's reorder the handling of the Driver#### entries with the invocation of PlatformBootManagerBeforeConsole(), which results in Driver#### entries being dispatched in the same way as option ROM images. Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index 1fb04dcbbcda..ad4c4c0406f6 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -850,6 +850,14 @@ BdsEntry ( } } + // + // Execute Driver Options. Images will be loaded but dispatch will be + // deferred for 3rd party images until EndOfDxe is signalled. + // + LoadOptions = EfiBootManagerGetLoadOptions (&LoadOptionCount, LoadOptionTypeDriver); + ProcessLoadOptions (LoadOptions, LoadOptionCount); + EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount); + // // Do the platform init, can be customized by OEM/IBV // Possible things that can be done in PlatformBootManagerBeforeConsole: @@ -868,13 +876,6 @@ BdsEntry ( // EfiBootManagerStartHotkeyService (&HotkeyTriggered); - // - // Execute Driver Options - // - LoadOptions = EfiBootManagerGetLoadOptions (&LoadOptionCount, LoadOptionTypeDriver); - ProcessLoadOptions (LoadOptions, LoadOptionCount); - EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount); - // // Connect consoles // -- 2.17.1