mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andi Kleen <ak@suse.de>, Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] kill default_ldt
Date: Fri, 18 Aug 2006 12:01:25 +0100	[thread overview]
Message-ID: <44E59E05.4070804@goop.org> (raw)

The default LDT is completely unused now that iBCS is no longer
supported, so get rid of it.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>

===================================================================

diff -r 121e0e54cca8 arch/i386/kernel/ldt.c
--- a/arch/i386/kernel/ldt.c	Fri Aug 18 11:36:24 2006 +0100
+++ b/arch/i386/kernel/ldt.c	Fri Aug 18 11:57:04 2006 +0100
@@ -160,16 +160,14 @@ static int read_default_ldt(void __user 
 {
 	int err;
 	unsigned long size;
-	void *address;
 
 	err = 0;
-	address = &default_ldt[0];
 	size = 5*sizeof(struct desc_struct);
 	if (size > bytecount)
 		size = bytecount;
 
 	err = size;
-	if (copy_to_user(ptr, address, size))
+	if (clear_user(ptr, size))
 		err = -EFAULT;
 
 	return err;
diff -r 121e0e54cca8 arch/i386/kernel/traps.c
--- a/arch/i386/kernel/traps.c	Fri Aug 18 11:36:24 2006 +0100
+++ b/arch/i386/kernel/traps.c	Fri Aug 18 11:36:24 2006 +0100
@@ -58,9 +58,6 @@
 #include "mach_traps.h"
 
 asmlinkage int system_call(void);
-
-struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
-		{ 0, 0 }, { 0, 0 } };
 
 /* Do we ignore FPU interrupts ? */
 char ignore_fpu_irq = 0;
diff -r 121e0e54cca8 include/asm-i386/desc.h
--- a/include/asm-i386/desc.h	Fri Aug 18 11:36:24 2006 +0100
+++ b/include/asm-i386/desc.h	Fri Aug 18 11:56:31 2006 +0100
@@ -33,11 +33,6 @@ static inline struct desc_struct *get_cp
 	return (struct desc_struct *)per_cpu(cpu_gdt_descr, cpu).address;
 }
 
-/*
- * This is the ldt that every process will get unless we need
- * something other than this.
- */
-extern struct desc_struct default_ldt[];
 extern struct desc_struct idt_table[];
 extern void set_intr_gate(unsigned int irq, void * addr);
 
@@ -159,7 +154,7 @@ static inline void clear_LDT(void)
 {
 	int cpu = get_cpu();
 
-	set_ldt_desc(cpu, &default_ldt[0], 5);
+	set_ldt_desc(cpu, NULL, 0);
 	load_LDT_desc();
 	put_cpu();
 }
@@ -172,10 +167,8 @@ static inline void load_LDT_nolock(mm_co
 	void *segments = pc->ldt;
 	int count = pc->size;
 
-	if (likely(!count)) {
-		segments = &default_ldt[0];
-		count = 5;
-	}
+	if (likely(!count))
+		segments = NULL;
 		
 	set_ldt_desc(cpu, segments, count);
 	load_LDT_desc();


             reply	other threads:[~2006-08-18 11:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18 11:01 Jeremy Fitzhardinge [this message]
2006-08-18 12:16 ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44E59E05.4070804@goop.org \
    --to=jeremy@goop.org \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome