Subject: Re: The question about the high memory support on MPC8360?

From: vijay baskar <[email-masked]>
Date: Tue, 27 Nov 2007 09:57:44 +0530

Scott Wood wrote:

On Mon, Nov 26, 2007 at 11:41:38AM +0530, vijay baskar wrote:

Hi friends,

Kernel virtual space is divided into 3 different zones namely ZONE_DMA,
ZONE_NORMAL, ZONE_HIGHMEM.Remember that the kernel follows the 3GB/1GB
split ie 3 GB for user space and 1 GB for kernel space. Since your ram
is 1 GB, 896 MB will be mapped one to one with the kernel virtual space.
This one to one mapping will be done in the ZONE_NORMAL and ZONE_DMA of
kernel virtual space.Remaining 128 MB of kernel virtual address space
will be used for setting up kernel data structures and for ioremaps and
vmallocs that the kernel will need to perform during boot up. If u
configure high memory this 128 MB will be used for accessing unmapped
memory regions in the ram and there wont be sufficient virtual
addresses for ioremaps and vmallocs. Thats why your kernel did not boot
when high mem is configured.

1. The split is 768/256 on powerpc, not 896/128.
2. Why do you think this is insufficient?

The kernel maps the last 1 GB of the virtual address space one to one
to the physical memory. This is called the kernel space. After the one
to one mapping is done for the available physical memory, the
remaining virtual addresses are used for vmalloc and ioremap.

The kernel also allows hardcoded mapping
of IO regions into its virtual address space through the
io_block_mapping interface. Many boards use the block IO mapping to
map the CCSRBAR/IMMR into the kernel address space, such that the
physical address and the virutal address is the same. Virtual
addresses beyond these hardcoded mappings cannot be used by
vmalloc/ioremap.

Now as more and more memory is added to the system the addresses
available for vmalloc and ioremap gets reduced, and memory allocations
start to fail, due to the lack of availability of virtual addresses.

Since u want to have 1 GB of ram an alternative to
this is that u can try 2 GB/ 2 GB split which is configurable ie 2 GB
for user space and 2 GB for kernel space in your kernel.

1. He said he wanted 2GB of RAM, not 1.
2. I don't think this mode of operation has been tested very well on
powerpc.

=> bootm fed00000 fe900000
## Booting image at fed00000 ...
Image Name: Linux-2.6.11
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1054435 Bytes = 1 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at fe900000 ...
Image Name: uboot ext2 ramdisk rootfs
Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
Data Size: 3195657 Bytes = 3 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Ramdisk to 0fc9a000, end 0ffa6309 ... OK

Could you try with a more recent, arch/powerpc kernel?

-Scott