`UnmapError::ParentEntryHugePage` is sometimes used incorrectly
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- operating-systems
Research direction
Start in src/structures/paging/mapper/mapped_page_table.rs at the four linked error-return sites, then inspect the analogous paths in RecursivePageTable. Trace how Size2MiB unmap failures reach UnmapError::ParentEntryHugePage and review the existing error definition. Done means the error naming or variants accurately distinguish both page-table conditions without leaving the mapped and recursive implementations inconsistent.
Written by the indexing model from the issue text.
Description
The error case is documented as:
An upper level page table entry has the
HUGE_PAGEflag set, which means that the
given page is part of a huge page and can't be freed individually.
However, it is also returned when an entry is expected to have the HUGE_PAGE flag set, but does not:
- https://github.com/rust-osdev/x86_64/blob/286ea1fec60e5a69b1ee1aae5ed6360ebc27135b/src/structures/paging/mapper/mapped_page_table/mod.rs#L105-L107
- https://github.com/rust-osdev/x86_64/blob/286ea1fec60e5a69b1ee1aae5ed6360ebc27135b/src/structures/paging/mapper/mapped_page_table/mod.rs#L125-L127
- https://github.com/rust-osdev/x86_64/blob/286ea1fec60e5a69b1ee1aae5ed6360ebc27135b/src/structures/paging/mapper/mapped_page_table/mod.rs#L265-L267
- https://github.com/rust-osdev/x86_64/blob/286ea1fec60e5a69b1ee1aae5ed6360ebc27135b/src/structures/paging/mapper/mapped_page_table/mod.rs#L288-L290
- analog for
RecursivePageTable
So when when a unmap operation on a Size2MiB page fails with ParentEntryHugePage the issue can be either:
- the P4 or P3 tables have the
HUGE_PAGEbit set - the P2 table doesn't have the
HUGE_PAGEbit set
The name of the ParentEntryHugePage variant sounds like the problem is case 1. So I think it would be good to add a separate new variant for case 2 or at least rename the ParentEntryHugePage to WrongPageSize or similar. However, this would be a breaking change.
Note that this issue is already present on v0.15.5.
- 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 ·
-
New major release?Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
rust-osdev/x86_64#600 · 16 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
rust-osdev/x86_64#587 · 1 comment ·
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 ·