Adding new mappings in pagetable doesn't require TLB flushes
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- operating-systems
Research direction
Trace MappedPageTable and similar mapping facilities, focusing on the MapperFlush return path and the handling of already-existing mappings. Read the cited Intel paging specification and inspect how the page-table write is ordered relative to later mapping use. Done means new mappings no longer require a TLB flush while existing mappings still produce an error and the write is safely ordered.
Written by the indexing model from the issue text.
Description
Currently, MappedPageTable and similar facilities always return MapperFlush when mapping a new page, and return a error is a mapping already exist.
According to Intel specifications, adding new mappings to a pagetable doesn't require a TLB flush.
If a paging-structure entry is modified to change the P flag from 0 to 1, no invalidation is necessary. This is
because no TLB entry or paging-structure cache entry is created with information from a paging-structure entry
in which the P flag is 0.
Although, for that to be correct, we still need to ensure that the pagetable entry is actually written at the end of the mapping function (currently, this is somehow enforced by the expected tlb flush that does inline asm invlpg without the nomem attribute), otherwise the compiler is allowed to do surprising reordering of the pagetable modification to e.g after the use of the mapping we're looking to make.
- Dominant language
- Rust
- Stars
- 946
- Forks
- 161
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-osdev/x86_64
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
rust-osdev/x86_64#629 · 5 comments ·
-
`PageTableEntry::addr` needs a `is_level_1_entry` argPossibly taken @phil-opp claimed this 19 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-osdev/x86_64#613 ·
-
`PageTableFlags::PAT_HUGE_PAGE` overlaps with address fieldPossibly taken @phil-opp claimed this 19 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
rust-osdev/x86_64#612 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
rust-osdev/x86_64#610 · 1 comment ·
-
New major release?Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
rust-osdev/x86_64#600 · 16 comments · 1 reaction ·
All issues in rust-osdev/x86_64
Similar issues
-
claim
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Nixitov/Riptide-Native#946 ·
Maintainers usually reply within 1 day
-
area: ai-assistants documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BetaBots-LLC/latticegate#17 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
storytold/craft-libs#5594 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
听歌识曲历史跳转后对应音源界面无法返回Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
LingyunStudio/RustMusic#16 ·