From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 30 Jul 2019 02:21:39 -0700 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2BEEF3091753; Tue, 30 Jul 2019 09:21:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.118.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74B4F5D6B2; Tue, 30 Jul 2019 09:21:37 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 04/35] OvmfPkg: Introduce XenPlatformPei To: devel@edk2.groups.io, anthony.perard@citrix.com Cc: Julien Grall , xen-devel@lists.xenproject.org, Jordan Justen , Ard Biesheuvel References: <20190729153944.24239-1-anthony.perard@citrix.com> <20190729153944.24239-5-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <8d4420c8-2ac2-0653-5d3a-1121bd698570@redhat.com> Date: Tue, 30 Jul 2019 11:21:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190729153944.24239-5-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 30 Jul 2019 09:21:39 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 07/29/19 17:39, Anthony PERARD wrote: > Introduce XenPlatformPei, a copy of OvmfPkg/PlatformPei without some > of QEMU specific initialization, Xen does not support QemuFwCfg. > > This new module will be adjusted to accommodate Xen PVH. > > fw_cfg dependents that have been removed, which are dynamically skipped > when running PlatformPei on Xen: > - GetFirstNonAddress(): controlling the 64-bit PCI MMIO aperture via the > (experimental) "opt/ovmf/X-PciMmio64Mb" file > - GetFirstNonAddress(): honoring the hotplug DIMM area > ("etc/reserved-memory-end") in the placement of the 64-bit PCI MMIO > aperture > - NoexecDxeInitialization() is removed, so PcdPropertiesTableEnable and > PcdSetNxForStack are left constant FALSE (not set dynamically from > fw_cfg "opt/ovmf/PcdXxxx") > - MaxCpuCountInitialization(), PublishPeiMemory(): the max CPU count is > not taken from the QemuFwCfgItemSmpCpuCount fw_cfg key; > PcdCpuMaxLogicalProcessorNumber is used intact and > PcdCpuApInitTimeOutInMicroSeconds is never changed or used. > - InitializeXenPlatform(), S3Verification(): S3 is assumed disabled (not > consulting "etc/system-states" via QemuFwCfgS3Enabled()). > - InstallFeatureControlCallback(): the feature control MSR is not set > from "etc/msr_feature_control" > (also removed FeatureControl.c as there is nothing been executed) > > Also removed: > - SMRAM/TSEG-related low mem size adjusting (PcdSmmSmramRequire is > assumed FALSE) in PublishPeiMemory(), > - QemuInitializeRam() entirely, > > Xen related changes: > - Have removed the module variable mXen, as it should be always true. > - Have the platform PEI initialization fails if Xen has not been > detected. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689 > Signed-off-by: Anthony PERARD > Reviewed-by: Laszlo Ersek > --- > > Notes: > v4: > - replace the other EFI_D_ by DEBUG_. > - Update Maintainers.txt > - fix one trailing whitespace > > v3: > - fix coding style in new code > (use DEBUG_xxx, add ASSERT before CpuDeadLoop) > - rebased, SPDX > > OvmfPkg/OvmfXen.dsc | 2 +- > OvmfPkg/OvmfXen.fdf | 2 +- > OvmfPkg/XenPlatformPei/XenPlatformPei.inf | 96 +++++ > OvmfPkg/XenPlatformPei/Cmos.h | 52 +++ > OvmfPkg/XenPlatformPei/Platform.h | 108 ++++++ > OvmfPkg/XenPlatformPei/Xen.h | 39 ++ > OvmfPkg/XenPlatformPei/AmdSev.c | 64 ++++ > OvmfPkg/XenPlatformPei/ClearCache.c | 112 ++++++ > OvmfPkg/XenPlatformPei/Cmos.c | 60 +++ > OvmfPkg/XenPlatformPei/Fv.c | 76 ++++ > OvmfPkg/XenPlatformPei/MemDetect.c | 421 ++++++++++++++++++++ > OvmfPkg/XenPlatformPei/Platform.c | 444 ++++++++++++++++++++++ > OvmfPkg/XenPlatformPei/Xen.c | 219 +++++++++++ > Maintainers.txt | 1 + > 14 files changed, 1694 insertions(+), 2 deletions(-) > create mode 100644 OvmfPkg/XenPlatformPei/XenPlatformPei.inf > create mode 100644 OvmfPkg/XenPlatformPei/Cmos.h > create mode 100644 OvmfPkg/XenPlatformPei/Platform.h > create mode 100644 OvmfPkg/XenPlatformPei/Xen.h > create mode 100644 OvmfPkg/XenPlatformPei/AmdSev.c > create mode 100644 OvmfPkg/XenPlatformPei/ClearCache.c > create mode 100644 OvmfPkg/XenPlatformPei/Cmos.c > create mode 100644 OvmfPkg/XenPlatformPei/Fv.c > create mode 100644 OvmfPkg/XenPlatformPei/MemDetect.c > create mode 100644 OvmfPkg/XenPlatformPei/Platform.c > create mode 100644 OvmfPkg/XenPlatformPei/Xen.c [...] > diff --git a/Maintainers.txt b/Maintainers.txt > index 34bdb275b4..42ec8d54af 100644 > --- a/Maintainers.txt > +++ b/Maintainers.txt > @@ -379,6 +379,7 @@ F: OvmfPkg/PlatformPei/Xen.* > F: OvmfPkg/SmbiosPlatformDxe/*Xen.c > F: OvmfPkg/XenBusDxe/ > F: OvmfPkg/XenIoPciDxe/ > +F: OvmfPkg/XenPlatformPei/ > F: OvmfPkg/XenPvBlkDxe/ > F: OvmfPkg/XenResetVector/ > R: Anthony Perard > Reviewed-by: Laszlo Ersek