From: Dong Yang dayss1224@gmail.com
Add supported KVM test cases and fix the compilation dependencies. --- Changes in v2: - Delete some repeat KVM test cases on riscv - Add missing headers to fix the build for new RISC-V KVM selftests
Dong Yang (1): KVM: riscv: selftests: Add missing headers for new testcases
Quan Zhou (2): KVM: riscv: selftests: Add common supported test cases KVM: riscv: selftests: Use the existing RISCV_FENCE macro in `rseq-riscv.h`
tools/testing/selftests/kvm/Makefile.kvm | 6 ++++++ tools/testing/selftests/kvm/include/riscv/processor.h | 2 ++ tools/testing/selftests/rseq/rseq-riscv.h | 3 +-- 3 files changed, 9 insertions(+), 2 deletions(-)
From: Quan Zhou zhouquan@iscas.ac.cn
Some common KVM test cases are supported on riscv now as following:
access_tracking_perf_test dirty_log_perf_test memslot_modification_stress_test memslot_perf_test mmu_stress_test rseq_test
Signed-off-by: Quan Zhou zhouquan@iscas.ac.cn Signed-off-by: Dong Yang dayss1224@gmail.com --- tools/testing/selftests/kvm/Makefile.kvm | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm index 38b95998e..3a7186551 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -197,6 +197,12 @@ TEST_GEN_PROGS_riscv += arch_timer TEST_GEN_PROGS_riscv += coalesced_io_test TEST_GEN_PROGS_riscv += get-reg-list TEST_GEN_PROGS_riscv += steal_time +TEST_GEN_PROGS_riscv += access_tracking_perf_test +TEST_GEN_PROGS_riscv += dirty_log_perf_test +TEST_GEN_PROGS_riscv += memslot_modification_stress_test +TEST_GEN_PROGS_riscv += memslot_perf_test +TEST_GEN_PROGS_riscv += mmu_stress_test +TEST_GEN_PROGS_riscv += rseq_test
TEST_GEN_PROGS_loongarch += coalesced_io_test TEST_GEN_PROGS_loongarch += demand_paging_test
On Thu, Aug 07, 2025 at 10:59:28PM +0800, dayss1224@gmail.com wrote:
From: Quan Zhou zhouquan@iscas.ac.cn
Some common KVM test cases are supported on riscv now as following:
access_tracking_perf_test dirty_log_perf_test memslot_modification_stress_test memslot_perf_test mmu_stress_test rseq_test
I gave these a light testing after pulling together an appropriate config (we should probably better document needed config symbols...) The tests seemed to mostly work for me, so ack for including them.
Signed-off-by: Quan Zhou zhouquan@iscas.ac.cn Signed-off-by: Dong Yang dayss1224@gmail.com
tools/testing/selftests/kvm/Makefile.kvm | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm index 38b95998e..3a7186551 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -197,6 +197,12 @@ TEST_GEN_PROGS_riscv += arch_timer TEST_GEN_PROGS_riscv += coalesced_io_test TEST_GEN_PROGS_riscv += get-reg-list TEST_GEN_PROGS_riscv += steal_time +TEST_GEN_PROGS_riscv += access_tracking_perf_test +TEST_GEN_PROGS_riscv += dirty_log_perf_test +TEST_GEN_PROGS_riscv += memslot_modification_stress_test +TEST_GEN_PROGS_riscv += memslot_perf_test +TEST_GEN_PROGS_riscv += mmu_stress_test +TEST_GEN_PROGS_riscv += rseq_test
Please integrate into the current list in alphabetical order.
Thanks, drew
TEST_GEN_PROGS_loongarch += coalesced_io_test TEST_GEN_PROGS_loongarch += demand_paging_test -- 2.34.1
-- kvm-riscv mailing list kvm-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv
From: Quan Zhou zhouquan@iscas.ac.cn
To avoid redefinition issues with RISCV_FENCE, directly reference the existing macro in `rseq-riscv.h`.
Signed-off-by: Quan Zhou zhouquan@iscas.ac.cn Signed-off-by: Dong Yang dayss1224@gmail.com --- tools/testing/selftests/rseq/rseq-riscv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/rseq/rseq-riscv.h b/tools/testing/selftests/rseq/rseq-riscv.h index 67d544aaa..06c840e81 100644 --- a/tools/testing/selftests/rseq/rseq-riscv.h +++ b/tools/testing/selftests/rseq/rseq-riscv.h @@ -8,6 +8,7 @@ * exception when executed in all modes. */ #include <endian.h> +#include <asm/fence.h>
#if defined(__BYTE_ORDER) ? (__BYTE_ORDER == __LITTLE_ENDIAN) : defined(__LITTLE_ENDIAN) #define RSEQ_SIG 0xf1401073 /* csrr mhartid, x0 */ @@ -24,8 +25,6 @@ #define REG_L __REG_SEL("ld ", "lw ") #define REG_S __REG_SEL("sd ", "sw ")
-#define RISCV_FENCE(p, s) \ - __asm__ __volatile__ ("fence " #p "," #s : : : "memory") #define rseq_smp_mb() RISCV_FENCE(rw, rw) #define rseq_smp_rmb() RISCV_FENCE(r, r) #define rseq_smp_wmb() RISCV_FENCE(w, w)
On Thu, Aug 07, 2025 at 10:59:29PM +0800, dayss1224@gmail.com wrote:
From: Quan Zhou zhouquan@iscas.ac.cn
To avoid redefinition issues with RISCV_FENCE, directly reference the existing macro in `rseq-riscv.h`.
Signed-off-by: Quan Zhou zhouquan@iscas.ac.cn Signed-off-by: Dong Yang dayss1224@gmail.com
tools/testing/selftests/rseq/rseq-riscv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/rseq/rseq-riscv.h b/tools/testing/selftests/rseq/rseq-riscv.h index 67d544aaa..06c840e81 100644 --- a/tools/testing/selftests/rseq/rseq-riscv.h +++ b/tools/testing/selftests/rseq/rseq-riscv.h @@ -8,6 +8,7 @@
- exception when executed in all modes.
*/ #include <endian.h> +#include <asm/fence.h> #if defined(__BYTE_ORDER) ? (__BYTE_ORDER == __LITTLE_ENDIAN) : defined(__LITTLE_ENDIAN) #define RSEQ_SIG 0xf1401073 /* csrr mhartid, x0 */ @@ -24,8 +25,6 @@ #define REG_L __REG_SEL("ld ", "lw ") #define REG_S __REG_SEL("sd ", "sw ") -#define RISCV_FENCE(p, s) \
- __asm__ __volatile__ ("fence " #p "," #s : : : "memory")
#define rseq_smp_mb() RISCV_FENCE(rw, rw) #define rseq_smp_rmb() RISCV_FENCE(r, r)
#define rseq_smp_wmb() RISCV_FENCE(w, w)
2.34.1
Reviewed-by: Andrew Jones ajones@ventanamicro.com
From: Dong Yang dayss1224@gmail.com
Add missing headers to fix the build for new RISC-V KVM selftests.
Signed-off-by: Quan Zhou zhouquan@iscas.ac.cn Signed-off-by: Dong Yang dayss1224@gmail.com --- tools/testing/selftests/kvm/include/riscv/processor.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/riscv/processor.h b/tools/testing/selftests/kvm/include/riscv/processor.h index 162f303d9..4cf5ae117 100644 --- a/tools/testing/selftests/kvm/include/riscv/processor.h +++ b/tools/testing/selftests/kvm/include/riscv/processor.h @@ -9,7 +9,9 @@
#include <linux/stringify.h> #include <asm/csr.h> +#include <asm/vdso/processor.h> #include "kvm_util.h" +#include "ucall_common.h"
#define INSN_OPCODE_MASK 0x007c #define INSN_OPCODE_SHIFT 2
On Thu, Aug 07, 2025 at 10:59:30PM +0800, dayss1224@gmail.com wrote:
From: Dong Yang dayss1224@gmail.com
Add missing headers to fix the build for new RISC-V KVM selftests.
Signed-off-by: Quan Zhou zhouquan@iscas.ac.cn Signed-off-by: Dong Yang dayss1224@gmail.com
tools/testing/selftests/kvm/include/riscv/processor.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/riscv/processor.h b/tools/testing/selftests/kvm/include/riscv/processor.h index 162f303d9..4cf5ae117 100644 --- a/tools/testing/selftests/kvm/include/riscv/processor.h +++ b/tools/testing/selftests/kvm/include/riscv/processor.h @@ -9,7 +9,9 @@ #include <linux/stringify.h> #include <asm/csr.h> +#include <asm/vdso/processor.h>
This is fine, but...
#include "kvm_util.h" +#include "ucall_common.h"
...this isn't correct. We should instead add this include line to all the source files that need it:
access_tracking_perf_test.c memslot_modification_stress_test.c memslot_perf_test.c
Thanks, drew
#define INSN_OPCODE_MASK 0x007c
#define INSN_OPCODE_SHIFT 2
2.34.1
-- kvm-riscv mailing list kvm-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv
On Thu, Aug 07, 2025 at 10:59:27PM +0800, dayss1224@gmail.com wrote:
From: Dong Yang dayss1224@gmail.com
Add supported KVM test cases and fix the compilation dependencies.
Changes in v2:
- Delete some repeat KVM test cases on riscv
- Add missing headers to fix the build for new RISC-V KVM selftests
Dong Yang (1): KVM: riscv: selftests: Add missing headers for new testcases
Quan Zhou (2): KVM: riscv: selftests: Add common supported test cases KVM: riscv: selftests: Use the existing RISCV_FENCE macro in `rseq-riscv.h`
tools/testing/selftests/kvm/Makefile.kvm | 6 ++++++ tools/testing/selftests/kvm/include/riscv/processor.h | 2 ++ tools/testing/selftests/rseq/rseq-riscv.h | 3 +-- 3 files changed, 9 insertions(+), 2 deletions(-)
The two fix patches need to come before the Makefile patch in order to avoid breaking the build.
Thanks, drew
linux-kselftest-mirror@lists.linaro.org