lkml.org 
[lkml]   [2017]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/30] x86, kaiser: map GDT into user page tables
On Fri, 10 Nov 2017, Dave Hansen wrote:
> __set_fixmap(get_cpu_gdt_ro_index(cpu), get_cpu_gdt_paddr(cpu), prot);
> +
> + /* CPU 0's mapping is done in kaiser_init() */
> + if (cpu) {
> + int ret;
> +
> + ret = kaiser_add_mapping((unsigned long) get_cpu_gdt_ro(cpu),
> + PAGE_SIZE, __PAGE_KERNEL_RO);
> + /*
> + * We do not have a good way to fail CPU bringup.
> + * Just WARN about it and hope we boot far enough
> + * to get a good log out.
> + */

The GDT fixmap can be set up before the CPU is started. There is no reason
to do that in cpu_init().

> +
> + /*
> + * We could theoretically do this in setup_fixmap_gdt().
> + * But, we would need to rewrite the above page table
> + * allocation code to use the bootmem allocator. The
> + * buddy allocator is not available at the time that we
> + * call setup_fixmap_gdt() for CPU 0.
> + */
> + kaiser_add_user_map_early(get_cpu_gdt_ro(0), PAGE_SIZE,
> + __PAGE_KERNEL_RO | _PAGE_GLOBAL);

This one is needs to stay.

Thanks,

tglx

\
 
 \ /
  Last update: 2017-11-20 21:23    [W:0.218 / U:3.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site