From 3c9529bd1cd5598679d259a4ba681add3ea07b81 Mon Sep 17 00:00:00 2001 From: Dongxu Sun Date: Thu, 7 Dec 2023 12:44:10 +0800 Subject: [PATCH] mbigen: vtimer: isolate mbigen vtimer funcs with macro virt inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I8MG11 CVE: NA -------------------------------- use CONFIG_HISILICON_IRQ_MBIGEN to isolate mbigen vtimer funcs in ./include/clocksource/arm_arch_timer.h file. Signed-off-by: Dongxu Sun --- include/clocksource/arm_arch_timer.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h index 16e59de1fc87..b3a011bfe68f 100644 --- a/include/clocksource/arm_arch_timer.h +++ b/include/clocksource/arm_arch_timer.h @@ -115,10 +115,28 @@ static inline bool vtimer_irqbypass_hw_support(struct arch_timer_kvm_info *info) return info->irqbypass_flag & VT_EXPANDDEV_PROBED; } +#ifdef CONFIG_HISILICON_IRQ_MBIGEN + void vtimer_mbigen_set_vector(int cpu_id, u16 vpeid); bool vtimer_mbigen_get_active(int cpu_id); void vtimer_mbigen_set_auto_clr(int cpu_id, bool set); void vtimer_gic_set_auto_clr(int cpu_id, bool set); void vtimer_mbigen_set_active(int cpu_id, bool set); +#else + +static inline void vtimer_mbigen_set_vector(int cpu_id, u16 vpeid) {} + +static inline bool vtimer_mbigen_get_active(int cpu_id) +{ + /* You really shouldn't get here.. */ + return false; +} + +static inline void vtimer_mbigen_set_auto_clr(int cpu_id, bool set) {} +static inline void vtimer_gic_set_auto_clr(int cpu_id, bool set) {} +static inline void vtimer_mbigen_set_active(int cpu_id, bool set) {} + +#endif + #endif -- Gitee