From fd8597e7794d268516109c53d92fb60d28007fae Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:05:10 +0800 Subject: [PATCH 01/10] Add files via upload --- src/syscall/syscall_names.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/syscall/syscall_names.h diff --git a/src/syscall/syscall_names.h b/src/syscall/syscall_names.h new file mode 100644 index 00000000..61413d73 --- /dev/null +++ b/src/syscall/syscall_names.h @@ -0,0 +1,15 @@ +#pragma once + +#include "dispatch.h" + +/* Name table generated from dispatch.tbl: shared with syscall.c so verbose + * logs can print syscall names. A new entry in dispatch.tbl automatically + * gains a name here; slots without a corresponding entry stay NULL and the + * caller falls back to printing the raw number. + */ +static const char *const syscall_names[SC_MAX_SYSCALL_NUM + 1] = { +#define _(sys_name, sc_handler, extra) [sys_name] = #sys_name, + SYSCALL_TABLE_ENTRIES(_) +#undef _ +}; + From 62cb2ef0c7552ca8ca2a053710a7ea1d81ece542 Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:05:53 +0800 Subject: [PATCH 02/10] Add files via upload --- src/syscall/syscall.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/syscall/syscall.c b/src/syscall/syscall.c index 0902245c..00ef7b8f 100644 --- a/src/syscall/syscall.c +++ b/src/syscall/syscall.c @@ -68,6 +68,7 @@ #include "syscall/sys.h" #include "syscall/usbdev.h" #include "syscall/sysvipc.h" +#include "syscall/syscall_names.h" #include "proved/timespec.h" #include "syscall/time.h" @@ -357,11 +358,6 @@ SC_FORWARD(sc_nanosleep, sys_nanosleep(g, x0, x1)) SC_FORWARD(sc_clock_nanosleep, sys_clock_nanosleep(g, (int) x0, (int) x1, x2, x3)) SC_FORWARD(sc_gettimeofday, sys_gettimeofday(g, x0, x1)) SC_FORWARD(sc_setitimer, sys_setitimer(g, (int) x0, x1, x2)) -SC_FORWARD(sc_timer_create, sys_timer_create(g, (int) x0, x1, x2)) -SC_FORWARD(sc_timer_gettime, sys_timer_gettime(g, (int) x0, x1)) -SC_FORWARD(sc_timer_getoverrun, signal_posix_timer_overrun((int) x0)) -SC_FORWARD(sc_timer_settime, sys_timer_settime(g, (int) x0, (int) x1, x2, x3)) -SC_FORWARD(sc_timer_delete, signal_posix_timer_delete((int) x0)) SC_FORWARD(sc_getitimer, sys_getitimer(g, (int) x0, x1)) SC_FORWARD(sc_times, sys_times(g, x0)) @@ -2309,7 +2305,7 @@ static int64_t sc_clone(guest_t *g, (unsigned long long) x0, (unsigned long long) x1, (unsigned long long) x2, (unsigned long long) x3, (unsigned long long) x4); - return sys_clone(current_thread->vcpu, g, x0, x1, 0, 0, x2, x2, x3, x4, + return sys_clone(current_thread->vcpu, g, x0, x1, 0, 0, x2, x3, x4, verbose); } @@ -2802,9 +2798,22 @@ int syscall_dispatch(hv_vcpu_t vcpu, guest_t *g, int *exit_code, bool verbose) if (verbose) { uint64_t elr = 0; hv_vcpu_get_sys_reg(vcpu, HV_SYS_REG_ELR_EL1, &elr); + const char *name = NULL; + if (x8 <= SC_MAX_SYSCALL_NUM) { + name = syscall_names[x8]; + } + + char nr_str[64]; + if (name) { + snprintf(nr_str, sizeof(nr_str), "%s(%llu)", name, + (unsigned long long) x8); + } else { + snprintf(nr_str, sizeof(nr_str), "%llu", (unsigned long long) x8); + } log_debug( - "syscall %llu@0x%llx(0x%llx, 0x%llx, 0x%llx, 0x%llx, " + "syscall %s@0x%llx(0x%llx, 0x%llx, 0x%llx, 0x%llx, " "0x%llx, 0x%llx)", + nr_str, (unsigned long long) x8, (unsigned long long) (elr >= 4 ? elr - 4 : elr), (unsigned long long) x0, (unsigned long long) x1, From bef1ed00a485f8210f0884be4792822b46c4ade3 Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:18:59 +0800 Subject: [PATCH 03/10] Add files via upload From 3ad49eef07959ba7c308bcb77ca51ab4d8f24841 Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:19:38 +0800 Subject: [PATCH 04/10] Add files via upload From 6eb792b090298cbcdca529e1a8687ecdc7dee842 Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:28:43 +0800 Subject: [PATCH 05/10] Add files via upload From 3fa82b2673f525f949142cb7d18b4abf1f825c36 Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:29:17 +0800 Subject: [PATCH 06/10] Add files via upload From ad42458a78b89d9e286bee60b078857f7b657cd7 Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:32:19 +0800 Subject: [PATCH 07/10] Add files via upload From 450b28602a04b7e2249f57bd1f8846880a1f47c1 Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:32:45 +0800 Subject: [PATCH 08/10] Add files via upload From c4b80fe7e21874bc244d5be5d088c51e95e8c51b Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:34:36 +0800 Subject: [PATCH 09/10] Add files via upload --- src/syscall/syscall.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/syscall/syscall.c b/src/syscall/syscall.c index 00ef7b8f..541f7d7a 100644 --- a/src/syscall/syscall.c +++ b/src/syscall/syscall.c @@ -358,6 +358,11 @@ SC_FORWARD(sc_nanosleep, sys_nanosleep(g, x0, x1)) SC_FORWARD(sc_clock_nanosleep, sys_clock_nanosleep(g, (int) x0, (int) x1, x2, x3)) SC_FORWARD(sc_gettimeofday, sys_gettimeofday(g, x0, x1)) SC_FORWARD(sc_setitimer, sys_setitimer(g, (int) x0, x1, x2)) +SC_FORWARD(sc_timer_create, sys_timer_create(g, (int) x0, x1, x2)) +SC_FORWARD(sc_timer_gettime, sys_timer_gettime(g, (int) x0, x1)) +SC_FORWARD(sc_timer_getoverrun, signal_posix_timer_overrun((int) x0)) +SC_FORWARD(sc_timer_settime, sys_timer_settime(g, (int) x0, (int) x1, x2, x3)) +SC_FORWARD(sc_timer_delete, signal_posix_timer_delete((int) x0)) SC_FORWARD(sc_getitimer, sys_getitimer(g, (int) x0, x1)) SC_FORWARD(sc_times, sys_times(g, x0)) @@ -2305,7 +2310,7 @@ static int64_t sc_clone(guest_t *g, (unsigned long long) x0, (unsigned long long) x1, (unsigned long long) x2, (unsigned long long) x3, (unsigned long long) x4); - return sys_clone(current_thread->vcpu, g, x0, x1, 0, 0, x2, x3, x4, + return sys_clone(current_thread->vcpu, g, x0, x1, 0, 0, x2, x2, x3, x4, verbose); } From 7b4e312f18a6a1dbe9fb4a2cbf25174e999f1b7d Mon Sep 17 00:00:00 2001 From: user-name-owen <345149286+user-name-owen@users.noreply.github.com> Date: Sat, 24 Oct 2026 16:35:01 +0800 Subject: [PATCH 10/10] Add files via upload