From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.20055.1679061716295729064 for ; Fri, 17 Mar 2023 07:01:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NmHrj2OY; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679061715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZTUKxt6FM9nTcmc0wAg54cw/wz1N98P1mZOW3Egn08U=; b=NmHrj2OYW+vc6sZfPXSA9eR7M0Tc6MyeFdyRhgRs1KRJxhvgFLbMmTdJXk3pMAnsvIQB9d AEG3PnKemIBrviCXFLoxoihI7xlHb+4JWaUtUqiB85n8smCBElcFvRe96Mm8yyhGDzYscH NYLta8psQWTs8tIh/huIYhoyaoFLY0U= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-570-ceuWYNobPRCuTwtaDsldHg-1; Fri, 17 Mar 2023 10:01:50 -0400 X-MC-Unique: ceuWYNobPRCuTwtaDsldHg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6CA6E3C11791; Fri, 17 Mar 2023 14:01:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E1B14042AC5; Fri, 17 Mar 2023 14:01:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AD5661800617; Fri, 17 Mar 2023 15:01:48 +0100 (CET) Date: Fri, 17 Mar 2023 15:01:48 +0100 From: "Gerd Hoffmann" To: Fiona Ebner Cc: devel@edk2.groups.io, Jordan Justen , Pawel Polawski , Jiewen Yao , Oliver Steffen , Ard Biesheuvel , Thomas Lamprecht Subject: Re: [PATCH v2 2/4] OvmfPkg/PlatformInitLib: detect physical address space Message-ID: <20230317140148.7ioafsne2asymfxi@sirius.home.kraxel.org> References: <20221004134728.55499-1-kraxel@redhat.com> <20221004134728.55499-3-kraxel@redhat.com> <5259991b-964c-4378-f206-9991053f7c7e@proxmox.com> MIME-Version: 1.0 In-Reply-To: <5259991b-964c-4378-f206-9991053f7c7e@proxmox.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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