1. 18 3月, 2021 1 次提交
    • V
      selftests: kvm: Add basic Hyper-V clocksources tests · 2c7f76b4
      Vitaly Kuznetsov 提交于
      Introduce a new selftest for Hyper-V clocksources (MSR-based reference TSC
      and TSC page). As a starting point, test the following:
      1) Reference TSC is 1Ghz clock.
      2) Reference TSC and TSC page give the same reading.
      3) TSC page gets updated upon KVM_SET_CLOCK call.
      4) TSC page does not get updated when guest opted for reenlightenment.
      5) Disabled TSC page doesn't get updated.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20210318140949.1065740-1-vkuznets@redhat.com>
      [Add a host-side test using TSC + KVM_GET_MSR too. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2c7f76b4
  2. 10 3月, 2021 1 次提交
  3. 08 3月, 2021 1 次提交
  4. 06 3月, 2021 1 次提交
  5. 05 3月, 2021 2 次提交
    • B
      bpf: Explicitly zero-extend R0 after 32-bit cmpxchg · 39491867
      Brendan Jackman 提交于
      As pointed out by Ilya and explained in the new comment, there's a
      discrepancy between x86 and BPF CMPXCHG semantics: BPF always loads
      the value from memory into r0, while x86 only does so when r0 and the
      value in memory are different. The same issue affects s390.
      
      At first this might sound like pure semantics, but it makes a real
      difference when the comparison is 32-bit, since the load will
      zero-extend r0/rax.
      
      The fix is to explicitly zero-extend rax after doing such a
      CMPXCHG. Since this problem affects multiple archs, this is done in
      the verifier by patching in a BPF_ZEXT_REG instruction after every
      32-bit cmpxchg. Any archs that don't need such manual zero-extension
      can do a look-ahead with insn_is_zext to skip the unnecessary mov.
      
      Note this still goes on top of Ilya's patch:
      
      https://lore.kernel.org/bpf/20210301154019.129110-1-iii@linux.ibm.com/T/#u
      
      Differences v5->v6[1]:
       - Moved is_cmpxchg_insn and ensured it can be safely re-used. Also renamed it
         and removed 'inline' to match the style of the is_*_function helpers.
       - Fixed up comments in verifier test (thanks for the careful review, Martin!)
      
      Differences v4->v5[1]:
       - Moved the logic entirely into opt_subreg_zext_lo32_rnd_hi32, thanks to Martin
         for suggesting this.
      
      Differences v3->v4[1]:
       - Moved the optimization against pointless zext into the correct place:
         opt_subreg_zext_lo32_rnd_hi32 is called _after_ fixup_bpf_calls.
      
      Differences v2->v3[1]:
       - Moved patching into fixup_bpf_calls (patch incoming to rename this function)
       - Added extra commentary on bpf_jit_needs_zext
       - Added check to avoid adding a pointless zext(r0) if there's already one there.
      
      Difference v1->v2[1]: Now solved centrally in the verifier instead of
        specifically for the x86 JIT. Thanks to Ilya and Daniel for the suggestions!
      
      [1] v5: https://lore.kernel.org/bpf/CA+i-1C3ytZz6FjcPmUg5s4L51pMQDxWcZNvM86w4RHZ_o2khwg@mail.gmail.com/T/#t
          v4: https://lore.kernel.org/bpf/CA+i-1C3ytZz6FjcPmUg5s4L51pMQDxWcZNvM86w4RHZ_o2khwg@mail.gmail.com/T/#t
          v3: https://lore.kernel.org/bpf/08669818-c99d-0d30-e1db-53160c063611@iogearbox.net/T/#t
          v2: https://lore.kernel.org/bpf/08669818-c99d-0d30-e1db-53160c063611@iogearbox.net/T/#t
          v1: https://lore.kernel.org/bpf/d7ebaefb-bfd6-a441-3ff2-2fdfe699b1d2@iogearbox.net/T/#tReported-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Fixes: 5ffa2550 ("bpf: Add instructions for atomic_[cmp]xchg")
      Signed-off-by: NBrendan Jackman <jackmanb@google.com>
      Acked-by: NMartin KaFai Lau <kafai@fb.com>
      Acked-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Tested-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      39491867
    • I
      selftests: fib_nexthops: Test blackhole nexthops when loopback goes down · 3a1099d3
      Ido Schimmel 提交于
      Test that blackhole nexthops are not flushed when the loopback device
      goes down.
      
      Output without previous patch:
      
       # ./fib_nexthops.sh -t basic
      
       Basic functional tests
       ----------------------
       TEST: List with nothing defined                                     [ OK ]
       TEST: Nexthop get on non-existent id                                [ OK ]
       TEST: Nexthop with no device or gateway                             [ OK ]
       TEST: Nexthop with down device                                      [ OK ]
       TEST: Nexthop with device that is linkdown                          [ OK ]
       TEST: Nexthop with device only                                      [ OK ]
       TEST: Nexthop with duplicate id                                     [ OK ]
       TEST: Blackhole nexthop                                             [ OK ]
       TEST: Blackhole nexthop with other attributes                       [ OK ]
       TEST: Blackhole nexthop with loopback device down                   [FAIL]
       TEST: Create group                                                  [ OK ]
       TEST: Create group with blackhole nexthop                           [FAIL]
       TEST: Create multipath group where 1 path is a blackhole            [ OK ]
       TEST: Multipath group can not have a member replaced by blackhole   [ OK ]
       TEST: Create group with non-existent nexthop                        [ OK ]
       TEST: Create group with same nexthop multiple times                 [ OK ]
       TEST: Replace nexthop with nexthop group                            [ OK ]
       TEST: Replace nexthop group with nexthop                            [ OK ]
       TEST: Nexthop group and device                                      [ OK ]
       TEST: Test proto flush                                              [ OK ]
       TEST: Nexthop group and blackhole                                   [ OK ]
      
       Tests passed:  19
       Tests failed:   2
      
      Output with previous patch:
      
       # ./fib_nexthops.sh -t basic
      
       Basic functional tests
       ----------------------
       TEST: List with nothing defined                                     [ OK ]
       TEST: Nexthop get on non-existent id                                [ OK ]
       TEST: Nexthop with no device or gateway                             [ OK ]
       TEST: Nexthop with down device                                      [ OK ]
       TEST: Nexthop with device that is linkdown                          [ OK ]
       TEST: Nexthop with device only                                      [ OK ]
       TEST: Nexthop with duplicate id                                     [ OK ]
       TEST: Blackhole nexthop                                             [ OK ]
       TEST: Blackhole nexthop with other attributes                       [ OK ]
       TEST: Blackhole nexthop with loopback device down                   [ OK ]
       TEST: Create group                                                  [ OK ]
       TEST: Create group with blackhole nexthop                           [ OK ]
       TEST: Create multipath group where 1 path is a blackhole            [ OK ]
       TEST: Multipath group can not have a member replaced by blackhole   [ OK ]
       TEST: Create group with non-existent nexthop                        [ OK ]
       TEST: Create group with same nexthop multiple times                 [ OK ]
       TEST: Replace nexthop with nexthop group                            [ OK ]
       TEST: Replace nexthop group with nexthop                            [ OK ]
       TEST: Nexthop group and device                                      [ OK ]
       TEST: Test proto flush                                              [ OK ]
       TEST: Nexthop group and blackhole                                   [ OK ]
      
       Tests passed:  21
       Tests failed:   0
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a1099d3
  6. 03 3月, 2021 2 次提交
  7. 02 3月, 2021 2 次提交
  8. 28 2月, 2021 1 次提交
  9. 27 2月, 2021 1 次提交
  10. 25 2月, 2021 1 次提交
  11. 24 2月, 2021 2 次提交
  12. 23 2月, 2021 1 次提交
  13. 17 2月, 2021 1 次提交
  14. 16 2月, 2021 3 次提交
  15. 15 2月, 2021 7 次提交
  16. 13 2月, 2021 12 次提交
  17. 12 2月, 2021 1 次提交