• Haibo Xu's avatar
    KVM: arm64: selftests: Enable tuning of error margin in arch_timer test · d1dafd06
    Haibo Xu authored
    There are intermittent failures occurred when stressing the
    arch-timer test in a Qemu VM:
    
     Guest assert failed,  vcpu 0; stage; 4; iter: 3
     ==== Test Assertion Failure ====
       aarch64/arch_timer.c:196: config_iter + 1 == irq_iter
       pid=4048 tid=4049 errno=4 - Interrupted system call
          1  0x000000000040253b: test_vcpu_run at arch_timer.c:248
          2  0x0000ffffb60dd5c7: ?? ??:0
          3  0x0000ffffb6145d1b: ?? ??:0
       0x3 != 0x2 (config_iter + 1 != irq_iter)e
    
    Further test and debug show that the timeout for an interrupt
    to arrive do have random high fluctuation, espectially when
    testing in an virtual environment.
    
    To alleviate this issue, just expose the timeout value as user
    configurable and print some hint message to increase the value
    when hitting the failure..
    Signed-off-by: default avatarHaibo Xu <haibo1.xu@intel.com>
    Reviewed-by: default avatarAndrew Jones <ajones@ventanamicro.com>
    Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
    Signed-off-by: default avatarAnup Patel <anup@brainfault.org>
    d1dafd06
arch_timer.c 13.1 KB