Skip to content

Commit 861bbbf

Browse files
committed
fix off-by-one for ASID check
1 parent 28f9511 commit 861bbbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/instructions/tlb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ where
259259
/// The caller has to ensure that SVM is enabled in EFER when the flush is executed.
260260
// FIXME: Make ASID a type and remove error type.
261261
pub unsafe fn asid(&mut self, asid: u16) -> Result<&mut Self, AsidOutOfRangeError> {
262-
if u32::from(asid) > self.invlpgb.nasid {
262+
if u32::from(asid) >= self.invlpgb.nasid {
263263
return Err(AsidOutOfRangeError {
264264
asid,
265265
nasid: self.invlpgb.nasid,

0 commit comments

Comments
 (0)