Skip to contentSkip to conversation

machine_kexec.c: Fix the description of segment handling.

PATCH In review Eric W. Biederman 2 participants 2 messages Jul 15, 2006 – Jul 17, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 machine_kexec.c: Fix the description of segment handling.

One of my original comments in machine_kexec was unclear and this should fix it.

---

Be very careful with this patch. It seems to be surrounded by a somebody else's problem field.

I wrote it months ago, and then forgot it. I started writing this email message several days ago and then forgot it.

Hopefully including this patch won't cause this effect to spread and cause the entire kernel to be universally treated as somebody else's problem. :)

 arch/i386/kernel/machine_kexec.c   |   13 +++++--------
 arch/x86_64/kernel/machine_kexec.c |   13 +++++--------
 2 files changed, 10 insertions(+), 16 deletions(-)
arch/i386/kernel/machine_kexec.c +5 -8
index 511abe5..a696f93 100644
@@ -189,14 +189,11 @@ NORET_TYPE void machine_kexec(struct kim
 	memcpy((void *)reboot_code_buffer, relocate_new_kernel,
 						relocate_new_kernel_size);
 
-	/* The segment registers are funny things, they are
-	 * automatically loaded from a table, in memory wherever you
-	 * set them to a specific selector, but this table is never
-	 * accessed again you set the segment to a different selector.
-	 *
-	 * The more common model is are caches where the behide
-	 * the scenes work is done, but is also dropped at arbitrary
-	 * times.
+	/* The segment registers are funny things, they have both a
+	 * visible and an invisible part.  Whenever the visible part is
+	 * set to a specific selector, the invisible part is loaded
+	 * with from a table in memory.  At no other time is the
+	 * descriptor table in memory accessed. 
 	 *
 	 * I take advantage of this here by force loading the
 	 * segments, before I zap the gdt with an invalid value.
arch/x86_64/kernel/machine_kexec.c +5 -8
index 83fb24a..ba9b571 100644
@@ -207,14 +207,11 @@ NORET_TYPE void machine_kexec(struct kim
 	__flush_tlb();
 
 
-	/* The segment registers are funny things, they are
-	 * automatically loaded from a table, in memory wherever you
-	 * set them to a specific selector, but this table is never
-	 * accessed again unless you set the segment to a different selector.
-	 *
-	 * The more common model are caches where the behide
-	 * the scenes work is done, but is also dropped at arbitrary
-	 * times.
+	/* The segment registers are funny things, they have both a
+	 * visible and an invisible part.  Whenever the visible part is
+	 * set to a specific selector, the invisible part is loaded
+	 * with from a table in memory.  At no other time is the
+	 * descriptor table in memory accessed. 
 	 *
 	 * I take advantage of this here by force loading the
 	 * segments, before I zap the gdt with an invalid value.
Signature · 1 line
1.4.1.gac83a
#1 lore raw

Re: [PATCH] machine_kexec.c: Fix the description of segment?handling.

Quoted 6 lines · Eric W. Biederman

One of my original comments in machine_kexec was unclear and this should fix it. =

Thanks, that looks a lot clearer to me.

Acked: Horms <[email protected]>

Signature · 3 lines
Horms                                           
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/