History log of /haiku/src/system/boot/platform/efi/mmu.cpp
Revision Date Author Comments
# bfd5d562 18-Jan-2022 David Karoly <karolyd577@gmail.com>

boot/efi/mmu: fix sign extension issues

Conversion from pointer to phys_addr_t (i.e. uint64) results
in a sign extension on x86.

Therefore we first convert to addr_t and then convert from
addr_t to phys_addr_t.

Change-Id: Id9d9db03d9940a11ea3892841c271e12fad3975a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4872
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# cc69b20b 21-Jan-2022 David Karoly <karolyd577@gmail.com>

boot/efi/arm: move arch_enter_kernel to identity mapped region

First try to allocate a page below 2GB.

If it fails, try to allocate a physical page at the address
returned by get_next_virtual_address so that we get an address
that is available in both virtual and physical space.

Finally try to allocate any available page. At this point
it's highly likely that it will be above 0x88000000 so it can be
used for trampoline code.

Change-Id: I3100a3e09efcd938bc630a52dcce74dc5f24beb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4878
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 235aa994 17-Dec-2021 David Karoly <karolyd577@gmail.com>

boot: rework 32-bit/64-bit kernel load base selection

Change-Id: I0aed05c0ef2ff1a162581e4f988bf24ed1e521e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4816
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# 1a7afaa4 13-Dec-2021 David Karoly <karolyd577@gmail.com>

boot/efi: fix for garbled first item returned by mmu_next_region()

Change-Id: Ic9d02800bccbb5508eeb0b2c1ee1ed1326d0829f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4783
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# 563ac512 30-Nov-2021 David Karoly <karolyd577@gmail.com>

boot/efi: fix compile issue with format strings

Change-Id: I144afe78f73fed211ea1c72584fa5f12e4452454
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4751
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 961c0ece 13-Aug-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/mmu: Disable fixed vaddr allocation on riscv

Change-Id: I137306be6e5d16a715e7efe9eb2614f0dd9e17cb


# f1fa58bf 25-Jul-2021 X512 <danger_mail@list.ru>

haiku_loader.efi: update for riscv64

* Added MMU page table generation.
* Added optional FDT device detection and passing to kernel.
* Add platform address translation stubs to bios_ia32
to drop EFI ifdefs

Change-Id: I89257c93c84404fd988f621b29f927ed0df3c3b1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4304
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 49e2b1f4 24-Nov-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

platform/efi: Fix 'narrowing width' error under clang

Change-Id: I84d7fea03868aadd50ff03a79d7769bff56c84be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3416
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# e6e0db9e 19-Nov-2020 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Rewrite allocated regions, remove mmu_free

mmu_free was only used for ACPI and only set a released flag
in the region. This released flag was never checked anywhere.

platform_free_region removes region from linked list now.
There are a lot of calls to it, so it should save some mem and make
memory layout cleaner.

Compiles on boots on AMD64
Compiles on ARM and loads kernel, but can't start it, since we havn't
setup the mmap with proper virtual addresses (with some other fixes to
ld-script and ELF32 loader EFI code.

Change-Id: Icfe871fa400b49f19e7ca1dbb9e1561309b21a22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3403
Reviewed-by: Rene Gollent <rene@gollent.com>


# 05586741 11-Sep-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi: fix pointer width on non-64-bit platforms

Change-Id: I041238af87df3e1e3a967216685413801fd49877
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2450
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# 9f30e61f 20-Jul-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/mmu: Add tracing, fix line widths. No functional change

Change-Id: I9fcd6790f7c7e8b9e12a3bc1a2c43cae091a11be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3048
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 957f468c 21-Feb-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/mmu: ensure sNextVirtualAddress is valid on 32-bit platforms

Change-Id: I1c762410860ac7a27cfc78345de3226e36195aba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2258
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 04f1baa7 05-Feb-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

EFI: Make our haiku_loader architecture agnostic

* This is the bulk of the work. Anything else should be
minor cleanups and tweaking.
* riscv64 isn't a viable EFI platform yet.. just acting
as a stand-in to test a non-x86 EFI haiku_loader

Change-Id: Ib03de81e2b562e693987b86d7b4318209fb1c792
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2256
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 485b5cf8 13-Dec-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

efi: Refactor our EFI code to use fuchsia's cleaner EFI headers.

* Drop gnu-efi

Change-Id: Ib601fc8ced49b18281b6b98cf861a5aef1b9c065
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2026
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# b482adb1 01-Nov-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

kernel/boot/efi: Continue breaking apart arch-specific code; hpet

* Move x86 hpet behind timer interface.
* Add a few if x86,x86_64 macros to start.cpp.

Change-Id: I583ec1b064785182e6d48dfbcd91b1bb2ead4b44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1929
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# a287df1c 11-Jun-2018 Augustin Cavalier <waddlesplash@gmail.com>

efi: Fix bad mode changes from previous commit.


# b2d0b369 10-Jun-2018 Jessica Hamilton <jessica.l.hamilton@gmail.com>

efi: redo mmu_map_physical_address to not require allocations.

* mmu_map_physical_address will get called prior to calling main()
which leaves us without a heap, malloc, and new. Instead, use
the kernel args physical allocated range array, and then
convert to our allocated memory region type on-demand.

Change-Id: I265fd165ef7143681e8e40c3686fda1a583c20dc


# 3d870da3 08-Jan-2017 Jessica Hamilton <jessica.l.hamilton@gmail.com>

UEFI: leave runtime memory identity mapped.

* We don't have kernel/userspace access to UEFI at this point
either, and with some firmware, if we don't keep the
runtime memory identity mapped, then the loader dies. This
will fix booting on such machines, and shouldn't have any
impact on already working machines.


# e2b610b4 13-Dec-2016 Henry Harrington <henry.harrington@gmail.com>

UEFI: CR0.WP must be set before entering the kernel.

If WP is not enabled then the kernel can freely write to read-only user
pages, which breaks copy-on-write.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# ec239abc 25-Apr-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: implement mmu_map_physical_memory & mmu_free.

Also move cpu, acpi, hpet init into platform_start_kernel, as we
need an initialised heap for alllocating memory for recording
the mapped regions.


# b3215a62 21-Oct-2014 Henry Harrington <henry.harrington@gmail.com>

EFI: preliminary support for starting the kernel.

Enough to let the kernel to print hello, but not much beyond that.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# dbf1363b 23-Jun-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: naive platform_allocate_region() implementation


# e2e1558a 20-Apr-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: stub functions so we can call loader's main() function.