lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090803055441.GA19428@elte.hu>
Date:	Mon, 3 Aug 2009 07:54:41 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	David Miller <davem@...emloft.net>
Cc:	a.p.zijlstra@...llo.nl, joerg.roedel@....com,
	fujita.tomonori@....ntt.co.jp, reif@...thlink.net,
	sparclinux@...r.kernel.org, linux-kernel@...r.kernel.org,
	x86@...nel.org, tony.luck@...el.com, akpm@...ux-foundation.org
Subject: Re: [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and
	pci-dma-compat.h


* David Miller <davem@...emloft.net> wrote:

> From: Ingo Molnar <mingo@...e.hu>
> Date: Sat, 18 Jul 2009 13:06:20 +0200
> 
> > I'm wondering why sparc32 frees from the middle of the kernel 
> > image. The way architectures generally do it is to put freeable 
> > pages into a separate section. That way it does not get mingled 
> > with the kernel core image area (which stays nicely continuous).
> 
> It's conditionally free'able, we actually use the pages if the 
> system is SMP and has more than cpu 0 installed.

Sounds similar to the alternate instructions section on x86:

 arch/x86/kernel/alternative.c:

        if (smp_alt_once)
                free_init_pages("SMP alternatives",
                                (unsigned long)__smp_locks,
                                (unsigned long)__smp_locks_end);

It's in a separate section and linked + freed separately. The linker 
script page-aligns it:

 arch/x86/kernel/vmlinux.lds.S:

        /*
         * smp_locks might be freed after init
         * start/end must be page aligned
         */
        . = ALIGN(PAGE_SIZE);
        .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
                __smp_locks = .;
                *(.smp_locks)
                __smp_locks_end = .;
                . = ALIGN(PAGE_SIZE);
        }

So that it can be freed. It's also placed next to the regular init 
section to not create too many holes. It also keeps the 'kernel text 
area' continuous and things like core_kernel_text() & co still work 
fine.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ