From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 42CFD803A5 for ; Fri, 24 Mar 2017 08:58:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A82C1C04BD4D; Fri, 24 Mar 2017 15:58:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A82C1C04BD4D Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A82C1C04BD4D Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-209.phx2.redhat.com [10.3.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id C568E7E59F; Fri, 24 Mar 2017 15:58:22 +0000 (UTC) References: Cc: edk2-devel@lists.01.org To: William Tambe , Jiewen Yao From: Laszlo Ersek Message-ID: <4d40b816-c024-020d-0471-c6023c6b5d0b@redhat.com> Date: Fri, 24 Mar 2017 16:58:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 24 Mar 2017 15:58:23 +0000 (UTC) Subject: Re: Page Table initialization and update in SMM mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2017 15:58:23 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Jiewen, On 03/22/17 15:14, William Tambe wrote: > Dear all, > > When building OVMF with SMM_REQUIRE: > > - Would you know where in the code base the Page Table set in the Cr3 > register is initialized during boot ? > > - Where does it get updated when a new page needs to be allocated or freed ? > > - Or is there a hook I can register myself to in order to get a chance to > review an entry to be added or removed from the Page Tables ? can you please help answer these questions? I seem to remember that we discussed code around this when we were looking into the SMM stack overflow experienced with OVMF: 509f8425b75d UefiCpuPkg: change PcdCpuSmmStackGuard default to TRUE 0d0c245dfb14 OvmfPkg: set SMM stack size to 16KB William: I suggest to check out the following files: UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c and/or to grep the code for "PcdCpuSmmStackGuard", to get a feel for what to investigate. Thanks Laszlo