[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TYSPR04MB7084FCAF74B4CFA30D386B698A2A2@TYSPR04MB7084.apcprd04.prod.outlook.com>
Date: Wed, 13 Mar 2024 05:30:41 +0000
From: Enlin Mu <enlin.mu@...look.com>
To: tglx@...utronix.de,
linux-kernel@...r.kernel.org,
enlin.mu@...soc.com,
enlinmu@...il.com
Cc: linux-hardening@...r.kernel.org
Subject: [PATCH] hrtimer:Add get_hrtimer_cpu_base()
From: Enlin Mu <enlin.mu@...soc.com>
On the Arm platform,arch_timer may occur irq strom,
By using the next_timer of hrtimer_cpu_base, it is
possible to quickly locate abnormal timers.
As it is an out of tree modules,the function needs
to be exproted.
Signed-off-by: Enlin Mu <enlin.mu@...soc.com>
---
include/linux/hrtimer.h | 1 +
kernel/time/hrtimer.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index aa1e65ccb615..2a37d2a8e808 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -277,6 +277,7 @@ static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim,
extern int hrtimer_cancel(struct hrtimer *timer);
extern int hrtimer_try_to_cancel(struct hrtimer *timer);
+extern struct hrtimer_cpu_base *get_hrtimer_cpu_base(int cpu);
static inline void hrtimer_start_expires(struct hrtimer *timer,
enum hrtimer_mode mode)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 70625dff62ce..f7cf7d48b91d 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1309,6 +1309,12 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
}
EXPORT_SYMBOL_GPL(hrtimer_start_range_ns);
+struct hrtimer_cpu_base *get_hrtimer_cpu_base(int cpu)
+{
+ return &per_cpu(hrtimer_bases, cpu);
+}
+EXPORT_SYMBOL_GPL(get_hrtimer_cpu_base);
+
/**
* hrtimer_try_to_cancel - try to deactivate a timer
* @timer: hrtimer to stop
--
2.39.2
Powered by blists - more mailing lists