aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi/source.py
diff options
context:
space:
mode:
authorJim Shu <jim.shu@sifive.com>2025-05-08 17:48:38 +0800
committerAlistair Francis <alistair.francis@wdc.com>2025-07-04 21:09:48 +1000
commitf9eaa1542be5f7273dec1111a1e17d8ff2a5bcba (patch)
treec591eb8035aa088f4c9adc4fcb8b43fe7ef761c1 /scripts/qapi/source.py
parent5ee4f21713d51fdf3d8756744ffe92365df8598b (diff)
downloadqemu-f9eaa1542be5f7273dec1111a1e17d8ff2a5bcba.zip
qemu-f9eaa1542be5f7273dec1111a1e17d8ff2a5bcba.tar.gz
qemu-f9eaa1542be5f7273dec1111a1e17d8ff2a5bcba.tar.bz2
target/riscv: support atomic instruction fetch (Ziccif)
Support 4-byte atomic instruction fetch when instruction is natural aligned. Current implementation is not atomic because it loads instruction twice for first and last 2 bytes. We load 4 bytes at once to keep the atomicity. This instruction preload method only applys when instruction is 4-byte aligned. If instruction is unaligned, it could be across pages so that preload will trigger additional page fault. We encounter this issue when doing pressure test of enabling & disabling Linux kernel ftrace. Ftrace with kernel preemption requires concurrent modification and execution of instruction, so non-atomic instruction fetch will cause the race condition. We may fetch the wrong instruction which is the mixing of 2 instructions. Also, RISC-V Profile wants to provide this feature by HW. RVA20U64 Ziccif protects the atomicity of instruction fetch when it is natural aligned. This commit depends on the atomic read support of translator_ld in the commit 6a9dfe1984b0c593fb0ddb52d4e70832e6201dd6. Signed-off-by: Jim Shu <jim.shu@sifive.com> Reviewed-by: Frank Chang <frank.chang@sifive.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20250508094838.19394-1-jim.shu@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'scripts/qapi/source.py')
0 files changed, 0 insertions, 0 deletions