[kernel][phys][vm] Formalize VM hand-off

This change introduces phys handoff abstractions describing the mappings
it created along with the VMARs - subVMARs of the root - that these
should end up in, as well as updating the kernel's VM initialization to
simply iterate over these and follow through with VMAR creation and
mapping reservation in a table-driven fashion. The table-driven aspect
simplifies things, is more flexible (being in turn driven by the source
of truth for those mappings), and readily extends support to the other
mappings we intend to make in physmap (e.g., periphmap and stacks).

This replaces the previous VMAR creation + reservation logic in VM init
that explicitly did this for the kernel and physmap alone.

Example VM init logging as of this change:
```
[00000.000] 00000:01025> initializing vm
[00000.000] 00000:01025> VM: handing off VMAR from phys: physmap @ [0xffffff8000000000, 0xffffff9000000000)
[00000.000] 00000:01025> VM: * mapping: physmap (rw): [0, 0x1000000000) -> [0xffffff8000000000, 0xffffff9000000000)
[00000.000] 00000:01025> VM: handing off VMAR from phys: kernel @ [0xffffffff00000000, 0xffffffff004af000)
[00000.000] 00000:01025> VM: * mapping: segment (p_vaddr = 0x0) (r): [0x3229000, 0x32a2000) -> [0xffffffff00000000, 0xffffffff00079000)
[00000.000] 00000:01025> VM: * mapping: segment (p_vaddr = 0x79000) (rx): [0x32a2000, 0x361b000) -> [0xffffffff00079000, 0xffffffff003f2000)
[00000.000] 00000:01025> VM: * mapping: segment (p_vaddr = 0x3f2000) (r): [0x361b000, 0x3626000) -> [0xffffffff003f2000, 0xffffffff003fd000)
[00000.000] 00000:01025> VM: * mapping: segment (p_vaddr = 0x3fd000) (rw): [0x3626000, 0x36d8000) -> [0xffffffff003fd000, 0xffffffff004af000)
```

Bug: 42164859
Change-Id: I0edb93e777ca945bc437b666b37cbfc49bfcd1ca
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1178312
Reviewed-by: Roland McGrath <mcgrathr@google.com>
Fuchsia-Auto-Submit: Joshua Seaton <joshuaseaton@google.com>
Reviewed-by: Adrian Danis <adanis@google.com>
Commit-Queue: Joshua Seaton <joshuaseaton@google.com>
11 files changed
tree: 95c714f701659fc70bc64fb5e9bcce10a2af38ae
  1. .fx/
  2. .helix/
  3. boards/
  4. build/
  5. bundles/
  6. docs/
  7. examples/
  8. infra/
  9. products/
  10. scripts/
  11. sdk/
  12. src/
  13. third_party/
  14. tools/
  15. zircon/
  16. .clang-format
  17. .clang-tidy
  18. .editorconfig
  19. .git-blame-ignore-revs
  20. .gitattributes
  21. .gitignore
  22. .gitmodules
  23. .gn
  24. .ignore
  25. analysis_options.yaml
  26. AUTHORS
  27. BUILD.gn
  28. CODE_OF_CONDUCT.md
  29. CONTRIBUTING.md
  30. fuchsia.code-workspace
  31. LICENSE
  32. OWNERS
  33. PATENTS
  34. pyproject.toml
  35. pyrightconfig.json
  36. README.md
  37. rustfmt.toml
  38. shac.star
  39. shac.textproto
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.