summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Library/LoadLinuxLib
Commit message (Collapse)AuthorAgeFilesLines
* OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ onesRebecca Cran2020-04-301-4/+4
| | | | | | | | | | | | | Generated mechanically with: find OvmfPkg -type f -exec sed -i -e 's/EFI_D_/DEBUG_/g' {} \; Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200429215327.606467-1-rebecca@bsdio.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-096-42/+6
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/LoadLinuxLib: list "LoadLinuxLib.h" in the INF fileLaszlo Ersek2018-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | The header file declares the InitLinuxDescriptorTables() and SetLinuxDescriptorTables() functions, which are called from "Linux.c" and implemented in "LinuxGdt.c". The header file also declares the JumpToKernel() and JumpToUefiKernel() functions, which are similarly called from "Linux.c". They are implemented (dependent on architecture) in "Ia32/JumpToKernel.nasm" and "X64/JumpToKernel.nasm". Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Suggested-by: Michael Kinney <michael.d.kinney@intel.com> Ref: http://mid.mail-archive.com/E92EE9817A31E24EB0585FDF735412F56327F7D3@ORSMSX113.amr.corp.intel.com Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: Make more use of ARRAY_SIZE()Gary Lin2016-10-271-1/+1
| | | | | | | | | | | | Convert the remaining pieces to make the code shorter and more readable. Cc: Justen Jordan <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: tweak subject line] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: fix conversion specifiers in DEBUG format stringsLaszlo Ersek2015-07-281-1/+2
| | | | | | | | | | | | Cc: Scott Duplichan <scott@notabs.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Reported-by: Scott Duplichan <scott@notabs.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Build-tested-by: Scott Duplichan <scott@notabs.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18095 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg LoadLinuxLib: Convert X64/JumpToKernel.asm to NASMJordan Justen2014-10-313-127/+33
| | | | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert X64/JumpToKernel.asm to X64/JumpToKernel.nasm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16288 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg LoadLinuxLib: Convert Ia32/JumpToKernel.asm to NASMJordan Justen2014-10-313-60/+8
| | | | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert Ia32/JumpToKernel.asm to Ia32/JumpToKernel.nasm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16287 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: Fix VS2005 build warningsJordan Justen2014-09-251-3/+3
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16171 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: EFI handover flags are in Bp->hdr.xloadflagsMatt Fleming2013-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | LoadLinux() is looking at the wrong field for the kernel's EFI handover protocol flags. It's not currently possible for JumpToUefiKernel() to ever be called (even accidentally) because BIT2 and BIT3 of Bp->hdr.load_flags are never set in modern kernels, which means that control is always transferred to the kernel via the legacy entry point. Look at the correct field so that the EFI handover protocol is used whenever it's available. Contributed-under: TianoCore Contribution Agreement 1.0 Cc: David Woodhouse <David.Woodhouse@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14721 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: allocate the EFI memory map for Linux as Loader DataLaszlo Ersek2013-08-181-2/+6
| | | | | | | | | | | | | | | | | | | | | | In Linux, efi_memblock_x86_reserve_range() and efi_reserve_boot_services() expect that whoever allocates the EFI memmap allocates it in Loader Data type memory. Linux's own exit_boot()-->low_alloc() complies, but SetupLinuxMemmap() in LoadLinuxLib doesn't. The memory type discrepancy leads to efi_memblock_x86_reserve_range() and efi_reserve_boot_services() both trying to reserve the range backing the memmap, resulting in memmap entry truncation in efi_reserve_boot_services(). This fix also makes this allocation consistent with all other persistent allocations in "OvmfPkg/Library/LoadLinuxLib/Linux.c". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reported-and-tested-by: Borislav Petkov <bp@suse.de> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14555 6f19259b-4bc3-4df7-8a09-765794883524
* Fix IA32 build failure.Ruiyu Ni2013-07-161-3/+3
| | | | | | Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14472 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg LoadLinuxLib: Use kernel's EFI entry point where availablejljusten2013-02-146-7/+107
| | | | | | | | | | | | | | Usage of the EFI entry point was made feasible in the kernel x64 boot protocol 2.12 where a 32-bit & 64-bit entry point became well defined. http://git.kernel.org/linus/09c205af Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14132 6f19259b-4bc3-4df7-8a09-765794883524
* Revert "OvmfPkg: LoadLinuxLib: Use kernel's EFI entry point where available"jljusten2013-01-286-106/+7
| | | | | | | This reverts commit r14053. This change depends on changes to the kernel which are not yet finalized/upstream. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14110 6f19259b-4bc3-4df7-8a09-765794883524
* Fix xcode tool chain assembly issue. andrewfish2013-01-231-1/+1
| | | | | | | | | | Contributed-under: TianoCore Contribution Agrement 1.0 Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> signed-off-by: Andrew Fish <afish@apple.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14078 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: Fix Xcode assembly issuejljusten2013-01-161-2/+2
| | | | | | | | | | | | | The Xcode assembler is much pickier than GCC. Also the 64-bit linker is not a fan of relocations so it is better to us IP relative code, but at least it removes a relocation entry. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrew Fish <afish@apple.com> [jordan.l.justen@intel.com: use .byte for retfq rather than lret] Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14055 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: LoadLinuxLib: Use kernel's EFI entry point where availablejljusten2013-01-166-9/+108
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14053 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: LoadLinuxLib: Zero kernel parameters instead of passing garbagejljusten2013-01-161-0/+28
| | | | | | | | | | | | | | | We're supposed to zero everything in the kernel bootparams that we don't explicitly initialise, other than the setup_header from 0x1f1 onwards for a precisely defined length, which is copied from the bzImage. We're *not* supposed to just pass the garbage that we happened to find in the bzImage file surrounding the setup_header. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14052 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: LoadLinuxLib: Fix check for relocatable kerneljljusten2013-01-161-3/+4
| | | | | | | | | | | Boot protocol 2.05 just means that the relocatable_kernel field is present in the header. We should actually check that it's *set*. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14051 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: LoadLinuxLib: Fix kernel entry for 64-bit OVMFjljusten2013-01-142-6/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently just jump to offset 0x200 in the kernel image, in 64-bit mode. This is completely broken. If it's a 32-bit kernel, we'll be jumping into the compressed data payload. If it's a 64-bit kernel, it'll work... but the 0x200 offset is explicitly marked as 'may change in the future', has already changed from 0x100 to 0x200 in the past with no fanfare, and bootloaders are instructed that they should look at the ELF header to find the offset. So although it does actually work today, it's still broken in the "someone needs to whipped for doing it this way" sense of the word. In fact, the same bug exists in other bootloaders so the 0x200 offset probably *is* now set in stone. But still it's only valid to use it if we *know* it's a 64-bit kernel. And we don't. There *is* no ELF header that we can look at when we're booting a bzImage, and we can't rely on it having a PE/COFF header either. The 32-bit entry point is always guaranteed to work, and we need to support it anyway. So let's just *always* use it, in 32-bit mode, and then we don't have to make up some horrible heuristics for detecting 32-bit vs. 64-bit kernels. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14045 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: Add LoadLinuxLib library implementationjljusten2012-11-028-0/+1036
This code is based on efilinux's bzimage support. git://git.kernel.org/pub/scm/boot/efilinux/efilinux.git Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Matt Fleming <matt.fleming@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13922 6f19259b-4bc3-4df7-8a09-765794883524