From: Charlie Jenkins <thecharlesjenkins@gmail.com>
To: Nam Cao <namcao@linutronix.de>
Cc: Charlie Jenkins via B4 Relay
<devnull+thecharlesjenkins.gmail.com@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>, Anup Patel <anup@brainfault.org>,
Atish Patra <atish.patra@linux.dev>,
Conor Dooley <conor@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 04/16] riscv: kprobes: Use generated instruction headers
Date: Thu, 18 Jun 2026 00:31:26 -0700 [thread overview]
Message-ID: <ajOezhejx7PcOw_x@blinky> (raw)
In-Reply-To: <87jys5egum.fsf@yellow.woof>
On Thu, Jun 11, 2026 at 08:22:41AM +0200, Nam Cao wrote:
> Charlie Jenkins via B4 Relay
> <devnull+thecharlesjenkins.gmail.com@kernel.org> writes:
> > This was again verified by checking all 32-bit values for each of these
> > functions and checking that the two version have the same behavior.
>
> Your checking is missing some cases. branch instructions and c.jr are
> broken.
>
> Btw, any chance that check can be added as a new kunit test case? I
> wrote the CONFIG_RISCV_KPROBES_KUNIT, but that only tests some values.
Okay I looked back over my test cases and realized my mistakes. I was
iterating through all possible 32-bit values and passing them into the
new simulate_* functions and comparing the register state to the old
simulate_* instructions. I missed the _pc + addr bug because the _pc
value I was using was 0. I missed the simulate_c_jr ra bug because I was
not checking ra.
Since I was checking against the previous version it's not possible to
do a straight one-to-one conversion to the kunit. I think it might be
possible to do something similar but I will need to mess with that to
determine a good way of doing it.
- Charlie
>
> Nam
next prev parent reply other threads:[~2026-06-18 7:31 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 4:45 [PATCH 00/16] riscv: Generate riscv instruction functions Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 01/16] riscv: Introduce instruction table generation Charlie Jenkins via B4 Relay
2026-06-10 15:56 ` Nam Cao
2026-06-11 1:06 ` Charlie Jenkins
2026-06-11 5:21 ` Nam Cao
2026-06-16 5:58 ` Charlie Jenkins
2026-04-08 4:45 ` [PATCH 02/16] riscv: alternatives: Use generated instruction headers for patching code Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 03/16] riscv: kgdb: Use generated instruction headers Charlie Jenkins via B4 Relay
2026-06-11 6:08 ` Nam Cao
2026-06-16 6:02 ` Charlie Jenkins
2026-04-08 4:45 ` [PATCH 04/16] riscv: kprobes: " Charlie Jenkins via B4 Relay
2026-06-11 6:14 ` Nam Cao
2026-06-16 6:06 ` Charlie Jenkins
2026-06-11 6:22 ` Nam Cao
2026-06-18 7:31 ` Charlie Jenkins [this message]
2026-06-18 15:31 ` Nam Cao
2026-04-08 4:45 ` [PATCH 05/16] riscv: cfi: " Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 06/16] riscv: Use generated instruction headers for misaligned loads/stores Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 07/16] riscv: kvm: Use generated instruction headers for csr code Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 08/16] riscv: kvm: Fix MMIO emulation for sign-extended insns Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 09/16] KVM: device: Add test device Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 10/16] KVM: riscv: selftests: Add mmio test Charlie Jenkins via B4 Relay
2026-04-08 4:45 ` [PATCH 11/16] riscv: kvm: Use generated instruction headers for mmio emulation Charlie Jenkins via B4 Relay
2026-04-08 4:46 ` [PATCH 12/16] riscv: kvm: Add emulated test csr Charlie Jenkins via B4 Relay
2026-04-08 4:46 ` [PATCH 13/16] KVM: riscv: selftests: Add csr emulation test Charlie Jenkins via B4 Relay
2026-04-08 4:46 ` [PATCH 14/16] riscv: kvm: Use generated instruction headers for csr emulation Charlie Jenkins via B4 Relay
2026-04-08 4:46 ` [PATCH 15/16] riscv: kexec: Use generated instruction headers for kexec relocations Charlie Jenkins via B4 Relay
2026-04-08 4:46 ` [PATCH 16/16] riscv: Remove unused instruction headers Charlie Jenkins via B4 Relay
2026-04-08 17:58 ` [PATCH 1/16] riscv: Introduce instruction table generation Charlie Jenkins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ajOezhejx7PcOw_x@blinky \
--to=thecharlesjenkins@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=atish.patra@linux.dev \
--cc=conor@kernel.org \
--cc=devnull+thecharlesjenkins.gmail.com@kernel.org \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=namcao@linutronix.de \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=pjw@kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox