[patch 2.5.39] allow ia64 kernel to be virtually mapped from any physical address

From: Luck, Tony (tony.luck@intel.com)
Date: Tue Oct 15 2002 - 19:18:20 EST


LKML copy (posted to linux-ia64 list earlier today). All of
the changes are ia64 specific, except the changes to fix
fs/proc/kcore.c

The current ia64 kernel expects to be loaded at physical 68MB
(KERNEL_START in asm-ia64/system.h). This is a problem for
machines that do not guarantee the presence of memory at that
address (e.g. ccNUMA platforms that configure memory based on
which nodes exist).

I bundled a solution to this in my earlier discontig patch (and
included other features like kernel text replication, which made
the patch far to large to be accepted).

This patch provides just the code needed to virtually map the
kernel to a fixed virtual address from whatever physical address
it happened to be loaded at (it is assumed that the bootloader
handled the issue of finding a suitably aligned piece of memory).

Almost all of the code is inside CONFIG_IA64_VMAP_KERNEL, there
are a few exceptions:

1) the "switch_mode" routine in head.S (which toggles between
running in virtual and physical mode) has been split into
separate "switch_mode_phys" and "switch_mode_virt" and the
callers changed to use the appropriate one.

2) There are new macros "__tpa()" and "__imva()" defined in
pgtable.h, versions are provided for the both the 'Y' and 'N'
state of CONFIG_IA64_VMAP_KERNEL, so that these may be used
freely in code without adding a zillion extra #ifdefs

3) fs/proc/kcore.c is currently broken (and has been for a long
time) because ia64 defines VMALLOC_START at a lower address that
PAGE_START. Try to access a vmalloc'd address to see the breakage.
This patch fixes that in changes *not* bracketed with
CONFIG_IA64_VMAP_KERNEL as well as providing the extra ELF Phdr
for the virtually mapped kernel inside the #ifdef.

4) I put the empty_zero_page changes inside #ifdef, but they
could be generic (avoids calling virt_to_page() a lot, which
may be a good thing).

-Tony



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



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:59 EST