Skip to content

Fix missing TLB flush#769

Open
sangho2 wants to merge 1 commit intomainfrom
sanghle/lvbs/fix_tlb_flush
Open

Fix missing TLB flush#769
sangho2 wants to merge 1 commit intomainfrom
sanghle/lvbs/fix_tlb_flush

Conversation

@sangho2
Copy link
Copy Markdown
Contributor

@sangho2 sangho2 commented Apr 13, 2026

This PR fixes missing TLB flushes. In particular, it covers cases like cross-core kernel-page not-present -> present or PDE widening, which result in faults because we do not maintain VM areas for kernel address space such that a page fault handler cannot properly update the PTEs. This PR simply flushes corresponding TLB entries.

@github-actions
Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

@sangho2 sangho2 marked this pull request as ready for review April 13, 2026 21:53
@sangho2 sangho2 enabled auto-merge April 13, 2026 21:53
@CvvT
Copy link
Copy Markdown
Contributor

CvvT commented Apr 14, 2026

This PR fixes missing TLB flushes. In particular, it covers not-present -> present cases which suffer from corner cases like speculative page table walks and more.

If it's not-present --> present, my understanding is that in worst case CPU would trigger page fault. Once it's resolved, TLB would be updated. So, we don't need to flush TLB proactively.

@sangho2
Copy link
Copy Markdown
Contributor Author

sangho2 commented Apr 14, 2026

This PR fixes missing TLB flushes. In particular, it covers not-present -> present cases which suffer from corner cases like speculative page table walks and more.

If it's not-present --> present, my understanding is that in worst case CPU would trigger page fault. Once it's resolved, TLB would be updated. So, we don't need to flush TLB proactively.

There are some corner cases that I can reproduce and that's why I wrote this PR :)

@CvvT
Copy link
Copy Markdown
Contributor

CvvT commented Apr 14, 2026

This PR fixes missing TLB flushes. In particular, it covers not-present -> present cases which suffer from corner cases like speculative page table walks and more.

If it's not-present --> present, my understanding is that in worst case CPU would trigger page fault. Once it's resolved, TLB would be updated. So, we don't need to flush TLB proactively.

There are some corner cases that I can reproduce and that's why I wrote this PR :)

What is the corner case?

@sangho2
Copy link
Copy Markdown
Contributor Author

sangho2 commented Apr 14, 2026

This PR fixes missing TLB flushes. In particular, it covers not-present -> present cases which suffer from corner cases like speculative page table walks and more.

If it's not-present --> present, my understanding is that in worst case CPU would trigger page fault. Once it's resolved, TLB would be updated. So, we don't need to flush TLB proactively.

There are some corner cases that I can reproduce and that's why I wrote this PR :)

What is the corner case?

This is about a kernel-level page fault. we don't have demand paging / page fault handler for it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants