dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch

28f7f8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
39700a
From: Piotr Krysiuk <piotras@gmail.com>
39700a
Date: Sun, 20 Apr 2014 15:58:45 +0200
28f7f8
Subject: [PATCH] Allow loading old kernels by placing GDT in conventional
28f7f8
 memory.
39700a
39700a
---
39700a
 grub-core/lib/i386/relocator.c | 11 +++++++----
28f7f8
 ChangeLog                      |  5 +++++
39700a
 2 files changed, 12 insertions(+), 4 deletions(-)
39700a
39700a
diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i386/relocator.c
28f7f8
index d2a1b27ae0e..ffaf25f088d 100644
39700a
--- a/grub-core/lib/i386/relocator.c
39700a
+++ b/grub-core/lib/i386/relocator.c
39700a
@@ -81,10 +81,13 @@ grub_relocator32_boot (struct grub_relocator *rel,
39700a
   void *relst;
39700a
   grub_relocator_chunk_t ch;
39700a
 
39700a
-  err = grub_relocator_alloc_chunk_align (rel, &ch, 0,
39700a
-					  (0xffffffff - RELOCATOR_SIZEOF (32))
39700a
-					  + 1, RELOCATOR_SIZEOF (32), 16,
39700a
-					  GRUB_RELOCATOR_PREFERENCE_NONE,
39700a
+  /* Specific memory range due to Global Descriptor Table for use by payload
39700a
+     that we will store in returned chunk.  The address range and preference
39700a
+     are based on "THE LINUX/x86 BOOT PROTOCOL" specification.  */
39700a
+  err = grub_relocator_alloc_chunk_align (rel, &ch, 0x1000,
39700a
+					  0x9a000 - RELOCATOR_SIZEOF (32),
39700a
+					  RELOCATOR_SIZEOF (32), 16,
39700a
+					  GRUB_RELOCATOR_PREFERENCE_LOW,
39700a
 					  avoid_efi_bootservices);
39700a
   if (err)
39700a
     return err;
28f7f8
diff --git a/ChangeLog b/ChangeLog
28f7f8
index 35564681a4d..73a89289945 100644
28f7f8
--- a/ChangeLog
28f7f8
+++ b/ChangeLog
28f7f8
@@ -1,3 +1,8 @@
28f7f8
+2014-04-20  Piotr Krysiuk  <piotras@gmail.com>
28f7f8
+
28f7f8
+	* grub-core/lib/i386/relocator.c: Allow loading old kernels by placing
28f7f8
+	GDT in conventional memory.
28f7f8
+
28f7f8
 2014-04-10  Colin Watson  <cjwatson@ubuntu.com>
28f7f8
 
28f7f8
 	* util/grub.d/30_os-prober.in: Tolerate devices with no filesystem