From 493dede919327659c1394ad7fc1ca1f60b0eff54 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 13 Apr 2017 19:43:38 +0200 Subject: [PATCH] The x86_64 crate requires no unsafe for tlb flushing --- blog/content/post/06-page-tables.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/blog/content/post/06-page-tables.md b/blog/content/post/06-page-tables.md index 3966d0a7..0d1dcaeb 100644 --- a/blog/content/post/06-page-tables.md +++ b/blog/content/post/06-page-tables.md @@ -855,14 +855,14 @@ x86_64 = "0.1.2" ```rust ... - p1[page.p1_index()].set_unused(); - unsafe { - use x86_64::instructions::tlb; - use x86_64::VirtualAddress; - tlb::flush(VirtualAddress(page.start_address())); - } - // TODO free p(1,2,3) table if empty - //allocator.deallocate_frame(frame); + p1[page.p1_index()].set_unused(); + + use x86_64::instructions::tlb; + use x86_64::VirtualAddress; + tlb::flush(VirtualAddress(page.start_address())); + + // TODO free p(1,2,3) table if empty + //allocator.deallocate_frame(frame); } ``` Now the desired page fault occurs even when we access the page before.