summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/108/other/2683
blob: cc5ccde080f07dc7cfda1602fbeb78ab482082b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
performance: 0.867
graphic: 0.841
semantic: 0.795
other: 0.784
PID: 0.759
device: 0.758
network: 0.714
permissions: 0.706
vnc: 0.685
socket: 0.632
KVM: 0.630
debug: 0.602
files: 0.573
boot: 0.479

TCG: probe_access() has inconsistent behavior
Description of problem:
In full-system mode, probe_access() will return NULL when the flag is TLB_MMIO.

accel/tcg/cputlb.c: probe_access_internal()
```
    if (unlikely(flags & ~(TLB_WATCHPOINT | TLB_NOTDIRTY | TLB_CHECK_ALIGNED))
        || (access_type != MMU_INST_FETCH && force_mmio)) {
        *phost = NULL;
        return TLB_MMIO;
    }
```
But in linux-user mode, it will return correct address when the flag is TLB_MMIO.

accel/tcg/user-exec.c: probe_access()
```
    return size ? g2h(env_cpu(env), addr) : NULL;
```
This will lead to some different behaviors, like cbo.zero in RISC-V.

target/riscv/op_helper.c: helper_cbo_zero()
```
    mem = probe_write(env, address, cbozlen, mmu_idx, ra);

    if (likely(mem)) {
        memset(mem, 0, cbozlen);
    } else {
        for (int i = 0; i < cbozlen; i++) {
            cpu_stb_mmuidx_ra(env, address + i, 0, mmu_idx, ra);
        }
    }
```
When the current instruction has memory callback by plugin:

Full-system mode uses slow-path(cpu_stb_mmuidx_ra) and inject mem_cbs correctly.

Linux-user mode uses fast-path(memset) and doesn't inject callbacks.

To ensure consistent results, probe_access() should return NULL when the flag is TLB_MMIO in linux-user mode.