Commit b2062209 authored by David Mosberger's avatar David Mosberger

ia64: Patch by Arun Sharma: fix allocation/handling of GDT shared page (the old code

	was inconsistent and in places still assumed there is both a GDT and a TSS
	shared page, but the latter was removed a long time ago).
parent d2d79af1
......@@ -62,10 +62,7 @@ extern unsigned long *ia32_gdt;
struct page *
ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int no_share)
{
# define NUM_SHARED_PAGES (PAGE_SIZE > IA32_PAGE_SIZE ? 1 : 2)
struct page *pg = ia32_shared_page[NUM_SHARED_PAGES * smp_processor_id()
+ (address - vma->vm_start)/PAGE_SIZE];
struct page *pg = ia32_shared_page[smp_processor_id()];
get_page(pg);
return pg;
}
......@@ -80,7 +77,7 @@ ia64_elf32_init (struct pt_regs *regs)
struct vm_area_struct *vma;
/*
* Map GDT and TSS below 4GB, where the processor can find them. We need to map
* Map GDT below 4GB, where the processor can find it. We need to map
* it with privilege level 3 because the IVE uses non-privileged accesses to these
* tables. IA-32 segmentation is used to protect against IA-32 accesses to them.
*/
......@@ -88,7 +85,7 @@ ia64_elf32_init (struct pt_regs *regs)
if (vma) {
vma->vm_mm = current->mm;
vma->vm_start = IA32_GDT_OFFSET;
vma->vm_end = vma->vm_start + max(PAGE_SIZE, 2*IA32_PAGE_SIZE);
vma->vm_end = vma->vm_start + PAGE_SIZE;
vma->vm_page_prot = PAGE_SHARED;
vma->vm_flags = VM_READ|VM_MAYREAD;
vma->vm_ops = &ia32_shared_page_vm_ops;
......
......@@ -30,7 +30,7 @@
extern void die_if_kernel (char *str, struct pt_regs *regs, long err);
struct exec_domain ia32_exec_domain;
struct page *ia32_shared_page[(PAGE_ALIGN(IA32_PAGE_SIZE)/PAGE_SIZE) * NR_CPUS];
struct page *ia32_shared_page[NR_CPUS];
unsigned long *ia32_boot_gdt;
unsigned long *cpu_gdt_table[NR_CPUS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment