Re: [PATCH v5 4/9] riscv/kprobe: Add common RVI and RVC instruction decoder code

Björn Töpel
2023-01-04T15:18:20Z

"liaochang (A)" <liaochang1@huawei.com> writes:

>> Shouldn't the mask be 0xf003?
>
> Actually, the mask should be 0xf003 indeedly, but it also bring another problem that
> it can't tell C.MV and C.JR via the mask and value parts. Look opcodes below:
>
> 15 14 13 12 | 11 10 9 8 | 7 6 5 4 | 3 2 1 0
> C.JR: 1 0 0 0 | rs1 0 1 0
> C.MV: 1 0 0 0 | rd rs2 1 0
>
> The only differece between C.MV and C.JR is the bits[2~6], these bitfield of C.JR is zero,
> the ones of C.MV is rs2 which never be zero. In order to tell C.MV and C.JR correclty, it
> is better to adjust the mask of C.JR to be 0xf07f as your patch(riscv, kprobe: Stricter c.jr/c.jalr decoding)
>
> Looking forward to your feedback.

Yup, that was the reason I submitted the fix! Let's wait for the fix to
be applied, and not include that fix in your feature series.

Björn