Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53872
b: refs/heads/master
c: 7a61d35
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Andi Kleen committed May 2, 2007
1 parent a1e3f00 commit d99b36e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 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: 39b7ee06859b07ca5fd4fabb44c4600316532574
refs/heads/master: 7a61d35d4b4056e7711031202da7605e052f4137
6 changes: 3 additions & 3 deletions trunk/arch/i386/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "cpu.h"

DEFINE_PER_CPU(struct desc_struct, cpu_gdt[GDT_ENTRIES]) = {
DEFINE_PER_CPU(struct gdt_page, gdt_page) = { .gdt = {
[GDT_ENTRY_KERNEL_CS] = { 0x0000ffff, 0x00cf9a00 },
[GDT_ENTRY_KERNEL_DS] = { 0x0000ffff, 0x00cf9200 },
[GDT_ENTRY_DEFAULT_USER_CS] = { 0x0000ffff, 0x00cffa00 },
Expand All @@ -48,8 +48,8 @@ DEFINE_PER_CPU(struct desc_struct, cpu_gdt[GDT_ENTRIES]) = {

[GDT_ENTRY_ESPFIX_SS] = { 0x00000000, 0x00c09200 },
[GDT_ENTRY_PDA] = { 0x00000000, 0x00c09200 }, /* set in setup_pda */
};
EXPORT_PER_CPU_SYMBOL_GPL(cpu_gdt);
} };
EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);

DEFINE_PER_CPU(struct i386_pda, _cpu_pda);
EXPORT_PER_CPU_SYMBOL(_cpu_pda);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ END(syscall_badsys)
#define FIXUP_ESPFIX_STACK \
/* since we are on a wrong stack, we cant make it a C code :( */ \
movl %fs:PDA_cpu, %ebx; \
PER_CPU(cpu_gdt, %ebx); \
PER_CPU(gdt_page, %ebx); \
GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \
addl %esp, %eax; \
pushl $__KERNEL_DS; \
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ idt_descr:
.word 0 # 32 bit align gdt_desc.address
ENTRY(early_gdt_descr)
.word GDT_ENTRIES*8-1
.long per_cpu__cpu_gdt /* Overwritten for secondary CPUs */
.long per_cpu__gdt_page /* Overwritten for secondary CPUs */

/*
* The boot_gdt must mirror the equivalent in setup.S and is
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ fastcall void do_spurious_interrupt_bug(struct pt_regs * regs,
fastcall unsigned long patch_espfix_desc(unsigned long uesp,
unsigned long kesp)
{
struct desc_struct *gdt = __get_cpu_var(cpu_gdt);
struct desc_struct *gdt = __get_cpu_var(gdt_page).gdt;
unsigned long base = (kesp - uesp) & -THREAD_SIZE;
unsigned long new_kesp = kesp - base;
unsigned long lim_pages = (new_kesp | (THREAD_SIZE - 1)) >> PAGE_SHIFT;
Expand Down
9 changes: 7 additions & 2 deletions trunk/include/asm-i386/desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ struct Xgt_desc_struct {
unsigned short pad;
} __attribute__ ((packed));

DECLARE_PER_CPU(struct desc_struct, cpu_gdt[GDT_ENTRIES]);
struct gdt_page
{
struct desc_struct gdt[GDT_ENTRIES];
} __attribute__((aligned(PAGE_SIZE)));
DECLARE_PER_CPU(struct gdt_page, gdt_page);

static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
{
return per_cpu(cpu_gdt, cpu);
return per_cpu(gdt_page, cpu).gdt;
}

extern struct Xgt_desc_struct idt_descr;
Expand Down

0 comments on commit d99b36e

Please sign in to comment.