On 9/10/19 11:43 AM, Thomas Huth wrote: > On 05/09/2019 12.39, Janosch Frank wrote: >> Testing SIGP emulation for the following order codes: >> * start >> * stop >> * restart >> * set prefix >> * store status >> * stop and store status >> * reset >> * initial reset >> * external call >> * emegergency call >> >> restart and set prefix are part of the library and needed to start >> other cpus. >> >> Signed-off-by: Janosch Frank >> --- > [...] >> +static void test_store_status(void) >> +{ >> + struct cpu_status *status = alloc_pages(1); >> + uint32_t r; >> + >> + report_prefix_push("store status at address"); >> + memset(status, 0, PAGE_SIZE * 2); >> + >> + report_prefix_push("running"); >> + smp_cpu_restart(1); >> + sigp(1, SIGP_STORE_STATUS_AT_ADDRESS, (uintptr_t)status, &r); >> + report("incorrect state", r == SIGP_STATUS_INCORRECT_STATE); >> + report("status not written", !memcmp(status, (void*)status + PAGE_SIZE, PAGE_SIZE)); >> + report_prefix_pop(); >> + >> + memset(status, 0, PAGE_SIZE); >> + report_prefix_push("stopped"); >> + smp_cpu_stop(1); >> + sigp(1, SIGP_STORE_STATUS_AT_ADDRESS, (uintptr_t)status, NULL); >> + while (!status->prefix) { mb(); } >> + report("status written", 1); >> + free_pages(status, PAGE_SIZE); > > Shouldn't that be PAGE_SIZE * 2 instead? Indeed > >> + report_prefix_pop(); >> + >> + report_prefix_pop(); >> +} > > The remaining part of the patch looks fine to me. Thanks for having a look > > Thomas >