dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

23d2ea
From 9889cf801bb7e8b70a249873a9c8254ac6ef8a39 Mon Sep 17 00:00:00 2001
39700a
From: Piotr Krysiuk <piotras@gmail.com>
39700a
Date: Sun, 20 Apr 2014 15:58:45 +0200
27a4da
Subject: [PATCH 079/260] Allow loading old kernels by placing GDT in
39700a
 conventional memory.
39700a
39700a
---
39700a
 ChangeLog                      |  5 +++++
39700a
 grub-core/lib/i386/relocator.c | 11 +++++++----
39700a
 2 files changed, 12 insertions(+), 4 deletions(-)
39700a
39700a
diff --git a/ChangeLog b/ChangeLog
27a4da
index 35564681a..73a892899 100644
39700a
--- a/ChangeLog
39700a
+++ b/ChangeLog
39700a
@@ -1,3 +1,8 @@
39700a
+2014-04-20  Piotr Krysiuk  <piotras@gmail.com>
39700a
+
39700a
+	* grub-core/lib/i386/relocator.c: Allow loading old kernels by placing
39700a
+	GDT in conventional memory.
39700a
+
39700a
 2014-04-10  Colin Watson  <cjwatson@ubuntu.com>
39700a
 
39700a
 	* util/grub.d/30_os-prober.in: Tolerate devices with no filesystem
39700a
diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i386/relocator.c
27a4da
index d2a1b27ae..ffaf25f08 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;
39700a
-- 
27a4da
2.13.0
39700a