summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
Commit message (Collapse)AuthorAgeFilesLines
* OvmfPkg/Bhyve: use static PCI32Base addressCorvin Köhne2021-07-052-3/+5
| | | | | | | | | | | | | | | | | | | | It's neccessary to allocate a Graphics Stolen Memory area to enable GPU-Passthrough for integrated Intel GPUs. Therefore, use a new memory layout with a static Pci32Baseaddress. Old layout: [... , lowmemlimit] RAM [lowmemlimit, 0xE000 0000] PCI Space New layout: [... , lowmemlimit] RAM [lowmemlimit, gsmbase ] Memory hole (may be absent) [gsmbase , 0xC000 0000] GSM (may be absent) [0xC000 0000, 0xE000 0000] PCI Space Reviewed-by: Peter Grehan <grehan@freebsd.org> Acked-by: Rebecca Cran <rebecca@bsdio.com> Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com> Message-Id: <20210705110842.14088-2-c.koehne@beckhoff.com>
* OvmfPkg/Bhyve: add USB supportCorvin Köhne2021-07-052-0/+17
| | | | | | | | | | | An USB driver is required to use a keyboard or mouse while installing an OS or while in a bootloader menu like grub when using GPU + USB Passthrough. Reviewed-by: Peter Grehan <grehan@freebsd.org> Acked-by: Rebecca Cran <rebecca@bsdio.com> Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com> Message-Id: <20210705110842.14088-1-c.koehne@beckhoff.com>
* OvmfPkg/XenPlatformPei: Relocate shared_info page mappingAnthony PERARD2021-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | Unfortunately, Xen isn't ready to deal with mapping at the top of the physical address space, so we relocate the mapping after the LAPIC location. See this thread about the issue with the mapping: - https://lore.kernel.org/xen-devel/f8c4151a-6dac-d87c-ef46-eb35ada07bd9@suse.com/ The PhysicalAddressIdentityMapping() call isn't going to do anything anymore since everything under 4GB is already mapped, but there is no need to remove the call. Cc: Jan Beulich <JBeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Message-Id: <20210628132337.46345-1-anthony.perard@citrix.com> Acked-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: replace "CC:" with "Cc:", to pacify PatchCheck.py]
* OvmfPkg/X86QemuLoadImageLib: State fw_cfg dependency in file headerDov Murik2021-06-292-0/+6
| | | | | | | | | | | | | | | | Make it clear that X86QemuLoadImageLib relies on fw_cfg; prepare the ground to add a warning about the incompatibility with boot verification process. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210628105110.379951-6-dovmurik@linux.ibm.com>
* OvmfPkg/GenericQemuLoadImageLib: Read cmdline from QemuKernelLoaderFsDov Murik2021-06-292-15/+139
| | | | | | | | | | | | | | | | | | Remove the QemuFwCfgLib interface used to read the QEMU cmdline (-append argument) and the initrd size. Instead, use the synthetic filesystem QemuKernelLoaderFs which has three files: "kernel", "initrd", and "cmdline". Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Message-Id: <20210628105110.379951-5-dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line"Dov Murik2021-06-291-3/+8
| | | | | | | | | | | | | | | | | | | | | | This reverts commit efc52d67e1573ce174d301b52fa1577d552c8441. Manually fixed conflicts in: OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c Note that besides re-exposing the kernel command line as a file in the synthetic filesystem, we also revert back to AllocatePool instead of AllocatePages. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210628105110.379951-4-dovmurik@linux.ibm.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/X86QemuLoadImageLib: plug cmdline blob leak on successDov Murik2021-06-291-2/+4
| | | | | | | | | | | | | | | | | | | When QemuLoadKernelImage() ends successfully, the command-line blob is not freed, even though it is not used elsewhere (its content is already copied to KernelLoadedImage->LoadOptions). The memory leak bug was introduced in commit 7c47d89003a6 ("OvmfPkg: implement QEMU loader library for X86 with legacy fallback", 2020-03-05). Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Reported-by: Laszlo Ersek <lersek@redhat.com> Fixes: 7c47d89003a6f8f7f6f0ce8ca7d3e87c630d14cc Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Message-Id: <20210628105110.379951-3-dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/GenericQemuLoadImageLib: plug cmdline blob leak on successDov Murik2021-06-291-2/+4
| | | | | | | | | | | | | | | | | | | When QemuLoadKernelImage() ends successfully, the command-line blob is not freed, even though it is not used elsewhere (its content is already copied to KernelLoadedImage->LoadOptions). The memory leak bug was introduced in commit ddd2be6b0026 ("OvmfPkg: provide a generic implementation of QemuLoadImageLib", 2020-03-05). Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Reported-by: Laszlo Ersek <lersek@redhat.com> Fixes: ddd2be6b0026abcd0f819b3915fc80c3de81dd62 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Message-Id: <20210628105110.379951-2-dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/Bhyve: clean up TPM_ENABLE remnantsRebecca Cran2021-06-242-79/+0
| | | | | | | | | | | | | TPM support hasn't been tested and any lines in the .dsc and .fdf files that appear to show support are bogus. Remove them. This fixes https://bugzilla.tianocore.org/show_bug.cgi?id=3354 . Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Message-Id: <20210612204340.52290-1-rebecca@bsdio.com> Reviewed-by: Peter Grehan <grehan@freebsd.org> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformCI: bump QEMU choco package version to 2021.5.5Laszlo Ersek2021-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently require QEMU choco package version 2020.08.14 (from commit 3ab9d60fcbe7), in "OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml". Said package version references the following URLs: https://community.chocolatey.org/packages/Qemu/2020.08.14#files -> https://qemu.weilnetz.de/w32/qemu-w32-setup-20200814.exe -> https://qemu.weilnetz.de/w64/qemu-w64-setup-20200814.exe These URLs no longer work; Stefan Weil seems to have moved the binaries to the following archive directories: - https://qemu.weilnetz.de/w32/2020/ - https://qemu.weilnetz.de/w64/2020/ In theory, the old QEMU choco packages should be fixed (their powershell scripts should be updated to reference the new URLs on Stefan Weil's website). However, this PlatformCI issue is blocking the merging of the security fix for TianoCore#3356, so getting PlatformCI functional again is urgent. Let's bump our QEMU choco package requirement to 2021.5.5, whose URLs work, for now. (Currently we cannot use any other choco package version, as Stefan's directories <https://qemu.weilnetz.de/w32> and <https://qemu.weilnetz.de/w64>, without any further subdirectories, only offer the 20210505 EXE files.) Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210609155731.10431-1-lersek@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg/README: Fix typo in READMEKAAIRA GUPTA2021-06-071-1/+1
| | | | | | | | | | | | | | Fix typographical error in the OvmfPkg/README by correcting the 'an' mistyped as 'and'. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: mikuback@linux.microsoft.com Cc: ray.ni@intel.com Signed-off-by: Kaaira Gupta <kaaira7319@gmail.com> Message-Id: <20210605171712.GA16976@kaaira-HP-Pavilion-Notebook> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: restrict XenPlatformLib to BdsDxe in the IA32, IA32X64, X64 DSCsLaszlo Ersek2021-06-043-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf" library instance is used in the following platform DSC files in edk2: OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc OvmfPkg/OvmfXen.dsc The Xen customizations are very light-weight in this PlatformBootManagerLib instance. Isolating them statically, for the sake of the first three DSC files, would save negligible binary code size, and would likely worsen code complexity (by way of introducing new internal interfaces) or blow up source code size (by duplicating almost the entire lib instance source code). So for now, keep this one bit of Xen dynamism even on QEMU. However, because it's only PlatformBootManagerLib now that uses XenPlatformLib (for the above-stated enlightenment), restrict the XenPlatformLib class resolution in the first three DSC files to the only DXE driver that consumes PlatformBootManagerLib (and therefore XenPlatformLib): BdsDxe. This will cause a build failure later if someone attempts to call a XenPlatformLib API (that is, tries to re-introduce Xen enlightenment) in a different module in these non-Xen DSC files. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-44-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/SmbiosPlatformDxe: split Xen entry point from QEMU entry pointLaszlo Ersek2021-06-046-82/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the SmbiosTablePublishEntry() function from "SmbiosPlatformDxe.c". "SmbiosPlatformDxe.c" becomes hypervisor-agnostic. Add SmbiosTablePublishEntry() back, simplified for QEMU, to the existent file "Qemu.c". The GetQemuSmbiosTables() function no longer needs to be declared in "SmbiosPlatformDxe.h"; "SmbiosPlatformDxe.h" becomes hypervisor-agnostic. Add SmbiosTablePublishEntry() back, renamed and simplified for Xen, to the new, arch-independent file "Xen.c". (The existent Xen-specific C files are arch-dependent.) Update both INF files; remove the dependencies that are now superfluous in each. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-43-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/SmbiosPlatformDxe: create Xen-specific module INF fileLaszlo Ersek2021-06-043-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "OvmfPkg/SmbiosPlatformDxe" is structured somewhat differently from the drivers duplicated and trimmed thus far in this series. The final QEMU and Xen versions will share a relatively significant amount of code, therefore duplicating the whole driver is less useful, even temporarily. Instead, duplicate the INF file, in preparation for customizing the entry point function. Because ArmVirtXen doesn't actually include OvmfPkg/SmbiosPlatformDxe [*], there is only one platform that's supposed to consume the new driver: OvmfXen. Switch OvmfXen to the new driver at once. [*] See commit 164cf4038357 ("OvmfPkg: SmbiosPlatformDxe: restrict current Xen code to IA32/X64", 2015-07-26). This patch is best viewed with "git show --find-copies-harder". Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-42-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/SmbiosPlatformDxe: declare InstallAllStructures() in header fileLaszlo Ersek2021-06-041-0/+11
| | | | | | | | | | | | | | | Add an extern declaration for the InstallAllStructures() function to the "SmbiosPlatformDxe.h" header file. (The leading comment block and the prototype are simply copied from "SmbiosPlatformDxe.c".) Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-41-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/SmbiosPlatformDxe: split GetXenSmbiosTables() decl. to new headerLaszlo Ersek2021-06-046-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Move the declaration of the GetXenSmbiosTables() function to a new header file called "XenSmbiosPlatformDxe.h". (The only declaration that remains in "SmbiosPlatformDxe.h" for now is that of GetQemuSmbiosTables().) Modify the pattern in "Maintainers.txt" so that the new file be covered in the "OvmfPkg: Xen-related modules" section. This patch is best viewed with "git show --no-renames". Cc: Andrew Fish <afish@apple.com> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-40-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* OvmfPkg/SmbiosPlatformDxe: locate SMBIOS protocol in InstallAllStructures()Laszlo Ersek2021-06-041-16/+14
| | | | | | | | | | | | | | | | | Locate the SMBIOS protocol internally to the InstallAllStructures() function. This has no performance impact (InstallAllStructures() is only called once), but moving the code from the entry point function makes the latter smaller. And that will be useful when we split the entry point function to two versions. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-39-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/SmbiosPlatformDxe: return EFI_NOT_FOUND if there is no SMBIOS dataLaszlo Ersek2021-06-041-0/+1
| | | | | | | | | | | | | | | | | | | | According to the function-top comment, SmbiosTablePublishEntry() is supposed to return an error code if no SMBIOS data is found, from either GetXenSmbiosTables() or GetQemuSmbiosTables(). Currently the function returns EFI_SUCCESS in this case however (propagated from gBS->LocateProtocol()). Make the return code match the documentation. (This issue is not too important, but it gets in the way of splitting the entry point function next.) Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-38-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/SmbiosPlatformDxe: clean up #includes and INFLaszlo Ersek2021-06-045-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Sort all sections in the INF file. - Remove unused packages (MdeModulePkg) and lib classes (BaseMemoryLib) from the INF file. - Restrict some lib classes (BaseLib, HobLib) and GUIDs (gEfiXenInfoGuid) to IA32 and X64, in the INF file; only the IA32/X64 Xen implementation requires these. - Don't make "SmbiosPlatformDxe.h" #include everything just as a convenience. Spell out directly needed #includes in every file (annotate each with an example identifier consumed), drop unused #includes. - Keep #includes sorted. - Remove the leading underscore from the #include guard macro name in "SmbiosPlatformDxe.h". Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-37-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/PciHostBridgeLibScan: clean up file names and file-top commentsLaszlo Ersek2021-06-044-5/+6
| | | | | | | | | | | | | | | | | | | | Rename "XenSupport.c" to "ScanForRootBridges.c", after the main function in it. Update the file-top comments; refer to both Bhyve and Xen. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-36-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/PciHostBridgeLibScan: remove PcdOvmfHostBridgePciDevIdLaszlo Ersek2021-06-042-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf" instance is used in the following platforms in edk2: OvmfPkg/Bhyve/BhyveX64.dsc OvmfPkg/OvmfXen.dsc Neither Bhyve nor Xen provide a Q35 board, therefore the expression PcdGet16 (PcdOvmfHostBridgePciDevId) != INTEL_Q35_MCH_DEVICE_ID always evaluates to TRUE, in the PciHostBridgeLibScan instance. Replace the expression with constant TRUE, eliminating the PCD dependency. (In effect, this reports that the root bridge being registered does not support extended PCI config space.) Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-35-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/PciHostBridgeLibScan: remove QEMU (fw_cfg) supportLaszlo Ersek2021-06-042-68/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf" instance is used in the following platforms in edk2: OvmfPkg/Bhyve/BhyveX64.dsc OvmfPkg/OvmfXen.dsc Both platforms define "PcdPciDisableBusEnumeration" with Fixed-at-Build access method, and TRUE value. Remove the PCD from the PciHostBridgeLibScan instance, and everything else that is useful only when the PCD is FALSE. In practice, this removes the PciHostBridgeUtilityGetRootBridges() function call, which is based on fw-cfg; see "OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c". (Note that the dependency on PciHostBridgeUtilityLib remains in place, given that the PciHostBridgeLibScan instance continues using lower-level functions from the library that do not depend on fw-cfg.) Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-34-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/PciHostBridgeLib: remove Bhyve and Xen supportLaszlo Ersek2021-06-044-497/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf" instance is used by the following platforms in edk2: OvmfPkg/AmdSev/AmdSevX64.dsc OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc All these platforms statically inherit PcdPciDisableBusEnumeration=FALSE from "MdeModulePkg.dec". Remove the the PCD and everything that depends on it from the PciHostBridgeLib instance. Namely, remove the logic that determines the root bridge apertures by (a) scanning the entire bus, device and function number space, and (b) parsing the BAR values that were pre-set by the Bhyve or Xen machinery. "XenSupport.c" used to be listed explicitly in "Maintainers.txt", remove it from that spot too. Cc: Andrew Fish <afish@apple.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-33-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* OvmfPkg/OvmfXen: consume PciHostBridgeLibScanLaszlo Ersek2021-06-041-1/+1
| | | | | | | | | | | | | | | | | Switch the OvmfXen platform from the "OvmfPkg/PciHostBridgeLib" instance to the "OvmfPkg/PciHostBridgeLibScan" instance. Currently this is a no-op functionally; we'll customize the "PciHostBridgeLibScan" instance later. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-32-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/Bhyve: consume PciHostBridgeLibScanLaszlo Ersek2021-06-041-1/+1
| | | | | | | | | | | | | | | | | | Switch the Bhyve platform from the "OvmfPkg/PciHostBridgeLib" instance to the "OvmfPkg/PciHostBridgeLibScan" instance. Currently this is a no-op functionally; we'll customize the "PciHostBridgeLibScan" instance later. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-31-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
* OvmfPkg/PciHostBridgeLibScan: create from PciHostBridgeLibLaszlo Ersek2021-06-044-0/+673
| | | | | | | | | | | | | | | | | | | | | | | | | | | Create an almost verbatim copy of the "OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf" library instance. The new PciHostBridgeLibScan instance will ultimately duplicate a negligible amount of code from the original, and will be used by the Bhyve and OvmfXen platforms. List the new driver in "Maintainers.txt", in the "OvmfPkg: bhyve-related modules" and "OvmfPkg: Xen-related modules" sections. This patch should be reviewed with "git show --find-copies-harder". Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-30-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/PciHostBridgeLib: consolidate #includes and INF file sectionsLaszlo Ersek2021-06-043-30/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | - In every C file, list every necessary public #include individually, with an example identifier that's actually consumed. - Place all public #includes first, all module-private #includes second. Separate them with a single empty line. Keep each section sorted in itself. - Sort all sections in the INF file, except [Defines]. - Add unlisted lib classes. - Remove unnecessary #include directives, add unlisted #include directives. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-29-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/IncompatiblePciDeviceSupportDxe: remove PcdPciDisableBusEnumerationLaszlo Ersek2021-06-042-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | At this point, the IncompatiblePciDeviceSupportDxe driver is included in the following platforms in edk2: OvmfPkg/AmdSev/AmdSevX64.dsc OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc All those platforms inherit FALSE for "PcdPciDisableBusEnumeration" from "MdeModulePkg.dec". This makes the PcdGetBool() call in the entry point of the driver superfluous; remove it. Clean up now unused dependencies in the INF file as well. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-28-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/Bhyve: remove IncompatiblePciDeviceSupport DXE driverLaszlo Ersek2021-06-042-2/+0
| | | | | | | | | | | | | | | | | | | | | The entry point function of "OvmfPkg/IncompatiblePciDeviceSupportDxe", namely DriverInitialize() [OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c], bails out immediately if "PcdPciDisableBusEnumeration" is TRUE. The Bhyve platform statically assigns this PCD TRUE. Thus, remove the driver from the Bhyve platform. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-27-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/OvmfXen: remove IncompatiblePciDeviceSupport DXE driverLaszlo Ersek2021-06-042-2/+0
| | | | | | | | | | | | | | | | | | | | | The entry point function of "OvmfPkg/IncompatiblePciDeviceSupportDxe", namely DriverInitialize() [OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c], bails out immediately if "PcdPciDisableBusEnumeration" is TRUE. The OvmfXen platform statically assigns this PCD TRUE. Thus, remove the driver from the OvmfXen platform. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-26-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/Bhyve: make "PcdPciDisableBusEnumeration" Fixed-at-BuildLaszlo Ersek2021-06-042-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Bhyve platform specifies the dynamic access method for "PcdPciDisableBusEnumeration" needlessly. After the DSC file sets the PCD to TRUE by default, the PCD is never written again. In particular, the "OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf" file references the PCD superfluously. Make the PCD Fixed-At-Build, and remove the PCD reference from the INF file. (Note that further simplifications are possible in "OvmfPkg/Bhyve/AcpiPlatformDxe", but those are out of scope for this patch series.) Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-25-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
* OvmfPkg: drop PcdPciDisableBusEnumeration from the AmdSev platformLaszlo Ersek2021-06-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | With the Xen-dependent PcdSetBoolS() call removed from OvmfPkg/PlatformPei, the "AmdSevX64.dsc" platform never writes "PcdPciDisableBusEnumeration". This means we don't need a dynamic default for the PCD in the DSC file; it could be declared Fixed-at-Build. However, because the PCD's default value in "MdeModulePkg.dec" is FALSE, remove the (same-value) platform default altogether. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-24-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg: drop PcdPciDisableBusEnumeration from the IA32, IA32X64, X64 DSCsLaszlo Ersek2021-06-043-3/+0
| | | | | | | | | | | | | | | | | | | | With the Xen-dependent PcdSetBoolS() call removed from OvmfPkg/PlatformPei, the "OvmfPkgIa32.dsc", "OvmfPkgIa32X64.dsc", "OvmfPkgX64.dsc" platforms never write "PcdPciDisableBusEnumeration". This means we don't need a dynamic default for the PCD in the DSC files; it could be declared Fixed-at-Build. However, because the PCD's default value in "MdeModulePkg.dec" is FALSE, remove the (same-value) platform defaults altogether. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-23-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/PlatformPei: remove Xen supportLaszlo Ersek2021-06-046-378/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "OvmfPkg/PlatformPei/PlatformPei.inf" module is used by the following platform DSCs: OvmfPkg/AmdSev/AmdSevX64.dsc OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc Remove Xen support from "OvmfPkg/PlatformPei", including any dependencies that now become unused. The basic idea is to substitute FALSE for "mXen". Remove "OvmfPkg/PlatformPei" from the "OvmfPkg: Xen-related modules" section of "Maintainers.txt". This patch is best reviewed with "git show -b -W". Cc: Andrew Fish <afish@apple.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-22-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* OvmfPkg/XenAcpiPlatformDxe: remove delayed ACPI table installationLaszlo Ersek2021-06-042-62/+2
| | | | | | | | | | | | | | | | | | | | | | | | Because "PcdPciDisableBusEnumeration" is always TRUE in the OvmfXen platform, we can remove the delayed ACPI table installation from XenAcpiPlatformDxe. A number of dependencies become useless this way; remove them too. (Note that, conversely, in the QemuFwCfgAcpiPlatformDxe driver, we *cannot* assume that "PcdPciDisableBusEnumeration" is always FALSE, regardless of Xen: in the ArmVirtQemu platform, the PCD may carry either FALSE or TRUE, dependent on whether or not the QEMU "virt" machine configuration includes a PCIe host controller, respectively.) Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-21-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/OvmfXen: make "PcdPciDisableBusEnumeration" Fixed-at-BuildLaszlo Ersek2021-06-045-28/+1
| | | | | | | | | | | | | | | | | | | | | | | The OvmfXen platform specifies the dynamic access method for "PcdPciDisableBusEnumeration" needlessly. After the DSC file sets the PCD to TRUE by default, the InitializeXen() function in XenPlatformPei superfluously sets the PCD to TRUE again. There are no other writes to the PCD in the platform. Make the PCD Fixed-At-Build, and remove the access (in fact, the whole InitializeXen() function) from XenPlatformPei. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-20-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/AcpiTables: remove unused moduleLaszlo Ersek2021-06-047-1131/+0
| | | | | | | | | | | | | | The "OvmfPkg/AcpiTables/AcpiTables.inf" module is no longer used by any module in edk2; remove it. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-19-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/Bhyve/AcpiPlatformDxe: fix file path typo in commentLaszlo Ersek2021-06-041-1/+1
| | | | | | | | | | | | | | | | | | The built-in ACPI tables for Bhyve are located in the "OvmfPkg/Bhyve/AcpiTables" module, not in the "OvmfPkg/AcpiTables" module. Correct the typo in a code comment. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Peter Grehan <grehan@freebsd.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-18-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
* OvmfPkg/XenAcpiPlatformDxe: remove OVMF's built-in ACPI tablesLaszlo Ersek2021-06-044-212/+0
| | | | | | | | | | | | | | | | | | | Xen is an advanced hypervisor; no Xen guest can function correctly without the hypervisor's dynamically provided ACPI tables. Remove the built-in (fallback) tables from XenAcpiPlatformDxe -- and the OvmfXen platform. Remove any dependencies from XenAcpiPlatformDxe that are no longer needed. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-17-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/XenAcpiPlatformDxe: remove the InstallAcpiTable() helper functionLaszlo Ersek2021-06-043-63/+36
| | | | | | | | | | | | | | | | | | The InstallAcpiTable() helper function buys us nothing. Reduce code complexity by removing the function. This patch is best viewed with "git show -b". Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-16-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/XenAcpiPlatformDxe: remove QEMU fw_cfg dependencyLaszlo Ersek2021-06-044-542/+1
| | | | | | | | | | | | | | | | | | | | | | The QemuDetected() function wraps QemuFwCfgIsAvailable(); it always fails on Xen. Because of that, we can eliminate the QemuDetected() call itself from the Xen ACPI platform driver, and then the rest of "Qemu.c" becomes useless -- the workhorse function of that source file is QemuInstallAcpiTable(), which we no longer call. Remove any dependencies that are no longer needed by the XenAcpiPlatformDxe driver. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-15-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/XenAcpiPlatformDxe: remove the QEMU ACPI linker/loader clientLaszlo Ersek2021-06-046-1717/+1
| | | | | | | | | | | | | | | | | | | | The root of the QEMU ACPI linker/loader client in XenAcpiPlatformDxe is the InstallQemuFwCfgTables() function. This function always fails on Xen, due to its top-most QemuFwCfgFindFile() call. Remove the InstallQemuFwCfgTables() function call from XenAcpiPlatformDxe, along with all dependencies that now become unused. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-14-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/AcpiPlatformDxe: remove the "AcpiPlatformDxe.inf" driverLaszlo Ersek2021-06-045-1192/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf" module is no longer referenced in any platform DSC file; remove it. That orphans the "AcpiPlatform.c", "Qemu.c" and "Xen.c" files in the "OvmfPkg/AcpiPlatformDxe/" directory; remove them. That in turn removes the only definitions of the InstallAcpiTable(), QemuDetected(), QemuInstallAcpiTable(), InstallXenTables() functions in the "OvmfPkg/AcpiPlatformDxe/" directory, so remove their declarations from "AcpiPlatform.h". Remove "OvmfPkg/AcpiPlatformDxe/Xen.c" from the "OvmfPkg: Xen-related modules" section of "Maintainers.txt", as well. Cc: Andrew Fish <afish@apple.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-13-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* OvmfPkg/XenAcpiPlatformDxe: create from AcpiPlatformDxeLaszlo Ersek2021-06-0411-2/+3023
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create an almost verbatim copy of the "OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf" driver for the OvmfXen platform. We're going to trim the driver in subsequent patches. Ultimately, the XenAcpiPlatformDxe driver will duplicate a negligible amount of code that is currently present in the QemuFwCfgAcpiPlatformDxe driver. List the new driver in "Maintainers.txt", in the "OvmfPkg: Xen-related modules" section. Switch the OvmfXen platform to the new driver at once. This patch should be reviewed with "git show --find-copies-harder". Cc: Andrew Fish <afish@apple.com> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-12-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* OvmfPkg/AcpiPlatformDxe: consolidate #includes and [LibraryClasses]Laszlo Ersek2021-06-0410-33/+41
| | | | | | | | | | | | | | | | | | | | | | | | - #include only such public headers in "AcpiPlatform.h" that are required by the function declarations and type definitions introduced in "AcpiPlatform.h". Don't use "AcpiPlatform.h" as a convenience #include file. - In every file, list every necessary public #include individually, with an example identifier that's actually consumed. - Remove unnecessary lib classes, add unlisted lib classes. - Remove unnecessary #include directives, add unlisted #include directives. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-11-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/AcpiPlatformDxe: move "QemuLoader.h" to IndustryStandardLaszlo Ersek2021-06-044-3/+1
| | | | | | | | | | | | | | | Turn the "QemuLoader.h" header into a public (IndustryStandard) one. The QEMU ACPI linker-loader interface is stable between QEMU and multiple guest firmwares. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-10-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/AcpiPlatformDxe/QemuLoader.h: remove QemuFwCfgLib class dependencyLaszlo Ersek2021-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | "QemuLoader.h" needs the QEMU_FW_CFG_FNAME_SIZE macro. This macro used to live in the QemuFwCfgLib class header, but we moved it to the more foundational IndustryStandard include file called "QemuFwCfg.h" in commit 5583a8a4ffd0 ("OvmfPkg/QemuFwCfgLib: move types/macros from lib class to IndustryStandard", 2017-02-22). Replace the lib class dependency with the more basic IndustryStandard dependency in "QemuLoader.h". Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-9-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/AcpiPlatformDxe: sort #includes and [LibraryClasses]Laszlo Ersek2021-06-047-31/+31
| | | | | | | | | | | | | | | | | Place all public #includes first, all module-private #includes second. Separate them with a single empty line. Keep each section sorted in itself. Sort all sections in both INF files. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-8-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/AcpiPlatformDxe: fix header file wartsLaszlo Ersek2021-06-042-6/+6
| | | | | | | | | | | | | | | | | | | - Remove the leading underscores from the #include guard macro names; clean up the names in general. - Remove the useless "Include/" directory prefix from the public header pathnames. - Fix incorrect file-top comment. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-7-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg/README: bump minimum QEMU version to 1.7.1, machine types to 1.7Laszlo Ersek2021-06-041-35/+8
| | | | | | | | | | | | | | | Due to switching to the QemuFwCfgAcpiPlatformDxe driver earlier in this series, require QEMU version 1.7.1 in the "OvmfPkg/README" file, and require 1.7 or later machine types too. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-6-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>