From: Matt Fleming <[email protected]>

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 <[email protected]>
Cc: Jordan Justen <[email protected]>
Cc: Borislav Petkov <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
---
 OvmfPkg/Library/LoadLinuxLib/Linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/LoadLinuxLib/Linux.c 
b/OvmfPkg/Library/LoadLinuxLib/Linux.c
index 4a3e2c1..37b14f5 100644
--- a/OvmfPkg/Library/LoadLinuxLib/Linux.c
+++ b/OvmfPkg/Library/LoadLinuxLib/Linux.c
@@ -647,7 +647,7 @@ LoadLinux (
 
   Bp->hdr.code32_start = (UINT32)(UINTN) Kernel;
   if (Bp->hdr.version >= 0x20c && Bp->hdr.handover_offset &&
-      (Bp->hdr.load_flags & (sizeof (UINTN) == 4 ? BIT2 : BIT3))) {
+      (Bp->hdr.xloadflags & (sizeof (UINTN) == 4 ? BIT2 : BIT3))) {
     DEBUG ((EFI_D_INFO, "Jumping to kernel EFI handover point at ofs %x\n", 
Bp->hdr.handover_offset));
 
     DisableInterrupts ();
-- 
1.8.1.4


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to