Skip to content

Commit

Permalink
Merge branch 'master' into patch-axel-1
Browse files Browse the repository at this point in the history
  • Loading branch information
lsf37 authored Jun 18, 2024
2 parents b398d43 + 17cac54 commit c7a9393
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 72 deletions.
4 changes: 2 additions & 2 deletions apps/sel4test-driver/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void init_timer(void)
ZF_LOGF_IF(error, "Failed to allocate notification object for tests");

error = seL4_TCB_BindNotification(simple_get_tcb(&env.simple), env.timer_notification.cptr);
ZF_LOGF_IF(error, "Failed to bind timer notification to sel4test-driver\n");
ZF_LOGF_IF(error, "Failed to bind timer notification to sel4test-driver");

/* set up the timer manager */
tm_init(&env.tm, &env.ltimer, &env.ops, 1);
Expand Down Expand Up @@ -323,7 +323,7 @@ void sel4test_run_tests(struct driver_env *e)
/* Extract and filter the tests based on the regex */
regex_t reg;
int error = regcomp(&reg, CONFIG_TESTPRINTER_REGEX, REG_EXTENDED | REG_NOSUB);
ZF_LOGF_IF(error, "Error compiling regex \"%s\"\n", CONFIG_TESTPRINTER_REGEX);
ZF_LOGF_IF(error, "Error compiling regex \"%s\"", CONFIG_TESTPRINTER_REGEX);

int skipped_tests = 0;
/* get all the tests in the test case section in the driver */
Expand Down
5 changes: 2 additions & 3 deletions apps/sel4test-driver/src/tests/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ static int test_callback(uintptr_t token)

int test_timer(driver_env_t env)
{
uint64_t time = 0;
test_finished = false;
timer_test_data_t test_data = { .goal_count = 3 };

Expand All @@ -46,7 +45,7 @@ int test_timer(driver_env_t env)

while (!test_finished) {
wait_for_timer_interrupt(env);
ZF_LOGV("Tick\n");
ZF_LOGV("Tick");
error = tm_update(&env->tm);
test_assert_fatal(!error);
}
Expand Down Expand Up @@ -79,7 +78,7 @@ test_gettime_timeout(driver_env_t env)

while (!test_finished) {
wait_for_timer_interrupt(env);
ZF_LOGV("Tick\n");
ZF_LOGV("Tick");
error = tm_update(&env->tm);
test_assert_fatal(!error);
}
Expand Down
8 changes: 4 additions & 4 deletions apps/sel4test-driver/src/testtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
/* Bootstrap test type. */
static inline void bootstrap_set_up_test_type(uintptr_t e)
{
ZF_LOGD("setting up bootstrap test type\n");
ZF_LOGD("setting up bootstrap test type");
}
static inline void bootstrap_tear_down_test_type(uintptr_t e)
{
ZF_LOGD("tearing down bootstrap test type\n");
ZF_LOGD("tearing down bootstrap test type");
}
static inline void bootstrap_set_up(uintptr_t e)
{
ZF_LOGD("set up bootstrap test\n");
ZF_LOGD("set up bootstrap test");
}
static inline void bootstrap_tear_down(uintptr_t e)
{
ZF_LOGD("tear down bootstrap test\n");
ZF_LOGD("tear down bootstrap test");
}
static inline test_result_t bootstrap_run_test(struct testcase *test, uintptr_t e)
{
Expand Down
2 changes: 1 addition & 1 deletion apps/sel4test-driver/src/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void wait_for_timer_interrupt(driver_env_t env)
void timeout(driver_env_t env, uint64_t ns, timeout_type_t timeout_type)
{
if (config_set(CONFIG_HAVE_TIMER)) {
ZF_LOGD_IF(timeServer_timeoutPending, "Overwriting a previous timeout request\n");
ZF_LOGD_IF(timeServer_timeoutPending, "Overwriting a previous timeout request");
timeServer_timeoutType = timeout_type;
int error = tm_register_cb(&env->tm, timeout_type, ns, 0,
TIMER_ID, timeout_cb, env->timer_notify_test.cptr);
Expand Down
2 changes: 1 addition & 1 deletion apps/sel4test-driver/src/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#define TIMER_ID 0

/* Timing related functions used only by in sel4test-driver */
/* Timing related functions used only within sel4test-driver */
void handle_timer_interrupts(driver_env_t env, seL4_Word badge);
void wait_for_timer_interrupt(driver_env_t env);
void timeout(driver_env_t env, uint64_t ns, timeout_type_t timeout);
Expand Down
6 changes: 3 additions & 3 deletions apps/sel4test-tests/src/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int check_zeroes(seL4_Word addr, seL4_Word size_bytes)
seL4_Word size_words = size_bytes / sizeof(seL4_Word);
while (size_words--) {
if (*p++ != 0) {
ZF_LOGE("Found non-zero at position %ld: %lu\n", ((long)p) - (addr), (unsigned long)p[-1]);
ZF_LOGE("Found non-zero at position %ld: %lu", ((long)p) - (addr), (unsigned long)p[-1]);
return 0;
}
}
Expand Down Expand Up @@ -432,7 +432,7 @@ static void sel4test_send_time_request(seL4_CPtr ep, uint64_t ns, sel4test_outpu
tag = seL4_MessageInfo_new(0, 0, 0, 1);
break;
default:
ZF_LOGE("Invalid time request\n");
ZF_LOGE("Invalid time request");
break;
}

Expand Down Expand Up @@ -566,7 +566,7 @@ void set_helper_tfep(env_t env, helper_thread_t *thread, seL4_CPtr tfep)
#ifdef CONFIG_KERNEL_MCS
int error = seL4_TCB_SetTimeoutEndpoint(thread->thread.tcb.cptr, tfep);
if (error != seL4_NoError) {
ZF_LOGF("Failed to set tfep\n");
ZF_LOGF("Failed to set tfep");
}
#endif
}
2 changes: 1 addition & 1 deletion apps/sel4test-tests/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int main(int argc, char **argv)
result = test->function((uintptr_t)&env);
} else {
result = FAILURE;
ZF_LOGF("Cannot find test %s\n", init_data->name);
ZF_LOGF("Cannot find test %s", init_data->name);
}

printf("Test %s %s\n", init_data->name, result == SUCCESS ? "passed" : "failed");
Expand Down
2 changes: 1 addition & 1 deletion apps/sel4test-tests/src/tests/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,4 @@ int smp_test_fpu(env_t env)
return sel4test_get_result();
}
DEFINE_TEST(FPU0002, "Test FPU remain valid across core migration", smp_test_fpu,
config_set(CONFIG_MAX_NUM_NODES) &&config_set(CONFIG_HAVE_TIMER) &&CONFIG_MAX_NUM_NODES > 1)
config_set(CONFIG_HAVE_TIMER) &&(CONFIG_MAX_NUM_NODES > 1))
54 changes: 28 additions & 26 deletions apps/sel4test-tests/src/tests/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static int test_ipc_pair(env_t env, test_func_t fa, test_func_t fb, bool inter_a
for (int sender_prio = 98; sender_prio <= 102; sender_prio++) {
for (int waiter_prio = 100; waiter_prio <= 100; waiter_prio++) {
for (int sender_first = 0; sender_first <= 1; sender_first++) {
ZF_LOGD("%d %s %d\n",
ZF_LOGD("%d %s %d",
sender_prio, sender_first ? "->" : "<-", waiter_prio);
seL4_Word thread_a_arg0, thread_b_arg0;
seL4_CPtr thread_a_reply, thread_b_reply;
Expand Down Expand Up @@ -469,13 +469,13 @@ server_fn(seL4_CPtr endpoint, seL4_CPtr reply, volatile int *state)
*state = *state + 1;
seL4_MessageInfo_t info = api_nbsend_recv(endpoint, info, endpoint, NULL, reply);
/* from here on we are running on borrowed time */
ZF_LOGD("Server awake!\n");
ZF_LOGD("Server awake!");
int i = 0;
while (i < RUNS) {
test_eq(seL4_GetMR(0), (seL4_Word) 12345678);
seL4_SetMR(0, 0xdeadbeef);
*state = *state + 1;
ZF_LOGD("Server replyRecv\n");
ZF_LOGD("Server replyRecv");
info = seL4_ReplyRecv(endpoint, info, NULL, reply);
i++;
}
Expand All @@ -486,7 +486,7 @@ static void proxy_fn(seL4_CPtr receive_endpoint, seL4_CPtr call_endpoint, seL4_W
seL4_MessageInfo_t info = seL4_MessageInfo_new(0, 0, 0, 0);

/* signal the initialiser that we are awake */
ZF_LOGD("Proxy nbsendrecv, sending on ep %lu, receiving on ep %lu, reply is %lu\n", call_endpoint, receive_endpoint,
ZF_LOGD("Proxy nbsendrecv, sending on ep %lu, receiving on ep %lu, reply is %lu", call_endpoint, receive_endpoint,
reply);
*state = *state + 1;
info = api_nbsend_recv(call_endpoint, info, receive_endpoint, NULL, reply);
Expand All @@ -498,13 +498,13 @@ static void proxy_fn(seL4_CPtr receive_endpoint, seL4_CPtr call_endpoint, seL4_W
test_eq(seL4_GetMR(0), (seL4_Word) 12345678);
seL4_SetMR(0, 12345678);

ZF_LOGD("Proxy call\n");
ZF_LOGD("Proxy call");
seL4_Call(call_endpoint, info);

test_eq(seL4_GetMR(0), (seL4_Word) 0xdeadbeef);

seL4_SetMR(0, 0xdeadbeef);
ZF_LOGD("Proxy replyRecv\n");
ZF_LOGD("Proxy replyRecv");
*state = *state + 1;
info = seL4_ReplyRecv(receive_endpoint, info, NULL, reply);
i++;
Expand All @@ -522,7 +522,7 @@ static void client_fn(seL4_CPtr endpoint, bool fastpath, int unused, volatile in
seL4_SetMR(0, 12345678);
seL4_MessageInfo_t info = seL4_MessageInfo_new(0, 0, 0, length);

ZF_LOGD("Client calling on ep %lu\n", endpoint);
ZF_LOGD("Client calling on ep %lu", endpoint);
info = seL4_Call(endpoint, info);

test_eq(seL4_GetMR(0), (seL4_Word) 0xdeadbeef);
Expand Down Expand Up @@ -555,12 +555,12 @@ static int single_client_server_chain_test(env_t env, int fastpath, int prio_dif
seL4_CPtr call_endpoint = vka_alloc_endpoint_leaky(&env->vka);
create_helper_thread(env, &proxies[i]);
set_helper_priority(env, &proxies[i], prio);
ZF_LOGD("Start proxy\n");
ZF_LOGD("Start proxy");
start_helper(env, &proxies[i], (helper_fn_t) proxy_fn, receive_endpoint,
call_endpoint, proxies[i].thread.reply.cptr, (seL4_Word) &proxy_state[i]);

/* wait for proxy to initialise */
ZF_LOGD("Recv for proxy\n");
ZF_LOGD("Recv for proxy");
seL4_Wait(call_endpoint, NULL);
test_eq(proxy_state[i], 1);
/* now take away its scheduling context */
Expand Down Expand Up @@ -642,9 +642,9 @@ ipc0016_call_once_fn(seL4_CPtr endpoint, volatile int *state)
{
seL4_MessageInfo_t info = seL4_MessageInfo_new(0, 0, 0, 0);
*state = *state + 1;
ZF_LOGD("Call %d\n", *state);
ZF_LOGD("Call %d", *state);
seL4_Call(endpoint, info);
ZF_LOGD("Resumed with reply\n");
ZF_LOGD("Resumed with reply");
*state = *state + 1;
}

Expand All @@ -653,15 +653,15 @@ static void ipc0016_reply_once_fn(seL4_CPtr endpoint, seL4_CPtr reply)
seL4_MessageInfo_t info = seL4_MessageInfo_new(0, 0, 0, 0);

/* send initialisation context back */
ZF_LOGD("seL4_nbsendrecv\n");
ZF_LOGD("seL4_nbsendrecv");
api_nbsend_recv(endpoint, info, endpoint, NULL, reply);

/* reply */
ZF_LOGD("Reply\n");
ZF_LOGD("Reply");
seL4_Send(reply, info);

/* wait (keeping sc) */
ZF_LOGD("Recv\n");
ZF_LOGD("Recv");
seL4_Wait(endpoint, NULL);

test_check(!"should not get here");
Expand Down Expand Up @@ -708,7 +708,7 @@ DEFINE_TEST(IPC0016, "Test reply returns scheduling context",
static void sender(seL4_CPtr endpoint, volatile int *state)
{
seL4_MessageInfo_t info = seL4_MessageInfo_new(0, 0, 0, 0);
ZF_LOGD("Client send\n");
ZF_LOGD("Client send");
*state = 1;
seL4_Send(endpoint, info);
*state = 2;
Expand All @@ -720,7 +720,7 @@ static void wait_server(seL4_CPtr endpoint, int messages)
seL4_Send(endpoint, seL4_MessageInfo_new(0, 0, 0, 0));
int i = 0;
while (i < messages) {
ZF_LOGD("Server wait\n");
ZF_LOGD("Server wait");
seL4_Wait(endpoint, NULL);
i++;
}
Expand Down Expand Up @@ -938,9 +938,9 @@ DEFINE_TEST(IPC0020, "test deleting a scheduling context while the client is wai

static void ipc21_faulter_fn(int *addr)
{
ZF_LOGD("Fault at %p\n", addr);
ZF_LOGD("Fault at %p", addr);
*addr = 0xdeadbeef;
ZF_LOGD("Resumed\n");
ZF_LOGD("Resumed");
}

static void ipc21_fault_handler_fn(seL4_CPtr endpoint, vspace_t *vspace, reservation_t *res, seL4_CPtr reply)
Expand All @@ -951,7 +951,7 @@ static void ipc21_fault_handler_fn(seL4_CPtr endpoint, vspace_t *vspace, reserva
while (1) {
test_check(seL4_isVMFault_tag(info));
void *addr = (void *) seL4_GetMR(seL4_VMFault_Addr);
ZF_LOGD("Handling fault at %p\n", addr);
ZF_LOGD("Handling fault at %p", addr);
int error = vspace_new_pages_at_vaddr(vspace, addr, 1, seL4_PageBits, *res);
test_eq(error, seL4_NoError);
seL4_ReplyRecv(endpoint, info, NULL, reply);
Expand Down Expand Up @@ -1012,15 +1012,15 @@ static seL4_CPtr ipc22_go;
static void ipc22_server_fn(seL4_CPtr init_ep, seL4_CPtr reply_cap)
{
seL4_MessageInfo_t info = seL4_MessageInfo_new(0, 0, 0, 0);
ZF_LOGD("Server init\n");
ZF_LOGD("Server init");

/* wait for the signal to go from the test runner -
* we have to block here to wait for all the clients to
* start and queue up - otherwise they will all be served
* by the same server and the point is to test stack spawning */
api_nbsend_wait(init_ep, info, init_ep, NULL);

ZF_LOGD("Server reply to fwded cap\n");
ZF_LOGD("Server reply to fwded cap");
seL4_Send(reply_cap, info);
}

Expand All @@ -1043,9 +1043,9 @@ static void ipc22_stack_spawner_fn(env_t env, seL4_CPtr endpoint, int server_pri
/* after the first nbsend, we want to signal the clients via init_ep */
first_ep = init_ep;

ZF_LOGD("Got another client\n");
ZF_LOGD("Got another client");
/* start helper and allow to initialise */
ZF_LOGD("Spawn server\n");
ZF_LOGD("Spawn server");
start_helper(env, &servers[i], (helper_fn_t) ipc22_server_fn, init_ep,
servers[i].thread.reply.cptr, 0, 0);
/* wait for it to block */
Expand Down Expand Up @@ -1207,7 +1207,7 @@ static int test_delete_reply_cap_then_sc(env_t env)
int error = seL4_TCB_SetPriority(env->tcb, env->tcb, 10);
test_eq(error, 0);

ZF_LOGD("Removed sc\n");
ZF_LOGD("Removed sc");
/* remove schedluing context */
error = api_sc_unbind(server.thread.sched_context.cptr);
test_eq(error, seL4_NoError);
Expand Down Expand Up @@ -1361,6 +1361,8 @@ static int test_sched_donation_cross_core(env_t env)

return sel4test_get_result();
}
DEFINE_TEST(IPC0028, "Cross core sched donation", test_sched_donation_cross_core,
config_set(CONFIG_KERNEL_MCS) &&config_set(CONFIG_MAX_NUM_NODES) &&CONFIG_MAX_NUM_NODES > 1);
/* This test currently fails.
See https://github.com/seL4/seL4/issues/941 and https://github.com/seL4/seL4/pull/986 */
DEFINE_TEST(IPC0028, "Cross core sched donation", test_sched_donation_cross_core, false);
/* config_set(CONFIG_KERNEL_MCS) &&(CONFIG_MAX_NUM_NODES > 1)); */
#endif /* CONFIG_KERNEL_MCS */
Loading

0 comments on commit c7a9393

Please sign in to comment.