lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1730386209.git.namcao@linutronix.de>
Date: Thu, 31 Oct 2024 16:14:14 +0100
From: Nam Cao <namcao@...utronix.de>
To: Anna-Maria Behnsen <anna-maria@...utronix.de>,
	Frederic Weisbecker <frederic@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andreas Hindborg <a.hindborg@...nel.org>,
	Alice Ryhl <aliceryhl@...gle.com>,
	Miguel Ojeda <ojeda@...nel.org>,
	Kees Cook <kees@...nel.org>,
	linux-kernel@...r.kernel.org
Cc: Jani Nikula <jani.nikula@...ux.intel.com>,
	intel-gfx@...ts.freedesktop.org,
	Sean Christopherson <seanjc@...gle.com>,
	Paolo Bonzini <pbonzini@...hat.com>,
	x86@...nel.org,
	Jakub Kicinski <kuba@...nel.org>,
	Kalle Valo <kvalo@...nel.org>,
	Jens Axboe <axboe@...nel.dk>,
	Christian Brauner <brauner@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	John Stultz <jstultz@...gle.com>,
	Nam Cao <namcao@...utronix.de>,
	Oliver Hartkopp <socketcan@...tkopp.net>
Subject: [RESEND PATCH v2 00/19] hrtimers: Consolidate hrtimer initialization - Part 1

(resend due to broken emails)

This is a follow up to version 1, which can be found here:

    https://lore.kernel.org/lkml/cover.1729864615.git.namcao@linutronix.de/

hrtimers must be initialized with a hrtimer_init() variant, and after that
the timer's callback function must be setup separately.

This separate initialization is error prone and awkward to use. The
separate initialization is also problematic for a clean Rust abstraction.

A combined setup function like timer_setup() is less error prone and
simpler to use.

This first part of the conversion provides:

  - a set of hrtimer_setup*() variants, which take the function pointer as
    argument.

  - hrtimer_update_function() which allows to change the callback function
    after initialization with the proper safety checks in place.

  - conversion of the hrtimer_init*_on_stack() variants

  - some minor cleanups

The remaining users will be converted in follow up series.

Most conversions were done with Coccinelle. See sematic patch below.

Changes versus v1:
  - Open code kvm_xen_init_vcpu() (Sean)
  - Drop the can/bcm patch (Oliver)
  - Folded the removal of hrtimer_init_sleeper() (tglx)
  - Update change logs and cover letter

The series applies on top of:

    git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core

and is also available from git:

    git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git hrtimer-setup-part1-v2

Best regards,

Nam

---
virtual patch
@@ expression timer, clock, mode, func; @@
- hrtimer_init(timer, clock, mode);
  ...
- timer->function = func;
+ hrtimer_setup(timer, func, clock, mode);

@@ expression timer, clock, mode, func; @@
- hrtimer_init(&timer, clock, mode);
  ...
- timer.function = func;
+ hrtimer_setup(&timer, func, clock, mode);

@@ expression timer, clock, mode, func; @@
- hrtimer_init_on_stack(&timer, clock, mode);
  ...
- timer.function = func;
+ hrtimer_setup_on_stack(&timer, func, clock, mode);

@@ expression timer, clock, mode; @@
- hrtimer_init_sleeper_on_stack(timer, clock, mode);
+ hrtimer_setup_sleeper_on_stack(timer, clock, mode);

---
 arch/x86/kvm/xen.c                             |  12 +--
 drivers/gpu/drm/i915/i915_request.c            |  17 ++--
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c |   2 -
 fs/aio.c                                       |   2 +-
 include/linux/hrtimer.h                        |  51 +++++++-----
 include/linux/wait.h                           |   4 +-
 io_uring/io_uring.c                            |   7 +-
 io_uring/timeout.c                             |   1 -
 kernel/futex/core.c                            |   6 +-
 kernel/sched/idle.c                            |   4 +-
 kernel/time/alarmtimer.c                       |   9 +-
 kernel/time/hrtimer.c                          | 110 ++++++++++++++++++-------
 kernel/time/sleep_timeout.c                    |   2 +-
 net/core/pktgen.c                              |   2 +-
 14 files changed, 136 insertions(+), 93 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ