Skip to content

Commit 54190d5

Browse files
committed
add tlbsync
1 parent 72a28bd commit 54190d5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/instructions/tlb.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,15 @@ pub unsafe fn flush_broadcast<S>(
156156
);
157157
}
158158
}
159+
160+
/// Synchronize broadcasted TLB Invalidations.
161+
///
162+
/// # Safety
163+
///
164+
/// This function is unsafe as it requires CPUID.(EAX=8000_0008H, ECX=0H):EBX.INVLPGB to be 1.
165+
#[inline]
166+
pub unsafe fn tlbsync() {
167+
unsafe {
168+
asm!("tlbsync", options(nomem, preserves_flags));
169+
}
170+
}

0 commit comments

Comments
 (0)