summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorZongmin Zhou <zhouzongmin@kylinos.cn>2026-08-26 15:50:09 +0800
committerAnup Patel <anup@brainfault.org>2026-09-15 18:55:51 +0530
commitb3d346838ec65fac7fd83f5dbcedd13cadfffddb (patch)
tree8efe5beae5e5a80a3337a298c66ecb602fef631d /tools/perf/scripts/python
parentf41fb17143df890855d3de980f8eb92dfd595817 (diff)
downloadlinux-next-b3d346838ec65fac7fd83f5dbcedd13cadfffddb.tar.gz
linux-next-b3d346838ec65fac7fd83f5dbcedd13cadfffddb.zip
KVM: riscv: Fix NACL hfence entry update order
The SBI v3.0 specification (section 15.1.2) requires a nested HFENCE entry to be populated as follows: 1) find an unused entry with Config.Pending == 0 2) update the Page_Number and Page_Count words 3) update the Config word with Config.Pending set __kvm_riscv_nacl_hfence() writes the Config word first, so the SBI implementation (or NACL hardware) can observe a pending entry with pnum/pcount values left over from the previous use of that entry, resulting in incorrect TLB flush ranges. Write pnum and pcount first and the Config word last. Since the consumer is an external agent on coherent shared memory, use WRITE_ONCE() to stop the compiler from reordering the stores and smp_wmb() to make the parameter words globally visible before the Pending bit is set. Fixes: d466c19cead5 ("RISC-V: KVM: Add common nested acceleration support") Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260826075009.68952-1-min_halo@163.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions