Skip to content
  1. Sep 12, 2022
    • Yu Kuai's avatar
      blk-throttle: factor out code to calculate ios/bytes_allowed · 681cd46f
      Yu Kuai authored
      
      
      No functional changes, new apis will be used in later patches to
      calculate wait time for throttled bios when new configuration is
      submitted.
      
      Noted this patch also rename tg_with_in_iops/bps_limit() to
      tg_within_iops/bps_limit().
      
      Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Link: https://lore.kernel.org/r/20220829022240.3348319-4-yukuai1@huaweicloud.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      681cd46f
    • Yu Kuai's avatar
      blk-throttle: prevent overflow while calculating wait time · 8d6bbaad
      Yu Kuai authored
      
      
      There is a problem found by code review in tg_with_in_bps_limit() that
      'bps_limit * jiffy_elapsed_rnd' might overflow. Fix the problem by
      calling mul_u64_u64_div_u64() instead.
      
      Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Link: https://lore.kernel.org/r/20220829022240.3348319-3-yukuai1@huaweicloud.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      8d6bbaad
    • Yu Kuai's avatar
      blk-throttle: fix that io throttle can only work for single bio · 320fb0f9
      Yu Kuai authored
      Test scripts:
      cd /sys/fs/cgroup/blkio/
      echo "8:0 1024" > blkio.throttle.write_bps_device
      echo $$ > cgroup.procs
      dd if=/dev/zero of=/dev/sda bs=10k count=1 oflag=direct &
      dd if=/dev/zero of=/dev/sda bs=10k count=1 oflag=direct &
      
      Test result:
      10240 bytes (10 kB, 10 KiB) copied, 10.0134 s, 1.0 kB/s
      10240 bytes (10 kB, 10 KiB) copied, 10.0135 s, 1.0 kB/s
      
      The problem is that the second bio is finished after 10s instead of 20s.
      
      Root cause:
      1) second bio will be flagged:
      
      __blk_throtl_bio
       while (true) {
        ...
        if (sq->nr_queued[rw]) -> some bio is throttled already
         break
       };
       bio_set_flag(bio, BIO_THROTTLED); -> flag the bio
      
      2) flagged bio will be dispatched without waiting:
      
      throtl_dispatch_tg
       tg_may_dispatch
        tg_with_in_bps_limit
         if (bps_limit == U64_MAX || bio_flagged(bio, BIO_THROTTLED))
          *wait = 0; -> wait time is zero
          return true;
      
      commit 9f5ede3c ("block: throttle split bio in case of iops limit")
      support to count split bios for iops limit, thus it adds flagged bio
      checking in tg_with_in_bps_limit() so that split bios will only count
      once for bps limit, however, it introduce a new problem that io throttle
      won't work if multiple bios are throttled.
      
      In order to fix the problem, handle iops/bps limit in different ways:
      
      1) for iops limit, there is no flag to record if the bio is throttled,
         and iops is always applied.
      2) for bps limit, original bio will be flagged with BIO_BPS_THROTTLED,
         and io throttle will ignore bio with the flag.
      
      Noted this patch also remove the code to set flag in __bio_clone(), it's
      introduced in commit 111be883 ("block-throttle: avoid double
      charge"), and author thinks split bio can be resubmited and throttled
      again, which is wrong because split bio will continue to dispatch from
      caller.
      
      Fixes: 9f5ede3c
      
       ("block: throttle split bio in case of iops limit")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Link: https://lore.kernel.org/r/20220829022240.3348319-2-yukuai1@huaweicloud.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      320fb0f9
    • Keith Busch's avatar
      sbitmap: fix batched wait_cnt accounting · 4acb8341
      Keith Busch authored
      
      
      Batched completions can clear multiple bits, but we're only decrementing
      the wait_cnt by one each time. This can cause waiters to never be woken,
      stalling IO. Use the batched count instead.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215679
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      Link: https://lore.kernel.org/r/20220909184022.1709476-1-kbusch@fb.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      4acb8341
  2. Sep 08, 2022
    • Uros Bizjak's avatar
      sbitmap: Use atomic_long_try_cmpxchg in __sbitmap_queue_get_batch · c35227d4
      Uros Bizjak authored
      
      
      Use atomic_long_try_cmpxchg instead of
      atomic_long_cmpxchg (*ptr, old, new) == old in __sbitmap_queue_get_batch.
      x86 CMPXCHG instruction returns success in ZF flag, so this change
      saves a compare after cmpxchg (and related move instruction in front
      of cmpxchg).
      
      Also, atomic_long_cmpxchg implicitly assigns old *ptr value to "old"
      when cmpxchg fails, enabling further code simplifications, e.g.
      an extra memory read can be avoided in the loop.
      
      No functional change intended.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
      Link: https://lore.kernel.org/r/20220908151200.9993-1-ubizjak@gmail.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c35227d4
    • Shigeru Yoshida's avatar
      nbd: Fix hung when signal interrupts nbd_start_device_ioctl() · 1de7c3cf
      Shigeru Yoshida authored
      
      
      syzbot reported hung task [1].  The following program is a simplified
      version of the reproducer:
      
      int main(void)
      {
      	int sv[2], fd;
      
      	if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv) < 0)
      		return 1;
      	if ((fd = open("/dev/nbd0", 0)) < 0)
      		return 1;
      	if (ioctl(fd, NBD_SET_SIZE_BLOCKS, 0x81) < 0)
      		return 1;
      	if (ioctl(fd, NBD_SET_SOCK, sv[0]) < 0)
      		return 1;
      	if (ioctl(fd, NBD_DO_IT) < 0)
      		return 1;
      	return 0;
      }
      
      When signal interrupt nbd_start_device_ioctl() waiting the condition
      atomic_read(&config->recv_threads) == 0, the task can hung because it
      waits the completion of the inflight IOs.
      
      This patch fixes the issue by clearing queue, not just shutdown, when
      signal interrupt nbd_start_device_ioctl().
      
      Link: https://syzkaller.appspot.com/bug?id=7d89a3ffacd2b83fdd39549bc4d8e0a89ef21239 [1]
      Reported-by: default avatar <syzbot+38e6c55d4969a14c1534@syzkaller.appspotmail.com>
      Signed-off-by: default avatarShigeru Yoshida <syoshida@redhat.com>
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Link: https://lore.kernel.org/r/20220907163502.577561-1-syoshida@redhat.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1de7c3cf
    • Jan Kara's avatar
      sbitmap: Avoid leaving waitqueue in invalid state in __sbq_wake_up() · 48c03331
      Jan Kara authored
      When __sbq_wake_up() decrements wait_cnt to 0 but races with someone
      else waking the waiter on the waitqueue (so the waitqueue becomes
      empty), it exits without reseting wait_cnt to wake_batch number. Once
      wait_cnt is 0, nobody will ever reset the wait_cnt or wake the new
      waiters resulting in possible deadlocks or busyloops. Fix the problem by
      making sure we reset wait_cnt even if we didn't wake up anybody in the
      end.
      
      Fixes: 040b83fc
      
       ("sbitmap: fix possible io hung due to lost wakeup")
      Reported-by: default avatarKeith Busch <kbusch@kernel.org>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Link: https://lore.kernel.org/r/20220908130937.2795-1-jack@suse.cz
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      48c03331
  3. Sep 06, 2022
  4. Sep 05, 2022
  5. Sep 04, 2022
    • Jens Axboe's avatar
      Revert "sbitmap: fix batched wait_cnt accounting" · bce1b56c
      Jens Axboe authored
      This reverts commit 16ede669
      
      .
      
      This is causing issues with CPU stalls on my test box, revert it for
      now until we understand what is going on. It looks like infinite
      looping off sbitmap_queue_wake_up(), but hard to tell with a lot of
      CPUs hitting this issue and the console scrolling infinitely.
      
      Link: https://lore.kernel.org/linux-block/e742813b-ce5c-0d58-205b-1626f639b1bd@kernel.dk/
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      bce1b56c
  6. Sep 03, 2022
  7. Sep 02, 2022
  8. Aug 26, 2022
  9. Aug 24, 2022
  10. Aug 23, 2022
  11. Aug 22, 2022
    • Bart Van Assche's avatar
      null_blk: Modify the behavior of null_map_queues() · 10b41ea1
      Bart Van Assche authored
      
      
      Instead of returning -EINVAL if an internal inconsistency is detected,
      fall back to a single submission queue. This patch prepares for changing
      the return value of the .map_queues() callbacks into void.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Keith Busch <kbusch@kernel.org>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
      Link: https://lore.kernel.org/r/20220815170043.19489-2-bvanassche@acm.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      10b41ea1
    • Santosh Pradhan's avatar
      block/rnbd-srv: Add event tracing support · 74e237b6
      Santosh Pradhan authored
      
      
      Add event tracing mechanism for following routines:
       - create_sess()
       - destroy_sess()
       - process_rdma()
       - process_msg_sess_info()
       - process_msg_open()
       - process_msg_close()
      
      How to use:
      1. Load the rnbd_server module
      2. cd /sys/kernel/debug/tracing
      3. If all the events need to be enabled:
              echo 1 > events/rnbd_srv/enable
      4. OR only speific routine/event needs to be enabled e.g.
              echo 1 > events/rnbd_srv/create_sess/enable
      5. cat trace
      5. Run some workload which can trigger create_sess() routine/event
      
      Signed-off-by: default avatarSantosh Pradhan <santosh.pradhan@ionos.com>
      Signed-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
      Signed-off-by: default avatarMd Haris Iqbal <haris.iqbal@ionos.com>
      Link: https://lore.kernel.org/r/20220818105551.110490-2-haris.iqbal@ionos.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      74e237b6
    • dougmill@linux.vnet.ibm.com's avatar
      block: sed-opal: Add ioctl to return device status · c6ea7060
      dougmill@linux.vnet.ibm.com authored
      
      
      Provide a mechanism to retrieve basic status information about
      the device, including the "supported" flag indicating whether
      SED-OPAL is supported. The information returned is from the various
      feature descriptors received during the discovery0 step, and so
      this ioctl does nothing more than perform the discovery0 step
      and then save the information received. See "struct opal_status"
      and OPAL_FL_* bits for the status information currently returned.
      
      This is necessary to be able to check whether a device is OPAL
      enabled, set up, locked or unlocked from userspace programs
      like systemd-cryptsetup and libcryptsetup. Right now we just
      have to assume the user 'knows' or blindly attempt setup/lock/unlock
      operations.
      
      Signed-off-by: default avatarDouglas Miller <dougmill@linux.vnet.ibm.com>
      Tested-by: default avatarLuca Boccassi <bluca@debian.org>
      Reviewed-by: default avatarScott Bauer <sbauer@plzdonthack.me>
      Acked-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      Link: https://lore.kernel.org/r/20220816140713.84893-1-luca.boccassi@gmail.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c6ea7060
    • Linus Torvalds's avatar
      Linux 6.0-rc2 · 1c23f9e6
      Linus Torvalds authored
      v6.0-rc2
      1c23f9e6
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4daa6a81
      Linus Torvalds authored
      Pull irq fixes from Ingo Molnar:
       "Misc irqchip fixes: LoongArch driver fixes and a Hyper-V IOMMU fix"
      
      * tag 'irq-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/loongson-liointc: Fix an error handling path in liointc_init()
        irqchip/loongarch: Fix irq_domain_alloc_fwnode() abuse
        irqchip/loongson-pch-pic: Move find_pch_pic() into CONFIG_ACPI
        irqchip/loongson-eiointc: Fix a build warning
        irqchip/loongson-eiointc: Fix irq affinity setting
        iommu/hyper-v: Use helper instead of directly accessing affinity
      4daa6a81
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4f61f842
      Linus Torvalds authored
      Pull x86 kprobes fix from Ingo Molnar:
       "Fix a kprobes bug in JNG/JNLE emulation when a kprobe is installed at
        such instructions, possibly resulting in incorrect execution (the
        wrong branch taken)"
      
      * tag 'perf-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/kprobes: Fix JNG/JNLE emulation
      4f61f842
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 7fb312d2
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Various fixes for tracing:
      
         - Fix a return value of traceprobe_parse_event_name()
      
         - Fix NULL pointer dereference from failed ftrace enabling
      
         - Fix NULL pointer dereference when asking for registers from eprobes
      
         - Make eprobes consistent with kprobes/uprobes, filters and
           histograms"
      
      * tag 'trace-v6.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Have filter accept "common_cpu" to be consistent
        tracing/probes: Have kprobes and uprobes use $COMM too
        tracing/eprobes: Have event probes be consistent with kprobes and uprobes
        tracing/eprobes: Fix reading of string fields
        tracing/eprobes: Do not hardcode $comm as a string
        tracing/eprobes: Do not allow eprobes to use $stack, or % for regs
        ftrace: Fix NULL pointer dereference in is_ftrace_trampoline when ftrace is dead
        tracing/perf: Fix double put of trace event when init fails
        tracing: React to error return from traceprobe_parse_event_name()
      7fb312d2
    • Steven Rostedt (Google)'s avatar
      tracing: Have filter accept "common_cpu" to be consistent · b2380577
      Steven Rostedt (Google) authored
      Make filtering consistent with histograms. As "cpu" can be a field of an
      event, allow for "common_cpu" to keep it from being confused with the
      "cpu" field of the event.
      
      Link: https://lkml.kernel.org/r/20220820134401.513062765@goodmis.org
      Link: https://lore.kernel.org/all/20220820220920.e42fa32b70505b1904f0a0ad@kernel.org/
      
      Cc: stable@vger.kernel.org
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Fixes: 1e3bac71
      
       ("tracing/histogram: Rename "cpu" to "common_cpu"")
      Suggested-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      b2380577
    • Steven Rostedt (Google)'s avatar
      tracing/probes: Have kprobes and uprobes use $COMM too · ab838444
      Steven Rostedt (Google) authored
      Both $comm and $COMM can be used to get current->comm in eprobes and the
      filtering and histogram logic. Make kprobes and uprobes consistent in this
      regard and allow both $comm and $COMM as well. Currently kprobes and
      uprobes only handle $comm, which is inconsistent with the other utilities,
      and can be confusing to users.
      
      Link: https://lkml.kernel.org/r/20220820134401.317014913@goodmis.org
      Link: https://lore.kernel.org/all/20220820220442.776e1ddaf8836e82edb34d01@kernel.org/
      
      Cc: stable@vger.kernel.org
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Fixes: 53305928
      
       ("tracing: probeevent: Introduce new argument fetching code")
      Suggested-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      ab838444
    • Steven Rostedt (Google)'s avatar
      tracing/eprobes: Have event probes be consistent with kprobes and uprobes · 6a832ec3
      Steven Rostedt (Google) authored
      Currently, if a symbol "@" is attempted to be used with an event probe
      (eprobes), it will cause a NULL pointer dereference crash.
      
      Both kprobes and uprobes can reference data other than the main registers.
      Such as immediate address, symbols and the current task name. Have eprobes
      do the same thing.
      
      For "comm", if "comm" is used and the event being attached to does not
      have the "comm" field, then make it the "$comm" that kprobes has. This is
      consistent to the way histograms and filters work.
      
      Link: https://lkml.kernel.org/r/20220820134401.136924220@goodmis.org
      
      Cc: stable@vger.kernel.org
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Fixes: 7491e2c4
      
       ("tracing: Add a probe that attaches to trace events")
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      6a832ec3
    • Steven Rostedt (Google)'s avatar
      tracing/eprobes: Fix reading of string fields · f04dec93
      Steven Rostedt (Google) authored
      Currently when an event probe (eprobe) hooks to a string field, it does
      not display it as a string, but instead as a number. This makes the field
      rather useless. Handle the different kinds of strings, dynamic, static,
      relational/dynamic etc.
      
      Now when a string field is used, the ":string" type can be used to display
      it:
      
        echo "e:sw sched/sched_switch comm=$next_comm:string" > dynamic_events
      
      Link: https://lkml.kernel.org/r/20220820134400.959640191@goodmis.org
      
      Cc: stable@vger.kernel.org
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Fixes: 7491e2c4
      
       ("tracing: Add a probe that attaches to trace events")
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      f04dec93
    • Steven Rostedt (Google)'s avatar
      tracing/eprobes: Do not hardcode $comm as a string · 02333de9
      Steven Rostedt (Google) authored
      The variable $comm is hard coded as a string, which is true for both
      kprobes and uprobes, but for event probes (eprobes) it is a field name. In
      most cases the "comm" field would be a string, but there's no guarantee of
      that fact.
      
      Do not assume that comm is a string. Not to mention, it currently forces
      comm fields to fault, as string processing for event probes is currently
      broken.
      
      Link: https://lkml.kernel.org/r/20220820134400.756152112@goodmis.org
      
      Cc: stable@vger.kernel.org
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Fixes: 7491e2c4
      
       ("tracing: Add a probe that attaches to trace events")
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      02333de9
    • Steven Rostedt (Google)'s avatar
      tracing/eprobes: Do not allow eprobes to use $stack, or % for regs · 2673c60e
      Steven Rostedt (Google) authored
      While playing with event probes (eprobes), I tried to see what would
      happen if I attempted to retrieve the instruction pointer (%rip) knowing
      that event probes do not use pt_regs. The result was:
      
       BUG: kernel NULL pointer dereference, address: 0000000000000024
       #PF: supervisor read access in kernel mode
       #PF: error_code(0x0000) - not-present page
       PGD 0 P4D 0
       Oops: 0000 [#1] PREEMPT SMP PTI
       CPU: 1 PID: 1847 Comm: trace-cmd Not tainted 5.19.0-rc5-test+ #309
       Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01
      v03.03 07/14/2016
       RIP: 0010:get_event_field.isra.0+0x0/0x50
       Code: ff 48 c7 c7 c0 8f 74 a1 e8 3d 8b f5 ff e8 88 09 f6 ff 4c 89 e7 e8
      50 6a 13 00 48 89 ef 5b 5d 41 5c 41 5d e9 42 6a 13 00 66 90 <48> 63 47 24
      8b 57 2c 48 01 c6 8b 47 28 83 f8 02 74 0e 83 f8 04 74
       RSP: 0018:ffff916c394bbaf0 EFLAGS: 00010086
       RAX: ffff916c854041d8 RBX: ffff916c8d9fbf50 RCX: ffff916c255d2000
       RDX: 0000000000000000 RSI: ffff916c255d2008 RDI: 0000000000000000
       RBP: 0000000000000000 R08: ffff916c3a2a0c08 R09: ffff916c394bbda8
       R10: 0000000000000000 R11: 0000000000000000 R12: ffff916c854041d8
       R13: ffff916c854041b0 R14: 0000000000000000 R15: 0000000000000000
       FS:  0000000000000000(0000) GS:ffff916c9ea40000(0000)
      knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000024 CR3: 000000011b60a002 CR4: 00000000001706e0
       Call Trace:
        <TASK>
        get_eprobe_size+0xb4/0x640
        ? __mod_node_page_state+0x72/0xc0
        __eprobe_trace_func+0x59/0x1a0
        ? __mod_lruvec_page_state+0xaa/0x1b0
        ? page_remove_file_rmap+0x14/0x230
        ? page_remove_rmap+0xda/0x170
        event_triggers_call+0x52/0xe0
        trace_event_buffer_commit+0x18f/0x240
        trace_event_raw_event_sched_wakeup_template+0x7a/0xb0
        try_to_wake_up+0x260/0x4c0
        __wake_up_common+0x80/0x180
        __wake_up_common_lock+0x7c/0xc0
        do_notify_parent+0x1c9/0x2a0
        exit_notify+0x1a9/0x220
        do_exit+0x2ba/0x450
        do_group_exit+0x2d/0x90
        __x64_sys_exit_group+0x14/0x20
        do_syscall_64+0x3b/0x90
        entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      Obviously this is not the desired result.
      
      Move the testing for TPARG_FL_TPOINT which is only used for event probes
      to the top of the "$" variable check, as all the other variables are not
      used for event probes. Also add a check in the register parsing "%" to
      fail if an event probe is used.
      
      Link: https://lkml.kernel.org/r/20220820134400.564426983@goodmis.org
      
      Cc: stable@vger.kernel.org
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Fixes: 7491e2c4
      
       ("tracing: Add a probe that attaches to trace events")
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      2673c60e