From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::144; helo=mail-it1-x144.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x144.google.com (mail-it1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9B4DA2194EB70 for ; Wed, 6 Mar 2019 08:41:42 -0800 (PST) Received: by mail-it1-x144.google.com with SMTP id l15so11136003iti.4 for ; Wed, 06 Mar 2019 08:41:42 -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=9I/6FXDVCvizoqcLtGWt2BGblBc5kS+bn/9lKn6bWhI=; b=AOhkqU3czJvt6ROMNBCpSmoIzvzpp+lSq0gGl7KcMpcADlJRojocUfCJZKzmk2OjnG SQX9yKYbS1vZCNx8P0pFmR1clRKYEMcsFXKc5m9YCG+aN1Ktr0xt6OyFBEU2mlccdIgS gIpHyPmRFcyu3+HvLFuWr2iAiOpvA9rfd6q+y9kq80ODji38ogJuj9yl5N28lg15gbvu WVmggnJpQqeF/tfdTsDDULEckZgfRAKr45X8BG4d0NXynzkEWyK8I0b45+gXpSxnTLBe LsDDxZlhJPH1M3cbxQwS63O6WPO2f7mEFgc7qlHfXvqI50EgovgnnFSeK0vSt9D+lrPw Dw0g== 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=9I/6FXDVCvizoqcLtGWt2BGblBc5kS+bn/9lKn6bWhI=; b=lblxlMxMjkFfA+XT1UxmfkPnbviSgyFYo8lE9oOPmYXLZyp2IfTTLmxgbcvyedLqcf wp/ZlAhZQQjnybRNl0hGFpEbkZ7FOyBbBtEXGmp2VnC9GQ+9T6cHybJlKoC2DQjAGGPO OJwIfg/v1pHUUEzsjKHsImHSiVZNJlv64oukYsmHEoHzV6kWpJ1n2OHdP6RiJnJpOL9J 4uQ9mt7s444EXa6C77OB0uFX2aQQQrbUrPcJ6dT+iEevxI3m0Q1jagoFIaepjITlz+lN ZCWfPYZ+3BJkUGYeQU+fV9YuLbcV8W/hd38XQce92Qyz5PY+wPCrQv5hZIOQA/sQbBJj 2e6w== X-Gm-Message-State: APjAAAVDUSQ90+LdquIfthP4U6lnn3pEBZTGwmk5Bl44ZAYgdi3xTuUt AxmHAT3w3Aur/i9eVGO1+VBwuwy0VMXJn3nljBBz8g== X-Google-Smtp-Source: APXvYqxdScfI8ClA+fyB2P+Ru6zJdUBHO8TWUZjLYU+j9l24SckD2HTunhdp0FpCRimanta94BSQTBLJXBk3u+JqerM= X-Received: by 2002:a02:3342:: with SMTP id k2mr4528133jak.62.1551890501712; Wed, 06 Mar 2019 08:41:41 -0800 (PST) MIME-Version: 1.0 References: <20190305133248.4828-1-ard.biesheuvel@linaro.org> <20190305133248.4828-6-ard.biesheuvel@linaro.org> <20190306163458.GQ21602@mac-ubuntu-vm> In-Reply-To: <20190306163458.GQ21602@mac-ubuntu-vm> From: Ard Biesheuvel Date: Wed, 6 Mar 2019 17:41:30 +0100 Message-ID: To: Achin Gupta Cc: "edk2-devel@lists.01.org" , Supreeth Venkatesh , Jiewen Yao , Leif Lindholm , Jagadeesh Ujja , nd Subject: Re: [PATCH 05/10] StandaloneMmPkg/StandaloneMmCoreEntryPoint: drop explicit SerialPortLib call X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2019 16:41:42 -0000 Content-Type: text/plain; charset="UTF-8" On Wed, 6 Mar 2019 at 17:35, Achin Gupta wrote: > > Hi Ard, > > On Tue, Mar 05, 2019 at 02:32:43PM +0100, Ard Biesheuvel wrote: > > Sending DEBUG output to the serial port should only be done via > > DebugLib calls, which is in charge of initializing the serial > > port when appropriate. So drop the explicit SerialPortInitialize () > > invocation, and rely on normal constructor ordering to get the > > serial port into the appropriate state at the right time. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Ard Biesheuvel > > --- > > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c | 3 --- > > 1 file changed, 3 deletions(-) > > > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > > index 5cca532456fd..c8e11a253d24 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > > @@ -232,9 +232,6 @@ _ModuleEntryPoint ( > > VOID *TeData; > > UINTN TeDataSize; > > > > - Status = SerialPortInitialize (); > > - ASSERT_EFI_ERROR (Status); > > This is done in the first few instructions after EL3 ERETs into S-EL0 to > initialise the StMM partition. The constructors will be called a bit later. I > agree with the change but does EDK2 provide a mechanism for early prints to the > console in case we need this in future. > If so, the correct way to achieve this would be to call the DebugLib constructor by hand, and that should call the SerialPortLib constructor. Unfortunately, EDK2 is not put together like that, and especially constructor ordering is slightly broken.