From 6119c78bc7e2cfc24f38ecf4b7f74c6e5f29e744 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 17 Feb 2021 17:35:13 +0800 Subject: [PATCH] kernel: riscv: really fix sharing logic We're comparing numbers and not MMUFlags, so invalid values crept in. Signed-off-by: Sean Cross --- kernel/src/arch/riscv/mem.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/arch/riscv/mem.rs b/kernel/src/arch/riscv/mem.rs index 2dc59d466..114886d9e 100644 --- a/kernel/src/arch/riscv/mem.rs +++ b/kernel/src/arch/riscv/mem.rs @@ -584,7 +584,7 @@ pub fn virt_to_phys(virt: usize) -> Result { } // If the page is "Valid" but shared, issue a sharing violation - if l0_pt.entries[vpn0] & MMUFlags::S.bits() == 1 { + if l0_pt.entries[vpn0] & MMUFlags::S.bits() != 0 { return Err(xous_kernel::Error::ShareViolation); }