arch: remove KERNEL_RAM_SIZE

We don't map all RAM at boot any more, just the kernel image.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-12-17 14:29:52 -08:00 committed by Anas Nashif
commit 893822fbda
2 changed files with 13 additions and 29 deletions

View file

@ -541,21 +541,10 @@ config MMU_PAGE_SIZE
support multiple page sizes, put the smallest one here.
config KERNEL_VM_BASE
hex "Base virtual address to link the kernel"
hex "Virtual address space base address"
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))
help
Define the base virtual memory address for the core kernel.
The kernel expects a mappings for all physical RAM regions starting at
this virtual address, with any unused space up to the size denoted by
KERNEL_VM_SIZE available for memory mappings. This base address denotes
the start of the RAM mapping and may not be the base address of the
kernel itself, but the offset of the kernel here will be the same as the
offset from the beginning of physical memory where it was loaded.
If there are multiple physical RAM regions which are discontinuous in
the physical memory map, they should all be mapped in a continuous
virtual region, with bounds defined by KERNEL_RAM_SIZE.
Define the base of the kernel's address space.
By default, this is the same as the DT_CHOSEN_Z_SRAM physical base SRAM
address from DTS, in which case RAM will be identity-mapped. Some
@ -563,7 +552,7 @@ config KERNEL_VM_BASE
just one RAM region and doing this makes linking much simpler, as
at least when the kernel boots all virtual RAM addresses are the same
as their physical address (demand paging at runtime may later modify
this for some subset of non-pinned pages).
this for non-pinned page frames).
Otherwise, if RAM isn't identity-mapped:
1. It is the architecture's responsibility to transition the
@ -576,14 +565,9 @@ config KERNEL_VM_BASE
double-linking of paging structures to make the instruction pointer
transition simpler).
config KERNEL_RAM_SIZE
hex "Total size of RAM mappings in bytes"
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_SRAM))
help
Indicates to the kernel the total size of RAM that is mapped. The
kernel expects that all physical RAM has a memory mapping in the virtual
address space, and that these RAM mappings are all within the virtual
region [KERNEL_VM_BASE..KERNEL_VM_BASE + KERNEL_RAM_SIZE).
Zephyr does not implement a split address space and if multiple
page tables are in use, they all have the same virtual-to-physical
mappings (with potentially different permissions).
config KERNEL_VM_OFFSET
hex "Kernel offset within address space"
@ -612,17 +596,16 @@ config KERNEL_VM_SIZE
Size of the kernel's address space. Constraining this helps control
how much total memory can be used for page tables.
The difference between KERNEL_RAM_SIZE and KERNEL_VM_SIZE indicates the
The difference between KERNEL_VM_BASE and KERNEL_VM_SIZE indicates the
size of the virtual region for runtime memory mappings. This is needed
for mapping driver MMIO regions, as well as special RAM mapping use-cases
such as VSDO pages, memory mapped thread stacks, and anonymous memory
mappings.
mappings. The kernel itself will be mapped in here as well at boot.
The system currently assumes all RAM can be mapped in the virtual address
space. Systems with very large amounts of memory (such as 512M or more)
Systems with very large amounts of memory (such as 512M or more)
will want to use a 64-bit build of Zephyr, there are no plans to
implement a notion of "high" memory in Zephyr to work around physical
RAM which can't have a boot-time mapping due to a too-small address space.
RAM size larger than the defined bounds of the virtual address space.
endif # MMU

View file

@ -7,6 +7,7 @@
#include <zephyr.h>
#include <syscall_handler.h>
#include <ztest.h>
#include <linker/linker-defs.h>
#include "test_syscalls.h"
#define BUF_SIZE 32
@ -16,8 +17,8 @@
|| defined(CONFIG_BOARD_NUCLEO_L073RZ)
#define FAULTY_ADDRESS 0x0FFFFFFF
#elif CONFIG_MMU
/* Just past the permanent RAM mapping should be a non-present page */
#define FAULTY_ADDRESS (CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_RAM_SIZE)
/* Just past the zephyr image mapping should be a non-present page */
#define FAULTY_ADDRESS ((uint8_t *)(&z_mapped_end))
#else
#define FAULTY_ADDRESS 0xFFFFFFF0
#endif