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 4343D21CFA608 for ; Thu, 24 Aug 2017 03:18:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B8D65D697; Thu, 24 Aug 2017 10:21:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9B8D65D697 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-82.phx2.redhat.com [10.3.116.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id A52DE71C88; Thu, 24 Aug 2017 10:21:30 +0000 (UTC) To: Star Zeng , edk2-devel@lists.01.org Cc: Jiewen Yao , Eric Dong References: <1503544809-166388-1-git-send-email-star.zeng@intel.com> From: Laszlo Ersek Message-ID: <820cfd94-d25e-214f-5555-92fc69951268@redhat.com> Date: Thu, 24 Aug 2017 12:21:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1503544809-166388-1-git-send-email-star.zeng@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 24 Aug 2017 10:21:31 +0000 (UTC) Subject: Re: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Fix memory protection crash 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: Thu, 24 Aug 2017 10:18:57 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi, On 08/24/17 05:20, Star Zeng wrote: > https://bugzilla.tianocore.org/show_bug.cgi?id=624 reports > memory protection crash in PiSmmCpuDxeSmm, Ia32 build with > RAM above 4GB (of which 2GB are placed in 64-bit address). > It is because UEFI builds identity mapping page tables, >> 4G address is not supported at Ia32 build. > > This patch is to get the PhysicalAddressBits that is used > to build in PageTbl.c(Ia32/X64), and use it to check whether > the address is supported or not in ConvertMemoryPageAttributes(). > > With this patch, the debug messages will be like below. > UefiMemory protection: 0x0 - 0x9F000 Success > UefiMemory protection: 0x100000 - 0x807000 Success > UefiMemory protection: 0x808000 - 0x810000 Success > UefiMemory protection: 0x818000 - 0x820000 Success > UefiMemory protection: 0x1510000 - 0x7B798000 Success > UefiMemory protection: 0x7B79B000 - 0x7E538000 Success > UefiMemory protection: 0x7E539000 - 0x7E545000 Success > UefiMemory protection: 0x7E55A000 - 0x7E61F000 Success > UefiMemory protection: 0x7E62B000 - 0x7F6AB000 Success > UefiMemory protection: 0x7F703000 - 0x7F70B000 Success > UefiMemory protection: 0x7F70F000 - 0x7F778000 Success > UefiMemory protection: 0x100000000 - 0x180000000 Unsupported > > Cc: Jiewen Yao > Cc: Laszlo Ersek > Cc: Eric Dong > Originally-suggested-by: Jiewen Yao > Reported-by: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c | 4 +++ > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 1 + > UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 31 +++++++++++++++++----- > 3 files changed, 30 insertions(+), 6 deletions(-) I might need a few days before I can test this. Please continue reviewing / discussing the patch (and if v2 is necessary, please CC me); just please give me a chance to test it before merging it. I hope I can test it beginning of next week at the latest. Thanks Laszlo