Skip to content
Snippets Groups Projects
  1. Oct 03, 2024
  2. Oct 02, 2024
    • Al Viro's avatar
      move asm/unaligned.h to linux/unaligned.h · 5f60d5f6
      Al Viro authored
      asm/unaligned.h is always an include of asm-generic/unaligned.h;
      might as well move that thing to linux/unaligned.h and include
      that - there's nothing arch-specific in that header.
      
      auto-generated by the following:
      
      for i in `git grep -l -w asm/unaligned.h`; do
      	sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i
      done
      for i in `git grep -l -w asm-generic/unaligned.h`; do
      	sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i
      done
      git mv include/asm-generic/unaligned.h include/linux/unaligned.h
      git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h
      sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild
      sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
      5f60d5f6
    • Yifei Liu's avatar
      selftests: breakpoints: use remaining time to check if suspend succeed · c66be905
      Yifei Liu authored
      
      step_after_suspend_test fails with device busy error while
      writing to /sys/power/state to start suspend. The test believes
      it failed to enter suspend state with
      
      $ sudo ./step_after_suspend_test
      TAP version 13
      Bail out! Failed to enter Suspend state
      
      However, in the kernel message, I indeed see the system get
      suspended and then wake up later.
      
      [611172.033108] PM: suspend entry (s2idle)
      [611172.044940] Filesystems sync: 0.006 seconds
      [611172.052254] Freezing user space processes
      [611172.059319] Freezing user space processes completed (elapsed 0.001 seconds)
      [611172.067920] OOM killer disabled.
      [611172.072465] Freezing remaining freezable tasks
      [611172.080332] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
      [611172.089724] printk: Suspending console(s) (use no_console_suspend to debug)
      [611172.117126] serial 00:03: disabled
      some other hardware get reconnected
      [611203.136277] OOM killer enabled.
      [611203.140637] Restarting tasks ...
      [611203.141135] usb 1-8.1: USB disconnect, device number 7
      [611203.141755] done.
      [611203.155268] random: crng reseeded on system resumption
      [611203.162059] PM: suspend exit
      
      After investigation, I noticed that for the code block
      if (write(power_state_fd, "mem", strlen("mem")) != strlen("mem"))
      	ksft_exit_fail_msg("Failed to enter Suspend state\n");
      
      The write will return -1 and errno is set to 16 (device busy).
      It should be caused by the write function is not successfully returned
      before the system suspend and the return value get messed when waking up.
      As a result, It may be better to check the time passed of those few
      instructions to determine whether the suspend is executed correctly for
      it is pretty hard to execute those few lines for 5 seconds.
      
      The timer to wake up the system is set to expire after 5 seconds and
      no re-arm. If the timer remaining time is 0 second and 0 nano secomd,
      it means the timer expired and wake the system up. Otherwise, the system
      could be considered to enter the suspend state failed if there is any
      remaining time.
      
      After appling this patch, the test would not fail for it believes the
      system does not go to suspend by mistake. It now could continue to the
      rest part of the test after suspend.
      
      Fixes: bfd092b8 ("selftests: breakpoint: add step_after_suspend_test")
      Reported-by: default avatarSinadin Shan <sinadin.shan@oracle.com>
      Signed-off-by: default avatarYifei Liu <yifei.l.liu@oracle.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      c66be905
    • Alessandro Zanni's avatar
      kselftest/devices/probe: Fix SyntaxWarning in regex strings for Python3 · a1900825
      Alessandro Zanni authored
      
      Insert raw strings to prevent Python3 from interpreting string literals
      as Unicode strings and "\d" as invalid escaped sequence.
      
      Fix the warnings:
      
      tools/testing/selftests/devices/probe/test_discoverable_devices.py:48:
      SyntaxWarning: invalid escape sequence '\d' usb_controller_sysfs_dir =
      "usb[\d]+"
      
      tools/testing/selftests/devices/probe/test_discoverable_devices.py: 94:
      SyntaxWarning: invalid escape sequence '\d' re_usb_version =
      re.compile("PRODUCT=.*/(\d)/.*")
      
      Fixes: dacf1d7a ("kselftest: Add test to verify probe of devices from discoverable buses")
      
      Reviewed-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
      Signed-off-by: default avatarAlessandro Zanni <alessandro.zanni87@gmail.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      a1900825
  3. Oct 01, 2024
    • Mark Brown's avatar
      KVM: selftests: Fix build on architectures other than x86_64 · 76f972c2
      Mark Brown authored
      
      The recent addition of support for testing with the x86 specific quirk
      KVM_X86_QUIRK_SLOT_ZAP_ALL disabled in the generic memslot tests broke the
      build of the KVM selftests for all other architectures:
      
      In file included from include/kvm_util.h:8,
                       from include/memstress.h:13,
                       from memslot_modification_stress_test.c:21:
      memslot_modification_stress_test.c: In function ‘main’:
      memslot_modification_stress_test.c:176:38: error: ‘KVM_X86_QUIRK_SLOT_ZAP_ALL’ undeclared (first use in this function)
        176 |                                      KVM_X86_QUIRK_SLOT_ZAP_ALL);
            |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Add __x86_64__ guard defines to avoid building the relevant code on other
      architectures.
      
      Fixes: 61de4c34 ("KVM: selftests: Test memslot move in memslot_perf_test with quirk disabled")
      Fixes: 218f6415 ("KVM: selftests: Allow slot modification stress test with quirk disabled")
      Reported-by: default avatarAishwarya TCV <aishwarya.tcv@arm.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Message-ID: <20240930-kvm-build-breakage-v1-1-866fad3cc164@kernel.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      76f972c2
    • Yun Lu's avatar
      selftest: hid: add missing run-hid-tools-tests.sh · 160c826b
      Yun Lu authored
      
      HID test cases run tests using the run-hid-tools-tests.sh script.
      When installed with "make install", the run-hid-tools-tests.sh
      script will not be copied over, resulting in the following error message.
      
        make -C tools/testing/selftests/ TARGETS=hid install \
        	  INSTALL_PATH=$KSFT_INSTALL_PATH
      
        cd $KSFT_INSTALL_PATH
        ./run_kselftest.sh -c hid
      
      selftests: hid: hid-core.sh
      bash: ./run-hid-tools-tests.sh: No such file or directory
      
      Add the run-hid-tools-tests.sh script to the TEST_FILES in the Makefile
      for it to be installed.
      
      Fixes: ffb85d5c ("selftests: hid: import hid-tools hid-core tests")
      Signed-off-by: default avatarYun Lu <luyun@kylinos.cn>
      Acked-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      160c826b
    • Jason A. Donenfeld's avatar
      selftests: vDSO: align getrandom states to cache line · a18c8357
      Jason A. Donenfeld authored
      
      This prevents false sharing, which makes a large difference on machines
      with several NUMA nodes, such as on a dual socket Intel(R) Xeon(R) Gold
      6338 CPU @ 2.00GHz, where the "bench-multi" test goes from 2.7s down to
      1.9s. While this is just test code, it also forms the basis of how folks
      will wind up implementing this in libraries, so we should implement this
      simple cache alignment improvement here.
      
      Suggested-by: Florian Weimer's avatarFlorian Weimer <fweimer@redhat.com>
      Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      a18c8357
  4. Sep 30, 2024
  5. Sep 27, 2024
  6. Sep 26, 2024
  7. Sep 25, 2024
  8. Sep 23, 2024
  9. Sep 20, 2024
  10. Sep 17, 2024
Loading