public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Fiona Ebner" <f.ebner@proxmox.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: devel@edk2.groups.io, Jordan Justen <jordan.l.justen@intel.com>,
	Pawel Polawski <ppolawsk@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Oliver Steffen <osteffen@redhat.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [PATCH v2 2/4] OvmfPkg/PlatformInitLib: detect physical address space
Date: Mon, 20 Mar 2023 15:20:48 +0100	[thread overview]
Message-ID: <550ddd42-2f53-b75e-c819-acfc12fd620f@proxmox.com> (raw)
In-Reply-To: <20230317140148.7ioafsne2asymfxi@sirius.home.kraxel.org>

Am 17.03.23 um 15:01 schrieb Gerd Hoffmann:
>   Hi,
> 
>> With edk2-stable202205 or when reverting the commit, my VM boots with
>> only 512 MiB of assigned memory. With the commit, with 512 MiB it cannot
>> even initialize the display, with 750 MiB it runs into a different error
>> during Linux boot, and with 900 MiB it boots fine again.
>>
>> So it seems that having a larger PhysMemAddressWidth requires more
>> memory? Is this expected and does running VMs with this version simply
>> require more memory now? Is there a way to avoid that?
> 
> Might be more memory being needed for page tables.  Making sure gigabyte
> pages are enabled (-cpu $name,pdpe1gb=on), so edk2 can use them for the
> mmio window identity mapping.
> 
> Alternatively try change the cap:
> 
> ------------------------------------------------------------
> diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> index 38cece9173e8..76df6fd020bf 100644
> --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> @@ -669,9 +669,9 @@ PlatformAddressWidthFromCpuid (
>        PhysBits = 47;
>      }
>  
> -    if (!Page1GSupport && (PhysBits > 40)) {
> -      DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 40 (no 1G pages available)\n", __func__));
> -      PhysBits = 40;
> +    if (!Page1GSupport && (PhysBits > 38)) {
> +      DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 38 (no 1G pages available)\n", __func__));
> +      PhysBits = 38;
>      }
>  
>      PlatformInfoHob->PhysMemAddressWidth = PhysBits;
> ------------------------------------------------------------
> 
> HTH,
>   Gerd
> 
> 

It seems that Page1GSupport is already TRUE in my case, so
unfortunately, the suggested changes don't help.

Before commit bbda386d25, PhysMemAddressWidth is 36, after the commit,
it's 47. I tried with hardcoding different values:
45 - My VM boots fine.
46 - I run into a "KVM internal error. Suberror: 1" during Linux boot
(that's also what happens with 47 and 750 MiB of memory).
47 - Hangs right away and display is never initialized.

Is there any interest to use a smaller limit than 47 from upstream's
perspective? Admittedly, it is a rather niche case to use OVMF with so
little memory.

In any case, thank you for taking a look!

Best Regards,
Fiona


  reply	other threads:[~2023-03-20 14:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 13:47 [PATCH v2 0/4] OvmfPkg: make better use of physical address space Gerd Hoffmann
2022-10-04 13:47 ` [PATCH v2 1/4] OvmfPkg/PlatformInitLib: qemu cpuid physbits detection Gerd Hoffmann
2022-10-04 13:47 ` [PATCH v2 2/4] OvmfPkg/PlatformInitLib: detect physical address space Gerd Hoffmann
2023-03-16 13:58   ` f.ebner
2023-03-16 14:37     ` Gerd Hoffmann
2023-03-17 11:34       ` [edk2-devel] " Fiona Ebner
2023-03-17 14:01     ` Gerd Hoffmann
2023-03-20 14:20       ` Fiona Ebner [this message]
2023-03-20 15:58         ` Gerd Hoffmann
2022-10-04 13:47 ` [PATCH v2 3/4] OvmfPkg/PlatformInitLib: dynamic mmio window size Gerd Hoffmann
2023-03-15  8:54   ` [edk2-devel] " joeyli
2023-03-15  9:28     ` Gerd Hoffmann
2023-05-16 14:00   ` Fiona Ebner
2023-05-17  5:59     ` [edk2-devel] " Gerd Hoffmann
2023-05-17 13:38       ` Fiona Ebner
2023-05-22 11:12         ` Gerd Hoffmann
2023-05-22 13:36           ` Fiona Ebner
2022-10-04 13:47 ` [PATCH v2 4/4] OvmfPkg/PciHotPlugInitDxe: reserve more mmio space Gerd Hoffmann
2022-10-04 15:57   ` Laszlo Ersek
2022-10-05  5:01     ` Gerd Hoffmann
2022-10-06  8:50       ` Laszlo Ersek
2022-10-07 21:49 ` [edk2-devel] [PATCH v2 0/4] OvmfPkg: make better use of physical address space Ard Biesheuvel

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=550ddd42-2f53-b75e-c819-acfc12fd620f@proxmox.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