Re: [PATCH v3 04/17] riscv: Add kprobes instruction simulation KUnit

Nam Cao <[email protected]>
Newsgroups org.infradead.lists.kvm-riscv,org.infradead.lists.linux-riscv,org.kernel.vger.kvm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
> +		} else if (riscv_insn_is_c_jr(i)) {
> +			u32 rs1_index = riscv_insn_c_jr_extract_xs1(i);
> +
> +			simulate_c_jr(i, addr, &regs);
> +
> +			KUNIT_EXPECT_EQ_MSG(test, regs.epc,
> +					    riscv_insn_reg_get_val((unsigned long *)&regs,
> +								   rs1_index),
> +					    "c.jr instruction (0x%x) incorrectly simulated", i);

Should we set a value to rs1, just like everything else?

> diff --git a/arch/riscv/kernel/tests/kprobes/test-kprobes.h b/arch/riscv/kernel/tests/kprobes/test-kprobes.h
> index 537f44aa9d3f..7a672de8f130 100644
> --- a/arch/riscv/kernel/tests/kprobes/test-kprobes.h
> +++ b/arch/riscv/kernel/tests/kprobes/test-kprobes.h
> @@ -19,6 +19,12 @@ extern void *test_kprobes_addresses[];
>  /* array of functions that return KPROBE_TEST_MAGIC */
>  extern long (*test_kprobes_functions[])(void);
>  
> +void test_kprobes_arbitrary(void);
> +
> +extern unsigned int *test_kprobes_arbitrary_addr;
> +
> +extern unsigned int *test_kprobes_c_bnez_addr1;
> +

Are these declarations used somewhere?

Nam

-- 
kvm-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kvm-riscv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.