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

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