`PageTableEntry::addr` needs a `is_level_1_entry` arg

Open
#613 0 comments 0 reactions 0 assignees View on GitHub

@phil-opp is already working on this.

Since Nov 16, 2026.

  • #633 by @phil-opp — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start at the PageTableEntry::addr entry point and trace the functions that call it, since the issue says they also need the is_level_1_entry flag. Check how PAT support from pull request 548 affects address masking and verify that huge-page addresses mask the potential PAT bit while 4KiB-page addresses remain correct. Done means the flag is propagated through all affected callers and addr returns the correct address for both cases.

Written by the indexing model from the issue text.

Description

We need to mask off a potential PAT bit at position 12 in the addr method, but only if this is a huge page. Otherwise the address is incorrect. Unfortunately we cannot find out whether an entry is mapping a huge page because the huge page bit is reused as PAT bit for 4KiB pages. So we need an additional is_level_1_entry argument for addr to decide this.

Unfortunately there are a lot of functions that call addr, so these will need a is_level_1_entry flag too...

PAT support was introduced in https://github.com/rust-osdev/x86_64/pull/548

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-osdev/x86_64

All issues in rust-osdev/x86_64

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.