public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Shi, Steven" <steven.shi@intel.com>
To: Laszlo Ersek <lersek@redhat.com>,
	edk2-devel-01 <edk2-devel@lists.01.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: "practical" memory allocation limit?
Date: Mon, 28 Aug 2017 14:25:41 +0000	[thread overview]
Message-ID: <06C8AB66E78EE34A949939824ABE2B313B57604E@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1714bf60-83a1-ce07-1d71-ac729d8e9dc8@redhat.com>

Hi Laszlo,

I happen to have a question about how to correctly get the system memory size on Qemu.

In the QemuInitializeRam() of OvmfPkg\PlatformPei\MemDetect.c, I add debug info as below to trace the GetSystemMemorySizeBelow4gb() and GetSystemMemorySizeAbove4gb() 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 = GetSystemMemorySizeBelow4gb ();

  UpperMemorySize = GetSystemMemorySizeAbove4gb ();

  DEBUG ((EFI_D_INFO, "LowerMemorySize= 0x%x\n", LowerMemorySize));

  DEBUG ((EFI_D_INFO, "UpperMemorySize= 0x%x\n", UpperMemorySize));



My test commands and trace outputs:

$ /opt/qemu/bin/qemu-system-x86_64 -m 5120 -enable-kvm -hda /home/jshi19/workspace/simics5-project/images/luv-v2.1_diskboot_gpt_x86_64_.img -machine pc-q35-2.9 -bios OVMF.fd -serial file:serial.log

LowerMemorySize= 0x80000000 //2GB, but should not it be 4GB?

UpperMemorySize= 0xC0000000 //3GB, but should not it be 1GB?





$ /opt/qemu/bin/qemu-system-x86_64 -m 6144 -enable-kvm -hda /home/jshi19/workspace/simics5-project/images/luv-v2.1_diskboot_gpt_x86_64_.img -machine pc-q35-2.9 -bios OVMF.fd -serial file:serial.log

LowerMemorySize= 0x80000000 //2GB, but should not it be 4GB?

UpperMemorySize= 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 <edk2-devel@lists.01.org>

> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming

> <liming.gao@intel.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>

> 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<mailto:edk2-devel@lists.01.org>

> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2017-08-28 14:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  8:43 "practical" memory allocation limit? Laszlo Ersek
2017-08-28 14:25 ` Shi, Steven [this message]
2017-08-28 14:39   ` Laszlo Ersek
2017-08-28 15:31     ` Shi, Steven
2017-08-28 16:23       ` Andrew Fish
2017-08-28 17:36         ` Laszlo Ersek
2017-08-28 23:53         ` Rebecca Cran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06C8AB66E78EE34A949939824ABE2B313B57604E@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox