From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 49A6621DF8074 for ; Mon, 28 Aug 2017 07:23:06 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 28 Aug 2017 07:25:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,441,1498546800"; d="scan'208,217";a="1008385835" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 28 Aug 2017 07:25:44 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 28 Aug 2017 07:25:44 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.39]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Mon, 28 Aug 2017 22:25:42 +0800 From: "Shi, Steven" To: Laszlo Ersek , edk2-devel-01 CC: "Kinney, Michael D" , "Gao, Liming" , Ard Biesheuvel Thread-Topic: [edk2] "practical" memory allocation limit? Thread-Index: AQHTH9m/B5z+I4nOkUmUdboLi0VXJaKZxkvw Date: Mon, 28 Aug 2017 14:25:41 +0000 Message-ID: <06C8AB66E78EE34A949939824ABE2B313B57604E@shsmsx102.ccr.corp.intel.com> References: <1714bf60-83a1-ce07-1d71-ac729d8e9dc8@redhat.com> In-Reply-To: <1714bf60-83a1-ce07-1d71-ac729d8e9dc8@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: "practical" memory allocation limit? 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: Mon, 28 Aug 2017 14:23:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Laszlo, I happen to have a question about how to correctly get the system memory si= ze on Qemu. In the QemuInitializeRam() of OvmfPkg\PlatformPei\MemDetect.c, I add debug = info as below to trace the GetSystemMemorySizeBelow4gb() and GetSystemMemor= ySizeAbove4gb() output. But the output results seems not right if my input = memory size > 4GB. See my commands and trace outputs in below. MemDetect.c Line 602: // // Determine total memory size available // LowerMemorySize =3D GetSystemMemorySizeBelow4gb (); UpperMemorySize =3D GetSystemMemorySizeAbove4gb (); DEBUG ((EFI_D_INFO, "LowerMemorySize=3D 0x%x\n", LowerMemorySize)); DEBUG ((EFI_D_INFO, "UpperMemorySize=3D 0x%x\n", UpperMemorySize)); My test commands and trace outputs: $ /opt/qemu/bin/qemu-system-x86_64 -m 5120 -enable-kvm -hda /home/jshi19/wo= rkspace/simics5-project/images/luv-v2.1_diskboot_gpt_x86_64_.img -machine p= c-q35-2.9 -bios OVMF.fd -serial file:serial.log LowerMemorySize=3D 0x80000000 //2GB, but should not it be 4GB? UpperMemorySize=3D 0xC0000000 //3GB, but should not it be 1GB? $ /opt/qemu/bin/qemu-system-x86_64 -m 6144 -enable-kvm -hda /home/jshi19/wo= rkspace/simics5-project/images/luv-v2.1_diskboot_gpt_x86_64_.img -machine p= c-q35-2.9 -bios OVMF.fd -serial file:serial.log LowerMemorySize=3D 0x80000000 //2GB, but should not it be 4GB? UpperMemorySize=3D 0x0 // 0GB, but should not it be 2GB? Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Laszlo Ersek > Sent: Monday, August 28, 2017 4:43 PM > To: edk2-devel-01 > Cc: Kinney, Michael D ; Gao, Liming > ; Ard Biesheuvel > Subject: [edk2] "practical" memory allocation limit? > > Hi, > > I've been curious about it for a long time, so I guess I might as well > ask the question: > > Even if OVMF's DXE phase is built for X64, and even if I give the VM > memory above 4GB -- confirmed by the MEMMAP command in the UEFI shell > --, in the OVMF log I see practically all allocations coming from the > 32-bit address space. > > OVMF produces all its memory resource descriptor HOBs in PEI, all > "tested". (No memory is added in DXE.) So why aren't DXE allocations > served from 64-bit space? > > Something seems to be artificially limiting run-of-the-mill pool and > page allocations in X64 OVMF; what is it? (It doesn't work like this in > ArmVirtQemu.) > > Thanks! > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel