Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79736
b: refs/heads/master
c: 77e463d
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Jan 30, 2008
1 parent 1ed2979 commit f57d904
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 261 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70f5088dd5e9fbd3a71b3a5b01395c676158194b
refs/heads/master: 77e463d1040d6310211ac5162729f5d4afc4dd8c
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/Makefile_32
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extra-y := head_32.o init_task.o vmlinux.lds
CPPFLAGS_vmlinux.lds += -Ui386

obj-y := process_32.o signal_32.o entry_32.o traps_32.o irq_32.o \
ptrace_32.o time_32.o ioport_32.o ldt_32.o setup_32.o i8259_32.o sys_i386_32.o \
ptrace_32.o time_32.o ioport_32.o ldt.o setup_32.o i8259_32.o sys_i386_32.o \
pci-dma_32.o i386_ksyms_32.o i387_32.o bootflag.o e820_32.o\
quirks.o i8237.o topology.o alternative.o i8253.o tsc_32.o io_delay.o

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/Makefile_64
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CPPFLAGS_vmlinux.lds += -Ux86_64
EXTRA_AFLAGS := -traditional

obj-y := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o \
ptrace_64.o time_64.o ioport_64.o ldt_64.o setup_64.o i8259_64.o sys_x86_64.o \
ptrace_64.o time_64.o ioport_64.o ldt.o setup_64.o i8259_64.o sys_x86_64.o \
x8664_ksyms_64.o i387_64.o syscall_64.o vsyscall_64.o \
setup64.o bootflag.o e820_64.o reboot_64.o quirks.o i8237.o \
pci-dma_64.o pci-nommu_64.o alternative.o hpet.o tsc_64.o bugs_64.o \
Expand Down
25 changes: 20 additions & 5 deletions trunk/arch/x86/kernel/ldt_64.c → trunk/arch/x86/kernel/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
oldldt = pc->ldt;
memset(newldt + oldsize * LDT_ENTRY_SIZE, 0,
(mincount - oldsize) * LDT_ENTRY_SIZE);

#ifdef CONFIG_X86_64
/* CHECKME: Do we really need this ? */
wmb();
#endif
pc->ldt = newldt;
wmb();
pc->size = mincount;
Expand Down Expand Up @@ -110,11 +114,18 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
}

/*
* Don't touch the LDT register - we're already in the next thread.
* No need to lock the MM as we are the last user
*
* 64bit: Don't touch the LDT register - we're already in the next thread.
*/
void destroy_context(struct mm_struct *mm)
{
if (mm->context.size) {
#ifdef CONFIG_X86_32
/* CHECKME: Can this ever happen ? */
if (mm == current->active_mm)
clear_LDT();
#endif
if (mm->context.size * LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
Expand Down Expand Up @@ -159,10 +170,14 @@ static int read_ldt(void __user *ptr, unsigned long bytecount)

static int read_default_ldt(void __user *ptr, unsigned long bytecount)
{
/* Arbitrary number */
/* x86-64 default LDT is all zeros */
if (bytecount > 128)
bytecount = 128;
/* CHECKME: Can we use _one_ random number ? */
#ifdef CONFIG_X86_32
unsigned long size = 5 * sizeof(struct desc_struct);
#else
unsigned long size = 128;
#endif
if (bytecount > size)
bytecount = size;
if (clear_user(ptr, bytecount))
return -EFAULT;
return bytecount;
Expand Down
253 changes: 0 additions & 253 deletions trunk/arch/x86/kernel/ldt_32.c

This file was deleted.

0 comments on commit f57d904

Please sign in to comment.