History log of /fuchsia/zircon/kernel/vm/vm.cpp
Revision Date Author Comments
# f0441ea7 01-Oct-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][formatting] Formatting pass on core kernel code

Also ran through 'astyle -j -A2' prior to running through clang-fmt,
which adds braces to one line conditionals.

Tested: build and runtests on arm and x86

Change-Id: I888c1ce43dbe12a936a3f13d89c5f8dc16ccab6a


# afb4c092 25-Sep-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][pmm] convert pmm_alloc_range() to returning a status instead of count

Tested: runtests on x86 and arm

Change-Id: Id3b550ee9affa742707b2c98ec4c543f1cca7c85


# 46a7c5a8 24-Jul-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][pmm] change pmm single page alloc routines to return status

Move from returning a status and the page pointer and/or physical
address in an argument.

Tested: build and runtests on both x86 and arm

Change-Id: If10d877f152d355bfa1359338cd71f5aefbccfb4


# bb9e3313 07-May-2018 Thomas Garnier <thgarnie@google.com>

[kernel][kaslr] Create static relocation

Add static relocation for x64 and arm64 using the kernel_relocated_base
global variable. Add the DISABLE_KASLR option. Remove any dependency to
KERNEL_BASE when __code_start should be used. Change symbolize script to
dump kaslr offset and correctly show static addresses. Adapt gdb script
to identify KASLR relocation at early boot or if attached later.

x64 specific:
- Simplify page table to use kernel_relocated_base
- Fix zedboot and multiboot dependencies on the static kernel base
- Ensure 16-bit boot path is relocated for secondary CPUs

SEC-31 #comment Add static relocation of the kernel module

Change-Id: I9acb0a53a82c2bbf9973921e4cfe60a1e03c7006


# 3f5ba44d 14-May-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][vm][formatting] replace few c style comments with c++

also general clang format run on the VM

Change-Id: I657dc2bc7b1758986aae8e12b3afe52d1a063bd2


# cdea48c8 18-Jul-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][pmm] first pass overhaul of the PMM

-Add a new PmmNode class that represents a pmm for a single NUMA node.
-Move main free queues into PmmNode.
-Make PmmArena be a child of PmmNode.
-Refactor the vm_page structure a bit to change how queues work. Make
the main queue node be intrinsic to the page, instead of per state.
-Move some per page helper routines into the page struct.
-Remove the KMAP flags, since they're not used on 64bit machines.

TODO:
-Make use of the LO_MEM flag for <4GB allocations
-Make use of the new active/inactive/wired queues in PmmNode
-Add support for multiple nodes in a NUMA system
-Keep page state count in PmmNode class to make page state counting less
expensive

Change-Id: I0ca5e55aad0bb2f393d2dc590b02f160e4740398


# e5ed6a42 18-Jan-2018 Brijen Raval <braval@google.com>

[kernel][gic] GIC code refactoring to add support for GICv3 in Hypervisor

Change-Id: Ia3e96db67ca507a26fbf537d8eb004c1d5a9b6b0


# 08314dff 12-Jan-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][platform] switch PC and ARM platform over to using the boot memory reservation system

Instead of tracking reserved memory in this layer, add reserved ranges
to the boot reserve system prior to adding arenas to the PMM. This
should allow the pmm to allocate memory out of itself without stepping
on reserved memory.

Change-Id: I98921ccbec90bf89decd597c90b219f164aefd07


# c1932bc5 16-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel] remove most uses of MEMBASE + KERNEL_LOAD_OFFSET

These two variables are almost always used when code wants to know the
kernel's physical load address. Add some code to simply save the kernel
load location at boot time and use that instead.
Also standardized the use of linker script defined variables into a
common header and format.

Change-Id: Iccde557d1082d39167a53b0fdc5f23289d81f200


# 7177a347 13-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm] use the peripheral memory map from the mdi, remove the use of mmu_initial_map

Multiple smaller changes here that were too hard to split:
-Switch arm code to mapping the peripheral map based on the mdi
-Construct a peripheral map reserve region after the fact when the vm comes up
-Remove the mmu_initial_map for both arm and x86
-Construct the physmap reserve region from the physmap #defines instead of the table
-Change arm start.S to map the first 512GB of physical space for the physmap

Change-Id: I345c521f38fde88cfabffbdaae6331e6b8ebd323


# 9cd6a5cb 28-Nov-2017 Todd Eisenberger <teisenbe@google.com>

[arch][mmu] Rename Map to MapContiguous

This is prep work for adding support for adding a non-contiguous map.

ZX-1424

Change-Id: I63a557a884cfe496cfee2fa58e9f9ec17ba18b8e


# 32a055e5 14-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][init] move the two vm init hooks back to lk_main() to be a bit easier to trace

Since they're always there and considered a milestone in the init
runlevels, should be consistent and call them directly.

Change-Id: I99879cbe6cba57ae547b0ab7c1cf39c948ea7775


# e80fb0e4 03-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][memory] refactor some physical<->virtual routines, formally naming the BKM physmap

This mostly just rearranges the names of things, but add an actual name
for the big kernel map and add some bounds checking to usage.

This should let us be a bit more dynamic about the physmap in the
future, including placing it at a random location and/or giving it a
more complex mapping.

Change-Id: I062d3f0483f27436252b9607174e10b852f0f832


# b23ee974 19-Oct-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] tweak the early VM memory reservation printfs slightly

Change-Id: Ie868c5d27b27127d62511f6d3778cf43755356b2


# d54624b7 14-Oct-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm64] Move the kernel run address out of the Big Kernel Map

-Added code in early boot to remap wherever the kernel was loaded to
approximately -4GB (KERNEL_LOAD_OFFSET still applies)
-Simplfy the mmu_initial_mapping stuff a bit, remove the DYNAMIC flag,
which wasn't used.
-Fix up the boot allocator very early in arm64 to figure out where
physical memory is.

ZX-1238 # Done

Change-Id: Ib43eb9288c79e01253c5c4499278e2fe83602bd1


# d382da70 13-Oct-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][bootalloc] move the boot time allocator into the BKM, instead of relying on pages off the end of the kernel

-In prep for relocating the kernel to different places in kernel space
without having to have the pages immediately after it also mapped.
-This is sort of a step back in safety/security since we're now going to
hold pointers into the BKM, but the longer term goal is to remove the
boot allocator altogether.

Change-Id: I9aa81ae1677a81070ec2f232d63aac91f4ac9e78


# 07166ed7 13-Oct-2017 Roland McGrath <mcgrathr@google.com>

[kernel] Consolidate kernel linker script

There is much more that's the same than that's different between
the architectures. Maintaining a single linker script that works
for both is easier than keeping two in synch.

Change-Id: I0655919e3f7dc5f8788d47bbe733f444c87ec97b


# 9c6c8017 12-Oct-2017 Roland McGrath <mcgrathr@google.com>

[kernel][code_patching] Do code_patching as an init hook, earlier

Don't depend on kernel/lib/code_patching from kernel/vm, only
from kernel/arch/x86, where it's actually used. This avoids
the possibility of an empty patch list, necessitating __WEAK.
Apply the patches much earlier via an LK_INIT_HOOK. This means
patches can be applied to code that runs earlier. There's no
reason to delay it.

Change-Id: I797ed23b5d7ca165778eaec4caa6896d0b5940af


# edd438b8 11-Oct-2017 Mark Seaborn <mseaborn@google.com>

[kernel][x86] Implement startup-time code patching for SMAP instructions

Add a macro, APPLY_CODE_PATCH_FUNC(), which allocates some placeholder
instructions and declares how to replace them with working code on
kernel startup.

The initial use case is filling out the STAC and CLAC instructions
conditionally depending on whether the CPU supports SMAP.

The mechanism is a little more general than this initial use case
requires. My intention is the mechanism will be usable for inline
assembly that can get inlined into multiple places.

Change-Id: I213504db574f58c2d093d2648771c03048775c09


# 0932bec7 11-Oct-2017 Roland McGrath <mcgrathr@google.com>

[kernel] Make mmu_initial_mappings const

Everything that can be const should be const.

Change-Id: If4ee54756a4ba932e242aea844477b8e35187310


# 16caa0f1 09-Oct-2017 Roland McGrath <mcgrathr@google.com>

[kernel][x86] Remove obsolete .text.header section from linker script

Also stop defining the _start symbol, which is confusing and redundant.

Change-Id: Ie283fe0065f58264dca0fbdb791de193e13bf296


# 5fb8e9ed 23-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] move vm.h to the new spot and remove some unused code

Change-Id: I69f1b804fb95dd44e3e0619943e8809519aa82ca


# ce187317 16-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm][formatting] mostly reordering includes after the rename

Change-Id: I8d94a8580ddd0233e036475bd6d4603f5881614f


# 161d9a5e 14-Sep-2017 George Kulakowski <kulakowski@google.com>

[vm][zx_status_t] Use zx_status_t throughout the vm layer

Change-Id: If40e2571cdbd382b7b90da90cdef40daf07a2bd0


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# 59e644b1 07-Sep-2017 George Kulakowski <kulakowski@google.com>

[zircon][mxtl->fbl] Rename mxtl to fbl

Change-Id: Ie21b6498e1bfb0a7fa0315e40b9e5c3ee78646be


# e1490736 01-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] move kernel/kernel/vm to just kernel/vm

Change-Id: I8f724a9f8a61415712661d1fdd3dc4e1c70cf620