[PATCH] RISC-V: KVM: Fix shift-out-of-bounds in make_xfence_request()
Jiakai Xu
xujiakai2025 at iscas.ac.cn
Fri Apr 3 16:07:37 PDT 2026
> idx is unsigned, so I would expect this 'idx < 0' to produce a warning
> that it's always false.
>
> I wouldn't introduce idx and just change the current condition instead
>
> if (vcpu->vcpu_id < hbase || vcpu->vcpu_id >= hbase + BITS_PER_LONG)
> continue;
Thanks for the review!
You're right, the 'idx < 0' check is redundant since idx is unsigned.
Will drop the idx variable and use your suggested condition directly.
Will send a v2 shortly.
Thanks,
Jiakai
More information about the linux-riscv
mailing list