aboutsummaryrefslogtreecommitdiffstats
path: root/executor/kvm.h
diff options
context:
space:
mode:
author6eanut <jiakaiPeanut@gmail.com>2026-01-22 04:23:38 +0000
committerAlexander Potapenko <glider@google.com>2026-02-25 07:36:12 +0000
commitc162cde9eaf50b92de5277df3e48c93349bf45a3 (patch)
tree4560241f339f0b21ebefa31b0db831886d55df73 /executor/kvm.h
parent787dfb7c5a058a72a4936baaab3c96c076d03079 (diff)
executor, sys/linux, pkg: enable syzos for riscv64
This patch enables syzos for riscv64 and implements the corresponding pseudo syscalls. Pseudo syscalls: - syz_kvm_setup_syzos_vm - syz_kvm_add_vcpu - syz_kvm_assert_syzos_uexit Syzos guest support: - guest_uexit - guest_execute_code - guest_handle_csrr and guest_handle_csrw Test seeds: - riscv64-syz_kvm_setup_syzos_vm - riscv64-syz_kvm_setup_syzos_vm-csrr - riscv64-syz_kvm_setup_syzos_vm-csrw
Diffstat (limited to 'executor/kvm.h')
-rw-r--r--executor/kvm.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/executor/kvm.h b/executor/kvm.h
index 227967fea..705d792b2 100644
--- a/executor/kvm.h
+++ b/executor/kvm.h
@@ -546,4 +546,26 @@
#endif // ARM64 SYZOS definitions
+// RISCV64 SYZOS definitions.
+#if GOARCH_riscv64
+// Core Local INTerruptor address.
+#define RISCV64_ADDR_CLINT 0x02000000
+// Platform Level Interrupt Controller address.
+#define RISCV64_ADDR_PLIC 0x0c000000
+// Write to this page to trigger a page fault and stop KVM_RUN.
+#define RISCV64_ADDR_EXIT 0x40000000
+// Two writable pages with KVM_MEM_LOG_DIRTY_PAGES explicitly set.
+#define RISCV64_ADDR_DIRTY_PAGES 0x40001000
+#define RISCV64_ADDR_USER_CODE 0x80000000
+// Location of the SYZOS guest code. Name shared with x86 SYZOS.
+#define SYZOS_ADDR_EXECUTOR_CODE 0x80008000
+#define RISCV64_ADDR_SCRATCH_CODE 0x80010000
+#define RISCV64_ADDR_STACK_BASE 0x80020000
+#define RISCV64_ADDR_EXCEPTION_VECTOR 0x00001000
+
+// Dedicated address within the exit page for the uexit command.
+#define RISCV64_ADDR_UEXIT (RISCV64_ADDR_EXIT + 256)
+
+#endif // RISCV64 SYZOS definitions
+
#endif // EXECUTOR_KVM_H