Re: [patch 5/5] x86/idt: Consolidate idt functionality

From: Peter Zijlstra
Date: Thu May 28 2020 - 12:18:50 EST


On Thu, May 28, 2020 at 04:53:20PM +0200, Thomas Gleixner wrote:

> -#ifdef CONFIG_X86_64
> -DECLARE_PER_CPU(u32, debug_idt_ctr);
> -static __always_inline bool is_debug_idt_enabled(void)
> -{
> - if (this_cpu_read(debug_idt_ctr))
> - return true;
> -
> - return false;
> -}
> -
> -static __always_inline void load_debug_idt(void)
> -{
> - load_idt((const struct desc_ptr *)&debug_idt_descr);
> -}
> -#else
> -static inline bool is_debug_idt_enabled(void)
> -{
> - return false;
> -}
> -
> -static inline void load_debug_idt(void)
> -{
> -}
> -#endif

I have a patch that does this too; except it doesn't put it back. I like
that one better :-)