Skip to content

Conversation

@luodeb
Copy link

@luodeb luodeb commented Dec 6, 2025

This module implements page table entries for ARMv7-A architecture using
the Short-descriptor format, which supports 2-level page tables:

  • L1 (Translation Table): 4096 entries, each mapping 1MB or pointing to L2
  • L2 (Page Table): 256 entries, each mapping 4KB (Small Page)

Copy link
Member

@equation314 equation314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, PagingHandler::alloc_frame is designed to support pages of only 4KB in size, but the L1 page table in ARMv7-A is 16KB.

It may require updating the page frame allocation interface, such as #16.

@luodeb

This comment was marked as resolved.

@aarkegz
Copy link
Contributor

aarkegz commented Jan 17, 2026

#35 and #37 have been merged, please rebase this PR to the latest main. @luodeb

luodeb added 16 commits January 19, 2026 10:24
Unifies the public API by re-exporting architecture-specific definitions,
making them accessible to downstream users without direct module imports.
Improves usability and reduces friction for multi-arch consumers.
@luodeb luodeb requested a review from aarkegz January 19, 2026 05:41
@luodeb luodeb requested a review from aarkegz January 19, 2026 12:34
// Deallocate all L2 page tables (each is 4KB)
let table = self.get_table(self.root_paddr);
for entry in table {
if !entry.is_unused() && !entry.is_huge() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may cause double-free if another page table is created by copy_from. See the solution in PageTable64.

// TODO: tune threshold; employ a more advanced data structure
const SMALL_FLUSH_THRESHOLD: usize = 32;

enum TlbFlusher<M: PagingMetaData> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this common enum to lib.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants