The test ./x86/access fails with a timeout when the system supports LA57. ../tests/access BUILD_HEAD=49934b5a timeout -k 1s --foreground 180 /usr/local/bin/qemu-system-x86_64 --no-reboot -nodefaults -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -machine accel=kvm -kernel /tmp/tmp.X0UHRhah33 -smp 1 -cpu max # -initrd /tmp/tmp.4nqs81FZ5t enabling apic starting test run ........................................................................... ........................................................................... .................................................................. 14008327 tests, 0 failures starting 5-level paging test. run ........................................................................... ........................................................................... ........................................ qemu-system-x86_64: terminating on signal 15 from pid 56169 (timeout) FAIL access (timeout; duration=180) The reason is, the test runs twice when LA57 is supported. Once with 4-level paging and once with 5-level paging. It cannot complete both these tests with default timeout of 180 seconds. Fix the problem by splitting the test into two. One for the 4-level paging and one for the 5-level paging. Signed-off-by: Babu Moger <babu.moger@xxxxxxx> --- Note: Let me know if there is a better way to take care of this. x86/access.c | 23 ++++++++++++++++------- x86/unittests.cfg | 6 ++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/x86/access.c b/x86/access.c index 4725bbd..d25066a 100644 --- a/x86/access.c +++ b/x86/access.c @@ -1141,19 +1141,28 @@ static int ac_test_run(void) return successes == tests; } -int main(void) +int main(int argc, char *argv[]) { - int r; - - printf("starting test\n\n"); - page_table_levels = 4; - r = ac_test_run(); + int r, la57; + + if ((argc == 2) && (strcmp(argv[1], "la57") == 0)) { + if (this_cpu_has(X86_FEATURE_LA57)) + la57 = 1; + else { + report_skip("5-level paging not supported, skip..."); + return report_summary(); + } + } - if (this_cpu_has(X86_FEATURE_LA57)) { + if (la57) { page_table_levels = 5; printf("starting 5-level paging test.\n\n"); setup_5level_page_table(); r = ac_test_run(); + } else { + page_table_levels = 4; + printf("starting test.\n\n"); + r = ac_test_run(); } return r ? 0 : 1; diff --git a/x86/unittests.cfg b/x86/unittests.cfg index 3000e53..475fcc6 100644 --- a/x86/unittests.cfg +++ b/x86/unittests.cfg @@ -119,6 +119,12 @@ arch = x86_64 extra_params = -cpu max timeout = 180 +[access-la57] +file = access.flat +arch = x86_64 +extra_params = -cpu max -append "la57" +timeout = 180 + [access-reduced-maxphyaddr] file = access.flat arch = x86_64