id = 1606 title = "riscv: fence.i is not functional" state = "opened" created_at = "2023-04-17T17:03:39.906Z" closed_at = "n/a" labels = ["target: riscv"] url = "https://gitlab.com/qemu-project/qemu/-/issues/1606" host-os = "Ubuntu 22.04.2 LTS" host-arch = "x86" qemu-version = "7.2.94 (v8.0.0-rc4)" guest-os = "Ubuntu 22.04.2 LTS" guest-arch = "RISC-V (riscv64-softmmu)" description = """The attached user-level test is designed to do the following (in iteration): - Thread P0 on CPU0 changes some text/code, while - Thread P1 on CPU1 checks/reads the code, fence.i, then executes the same code. Results (in stdout) indicates that CPU1 has read the new code (1:x5=a009) but executed the old one (1:x7=1) (against the specification).""" reproduce = """1. echo 2 > /proc/sys/vm/nr_hugepages 2. ./CoRF+fence.i""" additional = """Example output: ```[CoRF+fence.i.c](/uploads/c150ca0910783cc4bfc3886789b64c28/CoRF+fence.i.c) Test CoRF+fence.i Allowed Histogram (4 states) 25784 :>1:x5=0xa009; 1:x7=2; 24207 *>1:x5=0xa009; 1:x7=1; <-- THIS LINE 8 :>1:x5=0xa019; 1:x7=1; 1 :>1:x5=0xa019; 1:x7=2; Ok Witnesses Positive: 24207 Negative 25793 Condition exists (1:x5=0xa009 /\\ 1:x7=1) is validated Observation CoRF+fence.i Sometimes 24207 25793 Time CoRF+fence.i 0.85 Hash= ```"""