Re: [PATCH 3/7] x86/mm/init: pass unconverted symbol addresses to free_init_pages()

2018-08-04 Thread Andi Kleen
> [ Goes around and rummages ] > > Oh, never mind, looking around reminded me why: we want to map the > kernel text in the top 31 bits, so that we can use the faster > -mcmodel=kernel because all symbols fit in sign-extended 32 bits. > > Maybe there was some other reason too, but I think that's i

Re: [PATCH 3/7] x86/mm/init: pass unconverted symbol addresses to free_init_pages()

2018-08-04 Thread Hugh Dickins
On Sat, 4 Aug 2018, Linus Torvalds wrote: > On Fri, Aug 3, 2018 at 5:19 PM Hugh Dickins wrote: > > > > I thought that virt_to_page() only works on virtual addresses > > in the direct map > > You're right that virt_to_page() does not work on any _actual_ virtual > mappings (ie no user pages, and n

Re: [PATCH 3/7] x86/mm/init: pass unconverted symbol addresses to free_init_pages()

2018-08-04 Thread Linus Torvalds
On Fri, Aug 3, 2018 at 5:19 PM Hugh Dickins wrote: > > I thought that virt_to_page() only works on virtual addresses > in the direct map You're right that virt_to_page() does not work on any _actual_ virtual mappings (ie no user pages, and no vmalloc() pages etc). It does not follow page tables a

Re: [PATCH 3/7] x86/mm/init: pass unconverted symbol addresses to free_init_pages()

2018-08-03 Thread Hugh Dickins
On Thu, 2 Aug 2018, Dave Hansen wrote: > > From: Dave Hansen > > The x86 code has several places where it frees parts of kernel image: > > 1. Unused SMP alternative > 2. __init code > 3. The hole between text and rodata > 4. The hole between rodata and data > > We call free_init_pages() to

[PATCH 3/7] x86/mm/init: pass unconverted symbol addresses to free_init_pages()

2018-08-02 Thread Dave Hansen
From: Dave Hansen The x86 code has several places where it frees parts of kernel image: 1. Unused SMP alternative 2. __init code 3. The hole between text and rodata 4. The hole between rodata and data We call free_init_pages() to do this. Strangely, we convert the symbol addresses to ker