1. 14 Sep, 2023 1 commit
    • Magnus Karlsson's avatar
      selftests/xsk: print per packet info in verbose mode · 2d2712ca
      Magnus Karlsson authored
      Print info about every packet in verbose mode, both for Tx and
      Rx. This is useful to have when a test fails or to validate that a
      test is really doing what it was designed to do. Info on what is
      supposed to be received and sent is also printed for the custom packet
      streams since they differ from the base line. Here is an example:
      
      Tx addr: 37e0 len: 64 options: 0 pkt_nb: 8
      Tx addr: 4000 len: 64 options: 0 pkt_nb: 9
      Rx: addr: 100 len: 64 options: 0 pkt_nb: 0 valid: 1
      Rx: addr: 1100 len: 64 options: 0 pkt_nb: 1 valid: 1
      Rx: addr: 2100 len: 64 options: 0 pkt_nb: 4 valid: 1
      Rx: addr: 3100 len: 64 options: 0 pkt_nb: 8 valid: 1
      Rx: addr: 4100 len: 64 options: 0 pkt_nb: 9 valid: 1
      
      One pointless verbose print statement is also deleted and another one
      is made clearer.
      Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
      Link: https://lore.kernel.org/r/20230914084900.492-2-magnus.karlsson@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      2d2712ca
  2. 13 Sep, 2023 1 commit
  3. 12 Sep, 2023 4 commits
    • Alexei Starovoitov's avatar
      Merge branch 'bpf-x64-fix-tailcall-infinite-loop' · 5bbb9e1f
      Alexei Starovoitov authored
      Leon Hwang says:
      
      ====================
      bpf, x64: Fix tailcall infinite loop
      
      This patch series fixes a tailcall infinite loop on x64.
      
      From commit ebf7d1f5 ("bpf, x64: rework pro/epilogue and tailcall
      handling in JIT"), the tailcall on x64 works better than before.
      
      From commit e411901c ("bpf: allow for tailcalls in BPF subprograms
      for x64 JIT"), tailcall is able to run in BPF subprograms on x64.
      
      From commit 5b92a28a ("bpf: Support attaching tracing BPF program
      to other BPF programs"), BPF program is able to trace other BPF programs.
      
      How about combining them all together?
      
      1. FENTRY/FEXIT on a BPF subprogram.
      2. A tailcall runs in the BPF subprogram.
      3. The tailcall calls the subprogram's caller.
      
      As a result, a tailcall infinite loop comes up. And the loop would halt
      the machine.
      
      As we know, in tail call context, the tail_call_cnt propagates by stack
      and rax register between BPF subprograms. So do in trampolines.
      
      How did I discover the bug?
      
      From commit 7f6e4312 ("bpf: Limit caller's stack depth 256 for
      subprogs with tailcalls"), the total stack size limits to around 8KiB.
      Then, I write some bpf progs to validate the stack consuming, that are
      tailcalls running in bpf2bpf and FENTRY/FEXIT tracing on bpf2bpf.
      
      At that time, accidently, I made a tailcall loop. And then the loop halted
      my VM. Without the loop, the bpf progs would consume over 8KiB stack size.
      But the _stack-overflow_ did not halt my VM.
      
      With bpf_printk(), I confirmed that the tailcall count limit did not work
      expectedly. Next, read the code and fix it.
      
      Thank Ilya Leoshkevich, this bug on s390x has been fixed.
      
      Hopefully, this bug on arm64 will be fixed in near future.
      ====================
      
      Link: https://lore.kernel.org/r/20230912150442.2009-1-hffilwlqm@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      5bbb9e1f
    • Leon Hwang's avatar
      selftests/bpf: Add testcases for tailcall infinite loop fixing · e13b5f2f
      Leon Hwang authored
      Add 4 test cases to confirm the tailcall infinite loop bug has been fixed.
      
      Like tailcall_bpf2bpf cases, do fentry/fexit on the bpf2bpf, and then
      check the final count result.
      
      tools/testing/selftests/bpf/test_progs -t tailcalls
      226/13  tailcalls/tailcall_bpf2bpf_fentry:OK
      226/14  tailcalls/tailcall_bpf2bpf_fexit:OK
      226/15  tailcalls/tailcall_bpf2bpf_fentry_fexit:OK
      226/16  tailcalls/tailcall_bpf2bpf_fentry_entry:OK
      226     tailcalls:OK
      Summary: 1/16 PASSED, 0 SKIPPED, 0 FAILED
      Signed-off-by: default avatarLeon Hwang <hffilwlqm@gmail.com>
      Link: https://lore.kernel.org/r/20230912150442.2009-4-hffilwlqm@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      e13b5f2f
    • Leon Hwang's avatar
      bpf, x64: Fix tailcall infinite loop · 2b5dcb31
      Leon Hwang authored
      From commit ebf7d1f5 ("bpf, x64: rework pro/epilogue and tailcall
      handling in JIT"), the tailcall on x64 works better than before.
      
      From commit e411901c ("bpf: allow for tailcalls in BPF subprograms
      for x64 JIT"), tailcall is able to run in BPF subprograms on x64.
      
      From commit 5b92a28a ("bpf: Support attaching tracing BPF program
      to other BPF programs"), BPF program is able to trace other BPF programs.
      
      How about combining them all together?
      
      1. FENTRY/FEXIT on a BPF subprogram.
      2. A tailcall runs in the BPF subprogram.
      3. The tailcall calls the subprogram's caller.
      
      As a result, a tailcall infinite loop comes up. And the loop would halt
      the machine.
      
      As we know, in tail call context, the tail_call_cnt propagates by stack
      and rax register between BPF subprograms. So do in trampolines.
      
      Fixes: ebf7d1f5 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT")
      Fixes: e411901c ("bpf: allow for tailcalls in BPF subprograms for x64 JIT")
      Reviewed-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarLeon Hwang <hffilwlqm@gmail.com>
      Link: https://lore.kernel.org/r/20230912150442.2009-3-hffilwlqm@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      2b5dcb31
    • Leon Hwang's avatar
      bpf, x64: Comment tail_call_cnt initialisation · 2bee9770
      Leon Hwang authored
      Without understanding emit_prologue(), it is really hard to figure out
      where does tail_call_cnt come from, even though searching tail_call_cnt
      in the whole kernel repo.
      
      By adding these comments, it is a little bit easier to understand
      tail_call_cnt initialisation.
      Signed-off-by: default avatarLeon Hwang <hffilwlqm@gmail.com>
      Link: https://lore.kernel.org/r/20230912150442.2009-2-hffilwlqm@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      2bee9770
  4. 11 Sep, 2023 1 commit
  5. 09 Sep, 2023 2 commits
  6. 08 Sep, 2023 30 commits
  7. 07 Sep, 2023 1 commit
    • Linus Torvalds's avatar
      Merge tag 'rtc-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux · ff6e6ded
      Linus Torvalds authored
      Pull RTC updates from Alexandre Belloni:
       "Subsystem:
      
         - Add a way for drivers to tell the core the supported alarm range is
           smaller than the date range. This is not used yet but will be
           useful for the alarmtimers in the next release.
      
         - fix Wvoid-pointer-to-enum-cast warnings
      
         - remove redundant of_match_ptr()
      
         - stop warning for invalid alarms when the alarm is disabled
      
        Drivers:
      
         - isl12022: allow setting the trip level for battery level detection
      
         - pcf2127: add support for PCF2131 and multiple timestamps
      
         - stm32: time precision improvement, many fixes
      
         - twl: NVRAM support"
      
      * tag 'rtc-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (73 commits)
        dt-bindings: rtc: ds3231: Remove text binding
        rtc: wm8350: remove unnecessary messages
        rtc: twl: remove unnecessary messages
        rtc: sun6i: remove unnecessary message
        rtc: stop warning for invalid alarms when the alarm is disabled
        rtc: twl: add NVRAM support
        rtc: pcf85363: Allow to wake up system without IRQ
        rtc: m48t86: add DT support for m48t86
        dt-bindings: rtc: Add ST M48T86
        rtc: pcf2127: remove useless check
        rtc: rzn1: Report maximum alarm limit to rtc core
        rtc: ds1305: Report maximum alarm limit to rtc core
        rtc: tps6586x: Report maximum alarm limit to rtc core
        rtc: cmos: Report supported alarm limit to rtc infrastructure
        rtc: cros-ec: Detect and report supported alarm window size
        rtc: Add support for limited alarm timer offsets
        rtc: isl1208: Fix incorrect logic in isl1208_set_xtoscb()
        MAINTAINERS: remove obsolete pattern in RTC SUBSYSTEM section
        rtc: tps65910: Remove redundant dev_warn() and do not check for 0 return after calling platform_get_irq()
        rtc: omap: Do not check for 0 return after calling platform_get_irq()
        ...
      ff6e6ded