From patchwork Tue Jul 14 16:48:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 51110 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 19837202B9 for ; Tue, 14 Jul 2015 16:48:55 +0000 (UTC) Received: by wgwk7 with SMTP id k7sf4369941wgw.0 for ; Tue, 14 Jul 2015 09:48:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=0A8w9snFkzkmWZ7+5fbFVE8pV8XFMcJT8unhxSCjYUE=; b=YtnS+YV+PD/RsednlxeKZUSiShUw0W7oovXNqj2A57CKXtz1UlHrbL69cmpjilXqqf Q0dEv2YBiLW1nqFd/PgfxttQmzNM3TIT0GNDIzaOvYR8oayEEbmxlwJS52VDyvUWnLF9 xUOyMvlLkQG1ZFquSJKNAlMiIPxzssts6g7Qg206SC/LHqYonu1BKF1WQaCO9O9kv/EE YYexNItbpJK9m64pd5ac84AybQEZgkgZWqGJkR92RhZgWJtLx20Ekq/VGO3VAdE4NaYQ OwqHmOCRH5ubXe3K8ODoeqaIneSj8h4aBm08Im/7Qo9SikTI7jfwPnUfs/55Uwoc8SJF oC9g== X-Gm-Message-State: ALoCoQkPQijDp+0AsqJ8rrZhjwrxXdEFcAn5Z4Dav7rHiChoeaECqFkdonyVensImr67kBDt7DDi X-Received: by 10.112.253.135 with SMTP id aa7mr22033707lbd.11.1436892534346; Tue, 14 Jul 2015 09:48:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.34 with SMTP id n2ls75943laj.15.gmail; Tue, 14 Jul 2015 09:48:54 -0700 (PDT) X-Received: by 10.112.138.199 with SMTP id qs7mr38755863lbb.21.1436892534151; Tue, 14 Jul 2015 09:48:54 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id mk5si1437131lbc.47.2015.07.14.09.48.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jul 2015 09:48:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lahh5 with SMTP id h5so9602803lah.2 for ; Tue, 14 Jul 2015 09:48:54 -0700 (PDT) X-Received: by 10.112.220.7 with SMTP id ps7mr38465039lbc.72.1436892534029; Tue, 14 Jul 2015 09:48:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2514717lbb; Tue, 14 Jul 2015 09:48:52 -0700 (PDT) X-Received: by 10.50.33.41 with SMTP id o9mr4724193igi.57.1436892532425; Tue, 14 Jul 2015 09:48:52 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id lw7si1851858icc.87.2015.07.14.09.48.51 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 14 Jul 2015 09:48:52 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZF3Np-0000QI-Ra; Tue, 14 Jul 2015 16:48:41 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZF3Np-0000Q8-3U for edk2-devel@lists.sourceforge.net; Tue, 14 Jul 2015 16:48:41 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=lersek@redhat.com; helo=mx1.redhat.com; Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1ZF3Nn-0004T3-VY for edk2-devel@lists.sourceforge.net; Tue, 14 Jul 2015 16:48:41 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 4BACB3672AE; Tue, 14 Jul 2015 16:48:34 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com ([10.10.116.33]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6EGmDII010211; Tue, 14 Jul 2015 12:48:32 -0400 From: Laszlo Ersek To: edk2-devel@lists.sourceforge.net Date: Tue, 14 Jul 2015 18:48:05 +0200 Message-Id: <1436892487-17202-5-git-send-email-lersek@redhat.com> In-Reply-To: <1436892487-17202-1-git-send-email-lersek@redhat.com> References: <1436892487-17202-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Spam-Score: -2.9 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1ZF3Nn-0004T3-VY Cc: "Yao, Jiewen" , Jeff Fan Subject: [edk2] [PATCH v2 4/6] IntelFrameworkModulePkg/GenericBdsLib: remove AcpiS3->S3Save() call X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Ard Biesheuvel The AcpiS3->S3Save() call needs to occur before the end-of-DXE event is signalled. The end-of-DXE event needs to be signalled prior to invoking any UEFI drivers, applications, or connecting consoles. This means the call to S3Save() that occurs in BdsLibBootViaBootOption() violates the ordering constraints, and should be removed. Since it is the responsibility of the platform BDS to signal the end-of-DXE event, it should also perform the AcpiS3->S3Save() call at an appropriate time. Commit message update from Laszlo Ersek : Following Jiewen Yao's idea in http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16088/focus=16146 platforms that (1) use this exact instance of GenericBdsLib, *and* (2) support S3 should now collect the S3 state (3) in an End-of-Dxe callback in their AcpiS3SaveDxe drivers, *or* (4) with an explicit AcpiS3->S3Save() call made to their AcpiS3SaveDxe drivers from their PlatformBdsLib instances. OvmfPkg, which uses this GenericBdsLib instance, and has its own AcpiS3SaveDxe fork, follows (3). Vlv2TbltDevicePkg, which has a GenericBdsLib fork, and uses IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe, follows (4). There are no other platforms in the public edk2 repository that support S3. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek Reviewed-by: Yao, Jiewen [lersek@redhat.com: updated commit message] Cc: Ard Biesheuvel Cc: Jeff Fan Cc: Yao, Jiewen Signed-off-by: Laszlo Ersek --- Notes: v2: - update commit message again IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf | 1 - IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h | 1 - IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c | 10 ---------- 3 files changed, 12 deletions(-) diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf index 5381e33..5a138a9 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf @@ -119,7 +119,6 @@ [Protocols] gEfiLegacyBiosProtocolGuid ## SOMETIMES_CONSUMES gEfiCpuArchProtocolGuid ## CONSUMES gEfiDevicePathProtocolGuid ## CONSUMES - gEfiAcpiS3SaveProtocolGuid ## SOMETIMES_CONSUMES gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES gEfiUgaDrawProtocolGuid |gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## SOMETIMES_CONSUMES gEfiOEMBadgingProtocolGuid ## SOMETIMES_CONSUMES diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h b/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h index c32579b..7201d8a 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h @@ -33,7 +33,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include #include diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c index e02a710..4b7eca7 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -2233,7 +2233,6 @@ BdsLibBootViaBootOption ( EFI_DEVICE_PATH_PROTOCOL *FilePath; EFI_LOADED_IMAGE_PROTOCOL *ImageInfo; EFI_DEVICE_PATH_PROTOCOL *WorkingDevicePath; - EFI_ACPI_S3_SAVE_PROTOCOL *AcpiS3Save; LIST_ENTRY TempBootLists; EFI_BOOT_LOGO_PROTOCOL *BootLogo; @@ -2241,15 +2240,6 @@ BdsLibBootViaBootOption ( *ExitData = NULL; // - // Notes: this code can be remove after the s3 script table - // hook on the event EVT_SIGNAL_READY_TO_BOOT or - // EVT_SIGNAL_LEGACY_BOOT - // - Status = gBS->LocateProtocol (&gEfiAcpiS3SaveProtocolGuid, NULL, (VOID **) &AcpiS3Save); - if (!EFI_ERROR (Status)) { - AcpiS3Save->S3Save (AcpiS3Save, NULL); - } - // // If it's Device Path that starts with a hard drive path, append it with the front part to compose a // full device path //