From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web10.70599.1671796568550080719 for ; Fri, 23 Dec 2022 03:56:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OlQFjSi7; spf=pass (domain: kernel.org, ip: 145.40.68.75, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A6F44B82042 for ; Fri, 23 Dec 2022 11:56:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CDDDC433D2 for ; Fri, 23 Dec 2022 11:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671796565; bh=Pgxpg5WbkmCz03IPN0lp769cBlq7evr2xNWP+wtSNpQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OlQFjSi7D8QBLozUMnF/etYObFvIv+IWKMLg96wb4yDPMVj6XxtDIk1c3hderx2Pe 0ci4kvL6VMQlEIF2D2lqGQ9T9/cscjepF6vkPY3ta+o5yMGW211HCMtjGsp/NBq6t2 /ENBi3sUftonOyQeWkNxaDOi9W1R3Q8pJShboJjaP1Eh//TKxBhfJCHr9Jfjx+E+Z8 KUSJ5SwAgBEAkbvyz/SZ3FY5v5D3VHntMHvZOf1aVUWyVbAAM6v3AC9HVGSkq0fIu8 bTyog21iFkNvMEpd11OlPZ7IbWCz1adNF13mx6Bt2quVEOxXPuY6ngCO7cuLkwHmwA Bwx3LMmq9EtIw== Received: by mail-lj1-f176.google.com with SMTP id x11so4770879ljh.7 for ; Fri, 23 Dec 2022 03:56:05 -0800 (PST) X-Gm-Message-State: AFqh2krimygYVNEPx0hkQORWFLuzTZq6E+nl+WXRA+z16aQ7DsFd+JzA gPEIs8RxePiq0T4NbxlsUYStUngCN1vo256PWlM= X-Google-Smtp-Source: AMrXdXuU4Dl8PyGEvomAAObTmg3vLVgI57/+iSNHSf7YMCCaWLFWk13nWKMhtHohAcXlrKgIqYV9PyNTNNUFunhIba0= X-Received: by 2002:a2e:2413:0:b0:27b:54ad:6c59 with SMTP id k19-20020a2e2413000000b0027b54ad6c59mr746562ljk.352.1671796563500; Fri, 23 Dec 2022 03:56:03 -0800 (PST) MIME-Version: 1.0 References: <20221207053215.2527430-1-kraxel@redhat.com> In-Reply-To: <20221207053215.2527430-1-kraxel@redhat.com> From: "Ard Biesheuvel" Date: Fri, 23 Dec 2022 12:55:52 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH 1/1] OvmfPkg/PlatformInitLib: pass through reservations from qemu To: devel@edk2.groups.io, kraxel@redhat.com Cc: Oliver Steffen , Ard Biesheuvel , Jordan Justen , Jiewen Yao , Pawel Polawski Content-Type: text/plain; charset="UTF-8" On Wed, 7 Dec 2022 at 06:32, Gerd Hoffmann wrote: > > qemu uses the etc/e820 fw_cfg file not only for memory, but > also for reservations. Handle reservations by adding resource > descriptor hobs for them. > > A typical qemu configuration has a small reservation between > lapic and flash: > > # sudo cat /proc/iomem > [ ... ] > fee00000-fee00fff : Local APIC > feffc000-feffffff : Reserved <= HERE > ffc00000-ffffffff : Reserved > [ ... ] > > Signed-off-by: Gerd Hoffmann Merged as #3828 > --- > OvmfPkg/Library/PlatformInitLib/MemDetect.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > index b8feae4309de..a7a4e028ad50 100644 > --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c > +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > @@ -228,6 +228,22 @@ PlatformScanOrAdd64BitE820Ram ( > )); > } > } > + } else if (E820Entry.Type == EfiAcpiAddressRangeReserved) { > + if (AddHighHob) { > + DEBUG (( > + DEBUG_INFO, > + "%a: Reserved: Base=0x%Lx Length=0x%Lx\n", > + __FUNCTION__, > + E820Entry.BaseAddr, > + E820Entry.Length > + )); > + BuildResourceDescriptorHob ( > + EFI_RESOURCE_MEMORY_RESERVED, > + 0, > + E820Entry.BaseAddr, > + E820Entry.Length > + ); > + } > } > } > > -- > 2.38.1 > > > > > >