History log of /haiku/src/system/kernel/arch/arm/paging/32bit/ARMPagingMethod32Bit.h
Revision Date Author Comments
# b799d160 15-Jun-2023 David Karoly <karolyd577@gmail.com>

kernel/arm/paging: implement Modified Flag

* Introduce SWDBM flag similarly to the arm64 port
* Reuse TEX[2] for SWDBM flag which should be availble
to be used by the operating system if TEX remap
is enabled.
* Introduce SetAndClearPageTableEntryFlags for updating
accessed and modified flags atomically
* Startup sequence is handled similarly to accessed flag, i.e.
set Modified flag in initially mapped pages in bootloader and early map.
* Once the kernel initialization has progressed enough,
pages are mapped as read-only and modified flag handling is done
in the page fault handler.

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


# f61fb770 30-May-2023 David Karoly <karolyd577@gmail.com>

kernel/arm: don't set Accessed Flag when initially mapping a page

Pages should not be marked as accessed when initially mapping them.

However, there's a short interval during kernel startup when new pages
are mapped but the fault handler is not installed yet.

Therefore, we set Accessed Flag to 1 in early_map.
Once the kernel initialization has progressed enough, we start mapping
new pages with Accessed Flag set to 0.

The chicken and egg problem of initially mapping the vector page is
tackled by preallocating the vector page in the boot loader.

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


# d38dcdde 17-May-2023 David Karoly <karolyd577@gmail.com>

kernel/arm/paging: implement Accessed flag querying

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


# 84745ade 10-May-2023 David Karoly <karolyd577@gmail.com>

kernel/arm/paging: use simplified permission model

Change-Id: Ie0ed357ee9ca5bee4c10c6cbf74eaba77acdd179
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6435
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>


# 745a40d7 23-Apr-2022 David Karoly <karolyd577@gmail.com>

kernel/arm: implement memory attributes

Set AP[2:0] and XN flags based on page attributes.
PXN is not implemented as it seems to be available only
in L1 descriptors on ARMv7.

Set TEX, B, C flags based on memoryType:
* B_MTR_UC is mapped to Strongly Ordered (TEX=0, B=0, C=0)
* B_MTR_WC is mapped to Shareable Device Memory (TEX=0, B=1, C=0)
* B_MTR_WT is mapped to Outer and Inner Write-Through, no Write-Allocate (TEX=0, B=0, C=1)
* B_MTR_WB is mapped to Outer and Inner Write-Back, no Write-Allocate (TEx=0, B=1, C=1)
* B_MTR_WP has no direct equivalent on the ARM so it's mapped as B_MTR_WB
* default is Write-Back

Implement ARMPagingMethod32Bit::AttributesToPageTableEntryFlags()
for mapping from page attributes to AP[2:0] and XN flags.

Implement ARMPagingMethod32Bit::PageTableEntryFlagsToAttributes()
for the reverse mapping used in Query() and QueryInterrupt()
i.e. recover page attributes from AP[2:0] and XN flags.

Implement ARMPagingMethod32Bit::MemoryTypeToPageTableEntryFlags()
fr mapping from memoryType to TEX, B, C flags.

Implement ARMVMTranslationMap32Bit::Protect() which used to be commented out.

Accessed and modified flags are not implemented yet, so no such
flags are returned from Query() and QueryInterrupt().

Also because of this, we just invalidate TLB on any call to Protect()
without checking whether the page has been accessed.

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


# 1819aa71 07-Sep-2014 Ithamar R. Adema <ithamar@upgrade-android.com>

ARM: sync up VM code with x86

No big functional reason for this, but rather keep it in sync now
then have to do lots of work later on, when there are major changes.
Once I have it fully fleshed out for ARM, I might take a look if
we can generalise it a little more, as there's lots of code
_exactly_ the same for both platforms (and other platforms in
progress using the same code).


# 35171b07 12-Feb-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

arm: Miscellaneous build fixes

* Use atomic_get_and_set for return value
* Atomics are no longer volatile
* Add missing arch_cpu_pause stub
* Move arch_cpu_idle to arch_cpu header to match
other architectures


# 3091264b 31-Oct-2010 François Revol <revol@free.fr>

s/Copyirght/Copyright/ unless it's a neologism from Ithamar :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39235 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c917cd62 30-Oct-2010 Ithamar R. Adema <ithamar.adema@team-embedded.nl>

* ARM: Major VM work
- This is mostly a copy of the x86 32bit paging method and infrastructure, this was copied for two reasons:
1) It is the most complete VM arch
2) The first ARM PAE patches have landed on alkml, so we will have to deal with it in the future as well,
and this infrastructure has proven to be ready ;)
- No protection features, or dirty/accessed tracking yet
- Lots of #if 0

but....

It boots all the way up to init_modules() now, and then dies because of a lack of (ARM) ELF relocation implementation!

Since at this point the VM can be fully initialised, I'm going to focus on CPU exceptions next, so we can get KDL to trigger
when it happens, and I can actually debug from there ;)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39206 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1819aa71eeea86d951569eaa05bbe9eedfbf222e 07-Sep-2014 Ithamar R. Adema <ithamar@upgrade-android.com>

ARM: sync up VM code with x86

No big functional reason for this, but rather keep it in sync now
then have to do lots of work later on, when there are major changes.
Once I have it fully fleshed out for ARM, I might take a look if
we can generalise it a little more, as there's lots of code
_exactly_ the same for both platforms (and other platforms in
progress using the same code).


# 35171b073dc15f5d6a487135787f82a8484ab0ed 12-Feb-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

arm: Miscellaneous build fixes

* Use atomic_get_and_set for return value
* Atomics are no longer volatile
* Add missing arch_cpu_pause stub
* Move arch_cpu_idle to arch_cpu header to match
other architectures


# 3091264bb53e84341c9ac5a246d44363d8292353 31-Oct-2010 François Revol <revol@free.fr>

s/Copyirght/Copyright/ unless it's a neologism from Ithamar :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39235 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c917cd62618c2bfd683dba8bf34f96fb7bd37203 30-Oct-2010 Ithamar R. Adema <ithamar.adema@team-embedded.nl>

* ARM: Major VM work
- This is mostly a copy of the x86 32bit paging method and infrastructure, this was copied for two reasons:
1) It is the most complete VM arch
2) The first ARM PAE patches have landed on alkml, so we will have to deal with it in the future as well,
and this infrastructure has proven to be ready ;)
- No protection features, or dirty/accessed tracking yet
- Lots of #if 0

but....

It boots all the way up to init_modules() now, and then dies because of a lack of (ARM) ELF relocation implementation!

Since at this point the VM can be fully initialised, I'm going to focus on CPU exceptions next, so we can get KDL to trigger
when it happens, and I can actually debug from there ;)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39206 a95241bf-73f2-0310-859d-f6bbb57e9c96