Includeasmx86pgtable32h

#define VMALLOC_START (((unsigned long) high_memory + \

#ifdef CONFIG_HIGHMEM

# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) #else

# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) #endif

The start address of the vmalloc area depends on how much virtual address space memory is used for the direct mapping of RAM (and therefore on the high_memory variable defined above). The kernel also takes account of the fact that there is a gap of at least vmalloc_offset between the two areas and that the vmalloc area begins at an address divisible by vmalloc_offset. This results in the offset values shown in Table 3-5 for different memory configuration levels between 128 and 135 MiB; the offsets start a new cycle at 136 MiB.

Table 3-5: vmalloc_offset Values for Different RAM Sizes

Memory (MiB)

Offset (MiB)

128

8

129

15

130

14

131

13

132

12

133

11

134

10

135

9

Where the vmalloc area ends depends on whether highmem support is enabled — if it is not, no space is needed for persistent kernel mappings because the whole of RAM memory can be permanently mapped. Depending on configuration, the area therefore ends either at the start of the persistent kernel mappings or at the start of the fixmap area; two pages are always left as a safety gap to the vmalloc area.

The start and end of the persistent kernel mappings are defined as follows:

include/asm-x86/highmem.h

#define LAST_PKMAP 1024

#define PKMAP_BASE ( (FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK )

pkmap_base defines the start address (the calculation is made relative to the fixmap area using some constants that are discussed shortly). last_pkmap defines the number of pages used to hold the mappings.

The last memory section is occupied by fixed mappings. These are addresses that point to a random location in RAM memory. In contrast to linear mapping at the start of the fourth gigabyte, the correlation between virtual address and position in RAM memory is not preordained with this type of mapping but can be freely defined, even though it cannot be changed later. The fixmap area fills the virtual address space right up to its top end.

Continue reading here: Includeasmx86fixmap32h

Was this article helpful?

0 0