From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web12.29386.1595452819160766265 for ; Wed, 22 Jul 2020 14:20:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FcZTP3rM; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595452818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pFXkHrHYNgzAywdcLz+l7X9wBcg4IE40n/jYZ083cF8=; b=FcZTP3rMV+7vwThDa84LRxVFYmxyfw0iJ/zslI048PUnunJVxkG6+WMbbrA7LXO/3VD/uR 1lrfrd2Hr+cL+zkNKsev3Pphyf4H677ZFT6QsuARL2vp0FPYK/dF+o4hIXmS/lOO2+Xqtk T0cEHIljMkHiSEENfX0Ggp4XoYO2ALs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-507-69KYCquMN3CWkPsrkndZew-1; Wed, 22 Jul 2020 17:20:16 -0400 X-MC-Unique: 69KYCquMN3CWkPsrkndZew-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7717E800C64; Wed, 22 Jul 2020 21:20:14 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-129.ams2.redhat.com [10.36.113.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 645BD512FE; Wed, 22 Jul 2020 21:20:12 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v7 02/10] MdeModulePkg/PeiCore: Enable T-RAM evacuation in PeiCore (CVE-2019-11098) To: devel@edk2.groups.io, guomin.jiang@intel.com Cc: Michael Kubacki , Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao , Debkumar De , Harry Han , Catharine West References: <20200722083657.739-1-guomin.jiang@intel.com> <20200722083657.739-3-guomin.jiang@intel.com> From: "Laszlo Ersek" Message-ID: <8fc80842-c802-2ad8-2b39-97f3b34c3524@redhat.com> Date: Wed, 22 Jul 2020 23:20:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200722083657.739-3-guomin.jiang@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 07/22/20 10:36, Guomin Jiang wrote: > From: Michael Kubacki > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 > > Introduces new changes to PeiCore to move the contents of temporary > RAM visible to the PeiCore to permanent memory. This expands on > pre-existing shadowing support in the PeiCore to perform the following > additional actions: > > 1. Migrate pointers in PPIs installed in PeiCore to the permanent > memory copy of PeiCore. > > 2. Copy all installed firmware volumes to permanent memory. > > 3. Relocate and fix up the PEIMs within the firmware volumes. > > 4. Convert all PPIs into the migrated firmware volume to the corresponding > PPI address in the permanent memory location. > > This applies to PPIs and PEI notifications. > > 5. Convert all status code callbacks in the migrated firmware volume to > the corresponding address in the permanent memory location. > > 6. Update the FV HOB to the corresponding firmware volume in permanent > memory. > > 7. Add PcdMigrateTemporaryRamFirmwareVolumes to control if enable the > feature or not. when the PCD disable, the EvacuateTempRam() will > never be called. > > The function control flow as below: > PeiCore() > DumpPpiList() > EvacuateTempRam() > ConvertPeiCorePpiPointers() > ConvertPpiPointersFv() > MigratePeimsInFv() > MigratePeim() > PeiGetPe32Data() > LoadAndRelocatePeCoffImageInPlace() > MigrateSecModulesInFv() > ConvertPpiPointersFv() > ConvertStatusCodeCallbacks() > ConvertFvHob() > RemoveFvHobsInTemporaryMemory() > DumpPpiList() > > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Dandan Bi > Cc: Liming Gao > Cc: Debkumar De > Cc: Harry Han > Cc: Catharine West > Signed-off-by: Michael Kubacki > Acked-by: Laszlo Ersek > --- > MdeModulePkg/Core/Pei/PeiMain.inf | 2 + > MdeModulePkg/Core/Pei/PeiMain.h | 169 ++++++++ > MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 392 ++++++++++++++++++ > MdeModulePkg/Core/Pei/Image/Image.c | 116 ++++++ > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 82 ++++ > MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 24 ++ > MdeModulePkg/Core/Pei/Ppi/Ppi.c | 287 +++++++++++++ > 7 files changed, 1072 insertions(+) I've reviewed this incrementally against v5, which I had ACKed. My ACK stands. Thanks Laszlo