lkml.org 
[lkml]   [2015]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: setup: extend low identity map to cover whole kernel range
On Wed, 14 Oct, at 04:29:33PM, Paolo Bonzini wrote:
>
> On 14/10/2015 15:52, Matt Fleming wrote:
> >> > However, for non-PAE kernels there is no guarantee that the identity
> >> > mapping in the initial_page_table extends as far as the GDT; in this
> >> > case, accesses to the GDT will cause a page fault (which quickly becomes
> >> > a triple fault). Fix this by copying the kernel mappings from
> >> > swapper_pg_dir to initial_page_table twice, both at PAGE_OFFSET and at
> >> > identity mapping.
> >
> > Oops, good catch guys. This is clearly a bug, but...
> >
> > ... I'm a little surprised you managed to trigger this at all, because
> > the GDT we load in efi_call_phys_prolog() is part of the per-cpu data
> > section and therefore part of the kernel image.
>
> Only until setup_percpu, which is earlier than SetVirtualAddressMap.
> For example, I get:
>
> setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:1 nr_node_ids:1
> PERCPU: Embedded 18 pages/cpu @c728e000 s41800 r0 d31928 u73728
> ^^^^^^^
> but the kernel image ends at 0x037fffff.
>
> The GDT is 0xc728e000 in this run, so the GDT is at the beginning of the
> relocated percpu area.

Ah, good point. I completely missed that the percpu sections get
relocated.

--
Matt Fleming, Intel Open Source Technology Center


\
 
 \ /
  Last update: 2015-10-14 23:21    [W:1.629 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site